1. 程式人生 > >Linux 安裝Oracle11g的簡單步驟記錄

Linux 安裝Oracle11g的簡單步驟記錄

環境:CentOS、Redhat

步驟:

1、配置本地yum源,安裝依賴包:

yum -y install gcc elfutils-libelf-devel gcc-c++ libaio-devel libstdc++-devel sysstat unixODBC unixODBC-devel glibc-devel-2.5 compat-libstdc++* ksh

2、配置本地hosts:

vi /etc/hosts

192.168.186.134    db01

3、建立相關組及使用者:

groupadd dba

groupadd oinstall

groupadd oper

useradd oracle -g oinstall -G dba,oper

passwd oracle

4、建立安裝目錄及許可權:

mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1

chown -R oracle:oinstall /u01

chmod -R 775 /u01

5、配置相關引數:

vim /etc/sysctl.conf
kernel.shmall = 4294967296
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
kernel.shmall = 2097152
sysctl -p

vim /etc/security/limits.conf
oracle  soft  nproc  2047
oracle  hard  nproc  16384
oracle  soft  nofile  1024
oracle  hard  nofile  65536

vim /etc/pam.d/login
session    required     pam_limits.so

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
source /etc/profile

su - oracle

vim .bash_profile
export PATH
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

6、在oracle使用者下解壓軟體包:

su - oracle

unzip linux.x64_11gR2_database_1of2.zip

unzip linux.x64_11gR2_database_2of2.zip

7、安裝Oracle軟體:

su - oracle

export LANG=""

export DISPLAY=192.168.186.1:0.0

cd /tmp/database/

./runInstaller

8、安裝監聽:

netca

9、建立資料庫例項:

dbca

字符集:

ZHS16GBK-GBK16-bit Simplified Chinese

UTF8-Unicode 3.0 UTF-8 Universal character set,CESU-8 compliant