Install ORACLE 11g on RHEL5



 

 


 Engine 생성전



- oracle 계정생성 


[root@server114 root]groupadd g 5000 dba

[root@server114 root]# useradd g dba oracle

[root@server114 root]passwd oracle




- winscp 파일전송 


 

linux_11gR2_database_1of2.zip              /home/oracle

linux_11gR2_database_2of2.zip              /home/oracle


         



 


- 메모리, 디스크권장사항 확인하기



[root@server114 ~]# grep SwapTotal /proc/meminfo

SwapTotal:     2048248 kB

[root@server114 ~]# free

                   total       used       free     shared    buffers     cached

Mem:       1035200     510560     524640          0      24468     384800      // 최소한의 메모리 1GB

-/+ buffers/cache:     101292     933908

Swap:      2048248          0    2048248                                             // swap : 메모리의 1.5배~2배

[root@server114 ~]# df -h /tmp
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3           4.8G  2.9G  1.7G  65% /                                         // tmp  디렉토리 1 GB  이상 되야함
            




- 필수 패키지 권장사항 확인하기(아래의 패키지 중 하나라도 설치되어 있지 않다면 꼭 찾아서 설치하고 다음으로 진행.)




binutils-2.17.50.0.6

compat-libstdc++-33-3.2.3

elfutils-libelf-0.125

elfutils-libelf-devel-0.125

elfutils-libelf-devel-static-0.125

gcc-4.1.2

gcc-c++-4.1.2

glibc-2.5-24

glibc-common-2.5

glibc-devel-2.5

glibc-headers-2.5

kernel-headers-2.6.18

ksh-20060214

libaio-0.3.106

libaio-devel-0.3.106

libgcc-4.1.2

libgomp-4.1.2

libstdc++-4.1.2

libstdc++-devel-4.1.2

make-3.81

numactl-devel-0.9.8.i386

sysstat-7.0.2

unixODBC-32bit-2.2.11

unixODBC-devel-2.2.11



[root@server114 Server]# pwd

/media/RHEL_5.3 i386 DVD/Server

 

[root@server114 Server]#

[root@localhost Server]# rpm -qa | grep binutils-2.17.50.0.6

binutils-2.17.50.0.6-14.el5

[root@localhost Server]# rpm -qa | grep compat-libstdc++-33-3.2.3

compat-libstdc++-33-3.2.3-61

[root@localhost Server]# rpm -qa | grep elfutils-libelf

elfutils-libelf-devel-static-0.137-3.el5

elfutils-libelf-devel-0.137-3.el5

elfutils-libelf-0.137-3.el5

[root@localhost Server]# rpm -qa | grep gcc-4.1.2

libgcc-4.1.2-50.el5

gcc-4.1.2-50.el5

[root@localhost Server]# rpm -qa | grep gcc-c++-4.1.2

gcc-c++-4.1.2-50.el5

[root@localhost Server]# rpm -qa |grep glibc-2.5

glibc-2.5-58

[root@localhost Server]# rpm -qa | grep glibc-common

glibc-common-2.5-58

[root@localhost Server]# rpm -qa | grep glibc-devel

glibc-devel-2.5-58

[root@localhost Server]# rpm -qa | grep glibc-headers

glibc-headers-2.5-58

compat-glibc-headers-2.3.4-2.26

[root@localhost Server]# rpm -qa | grep kernel-headers-2.6.18

kernel-headers-2.6.18-238.el5

[root@localhost Server]# rpm -qa | grep ksh

ksh-20100202-1.el5_5.1

[root@localhost Server]# rpm -qa | grep libaio

libaio-0.3.106-5 

[root@localhost Server]# rpm -qa | grep libaio-devel   

[root@server114 Server]# rpm -Uvh libaio-devel-0.3.106-3.2.i386.rpm

warning: libaio-devel-0.3.106-3.2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing...                ########################################### [100%]

 

   1:libaio-devel           ########################################### [100%]


[root@server114 Server]# rpm -qa | grep libgcc-4.1.2

libgcc-4.1.2-44.el5

[root@server114 Server]# rpm -qa | grep libgomp

libgomp-4.3.2-7.el5

[root@server114 Server]# rpm -qa | grep libstdc++

compat-libstdc++-296-2.96-138

libstdc++-devel-4.1.2-44.el5

compat-libstdc++-33-3.2.3-61

libstdc++-4.1.2-44.el5

[root@server114 Server]# rpm -qa | grep make-3.81

make-3.81-3.el5

[root@server114 Server]# rpm -qa | grep numactl-devel

[root@server114 Server]# rpm -Uvh numactl-devel-0.9.8-7.el5.i386.rpm

warning: numactl-devel-0.9.8-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing...                ########################################### [100%]

   1:numactl-devel          ########################################### [100%]

[root@server114 Server]#

[root@server114 Server]#

[root@server114 Server]# rpm -qa | grep sysstat-7.0.2

[root@server114 Server]# rpm -ivh sysstat-7.0.2-3.el5.i386.rpm

