I. 리눅스 설치
1. Oracle Enterprise Linux 4 설치
VirtualBox 6.x 버전 이상에 설치할 때에는 VM의 그래픽 컨트롤러를 "VBoxVGA"로 설정하고 설치해야 x window를 정상으로 실행할 수 있습니다.
'잘못된 설정 감지됨' 경고가 나오더라도 무시하기 바랍니다.
{}
II. 사전 준비
1. VirbualBox Guest Addition 설치
2. 설치 내역 확인
root 유저로 수행
uname -r uname -a cat /etc/redhat-release
[root@oel4 ~]# uname -r 2.6.9-89.0.0.0.1.EL [root@oel4 ~]# uname -a Linux oel4 2.6.9-89.0.0.0.1.EL #1 Tue May 19 05:21:57 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux [root@oel4 ~]# cat /etc/redhat-release Red Hat Enterprise Linux AS release 4 (Nahant Update 8)
3. 추가 환경 설정
vi /etc/hosts root 유저로 편집
<ip> <호스트명> # 맨 처음 줄에 추가
root 유저로 미사용 서비스 끄기
chkconfig --level 123456 xinetd off chkconfig --level 123456 sendmail off chkconfig --level 123456 cups off chkconfig --level 123456 cups-config-daemon off chkconfig --level 123456 smartd off chkconfig --level 123456 iptables off chkconfig --level 123456 bluetooth off chkconfig --level 123456 isdn off chkconfig --level 123456 pcmcia off
4. 패키지 설치
root 유저로 필수 패키지 설치 여부 조사
rpm -q binutils-* rpm -q compat-db-* rpm -q control-center-* rpm -q gcc-* rpm -q gcc-c++-* rpm -q glibc-* rpm -q glibc-common-* rpm -q gnome-libs-* rpm -q libstdc++-* rpm -q libstdc++-devel-* rpm -q make-* rpm -q pdksh-* rpm -q sysstat-* rpm -q xscreensaver-*
[root@oel4 ~]# rpm -q binutils-* binutils-2.15.92.0.2-25 [root@oel4 ~]# rpm -q compat-db-* compat-db-4.1.25-9 [root@oel4 ~]# rpm -q control-center-* control-center-2.8.0-12.rhel4.5 [root@oel4 ~]# rpm -q gcc-* gcc-3.4.6-11.0.1 [root@oel4 ~]# rpm -q gcc-c++-* gcc-c++-3.4.6-11.0.1 [root@oel4 ~]# rpm -q glibc-* glibc-2.3.4-2.43 glibc-2.3.4-2.43 [root@oel4 ~]# rpm -q glibc-common-* glibc-common-2.3.4-2.43 [root@oel4 ~]# rpm -q gnome-libs-* gnome-libs-1.4.1.2.90-44.2 [root@oel4 ~]# rpm -q libstdc++-* libstdc++-3.4.6-11.0.1 libstdc++-3.4.6-11.0.1 [root@oel4 ~]# rpm -q libstdc++-devel-* libstdc++-devel-3.4.6-11.0.1 [root@oel4 ~]# rpm -q make-* make-3.80-7.EL4 [root@oel4 ~]# rpm -q pdksh-* pdksh-5.2.14-30.6 [root@oel4 ~]# rpm -q sysstat-* sysstat-5.0.5-25.el4 [root@oel4 ~]# rpm -q xscreensaver-* xscreensaver-4.18-5.rhel4.14.0.1
패키지 설치 (oracle-validated 미설치시)
root 유저로 수행 (oracle-validated 미설치시)
rpm -ivh libaio-* rpm -ivh glib-devel-* rpm -ivh xorg-x11-deprecated-libs-*i386.rpm
[root@oel4 RPMS]# rpm -ivh libaio-0.3.105-2.x86_64.rpm 경고: libaio-0.3.105-2.x86_64.rpm: V3 DSA signature: NOKEY, key ID b38a8516 준비 중... ########################################### [100%] 1:libaio ########################################### [100%] [root@oel4 RPMS]# rpm -ivh xorg-x11-deprecated-libs-6.8.2-1.0.1.EL.63.i386.rpm 경고: xorg-x11-deprecated-libs-6.8.2-1.0.1.EL.63.i386.rpm: V3 DSA signature: NOKEY, key ID b38a8516 준비 중... ########################################### [100%] 1:xorg-x11-deprecated-lib########################################### [100%] [root@oel4 RPMS]# rpm -ivh glib-devel-1.2.10-15.x86_64.rpm 경고: glib-devel-1.2.10-15.x86_64.rpm: V3 DSA signature: NOKEY, key ID b38a8516 준비 중... ########################################### [100%] 1:glib-devel ########################################### [100%]
5. 9i 추가 리눅스 설정
Linux 추가 패키지 설치
rpm -ivh compat-gcc-32-* rpm -ivh compat-gcc-32-c++-*
[root@oel4 RPMS]# rpm -ivh compat-gcc-32-3.2.3-47.3.x86_64.rpm 경고: compat-gcc-32-3.2.3-47.3.x86_64.rpm: V3 DSA signature: NOKEY, key ID b38a8516 준비 중... ########################################### [100%] 1:compat-gcc-32 ########################################### [100%] [root@oel4 RPMS]# rpm -ivh compat-gcc-32-c++-3.2.3-47.3.x86_64.rpm 경고: compat-gcc-32-c++-3.2.3-47.3.x86_64.rpm: V3 DSA signature: NOKEY, key ID b38a8516 준비 중... ########################################### [100%] 1:compat-gcc-32-c++ ########################################### [100%]
리눅스 필수 패키지 설치 확인
rpm -q kernel-* rpm -q glibc-* rpm -q gcc-* rpm -q gcc-c++-* rpm -q libstdc++-* rpm -q libstdc++-devel-* rpm -q libstdc++-* rpm -q glibc-devel-* rpm -q glibc-* rpm -q make-* rpm -q gnome-libs-* rpm -q ORBit-* rpm -q audiofile-* rpm -q esound-* rpm -q gtk+-* rpm -q imlib-* rpm -q libpng10-* rpm -q libungif-* rpm -q tcp_wrappers-* rpm -q setarch-* rpm -q libaio-* rpm -q glibc-kernheaders-* rpm -q glibc-headers-* rpm -q glibc-devel-*
[root@oel4 database]# rpm -q kernel-* kernel-2.6.9-89.0.0.0.1.EL [root@oel4 database]# rpm -q glibc-* glibc-2.3.4-2.43 glibc-2.3.4-2.43 [root@oel4 database]# rpm -q gcc-* gcc-3.4.6-11.0.1 [root@oel4 database]# rpm -q gcc-c++-* gcc-c++-3.4.6-11.0.1 [root@oel4 database]# rpm -q libstdc++-* libstdc++-3.4.6-11.0.1 libstdc++-3.4.6-11.0.1 [root@oel4 database]# rpm -q libstdc++-devel-* libstdc++-devel-3.4.6-11.0.1 [root@oel4 database]# rpm -q libstdc++-* libstdc++-3.4.6-11.0.1 libstdc++-3.4.6-11.0.1 [root@oel4 database]# rpm -q glibc-devel-* glibc-devel-2.3.4-2.43 glibc-devel-2.3.4-2.43 [root@oel4 database]# rpm -q glibc-* glibc-2.3.4-2.43 glibc-2.3.4-2.43 [root@oel4 database]# rpm -q make-* make-3.80-7.EL4 [root@oel4 database]# rpm -q gnome-libs-* gnome-libs-1.4.1.2.90-44.2 [root@oel4 database]# rpm -q ORBit-* ORBit-0.5.17-14.0.1 [root@oel4 database]# rpm -q audiofile-* audiofile-0.2.6-1.el4.1 [root@oel4 database]# rpm -q esound-* esound-0.2.35-2 [root@oel4 database]# rpm -q gtk+-* gtk+-1.2.10-36 [root@oel4 database]# rpm -q imlib-* imlib-1.9.13-23 [root@oel4 database]# rpm -q libpng10-* libpng10-1.0.16-3.el4_7.3 [root@oel4 database]# rpm -q libungif-* libungif-4.1.3-1.el4.2 [root@oel4 database]# rpm -q tcp_wrappers-* tcp_wrappers-7.6-37.9.el4 [root@oel4 database]# rpm -q setarch-* setarch-1.6-1 [root@oel4 database]# rpm -q libaio-* libaio-0.3.105-2 libaio-0.3.105-2 [root@oel4 ~]# rpm -q glibc-kernheaders-* glibc-kernheaders-2.4-9.1.103.EL [root@oel4 ~]# rpm -q glibc-headers-* glibc-headers-2.3.4-2.43 [root@oel4 ~]# rpm -q glibc-devel-* glibc-devel-2.3.4-2.43 glibc-devel-2.3.4-2.43
root 유저로 수행
mv /usr/bin/gcc /usr/bin/gcc.orig mv /usr/bin/g++ /usr/bin/g++.orig ln -s /usr/bin/x86_64-redhat-linux-gcc32 /usr/bin/gcc ln -s /usr/bin/x86_64-redhat-linux-g++32 /usr/bin/g++
[root@oel4 ~]# mv /usr/bin/gcc /usr/bin/gcc.orig [root@oel4 ~]# mv /usr/bin/g++ /usr/bin/g++.orig [root@oel4 ~]# ln -s /usr/bin/x86_64-redhat-linux-gcc32 /usr/bin/gcc [root@oel4 ~]# ln -s /usr/bin/x86_64-redhat-linux-g++32 /usr/bin/g++
vi /etc/profile 수정
if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi
III. DB 소프트웨어 설치
oracle 유저로 수행
export LANG=c # 설치 화면에 한글 문자가 깨지는 것 대신 영문으로 표기함 ./runInstaller
root 유저로 수행
/tmp/orainstRoot.sh
[root@oel4 ~]# /tmp/orainstRoot.sh Creating Oracle Inventory pointer file (/etc/oraInst.loc) Changing groupname of /u01/app/oracle/oraInventory to oinstall.
root 유저로 수행
/u01/app/oracle/product/9.2.0/db_1/root.sh
[root@oel4 ~]# /u01/app/oracle/product/9.2.0/db_1/root.sh Running Oracle9 root.sh script... \nThe following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/9.2.0/db_1 Enter the full pathname of the local bin directory: [/usr/local/bin]: Copying dbhome to /usr/local/bin ... Copying oraenv to /usr/local/bin ... Copying coraenv to /usr/local/bin ... \nCreating /etc/oratab file... Adding entry to /etc/oratab file... Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root.sh script. Now product-specific root actions will be performed.
IV. PSU & 패치
1. Patch Set 설치
root 유저로 수행
/u01/app/oracle/product/9.2.0/db_1/root.sh
[root@oel4 ~]# /u01/app/oracle/product/9.2.0/db_1/root.sh Running Oracle9 root.sh script... \nThe following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/9.2.0/db_1 Enter the full pathname of the local bin directory: [/usr/local/bin]: The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y Copying dbhome to /usr/local/bin ... The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y Copying oraenv to /usr/local/bin ... The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y Copying coraenv to /usr/local/bin ... Adding entry to /etc/oratab file... Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root.sh script. Now product-specific root actions will be performed.
2. Critical Patch 적용
oracle 유저로 OPatch 파일 업데이트
cd $ORACLE_HOME OPatch/opatch version mv OPatch OPatch.old cp -r <opatch 압축 해제 경로>/OPatch . OPatch/opatch version
[oracle@orcl ~]$ cd $ORACLE_HOME [oracle@orcl db_1]$ OPatch/opatch version Oracle Interim Patch Installer version 1.0.0.0.55 Copyright (c) 2006 Oracle Corporation. All Rights Reserved.. We recommend you refer to the OPatch documentation under OPatch/docs for usage reference. We also recommend using the latest OPatch version. For the latest OPatch version and other support related issues, please refer to document 293369.1 which is viewable from metalink.oracle.com OPatch Version: 1.0.0.0.55 [oracle@orcl db_1]$ mv OPatch OPatch.old [oracle@orcl db_1]$ cp -r /media/oracle/OPatch . [oracle@orcl db_1]$ OPatch/opatch version Oracle Interim Patch Installer version 1.0.0.0.64 Copyright (c) 2011 Oracle Corporation. All Rights Reserved.. Oracle recommends you to use the latest OPatch version and read the OPatch documentation available in the OPatch/docs directory for usage. For information about the latest OPatch and other support-related issues, refer to document ID 293369.1 available on My Oracle Support (https://myoraclesupport.oracle.com) OPatch Version: 1.0.0.0.64
oracle 유저로 패치 내역 조사
export PATH=$PATH:$ORACLE_HOME/OPatch:/usr/ccs/bin opatch lsinventory
[oracle@orcl ~]$ export PATH=$PATH:$ORACLE_HOME/OPatch:/usr/ccs/bin [oracle@orcl ~]$ opatch lsinventory Oracle Interim Patch Installer version 1.0.0.0.55 Copyright (c) 2006 Oracle Corporation. All Rights Reserved.. We recommend you refer to the OPatch documentation under OPatch/docs for usage reference. We also recommend using the latest OPatch version. For the latest OPatch version and other support related issues, please refer to document 293369.1 which is viewable from metalink.oracle.com Oracle Home = /u01/app/oracle/product/9.2.0/db_1 Location of Oracle Universal Installer components = /u01/app/oracle/product/9.2.0/db_1/oui Location of OraInstaller.jar = "/u01/app/oracle/product/9.2.0/db_1/oui/jlib" Oracle Universal Installer shared library = /u01/app/oracle/product/9.2.0/db_1/oui/lib/linux/liboraInstaller.so Location of Oracle Inventory Pointer = /etc/oraInst.loc Location of Oracle Inventory = /u01/app/oracle/product/9.2.0/db_1/inventory Path to Java = /u01/app/oracle/product/9.2.0/db_1/jre/1.4.2/bin/java Log file = /u01/app/oracle/product/9.2.0/db_1/.patch_storage/<patch ID>/*.log Creating log file "/u01/app/oracle/product/9.2.0/db_1/.patch_storage/LsInventory__06-16-2017_10-22-42.log" Result: There is no Interim Patch OPatch succeeded.
oracle 유저로 패치 수행
cd <패치 압축 해제 경로>/9655027 opatch apply
[oracle@orcl oracle]$ cd 9655027 [oracle@orcl 9655027]$ opatch apply Oracle Interim Patch Installer version 1.0.0.0.64 Copyright (c) 2011 Oracle Corporation. All Rights Reserved.. Oracle recommends you to use the latest OPatch version and read the OPatch documentation available in the OPatch/docs directory for usage. For information about the latest OPatch and other support-related issues, refer to document ID 293369.1 available on My Oracle Support (https://myoraclesupport.oracle.com) Oracle Home : /u01/app/oracle/product/9.2.0/db_1 Oracle Home Inventory : /u01/app/oracle/product/9.2.0/db_1/inventory Central Inventory : /u01/app/oracle/oraInventory from : /etc/oraInst.loc OUI location : /u01/app/oracle/product/9.2.0/db_1/oui OUI shared library : /u01/app/oracle/product/9.2.0/db_1/oui/lib/linux/liboraInstaller.so Java location : /u01/app/oracle/product/9.2.0/db_1/jre/1.4.2/bin/java Log file location : /u01/app/oracle/product/9.2.0/db_1/.patch_storage/<patch ID>/*.log Creating log file "/u01/app/oracle/product/9.2.0/db_1/.patch_storage/9655027/Apply_9655027_06-16-2017_10-45-11.log" Invoking fuser to check for active processes. Invoking fuser on "/u01/app/oracle/product/9.2.0/db_1/bin/agentctl" Invoking fuser on "/u01/app/oracle/product/9.2.0/db_1/Apache/Apache/bin/rotatelogs" Invoking fuser on "/u01/app/oracle/product/9.2.0/db_1/Apache/Apache/bin/httpd" Invoking fuser on "/u01/app/oracle/product/9.2.0/db_1/bin/dbsnmp" Invoking fuser on "/u01/app/oracle/product/9.2.0/db_1/Apache/Apache/bin/htpasswd" Invoking fuser on "/u01/app/oracle/product/9.2.0/db_1/bin/oracle" Provide your email address to be informed of security issues, install and initiate Oracle Configuration Manager. Easier for you if you use your My Oracle Support Email address/User Name. Visit http://www.oracle.com/support/policies.html for details. Email address/User Name: You have not provided an email address for notification of security issues. Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: Y Oracle Configuration Manager has been installed but not configured. OCM enables Oracle to provide superior, proactive support for our customers. Oracle strongly recommends customers configure OCM. To complete the configuration of OCM, refer to the OCM Installation and Administration Guide (http://www.oracle.com/technology/documentation/ocm.html). Backing up comps.xml ... OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only. Please shut down Oracle instances running out of this ORACLE_HOME (Oracle Home = /u01/app/oracle/product/9.2.0/db_1) Is this system ready for updating? Please respond Y|N > Y Executing the Apply pre-patch script (/media/oracle/9655027/custom/scripts/pre)... Applying patch 9655027... Patching archive files... Patching jar files... Patching copy files... Creating new directory "/u01/app/oracle/product/9.2.0/db_1/cpu/CPUJul2010/owa_all/101" Creating new directory "/u01/app/oracle/product/9.2.0/db_1/cpu/CPUJul2010/owa_all/90" Creating new directory "/u01/app/oracle/product/9.2.0/db_1/cpu/CPUJul2010/owa_all/30" Creating new directory "/u01/app/oracle/product/9.2.0/db_1/oraolap/admin" Creating new directory "/u01/app/oracle/product/9.2.0/db_1/cpu/view_recompile" Creating new directory "/u01/app/oracle/product/9.2.0/db_1/cpu/scripts" Creating file to hold list of directories that were mkdir'ed: "/u01/app/oracle/product/9.2.0/db_1/.patch_storage/9655027/opatch_dirs_created.lst" Running make for target client_sharedlib. Running make for target ioracle. Running make for target ioklist. Running make for target iokinit. Running make for target iokdstry. Running make for target libnk59.so. Running make for target itnsping. Running make for target ilsnrctl. Running make for target itnslsnr. Running make for target idbsnmp. Running make for target iagentctl. Running make for target oidldapd. Running make for target newsqlplus. Inventory is good and does not have any dangling patches. Updating inventory... Verifying patch... Backing up comps.xml ... Executing the Apply post-patch script (/media/oracle/9655027/custom/scripts/post)... OPatch succeeded.
oracle 유저로 패치 결과 조사
opatch lsinventory
[oracle@orcl 9655027]$ opatch lsinventory Oracle Interim Patch Installer version 1.0.0.0.64 Copyright (c) 2011 Oracle Corporation. All Rights Reserved.. Oracle recommends you to use the latest OPatch version and read the OPatch documentation available in the OPatch/docs directory for usage. For information about the latest OPatch and other support-related issues, refer to document ID 293369.1 available on My Oracle Support (https://myoraclesupport.oracle.com) Oracle Home : /u01/app/oracle/product/9.2.0/db_1 Oracle Home Inventory : /u01/app/oracle/product/9.2.0/db_1/inventory Central Inventory : /u01/app/oracle/oraInventory from : /etc/oraInst.loc OUI location : /u01/app/oracle/product/9.2.0/db_1/oui OUI shared library : /u01/app/oracle/product/9.2.0/db_1/oui/lib/linux/liboraInstaller.so Java location : /u01/app/oracle/product/9.2.0/db_1/jre/1.4.2/bin/java Log file location : /u01/app/oracle/product/9.2.0/db_1/.patch_storage/<patch ID>/*.log Creating log file "/u01/app/oracle/product/9.2.0/db_1/.patch_storage/LsInventory__06-16-2017_10-47-52.log" Result: Installed Patch List: ===================== 1) Patch 9655027 applied on Fri Jun 16 10:47:16 KST 2017 Unique Patch ID: 12691158 [ Bug fixes: 6057120 5517051 7120509 5901910 6066116 8534403 4057920 9352224 5744161 6453643 6375910 5527732 5089244 5514908 7127618 9119275 7576801 6654193 6395038 9655027 6690077 5901875 6954722 8290638 6826554 6079582 7592365 5917099 5964709 5369855 5839764 7375695 7154111 3345222 5116414 6521027 6120177 4528014 4157520 7154115 6042409 5284303 5526018 6117049 5722472 6404861 2855117 5372831 5631915 6647071 6769003 5631836 6451637 6055396 4334992 5849054 6319169 88366758 4683638 6639973 6079599 5558878 6020552 2701372 6053580 5188321 6613049 6703834 5345437 4609147 7335157 5080775 6350567 4088156 5965170 5703297 6153972 5929055 6862814 8525675 5933477 5490859 6864197 6619946 4215910 5605370 6444045 5754150 5491035 5726053 4115449 6404447 6493035 5745084 4969005 6864082 9117646 6646842 4970079 6787081 8290549 5057695 5149865 6529567 4599763 ] OPatch succeeded.
oracle 유저로 remove_demo 실행
cd 9655027 sh remove_demo.sh
[oracle@orcl oracle]$ cd 9655027 [oracle@orcl 9655027]$ sh remove_demo.sh Your ORACLE_HOME is /u01/app/oracle/product/9.2.0/db_1 This script will remove the Vulnerable OHS Demos /u01/app/oracle/product/9.2.0/db_1/Apache/Apache/fcgi-bin/echo* Please note that you will NOT be able to restore these demos after removing, if you may want to restore these demos, please manually backup all the files under /u01/app/oracle/product/9.2.0/db_1/Apache/Apache/fcgi-bin/ directory, and then rerun remove_demo.sh Continue to remove the Vulnerable OHS Demos. Please respond Y|[N] => Y Removing the Vulnerable OHS Demos... Patch Installation Script Completed Exiting...
vi $ORACLE_HOME/Apache/Apache/conf/httpd.conf 주석처리
# FastCGIServer fcgi-bin/echo -initial-env ORACLE_HOME \ # -initial-env NLS_LANG
root 유저로 수행
chown root $ORACLE_HOME/bin/dbsnmp chmod 6750 $ORACLE_HOME/bin/dbsnmp
[root@orcl ~]# chown root /u01/app/oracle/product/9.2.0/db_1/bin/dbsnmp [root@orcl ~]# chmod 6750 /u01/app/oracle/product/9.2.0/db_1/bin/dbsnmp
V. 리스너 생성
[oracle@oel4 ~]$ lsnrctl status LSNRCTL for Linux: Version 9.2.0.8.0 - Production on 16-JUN-2017 11:02:49 Copyright (c) 1991, 2006, Oracle Corporation. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora92)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 9.2.0.8.0 - Production Start Date 16-JUN-2017 10:59:25 Uptime 0 days 0 hr. 3 min. 26 sec Trace Level off Security OFF SNMP OFF Listener Parameter File /u01/app/oracle/product/9.2.0/db_1/network/admin/listener.ora Listener Log File /u01/app/oracle/product/9.2.0/db_1/network/log/listener.log Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora92)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC))) Services Summary... Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully
VI. Database 생성