看了小布老師的oracle安裝視頻,才發現oracle安裝真的很鬱悶啊。沒有什麼難度就是前期準備的東西比較亂而已,所以自己編了一個安裝腳本,包括修改主機名、設置內核變量,創建用戶 等一些準備活動。這樣一來就不用再重複的做同樣的工作了,下面就是我編的腳本外加安裝筆記(昨天剛裝完的oracle,暫時沒有時間試驗呢):
測試完成,有兩處筆誤已經修改完了。
####################################################################
#!/bin/bash
# oracle
# 2009/03/12 first twtcom
# set variable
# ORACLE_BASE=/u1
# oracle
# 2009/03/12 first twtcom
# set variable
# ORACLE_BASE=/u1
echo -n "Please enter HOSTNAME(default oracle):"
read HOSTNAME
if [ -z $HOSTNAME ]
then
HOSTNAME=oracle
fi
read HOSTNAME
if [ -z $HOSTNAME ]
then
HOSTNAME=oracle
fi
echo -n "Please enter ORACLE_BASE(default /u1):"
read ORACLE_BASE
if [ -z $ORACLE_BASE ]
then
ORACLE_BASE=/u1
fi
read ORACLE_BASE
if [ -z $ORACLE_BASE ]
then
ORACLE_BASE=/u1
fi
# ORACLE_HOME=$ORACLE_BASE/oracle
echo -n "Please enter HOME(default oracle):"
read HOME
if [ -z $HOME ]
then
HOME=oracle
fi
ORACLE_HOME=$ORACLE_BASE/$HOME
read HOME
if [ -z $HOME ]
then
HOME=oracle
fi
ORACLE_HOME=$ORACLE_BASE/$HOME
# ORACLE_SID=oral
echo -n "Please enter ORACLE_SID(default oral):"
read ORACLE_SID
if [ -z $ORACLE_SID ]
then
ORACLE_SID=oral
fi
USER=oracle
SYSCTL=/etc/sysctl.conf
LIMITS=/etc/security/limits.conf
PAM=/etc/pam.d/login
PROFILE=/etc/profile
BASH_PROFILE=$ORACLE_HOME/.bash_profile
IPADDR=`ifconfig eth0|grep "inet addr"|cut -d : -f 2|cut -d ' ' -f 1`
HOSTS=/etc/hosts
NETWORK=/etc/sysconfig/network
# hostname
grep -v "HOSTNAME" $NETWORK > $NETWORK
echo "HOSTNAME=$HOSTNAME" >> $NETWORK
echo "$IPADDR $HOSTNAME">> $HOSTS
grep -v "HOSTNAME" $NETWORK > $NETWORK
echo "HOSTNAME=$HOSTNAME" >> $NETWORK
echo "$IPADDR $HOSTNAME">> $HOSTS
# useradd
mkdir -p $ORACLE_BASE
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba -d $ORACLE_HOME $USER
chown -R $USER:oinstall $ORACLE_BASE
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba -d $ORACLE_HOME $USER
chown -R $USER:oinstall $ORACLE_BASE
cat >> $SYSCTL << EOF
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
EOF
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
EOF
cat >> $LIMITS <<EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF
cat >> $PAM <<EOF
session required pam_limits.so
EOF
session required pam_limits.so
EOF
cat >> $PROFILE <<EOF
if [ \$USER = "oracle" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
EOF
if [ \$USER = "oracle" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
EOF
cat >> $BASH_PROFILE <<EOF
ORACLE_BASE=\$ORACLE_BASE
ORACLE_HOME=\$ORACLE_BASE/oracle
ORACLE_SID=twtcom
PATH=\$ORACLE_HOME/bin:\$PATH
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
EOF
sleep 1
/sbin/sysctl -p
/etc/init.d/network restart
/sbin/sysctl -p
/etc/init.d/network restart
#####################################################################
racle11g 安裝 b32002.pdf
一、
1、檢查軟件包
install guild P52
2、創建目錄
mkdir -p /u1
groupadd oinstall
groupadd dba
useradd -g ointall -G dba -d /u1/oracle oracle
chown -R oracle:oinstall /u1
id nobody 檢查有沒有nobody用戶
一、
1、檢查軟件包
install guild P52
2、創建目錄
mkdir -p /u1
groupadd oinstall
groupadd dba
useradd -g ointall -G dba -d /u1/oracle oracle
chown -R oracle:oinstall /u1
id nobody 檢查有沒有nobody用戶
3、修改配置文件
/etc/sysctl.conf
/etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
/etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
/etc/pam.d/login
session required pam_limits.so
/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
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
su - oracle
pwd 可以看到缺省目錄是/u1/oracle
vi .bash_profile
ORACLE_BASE=/u1
ORACLE_HOME=$ORACLE_BASE/oracle
ORACLE_SID=twtcom
PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
ORACLE_HOME=$ORACLE_BASE/oracle
ORACLE_SID=twtcom
PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
vi /etc/hosts
192.168.152.100 oracle
192.168.152.100 oracle
ping oracle
第三章 oracle database 安裝
oui
advance install
不創建數據庫
netca 11g新特性
dbca 11g3種類型 10g4種類型
character set AL32UTF8 推薦類型可以存儲很多漢字
第三章 oracle database 安裝
oui
advance install
不創建數據庫
netca 11g新特性
dbca 11g3種類型 10g4種類型
character set AL32UTF8 推薦類型可以存儲很多漢字
$ORACLE_BASE/oridata 存數數據
stty erase ^h
stty erase ^h