반응형

이 포스팅은 2015년 2월 17일에 작성된 예전 블로그 글을 새로이 옮긴 것입니다. 참고바랍니다.


 

Setup

설치에 필요한 파일

  • 10201_database_linux32.zip (/home/oracle)
  • patchset 파일 (/home/oracle/patchset)
    • p6810189_10204_Linux-x86.zip
    • p8202632_10205_LINUX.zip
  • patch 파일 (/home/oracle/patch)
    • p4198954_40_LINUX.zip

 

그룹, 사용자 생성

useradd -g dba oracle
passwd oracle

 

Oracle 10gR2 압축 해제

cd /home/oracle
unzip 10201_database_linux32.zip

/home/oracle/database 디렉터리가 생성된다.

 

Kernel Parameters 설정

vi /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
vi /etc/security/limits.conf

# 아래 내용 추가
oracle10gR2 soft nproc 2047
oracle10gR2 hard nproc 16384
oracle10gR2 soft nofile 1024
oracle10gR2 hard nofile 65536
vi /etc/pam.d/login

# 아래 내용 추가
session required pam_limits.so

 

패키지 설치

cd /media/cdrecoder/RedHat/RPMS rpm -Uvh libaio-devel-*.rpm
cd /home/oracle/patch unzip p4198954_40_LINUX.zip

Archive: p4198954_40_LINUX.zip
inflating: compat-libcwait-2.1-1.i386.rpm
inflating: compat-oracle-rhel4-1.0-5.i386.rpm
inflating: README.txt
rpm -Uvh compat-libcwait-*.rpm && rpm -Uvh compat-oracle-rhel4-*.rpm

 

.bash_profile 파일 설정

vi /home/oracle/.bash_profile

# 아래 내용 추가
export EDITOR=vi
export LD_ASSUME_KERNEL=2.4.19
export ORACLE_BASE=/home/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
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

만약 ANSI가 아닌 UNICODE를 사용하고 싶다면, KO16MSWIN949AL32UTF8로 변경한다.

 

/etc/hosts 파일 수정

# IP hostname.localdomain hostname 순으로 추가

127.0.0.1 localhost.localdomain localhost
192.168.0.60 rhel5.localdomain rhel5

 

Oracle 10gR2 (10.2.0.1) Installation

orainst.loc 파일 생성

vi /etc/oraInst.loc

# 아래 내용 추가
inventory_loc=/home/oracle/oraInventory
inst_group=dba
# 권한 변경
chown oracle.dba /etc/oraInst.loc
chown -R oracle.dba /home/oracle

 

response 파일 수정

su - oracle
vi /home/oracle/database/response/enterprise.rsp

# 아래 내용 찾아서 수정
UNIX_GROUP_NAME="dba"
ORACLE_HOME="/home/oracle/product/10.2.0/db_1"
ORACLE_HOME_NAME="OraDb10gR2Home1"
COMPONENT_LANGUAGES={"en,ko"}
INSTALL_TYPE="EE"
n_configuratinOption="3"

 

10.2.0.1 설치

cd /home/oracle/database/
./runInstaller -silent -responseFile /home/oracle/database/response/enterprise.rsp
Oracle Universal Installer 시작 중...

설치 프로그램 요구 사항 확인 중...

운영 체제 버전 확인 중: 필수 버전redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2 성공함 설치 프로그램 요구 사항을 모두 충족했습니다.

다음에서 Oracle Universal Installer의 시작을 준비하는 중 /tmp/OraInstall2015-08-11_04-09-11AM. 기다리십시오.[oracle@rhel4 database]$ Oracle Universal Installer, 버전 10.2.0.1.0 Production Copyright (C) 1999, 2005, Oracle. All rights reserved.

(중략)

설치 단계가 완료되었습니다.(Tue Aug 11 04:13:39 KST 2015)

WARNING:시스템을 구성하려면 다음 구성 스크립트 /home/oracle/product/10.2.0/db_1/root.sh을(를) 루트로 실행해야 합니다. 구성 툴 실행을 건너 뛸 경우 구성이 완료되지 않고
제품이 제대로 작동하지 않습니다.제품이 제대로 작동하도록 하기 위해서는 OUI를 종료한 후
스크립트 및 구성 툴을 실행해야 합니다.
su -
/home/oracle/product/10.2.0/db_1/root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME= /home/oracle/product/10.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 ...