warning: sysstat-7.0.2-3.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing...                ########################################### [100%]

   1:sysstat                ########################################### [100%]

[root@server114 Server]# rpm -qa | grep unixODBC-32bit-2.2.11

[root@server114 Server]# rpm -ivh unixODBC-*

warning: unixODBC-2.2.11-7.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing...                ########################################### [100%]

   1:unixODBC               ########################################### [ 33%]

   2:unixODBC-devel         ########################################### [ 67%]

   3:unixODBC-kde           ########################################### [100%]

 

[root@server114 Server]#





- 설치에 필요한 그룹과 사용자 생성 및 수정


[root@localhost Server]# groupadd  oinstall

 

[root@localhost Server]# groupadd  oper

[root@localhost Server]# usermod -g oinstall -G dba,oper  oracle




- 설치할 사용자의 Resource Limit 값을 확인하고 수정


[root@localhost ~]# vi /etc/security/limits.conf

 

Oracle  soft  nproc  2047

Oracle  hard  nproc  16384

Oracle  soft  nofile  1024

oracle  hard  nofile  65536

 

oracle  soft  stack  10240





- 커널파라미터 설정하기


[root@localhost ~]# vi /etc/sysctl.conf  ( 아래 내용 추가 후 저장공백대소문자 주의)


fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmall = 2097152

kernel.shmmax = 536870912

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048586


[root@localhost ~]# sysctl –p          // 위 설정값을 적용 







- oracle 사용자의 환경설정


[root@localhost ~]# vi /home/oracle/.bash_profile

 

export EDITOR=vi

export ORACLE_BASE=/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11g

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


[root@server114 Server]# vi /etc/pam.d/login


session   required   pam_limits.so





- oracle 설치 파일 압축 풀기


[oracle@localhost oracle]# pwd

/home/oracle

[root@localhost oracle]# ls -l

-rw-r--r-- 1 oracle dba 1285396902 Jun  2  2010 linux_11gR2_database_1of2.zip

-rw-r--r-- 1 oracle dba  995359177 Jun  2  2010 linux_11gR2_database_2of2.zip

 

[root@localhost oracle]# unzip linux_11gR2_database_1of2.zip && unzip linux_11gR2_database_2of2.zip

 

[root@localhost oracle]# chown  -R  oracle.dba  /home/oracle

 

[root@localhost oracle]# chown  -R  oracle.dba  /app

 




-  RHEL4 로그아웃 후 오라클계정으로 로그인.

 





● Engine(11.2.0.1) 생성



-  새터미널열어서 runInstaller 실행.


[root@server114 oracle]$ cd database

[root@server114 database]./runInstaller




   OUI   




1. security updates - 체크해제 -  next 

 



2. 경고창 - yes 

 



3. install database software only




4. single instance database installation 





5. Korean 추가

 

 



6 .Enterprise Edition 을 선택한 후 select Options 클릭




7. Oracle Partitioning 제외하고 나머지 체크 해제



8. Oracle Base  Oracle Home 디렉토리 설정 (환경설정파일 설정대로 되어 있음)





9. oracle inventory 디렉터리설정

 




10.관리그룹지정 - 기본값




11. 선행체크사항 점검 -  오른쪽 상단에 ∨ ignore all 




12. 요약





13. 엔진설치 진행



 


14. 루트로 스크립트 실행 




15. 설치종료




 

- 설치 확인


[oracle@localhost ~]$ sqlplus   as  sysdba

 

SQL*Plus: Release 11.2.0.1.0 Production on Sat Apr 13 10:23:32 2013

 

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

 

Connected to an idle instance.

 

SQL> exit


 


 






● DB생성 (DBCA) :  DataBase Configuration Assistant


 

- 터미널에서 dbca 치면 database configuration assistant 시작


[oracle@server114 oracle]dbca 



     


1. DBCA 시작




2. 수행하고자 하는 작업 선택 - create a database  - next




3. DB생성할 템플리트선택 - general purpose - next




4 DB ID - testdb




5. Enterprise Manager 체크해제 




6. 계정암호 설정




7. 암호 복잡하게 하라는 경고 - yes





8. 데이터베이스 파일 저장방식 -  file system (기본값) -  file location variables 버튼눌러 정보확인




9.정보확인





10. Flash Recovery area 지정 - 기본값  




11. Sample schema 체크 (연습용 계정을 의미)




12. Memory: SGA  PGA 로 사용될 메모리 값 설정 - 기본값 - 세번째 탭(sizing) 이동




13. character set 설정 - 세번째옵션 - KO16MSWIN949 선택




14 위의 화면에서 All initialization Parameters 버튼을 누르면 현재까지 설정되어 있는 주요 파라미터들을 볼수있음





15. 요약




16. create databse




17.확인





18. DB생성시작





19. 생성완료






 

DB생성(11.2.0.1) 확인 


[oracle@server114 oracle]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.1.0 Production on Wed Feb 25 02:09:09 2015


Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Partitioning option


SQL> select status from v$instance;


STATUS

----------------

OPEN


SQL>