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. oracle-validate 미설치시 설정
root 유저로 수행 (oracle-validated 미설치시)
# groupadd oinstall # groupadd dba # useradd -g oinstall -G oinstall,dba oracle # id oracle # passwd oracle
[root@oel4 ~]# groupadd oinstall [root@oel4 ~]# groupadd dba [root@oel4 ~]# useradd -g oinstall -G oinstall,dba oracle [root@oel4 ~]# id oracle uid=500(oracle) gid=501(oinstall) groups=501(oinstall),500(dba) [root@oel4 ~]# passwd oracle Changing password for user oracle. New UNIX password: BAD PASSWORD: it is based on a dictionary word Retype new UNIX password: passwd: all authentication tokens updated successfully.
vi /etc/security/limits.conf 편집 root 유저로 수행 (oracle-validated 미설치시)
oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536
vi /etc/pam.d/login 편집 root 유저로 수행 (oracle-validated 미설치시)
session required pam_limits.so
6. 필수 설정
root 유저로 수행
mkdir /u01 chown oracle:oinstall /u01
[root@oel4 ~]# mkdir /u01 [root@oel4 ~]# chown oracle:oinstall /u01
oracle 유저 : vi .bash_profile
export EDITOR=vi export LD_ASSUME_KERNEL=2.4.19 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 export ORACLE_SID=orcl export LANG=ko_KR.eucKR export ORACLE_TERM=xterm export NLS_LANG=AMERICAN_AMERICA.KO16KSC5601 export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib export PATH=$JAVA_HOME/bin:$PATH:$ORACLE_HOME/bin export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib export PS1='[\u@$ORACLE_SID \W]$ '
III. DB 소프트웨어 설치
root 유저로 /etc/redhat-release 수정
cp /etc/redhat-release /etc/redhat-release.bak # 원본 백업
root 유저로 vi /etc/redhat-release 파일 수정
redhat-3
oracle 유저로 설치 파일 권한 변경
cd <설치 파일 압축 해제 경로> chmod 755 Disk1/runInstaller chmod 755 Disk1/install/runInstaller chmod 755 Disk1/install/unzip
[oracle@orcl sf_oracle]# cd /media/sf_oracle [oracle@orcl sf_oracle]# chmod 755 Disk1/runInstaller [oracle@orcl sf_oracle]# chmod 755 Disk1/install/runInstaller [oracle@orcl sf_oracle]# chmod 755 Disk1/install/unzip
oracle 유저로 실행
cd Disk1 ./runInstaller
root 유저로 수행
/u01/app/oracle/oraInventory/orainstRoot.sh
[root@oel4 ~]# /u01/app/oracle/oraInventory/orainstRoot.sh Creating the Oracle inventory pointer file (/etc/oraInst.loc) Changing groupname of /u01/app/oracle/oraInventory to oinstall.
root 유저로 수행
/u01/app/oracle/product/10.1.0/db_1/root.sh
[root@oel4 ~]# /u01/app/oracle/product/10.1.0/db_1/root.sh Running Oracle10 root.sh script... \nThe following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/10.1.0/db_1 Enter the full pathname of the local bin directory: [/usr/bin]: Copying dbhome to /usr/bin ... Copying oraenv to /usr/bin ... Copying coraenv to /usr/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. /var/opt/oracle does not exist. Creating it now. /etc/oracle does not exist. Creating it now. Successfully accumulated necessary OCR keys. Creating OCR keys for user 'root', privgrp 'root'.. Operation successful. Oracle Cluster Registry for cluster has been initialized Adding to inittab Checking the status of Oracle init process... Expecting the CRS daemons to be up within 600 seconds. CSS is active on these nodes. oel4 CSS is active on all nodes. Oracle CSS service is installed and running under init(1M)
root 유저로 /etc/redhat-release 원상 복원
cp /etc/redhat-release.bak /etc/redhat-release
[root@oel4 ~]# cp /etc/redhat-release.bak /etc/redhat-release cp: overwrite `/etc/redhat-release'? yes [root@oel4 ~]# cat /etc/redhat-release Red Hat Enterprise Linux AS release 4 (Nahant Update 8)
IV. PSU & 패치
1. Patch Set (10.1.0.5)
oracle 유저로 수행
cd <패치 파일 압축 해제 경로>/Disk1 ./runInstaller
root 유저로 cssd 정지
/etc/init.d/init.cssd stop
[root@oel4 ~]# /etc/init.d/init.cssd stop Shutting down CRS daemon. Shutting down EVM daemon. Shutting down CSS daemon. Shutdown request successfully issued.
root 유저로 수행
/u01/app/oracle/product/10.1.0/db_1/root.sh
[root@oel4 ~]# /u01/app/oracle/product/10.1.0/db_1/root.sh Running Oracle 10g root.sh script... The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/10.1.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 ... 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. clscfg: EXISTING configuration version 2 detected. clscfg: version 2 is 10G Release 1. Successfully accumulated necessary OCR keys. clscfg: Arguments check out successfully. NO KEYS WERE WRITTEN. Supply -force parameter to override. -force is destructive and will destroy any previous cluster configuration. Oracle Cluster Registry for cluster has already been initialized Starting Oracle CSS service under init(1M) Startup will be queued to init within 30 seconds. Expecting the CRS daemons to be up within 120 seconds. CSS is active on these nodes. oel4 CSS is active on all nodes. Oracle CSS service is installed and running under init(1M)
2. Patch Set (10.1.0.6)
oracle 유저로 설치 사전 준비 수행
chmod 755 <패치 파일 압축 해제 경로>/cd/Disk1/install/runInstaller chmod 755 <패치 파일 압축 해제 경로>/cd/Disk1/install/unzip cd <패치 파일 압축 해제 경로>/cd/Disk1/install ./runInstaller
3. Critical Patch Update
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.61 Copyright (c) 2009 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/10.1.0/db_1 Oracle Home Inventory : /u01/app/oracle/product/10.1.0/db_1/inventory Central Inventory : /u01/app/oracle/oraInventory from : /etc/oraInst.loc OUI location : /u01/app/oracle/product/10.1.0/db_1/oui OUI shared library : /u01/app/oracle/product/10.1.0/db_1/oui/lib/linux/liboraInstaller.so Java location : /u01/app/oracle/product/10.1.0/db_1/jre/1.4.2/bin/java Log file location : /u01/app/oracle/product/10.1.0/db_1/.patch_storage/<patch ID>/*.log Creating log file "/u01/app/oracle/product/10.1.0/db_1/.patch_storage/LsInventory__06-21-2017_12-56-17.log" Result: There is no Interim Patch OPatch succeeded.
oracle 유저로 패치
cd 13343482 opatch apply
[oracle@orcl sf_oracle]$ cd 13343482 [oracle@orcl 13343482]$ opatch apply Oracle Interim Patch Installer version 1.0.0.0.61 Copyright (c) 2009 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/10.1.0/db_1 Oracle Home Inventory : /u01/app/oracle/product/10.1.0/db_1/inventory Central Inventory : /u01/app/oracle/oraInventory from : /etc/oraInst.loc OUI location : /u01/app/oracle/product/10.1.0/db_1/oui OUI shared library : /u01/app/oracle/product/10.1.0/db_1/oui/lib/linux/liboraInstaller.so Java location : /u01/app/oracle/product/10.1.0/db_1/jre/1.4.2/bin/java Log file location : /u01/app/oracle/product/10.1.0/db_1/.patch_storage/<patch ID>/*.log Creating log file "/u01/app/oracle/product/10.1.0/db_1/.patch_storage/13343482/Apply_13343482_06-21-2017_12-58-36.log" Invoking fuser to check for active processes. Invoking fuser on "/u01/app/oracle/product/10.1.0/db_1/bin/oracle" Invoking fuser on "/u01/app/oracle/product/10.1.0/db_1/bin/tnslsnr" 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/10.1.0/db_1) Is this system ready for updating? Please respond Y|N > y Executing the Apply pre-patch script (/media/sf_oracle/13343482/custom/scripts/pre)... Applying patch 13343482... Patching archive files... Patching jar files... Patching copy files... Creating new directory "/u01/app/oracle/product/10.1.0/db_1/cpu/CPUJan2012/MODPLSQL/owa_all/30" Creating new directory "/u01/app/oracle/product/10.1.0/db_1/cpu/CPUJan2012/MODPLSQL/owa_all/101" Creating new directory "/u01/app/oracle/product/10.1.0/db_1/cpu/CPUJan2012/MODPLSQL/owa_all/90" Creating new directory "/u01/app/oracle/product/10.1.0/db_1/cpu/scripts" Creating new directory "/u01/app/oracle/product/10.1.0/db_1/j2ee/OC4J_EM/applications/em/em/admin/rep" Creating new directory "/u01/app/oracle/product/10.1.0/db_1/cpu/view_recompile" Creating file to hold list of directories that were mkdir'ed: "/u01/app/oracle/product/10.1.0/db_1/.patch_storage/13343482/opatch_dirs_created.lst" Running make for target client_sharedlib. Running make for target ioracle. Running make for target iokinit. Running make for target ioklist. Running make for target iokdstry. Running make for target itnsping. Running make for target ilsnrctl. Running make for target itnslsnr. Running make for target iimp. Running make for target ictxload. Running make for target libnmemso. 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/sf_oracle/13343482/custom/scripts/post)... OPatch succeeded.
oracle 유저로 패치 결과 확인
opatch lsinventory
[oracle@orcl ~]$ opatch lsinventory Oracle Interim Patch Installer version 1.0.0.0.61 Copyright (c) 2009 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/10.1.0/db_1 Oracle Home Inventory : /u01/app/oracle/product/10.1.0/db_1/inventory Central Inventory : /u01/app/oracle/oraInventory from : /etc/oraInst.loc OUI location : /u01/app/oracle/product/10.1.0/db_1/oui OUI shared library : /u01/app/oracle/product/10.1.0/db_1/oui/lib/linux/liboraInstaller.so Java location : /u01/app/oracle/product/10.1.0/db_1/jre/1.4.2/bin/java Log file location : /u01/app/oracle/product/10.1.0/db_1/.patch_storage/<patch ID>/*.log Creating log file "/u01/app/oracle/product/10.1.0/db_1/.patch_storage/LsInventory__06-21-2017_13-22-33.log" Result: Installed Patch List: ===================== 1) Patch 13343482 applied on Wed Jun 21 13:14:06 KST 2017 Unique Patch ID: 14274679 [ Bug fixes: 5220448 6350565 6079585 5458753 9655023 4175906 5901912 6864078 4486132 5896963 11725035 6647005 5095815 4519477 5347751 4691191 4754900 5861360 8290534 5382595 5071931 6370967 5458543 6607951 5179574 4329444 5029950 5464895 5029952 5029954 5738539 5648727 5352587 5631915 4402808 4871035 6455161 5114396 5091108 5584790 4605877 4751932 5751672 5490845 10080564 6753516 8534394 3345756 5933477 7592360 5094098 10183338 5015557 5675556 4679094 5154689 12828135 5222931 5910829 5754150 5227879 4152843 4661844 6079603 5637094 7044603 6016022 4905112 8290629 4581220 4166537 7120513 5276400 7154097 7154098 5408664 5563256 6395024 4146291 6397568 6854919 12419228 9108675 5901877 4768040 5049074 7022400 5960451 5490935 5049077 4542188 4680009 4593539 4555795 12565867 5406923 4359124 5689908 5258410 4969005 3962946 3743912 5648102 9352208 5057964 8836540 3935623 5014128 4873311 4439469 4331689 6705965 4597251 4903532 6055387 9764906 7576788 5650178 5225797 4047969 4554284 5376215 4874628 5401921 5151518 4458415 4700543 7375686 5226235 4900129 5122955 5095648 4561867 5239126 5869471 4712638 5354517 4925103 4745776 5998987 4939157 6404864 4627335 7300525 5501362 4587572 4969029 9119261 6270140 5055442 7334756 6639839 4492467 5222032 5151675 5242647 6999528 6737308 7137797 6864202 4587431 5605370 6647068 9952279 6826532 4335559 5417371 4671216 5065930 9362645 4575854 6130365 5355257 7173149 5243019 6639553 4966417 5884075 4899479 4610820 3837600 5092688 4528572 4449900 4601861 6009358 4226736 6404447 13343482 4348230 8785236 5233111 5644862 4197970 ] OPatch succeeded.
V. 리스너 생성
oracle 유저로 실행
netca
[oracle@orcl ~]$ lsnrctl status LSNRCTL for Linux: Version 10.1.0.5.0 - Production on 21-JUN-2017 13:34:31 Copyright (c) 1991, 2004, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oel4)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 10.1.0.5.0 - Production Start Date 21-JUN-2017 13:34:16 Uptime 0 days 0 hr. 0 min. 14 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/oracle/product/10.1.0/db_1/network/admin/listener.ora Listener Log File /u01/app/oracle/product/10.1.0/db_1/network/log/listener.log Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel4)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) 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 생성
oracle 유저로 실행
dbca