Creating /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.

$ sqlplus / as sysdba로 버전(10.2.0.1) 확인.

 

Oracle 10gR2 (10.2.0.4) Patch

Oacle이 실행 중이면, 패치가 진행되지 않는다. 재부팅 또는 프로세스 종료 후 패치 진행.

su - oracle
cd /home/oracle/patchset unzip p6810189_10204_Linux-x86.zip

 

response 파일 수정

vi /home/oracle/patchset/Disk1/response/patchset.rsp

# 아래 내용 찾아서 수정
UNIX_GROUP_NAME="dba"
FROM_LOCATION="../stage/products.xml"
ORACLE_HOME="/home/oracle/patchset/product/10.2.0/db_1"
ORACLE_HOME_NAME="OraDb10gR2Home1"
COMPONENTLANGUAGES={"en,ko"}

만약 GENERAL PURPOSE를 찾을 수 없다고 나오면, FROM_LOCATION의 값을 절대주소로 변경한다. "../stage/products.xml""/home/oracle/patchset/stage/products.xml"

 

10.2.0.4 패치

cd /home/oracle/patchset/Disk1
./runInstaller -silent -responseFile /home/oracle/patchset/Disk1/response/patchset.rsp
Oracle Universal Installer 시작 중...

설치 프로그램 요구 사항 확인 중...

운영 체제 버전 확인 중: 필수 버전redhat-3, SuSE-9, SuSE-10, redhat-4, redhat-5, UnitedLinux-1.0, asianux-1, asianux-2 or asianux-3 성공함 설치 프로그램 요구 사항을 모두 충족했습니다.

다음에서 Oracle Universal Installer의 시작을 준비하는 중 /tmp/OraInstall2015-08-11_05-00-16AM. 기다리십시오.[oracle@rhel4 Disk1]$ Oracle Universal Installer, 버전 10.2.0.5.0 Production Copyright (C) 1999, 2008, Oracle. All rights reserved.

(중략)

설치 단계가 완료되었습니다.(2015년 8월 11일 화요일 오전 5시 04분 49초 KST)
WARNING: 다음 구성 스크립트는 "루트" 사용자로 실행해야 합니다.
#!/bin/sh
#Root script to run
/home/oracle/product/10.2.0/db_1/root.sh
구성 스크립트 실행:
    1. 터미널 창을 엽니다.
    2. "루트"로 로그인합니다.
    3. 스크립트를 실행합니다.

Oracle Database 10g Release 2 Patch Set 3의 설치을(를) 성공했습니다.
su -
/home/oracle/product/10.2.0/db_1/root.sh

[/usr/local/bin] 에서 [Enter], 덮어쓸 것인지 물어보면 전부다 Y 입력 후, [확인]

Running Oracle10 root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME= /home/oracle/product/10.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 ...

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.

설치 확인: $ sqlplus / as sysdba로 버전(10.2.0.4) 확인.

 

Create Database

response 파일 수정

su - oracle
vi /home/oracle/database/response/dbca.rsp

# 아래 내용 찾아서 수정
GDBNAME = "testdb"
SID = "testdb"
TEMPLATENAME = "New Database"
CHARACTERSET = "KO16MSWIN949" # 주석 해제
NATIONALCHARACTERSET= "UTF8" # 주석 해제

위에서 UNICODE를 선택했다면 여기서도 KO16MSWIN949를 AL32UTF8로 변경한다.

 

데이터베이스 생성

cd /home/oracle/product/10.2.0/db_1/bin/
./dbca -silent -responseFile /home/oracle/database/response/dbca.rsp
Oracle 인스턴스 생성 및 시작 중
1% 완료
4% 완료
데이터베이스 파일 생성 중
8% 완료
데이터 딕셔너리 뷰 생성 중
9% 완료
10% 완료
(중략)
데이터베이스 생성 완료 중
89% 완료
90% 완료
91% 완료
95% 완료
99% 완료
100% 완료
자세한 내용은 로그 파일 "/home/oracle/product/10.2.0/db_1/cfgtoollogs/dbca/testdb/testdb.log"을(를) 참조하십시오

