설치 순서
1. 계정 생성 및 각종 환경 설정
2. 설치시 필요한 프로그램 설치
3. 10.2.0.1.0버전 설치
4. 10.2.0.5.0패치 설치
- 설치에 필요한 파일은 대부분 yum으로 설치 가능하고, 10.2.0.1.0버전과 10.2.0.5.0패치만 다운받으면 된다.
- 이글을 쓰는 시점에는 이미 오라클에서 10g의 지원을 중단했기 때문에 오라클웹 사이트에서는 해당 버전을 다운 받을 수 없다.
- 해당 버전명으로 구글링해서 받아야 할 것이다
1. 계정 생성 및 각종 환경 설정
- oracle 계정 생성
[root@b1ix ~]# groupadd -g 5000 dba
[root@b1ix ~]# useradd -g dba oracle
[root@b1ix ~]# passwd oracle
- /etc/sysctl.conf파일의 맨 아랫줄에 추가해 준다. 위에 겹치는 부분들이 있으면 #으로 주석 처리 해준다
- 추가후에 커널 변경값을 적용 한다
[root@b1ix ~]# vim /etc/sysctl.conf
kernel.shmmax=536870912
kernel.shmmni=4096
kernel.shmall=2097152
kernel.sem=250 32000 100 128
fs.file-max=65536
net.ipv4.ip_local_port_range=1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144
[root@b1ix ~]# sysctl -p
- /etc/security/limits.conf 파일에 아래 부분을 추가한다
[root@b1ix ~]# vim /etc/security/limits.conf
oracle10g soft nproc 2047
oracle10g hard nproc 16384
oracle10g soft nofile 1024
oracle10g hard nofile 65536
[root@b1ix ~]
- /etc/pam.d/login파일에 아래 내용을 추가한다
[root@b1ix ~]# vim /etc/pam.d/login
session required pam_limits.so
[root@b1ix ~]
- 위에서 만든 oracle계정의 .bash_profile파일에 아래 부분 추가
[root@b1ix ~]# su - oracle
[oracle@b1ix ~]$ vim .bash_profile
export EDITOR=vim
export LD_ASSUME_KERNEL=2.4.19
export ORACLE_BASE=/home/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10g
export ORACLE_SID=testdb
export LANG=ko_KR.eucKR
export ORACLE_TERM=xterm
export NLS_LANG=AMERICAN_AMERICA.KO16MSWIN949
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export PATH=$PATH:$ORACLE_HOME/bin
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
[oracle@b1ix ~]
2. 설치시 필요한 프로그램 설치
- 각종 패키지 설치
- 아래 나열된 패키지 목록들은 해당 리눅스서버 환경에 따라 필요 할 수도 있고, 필요 없을 수도 있다
- 설치시 오류가 1개라도 덜 나게 하기 위해선, 그냥 다 까는게 정신건강에 좋다
- 아래 나열된 패키지 목록들은 의존성 때문에한번에 설치가 안될수도 있기 때문에 나눠서 하는걸 추천한다
# yum install ld-linux.so.2 libXp.x86_64 libXt.x86_64 libXp-devel.x86_64 libXt-devel.x86_64 libXp.i686 libXt.i686 libXp-devel.i686 libXt-devel.i686 libXtst.i686 libXtst.i686 libXtst-devel.i686 libXtst-devel.x86_64 binutils.x86_64 binutils-devel.i686 binutils-devel.x86_64 compat-libstdc++-33 compat-db.x86_64 compat-db42.x86_64 glibc.i686 glibc.x86_64 glibc-devel.i686 glibc-devel.x86_64 libstdc++.i686 libstdc++.x86_64 libstdc++-devel.i686 libstdc++-devel.x86_64 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ ksh libaio libaio-devel libgomp libgcc make sysstat unixODBC unixODBC-devel pdksh
- 의존성 때문에 나눠놓은 부분
# yum install ld-linux.so.2 libXp.x86_64 libXt.x86_64 libXp-devel.x86_64 libXt-devel.x86_64 libXp.i686 libXt.i686 libXp-devel.i686 libXt-devel.i686 libXtst.i686 libXtst.i686 libXtst-devel.i686 libXtst-devel.x86_64
# yum install binutils.x86_64 binutils-devel.i686 binutils-devel.x86_64
# yum install compat-libstdc++-33 compat-db.x86_64 compat-db42.x86_64
# yum install glibc.i686 glibc.x86_64 glibc-devel.i686 glibc-devel.x86_64
# yum install libstdc++.i686 libstdc++.x86_64 libstdc++-devel.i686 libstdc++-devel.x86_64
# yum install elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static
# yum install gcc gcc-c++ ksh libaio libaio-devel libgomp libgcc make sysstat unixODBC unixODBC-devel pdksh
- vnc server 설치
- vnc를 oracle계정으로 들어가야 하기 때문에, 설치후에 oracle 계정으로 들어가서 vncserver를 실행한다
- vncserver를 최초 실행시 암호를 설정하는 부분이 나온다. 이 부분의 암호는 vnc접속시 암호이다
- 필자는 이미 root계정으로 vncserver를 실행해 놨었기 때문에, desktop번호가 2번으로 나온다
[root@b1ix ~]# yum install tigervnc-server
.
.
.
[root@b1ix ~]# su - oracle
[oracle@b1ix ~]$ vncserver
You will require a password to access your desktops.
Password:
Verify:
xauth: file /home/oracle/.Xauthority does not exist
xauth: (stdin):1: bad display name "b1ix:2" in "add" command
New 'b1ix:2 (oracle)' desktop is b1ix:2
Creating default startup script /home/oracle/.vnc/xstartup
Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/b1ix:2.log
[oracle@b1ix ~]
- 이부분에서 잘 안될 경우 vim /etc/sysconfig/vncservers로 해당 파일의 설정을 아래와 같이 하고 vnc를 재시작 해보면 된다.
- 1:root로 되어 있던 값을 1:oracle로 변경시에는 오류가 뜰수 있다, 아래처럼 직접 root로 실행된 vnc를 종료 해주면 된다.
[root@b1ix ~]# vim /etc/sysconfig/vncservers
#VNCSERVERS="1:root"
VNCSERVERS="1:oracle"
VNCSERVERARGS[1]="-geometry 1200x1024"
[root@b1ix ~]# service vncserver restart
VNC 서버 종료 중: 1:oracle [실패]
VNC 서버 (을)를 시작 중: 1:oracle A VNC server is already running as :1
[실패]
[root@b1ix ~]# vncserver -list
TigerVNC server sessions:
X DISPLAY # PROCESS ID
:1 7363
[root@b1ix ~]# vncserver -kill :1
Killing Xvnc process ID 7363
[root@b1ix ~]# service vncserver restart
VNC 서버 종료 중: 1:oracle [실패]
VNC 서버 (을)를 시작 중: 1:oracle
New 'b1ix:1 (oracle)' desktop is b1ix:1
Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/b1ix:1.log
[ OK ]
[root@b1ix ~]#
- 여러 vnc를 동시에 사용하고 싶다면, VNCSERVERS="1:oracle" 이부분을, VNCSERVERS="1:root 2:oracle 3:anyusers" 식으로 변경하면 된다
- 위와 같이 설정시 :1은 5901포트, :2는 5902포트 식으로 자동으로 port가 할당 되어, 해당 포트로 vnc접속시 해당 계정으로 사용이 가능해진다
3. 10.2.0.1.0버전 설치
- vnc에 접속하여 설치
- 터미널을 열고 압축 풀기
- /home/oracle/download에 받아놓았던 10.2.0.1.0버전의 cpio파일을 풀면, database라는 폴더가 생성된다
[oracle@b1ix ~]$ cpio -idmv < ./download/10201_database_linux_x86_64.cpio
.
.
.
[oracle@b1ix ~]$ ll
\ud569\uacc4 40
drwxr-xr-x 6 oracle dba 4096 2005-10-23 16:55 database
.
.
.
- runInstaller 실행하기
[oracle@b1ix ~]$ cd database/
[oracle@b1ix database]$ ll
\ud569\uacc4 36
drwxrwxr-x 9 oracle dba 4096 2005-10-20 10:03 doc
drwxr-xr-x 5 oracle dba 4096 2005-10-23 16:49 install
drwxr-xr-x 2 oracle dba 4096 2005-10-23 16:49 response
-rwxr-xr-x 1 oracle dba 1326 2005-10-23 16:49 runInstaller
drwxrwxr-x 9 oracle dba 12288 2005-10-23 16:49 stage
-rw-rw-r-- 1 oracle dba 5416 2005-10-20 05:07 welcome.html
[oracle@b1ix database]$ ./runInstaller
Oracle Universal Installer 시작중...
설치 프로그램 요구 사항 확인중...
운영체제 요구사항 확인중: 필수버전 redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
실패함 <<<<
Oracle Universal Installer를 종료하는 중입니다. 이 세션에 대한 로그를 /tmp/OraInstall2019-03-29_02-15-23PM/installActions2019-03-29_02-15-23PM.log에서 찾을 수 있습니다.
- 실패할 경우에 는 -ignoreSysPrereqs 옵션을 추가 한다
[oracle@b1ix database]$ ./runInstaller -ignoreSysPrereqs
Oracle Universal Installer 시작중...
설치 프로그램 요구 사항 확인중...
운영체제 요구사항 확인중: 필수버전 redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
실패함 <<<<
>>> 필수 필요 조건을 만족하지 않지만 무시하고 계속 하는 중입니다.
다음에서 Oracle Universal Installer의 시작을 준비하는 중 /tmp/OraInstall2019-03-29_02-18-54PM. 기다립시오.[oracle@b1ix database]$ Oracle Universal Installer, 버전 10.2.0.1.0 Production
Copyright (C) 1999, 2005, Oracle. All rights reserved.
.
.
.
- 이때 오라클 설치 창이 안뜨거나, 언어가 깨져서 나올 수 있다.
- 현재 시도중인 서버에서는 언어만 깨져 나와서 export LANG=C(혹은 mswin94)를 설정후 제대로 영어로 표시 됐다
- 화면이 안나올때는 echo $DISPAY를 해보고, export DISPLAY=localhost:1.0 와 같은 설정으로 DISPLAY를 잡아줘야 한다
- 처음 할땐 화면 설정의 숫자를 몰라서 localhost:1.0, localhost:2.0... 식으로 하나씩 해봤었다.. ㅡ/.ㅡ
[oracle@b1ix ~]$[oracle@b1ix database]$ echo $LANG
ko_KR.UTF-8
[oracle@b1ix database]$ export LANG=C
[oracle@b1ix database]$ ./runInstaller -ignoreSysPrereqs
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
Failed <<<<
>>> Ignoring required pre-requisite failures. Continuing...
- 설치 화면이 제대로 나오면, 이부분 부터는 자신이 원하는 설정에 맞게 install을 진행 하면 된다.
- 설치시 여러가지 오류가 뜰 수 있다
- Configuration assistant "Oracle Net Configuration Assistant" failed 오류
- /etc/hosts에 해당 호스트명과 IP를 등록해주면 된다
[root@b1ix ~]# vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.19 b1ix b1ix.oracle.com
- ora-27125 :unable to create shared memory segment 오류
- dbca에서 발생하는 오류 $ORACLE_HOME/bin으로 가서 oracle을 아래 내용으로 수정해주면된다
- oracle파일의 권한을 설정 안해주면 ora-12546 tns permission denied 오류가 뜨게 된다
[oracle@b1ix ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/10.1.0/db_1
[oracle@b1ix ~]$ cd /u01/app/oracle/product/10.1.0/db_1/bin
[oracle@b1ix bin]$ mv oracle oracle.bin
[oracle@b1ix bin]$ chmod 6755 oracle
[oracle@b1ix bin]$ vim oracle
#!/bin/bash
export DISABLE_HUGETLBFS=1
exec $ORACLE_HOME/bin/oracle.bin $@
[oracle@b1ix bin]$
- OUI-10058: the oui inventory on this system does not exist or is not writable 오류
- oraInst.loc파일의 권한을 644로 변경하면 된다
[oracle@b1ix ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/10.1.0/db_1
[oracle@b1ix ~]$ cd /u01/app/oracle/product/10.1.0/db_1
[oracle@b1ix db_1]$ chmod 644 oraInst.loc
- 설치완료
[oracle@b1ix ~]$ sqlplus
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Apr 2 21:20:50 2019
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter user-name: system
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL>
SQL> show parameter db_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string ORCL
SQL>
4. 10.2.0.5.0패치 설치
- 10.0.2.5패치는 zip 파일로 되어 있어서 우선 압축을 풀고, Disk1로 들어가서 runInstaller를 실행 시키면 된다
[oracle@b1ix ~]$ mkdir p10205
[oracle@b1ix ~]$ cd p10205/
[oracle@b1ix p10205]$ unzip ../download/p8202632_10205_Linux-x86-64.zip
.
.
.
[oracle@b1ix p10205]$ ll
total 172
drwxr-xr-x 5 oracle dba 4096 Apr 29 2010 Disk1
-rwxr-xr-x 1 oracle dba 171131 Apr 29 2010 README.htm
[oracle@b1ix p10205]$ cd Disk1/
[oracle@b1ix Disk1]$ ll
total 184
drwxr-xr-x 4 oracle dba 4096 Apr 29 2010 install
-rwxr-xr-x 1 oracle dba 171131 Apr 29 2010 patch_note.htm
drwxr-xr-x 2 oracle dba 4096 Apr 29 2010 response
-rwxr-xr-x 1 oracle dba 3927 Apr 29 2010 runInstaller
drwxr-xr-x 11 oracle dba 4096 Apr 29 2010 stage
[oracle@b1ix Disk1]$ ./runInstaller
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be redhat-3, SuSE-9, SuSE-10, redhat-4, redhat-5, redhat-6, UnitedLinux-1.0, asianux-1, asianux-2, asianux-3, enterprise-4, enterprise-5 or SuSE-11
Passed
All installer requirements met.
Checking Temp space: must be greater than 80 MB. Actual 182862 MB Passed
Checking swap space: must be greater than 150 MB. Actual 8191 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2019-03-29_02-46-50PM. Please wait ...[oracle@b1ix Disk1]$ Oracle Universal Installer, Version 10.2.0.5.0 Production
Copyright (C) 1999, 2010, Oracle. All rights reserved.
Warning: Cannot convert string "-b&h-lucida-medium-r-normal-sans-*-140-*-*-p-*-iso8859-1" to type FontStruct
- 이번엔 이상 없이 설치 화면이 떠서 바로 패치를 시작했다
- 패시 시작 직후 "OUI-10036: Could not create the inventory location. You may not have permission to write to this location. "오류가 떴는데, inventory directory의 주소가 제대로 설정이 안되어 있어서 그랬던 거였다. 필자의 경우 위 설치 경로상 /home/oracle/oraInventory 에 inventory directory가 있다
- Oracle Universal Installer has detected that there are processes running in the currently selected Oracle Home. The following processes need to be shutdown before continuing 오류
- 위 오류가 난다면 서버를 재부팅하면 해결된다
- ORA-01092: ORACLE instance terminated. Disconnection forced 오류
- 패치후 발생 할 수 있는 버그로, 패치가 제대로 적용되지 않아서 발생 할 수 있는 오류이다
- sqlplus / as sysdba로 접속후 startup upgrade; 후에 @$ORACLE_HOME/rdbms/admin/catupgrd.sql를 실행 시키고, shutdown immediate;로 오라클을 끈다음 startup;으로 다시 켜면 된다
[oracle@b1ix ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Wed Apr 3 10:32:46 2019
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup upgrade;
ORACLE instance started.
Total System Global Area 2.2783E+10 bytes
Fixed Size 2137176 bytes
Variable Size 2483028904 bytes
Database Buffers 2.0284E+10 bytes
Redo Buffers 14639104 bytes
Database mounted.
Database opened.
SQL>
SQL> @$ORACLE_HOME/rdbms/admin/catupgrd.sql
DOC>######################################################################
DOC>######################################################################
DOC> The following statement will cause an "ORA-01722: invalid number"
DOC> error if the user running this script is not SYS. Disconnect
DOC> and reconnect with AS SYSDBA.
DOC>######################################################################
DOC>######################################################################
.
.
.
.
Total Upgrade Time: 00:21:04
DOC>#######################################################################
DOC>#######################################################################
DOC>
DOC> The above PL/SQL lists the SERVER components in the upgraded
DOC> database, along with their current version and status.
DOC>
DOC> Please review the status and version columns and look for
DOC> any errors in the spool log file. If there are errors in the spool
DOC> file, or any components are not VALID or not the current version,
DOC> consult the Oracle Database Upgrade Guide for troubleshooting
DOC> recommendations.
DOC>
DOC> Next shutdown immediate, restart for normal operation, and then
DOC> run utlrp.sql to recompile any invalid application objects.
DOC>
DOC>#######################################################################
DOC>#######################################################################
DOC>#
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
Total System Global Area 2.2783E+10 bytes
Fixed Size 2137176 bytes
Variable Size 2516583336 bytes
Database Buffers 2.0250E+10 bytes
Redo Buffers 14639104 bytes
Database mounted.
Database opened.
SQL>
- 설치 확인
[root@b1ix ~]# su - oracle
[oracle@b1ix ~]$ sqlplus system
SQL*Plus: Release 10.2.0.5.0 - Production on Wed Apr 3 11:05:41 2019
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>