Oacle 제 01 장 설치

2015-09-29
[root@mdb ~]# vim /etc/hosts
10.10.2.87      mdb

#     
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/
mkdir -p /usr/local/src/oracle
mv linux.x64_11gR2_client.zip /usr/local/src/oracle
mv linux.x64_11gR2_database_1of2.zip /usr/local/src/oracle
mv linux.x64_11gR2_database_2of2.zip /usr/local/src/oracle
#     
cd /usr/local/src/oracle
unzip linux.x64_11gR2_database_1of2.zip && unzip linux.x64_11gR2_database_2of2.zip
#     
yum -y install  gcc gcc-c++ make binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static glibc glibc-common glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel numactl-devel sysstat unixODBC unixODBC-devel kernel-headers pdksh pcre-devel
#   、  
groupadd oinstall && groupadd dba && useradd -g oinstall -G dba oracle
echo "oracle" | passwd --stdin oracle && id oracle
#      
vim /etc/sysctl.conf
#      
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1073741824
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 = 1048576
#        
sysctl -p
#      
vim /etc/security/limits.conf
#      
oracle           soft    nproc           2047
oracle           hard    nproc           16384
oracle           soft    nofile          1024
oracle           hard    nofile          65536
oracle           soft    stack           10240
#  /etc/pam.d/login  
vim /etc/pam.d/login
#      
session  required   /lib64/security/pam_limits.so
session  required   pam_limits.so
#  /etc/profile  
vim /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
#    
mkdir -p /u01/app/oracle/product/11.2.0
mkdir /u01/app/oracle/{oradata,inventory,fast_recovery_area}
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
#  oracle      
su - oracle
vim .bash_profile
#      
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0
ORACLE_SID=orcl
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
#          
cp -R /usr/local/src/oracle/database/response/ .
cd response/
vim db_install.rsp
#      
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=mdb
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oracle/inventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/u01/app/oracle/product/11.2.0
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
DECLINE_SECURITY_UPDATES=true
#          Oracle 11g
cd /usr/local/src/oracle/database/
./runInstaller -silent -responseFile /home/oracle/response/db_install.rsp -ignorePrereq
#    , root    ,    :
ctrl +d
sh /u01/app/oracle/inventory/orainstRoot.sh
sh /u01/app/oracle/product/11.2.0/root.sh
#         
su - oracle
netca /silent /responsefile /home/oracle/response/netca.rsp
netstat -tnulp | grep 1521
#         ,   
vim /home/oracle/response/dbca.rsp
#      
GDBNAME = "orcl"
SID = "orcl"
SYSPASSWORD = "oracle"
SYSTEMPASSWORD = "oracle"
SYSMANPASSWORD = "oracle"
DBSNMPPASSWORD = "oracle"
DATAFILEDESTINATION =/u01/app/oracle/oradata
RECOVERYAREADESTINATION=/u01/app/oracle/fast_recovery_area
CHARACTERSET = "AL32UTF8"
TOTALMEMORY = "1638"
#    
dbca -silent -responseFile /home/oracle/response/dbca.rsp
#      
ps -ef | grep ora_ | grep -v grep
#      
lsnrctl status
#        
sqlplus / as sysdba
SQL> select status from v$instance;
#       ,   dbstart、dbshut  、  oracle  
vim /u01/app/oracle/product/11.2.0/bin/dbstart
ORACLE_HOME_LISTNER=$ORACLE_HOME
vim /u01/app/oracle/product/11.2.0/bin/dbshut
ORACLE_HOME_LISTNER=$ORACLE_HOME
vim /etc/oratab
orcl:/u01/app/oracle/product/11.2.0:Y
#   root,      ,   service    、  、  oracle  
ctrl+d
vim /etc/rc.d/init.d/oracle
#-----------------------------------------------------------------------------------
#!/bin/bash

# oracle: Start/Stop Oracle Database 11g R2
# chkconfig: 345 90 10
# description: The Oracle Database is an Object-Relational Database Management System.
# 
. /etc/rc.d/init.d/functions
LOCKFILE=/var/lock/subsys/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0
ORACLE_USER=oracle
case "$1" in
'start')
   if [  -f $LOCKFILE ]; then
      echo $0 already running.
      exit 1
   fi 
   echo -n $"Starting Oracle Database:"
   su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl start"
   su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
   su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl start dbconsole"
   touch $LOCKFILE
   ;;
'stop')
   if [ ! -f $LOCKFILE ]; then
      echo $0 already stopping.
      exit 1
   fi 
   echo -n $"Stopping Oracle Database:"
   su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl stop"
   su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbshut" 
   su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
   rm -f $LOCKFILE
   ;; 
'restart')
   $0 stop
   $0 start
   ;; 
'status')
   if [ -f $LOCKFILE ]; then
      echo $0 started.
      else 
      echo $0 stopped.
   fi 
   ;;
*) 
   echo "Usage: $0 [start|stop|status]"
   exit 1
esac
exit 0
#-------------------------------------------------------------------
#  /etc/init.d/oracle      
chmod 755 /etc/init.d/oracle
#      
chkconfig oracle on
#  service oracle start/stop/restart  
service oracle start/stop/restart

 
참고 자료
[1]임 수 택.Oracle 11g R2 DBA 운영 지침[M].북경:청화대학 출판사,2013
[2] 직접 CentOS-6.5 설치 Oracle 11g R2
[3] Linux 침묵 설 치 를 위 한 Oracle 11gR 2
[4] RHEL 6(CentOS 6)에 Oracle 11g R2 수기 설치(전체 상세 사용 가능 버 전)
[5] Linux 시스템(X64)설치 Oracle 11g 전체 설치 그림 튜 토리 얼 에 기본 동작 추가
[6] Oracle 11g R2+RAC+ASM+Oracle Linux 6.4 설치 상세 설명(그림)
[7] CentOS 6.4 에 Oracle 11g R2 그림 튜 토리 얼 설치
[8] Oracle RAC-설치 도해
[9] CentOs 6.3_64 침묵 설치 oracle11gr2
[10] Oracle 11g R2 침묵 설치
[11] Oacle 11g R2 침묵 설치
[12] CentOS-6.4-x64 에 Oracle 11g R2(11.2.0.3)를 조용히 설치 합 니 다.
[13] Oracle Database 11g R2 RAC 침묵 설치 문서
[14] Oracle Database 11g Release 2 (11.2.0.1.0)
[15] SQL Developer 4.1.2
[16] Oracle Linux 6 Repositories

좋은 웹페이지 즐겨찾기