/home/oracle/admin 디렉터리에 testdb 디렉터리가 생성되어 있으면, DB가 생성된 것이다.

sqlplus / as sysdba
startup
select status from v$instance;

STATUS가 OPEN 상태이면 정상.

 

Oracle 10gR2 (10.2.0.5) Patch

Oracle이 실행 중이면, 패치가 진행되지 않는다. 재부팅 또는 프로세스 종료 후 패치 진행.

su - oracle
cd /home/oracle/patchset
rm -rf Disk1 rm -rf README.html
unzip p8202632_10205_LINUX.zip

 

response 파일 수정

vi /home/oracle/patchset/Disk1/response/patchset.rsp

# 아래 내용 찾아서 수정
UNIX_GROUP_NAME="dba"
FROM_LOCATION="../stage/products.xml"
ORACLE_HOME="/home/oracle/product/10.2.0/db_1"
ORACLE_HOME_NAME="OraDb10gR2Home1"
COMPONENT_LANGUAGES={"en,ko"}
DECLINE_SECURITY_UPDATES=TRUE

 

10.2.0.5 패치

cd /home/oracle/patchset/Disk1
./runInstaller -silent -responseFile /home/oracle/patchset/Disk1/response/patchset.rsp
Oracle Universal Installer 시작 중...

설치 프로그램 요구 사항 확인 중...

운영 체제 버전 확인 중: 필수 버전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 성공함 설치 프로그램 요구 사항을 모두 충족했습니다.

다음에서 Oracle Universal Installer의 시작을 준비하는 중 /tmp/OraInstall2015-08-11_05-55-51AM. 기다리십시오.[oracle@rhel4 Disk1]$ Oracle Universal Installer, 버전 10.2.0.5.0 Production Copyright (C) 1999, 2010, Oracle. All rights reserved.

(중략)

설치 단계가 완료되었습니다.(2015년 8월 11일 화요일 오전 6시 13분 44초 KST)
WARNING: 다음 구성 스크립트는 "루트" 사용자로 실행해야 합니다.
#!/bin/sh
#Root script to run
/home/oracle/product/10.2.0/db_1/root.sh
구성 스크립트 실행:
    1. 터미널 창을 엽니다.
    2. "루트"로 로그인합니다.
    3. 스크립트를 실행합니다.

Oracle Database 10g Release 2 Patch Set 4의 설치을(를) 성공했습니다.
자세한 내용은 '/home/oracle/oraInventory/logs/silentInstall2015-08-11_06-08-16AM.log'을(를) 확인하십시오.
su -
/home/oracle/product/10.2.0/db_1/root.sh

[/usr/local/bin]에서 [Enter], 덮어쓸 것인지 물어보면 전부다 Y 입력 후, [확인]

Running Oracle 10g root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME= /home/oracle/product/10.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 ...
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.

$ sqlplus / as sysdba로 버전(10.2.0.5) 확인.

 

Post Upgrade(DB 파라미터 값 수정)

sqlplus / as sysdba
startup upgrade
select status from v$instance;
@?/rdbms/admin/catupgrd.sql
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>#
shutdown
startup
@?/rdbms/admin/utlrp.sql
TIMESTAMP
------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END 2015-08-11 06:40:59
DOC> The following query reports the number of objects that have compiled
DOC> with errors (objects that compile with errors have status set to 3 in
DOC> obj$). If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#
OBJECTS WITH ERRORS
-------------------
                  0
DOC> The following query reports the number of errors caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC>#
ERRORS DURING RECOMPILATION
---------------------------
                          0
shutdown
startup
select status from v$instance;

업그레이드 완료.

반응형

'IT' 카테고리의 다른 글

OPatch Users's Guide  (0) 2020.10.04
Oracle 11gR2 Silent Install on RHEL5  (0) 2020.10.04
QNAP TS-251 개봉 및 설치 감상기  (0) 2020.10.04
FreeNAS 9.2.1.5 설치 매뉴얼  (0) 2020.10.04
교보문고 샘(sam) 0.0086 펌웨어 제작 가이드  (0) 2020.10.04
  • 네이버 블러그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 카카오스토리 공유하기