|
#kimtheho
32bit는 지원되지 않습니다.
$ sudo apt update
$ sudo apt install -y alien net-tools vim libaio1 libaio-dev
$ ls
oracle-xe-11.2.0-1.0.x86_64.rpm.zip |
$ unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
Archive: oracle-xe-11.2.0-1.0.x86_64.rpm.zip creating: Disk1/ creating: Disk1/upgrade/ inflating: Disk1/upgrade/gen_inst.sql creating: Disk1/response/ inflating: Disk1/response/xe.rsp inflating: Disk1/oracle-xe-11.2.0-1.0.x86_64.rpm |
$ cd Disk1/
$ ls
oracle-xe-11.2.0-1.0.x86_64.rpm response upgrade |
$ sudo alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm
oracle-xe_11.2.0-2_amd64.deb generated |
만약 oracle-xe_11.2.0-2_amd64.deb file이 이미 생성되어 있는 상태라면 여기서 부터 시작하면 된다.
$ sudo vi /sbin/chkconfig
#!/bin/bash # Oracle 11gR2 XE installer chkconfig hack for Ubuntu file=/etc/init.d/oracle-xe if [[ ! `tail -n1 $file | grep INIT` ]]; then echo >> $file echo '### BEGIN INIT INFO' >> $file echo '# Provides: OracleXE' >> $file echo '# Required-Start: $remote_fs $syslog' >> $file echo '# Required-Stop: $remote_fs $syslog' >> $file echo '# Default-Start: 2 3 4 5' >> $file echo '# Default-Stop: 0 1 6' >> $file echo '# Short-Description: Oracle 11g Express Edition' >> $file echo '### END INIT INFO' >> $file fi update-rc.d oracle-xe defaults 80 01 #EOF |
$ sudo chmod 755 /sbin/chkconfig
$ sudo vi /etc/sysctl.d/60-oracle.conf
# Oracle 11g XE kernel parameters fs.file-max=6815744 net.ipv4.ip_local_port_range=9000 65000 kernel.sem=250 32000 100 128 kernel.shmmax=536870912 |
$ sudo service procps start
$ sudo mkdir -p /var/lock/subsys
$ sudo touch /var/lock/subsys/listener
$ sudo dpkg -i oracle-xe_11.2.0-2_amd64.deb
Selecting previously unselected package oracle-xe. (데이터베이스 읽는중 ...현재 320140개의 파일과 디렉터리가 설치되어 있습니다.) Preparing to unpack oracle-xe_11.2.0-2_amd64.deb ... Unpacking oracle-xe (11.2.0-2) ... oracle-xe (11.2.0-2) 설정하는 중입니다 ... Executing post-install steps... You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database. Processing triggers for libc-bin (2.27-3ubuntu1.6) ... Processing triggers for systemd (237-3ubuntu10.56) ... Processing triggers for ureadahead (0.100.0-21) ... ureadahead will be reprofiled on next reboot Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ... Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ... Processing triggers for mime-support (3.60ubuntu1) ... |
$ sudo ln -s /usr/bin/awk /bin/awk
$ sudo /etc/init.d/oracle-xe configure
Oracle Database 11g Express Edition Configuration ------------------------------------------------- This will configure on-boot properties of Oracle Database 11g Express Edition. The following questions will determine whether the database should be starting upon system boot, the ports it will use, and the passwords that will be used for database accounts. Press to accept the defaults. Ctrl-C will abort. Specify the HTTP port that will be used for Oracle Application Express [8080]: Specify a port that will be used for the database listener [1521]: /etc/init.d/oracle-xe: line 405: /bin/awk: No such file or directory Specify a password to be used for database accounts. Note that the same password will be used for SYS and SYSTEM. Oracle recommends the use of different passwords for each database account. This can be done after initial configuration: Confirm the password: Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:y Starting Oracle Net Listener...Done Configuring database...grep: /u01/app/oracle/product/11.2.0/xe/config/log/*.log: No such file or directory grep: /u01/app/oracle/product/11.2.0/xe/config/log/*.log: No such file or directory Done /bin/chmod: cannot access '/u01/app/oracle/diag': No such file or directory Starting Oracle Database 11g Express Edition instance...Done Installation completed successfully. |
oracle 설정파일 실행해주기
$ . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh |
필요한 directory 생성하기
$ sudo mkdir -p /u01/app/oracle/product/11.2.0/xe/log $ sudo mkdir -p /u01/app/oracle/product/11.2.0/xe/log/diag/clients |
Oracle 실행해 주기
$ lsnrctl start |
$ sudo vi /etc/bash.bashrc
(맨 아래에 넣기)
. /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh |
$ vi ~/.bashrc
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe export ORACLE_SID=XE export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh` export ORACLE_BASE=/u01/app/oracle export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH export PATH=$ORACLE_HOME/bin:$PATH <- 이 부분은 상황에 맞게 설정해준다. 무슨 말인지 모르면 그대로 하면 된다. |
$ source ~/.bashrc
또는
재부팅하기
Oracle 실행
$ sudo systemctl start oracle-xe
$ systemctl status oracle-xe
● oracle-xe.service - SYSV: This is a program that is responsible for t> Loaded: loaded (/etc/init.d/oracle-xe; generated) Active: active (exited) since Sun 2022-12-11 12:33:38 KST; 1min 30> Docs: man:systemd-sysv-generator(8) Process: 411392 ExecStart=/etc/init.d/oracle-xe start (code=exited,> CPU: 55ms |
$ sudo chown -R oracle:dba /var/tmp/.oracle
$ lsnrctl status
$ sudo systemctl start oracle-xe.service
http://localhost:8080/apex
참고:https://www.youtube.com/watch?v=Du8HoIPalvA
https://www.youtube.com/watch?v=eWxzhlWvsfk
계정 생성하기
먼저 splplus로 접속을 한다:
$ sqlplus SQL*Plus: Release 11.2.0.2.0 Production on 월 12월 12 12:15:52 2022 Copyright (c) 1982, 2011, Oracle. All rights reserved. Enter user-name: sys as sysdba Enter password: Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production |
계정을 생성한다:
SQL> create user [id] identified by [password]; User created. |
권한 설정을한다:
SQL> grant connect, resource, dba to change_account; Grant succeeded. |
적용한다:
SQL> commit; Commit complete. |
Oracle server가 꺼져있을 때 이렇게 나온다:
$ systemctl status oracle-xe ○ oracle-xe.service - SYSV: This is a program that is responsible for t> Loaded: loaded (/etc/init.d/oracle-xe; generated) Active: inactive (dead) Docs: man:systemd-sysv-generator(8) ...skipping... ○ oracle-xe.service - SYSV: This is a program that is responsible for t> Loaded: loaded (/etc/init.d/oracle-xe; generated) Active: inactive (dead) Docs: man:systemd-sysv-generator(8) |
Oracle server가 꺼져 있다면 아래 명령으로 켜주면 된다:
$ sudo systemctl start oracle-xe.service |