配置oracle10g rac使用过的一些脚本
#用户设置
groupadd -g 1000 oinstall
groupadd -g 1100 dba
useradd -u 1001 -g oinstall -G dba oracle
mkdir -p /oracle
chown -R oracle:oinstall /oracle
chmod -R 755 /oracle
mkdir -p /kk
#修改环境变量配置
export ORACLE_BASE=/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0
export ORA_CRS_HOME=$ORACLE_BASE/product/crs
export ORACLE_SID=EDWPRD1
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
#建立软连接
#10.2.0.1修改内核
kernel.shmmni=4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65500
net.core.rmem_default = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
net.core.rmem_max = 262144
#修改shell限制
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
#检查包
rpm -q binutils compat-gcc-34 compat-libstdc++-296 control-center
rpm -q gcc-c++ glibc glibc-common glibc-devel libaio libgcc
rpm -q gcc libstdc++ libstdc++-devel libXp make openmotif22 setarch
#修改os版本
export JAVA_HOME=/usr/jdk
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin
#hangcheck模块
echo "options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180" >> /etc/modprobe.conf
echo "/sbin/modprobe hangcheck-timer">> /etc/rc.local
#配置VNC
vi /root/.vnc/xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
gnome-session &
0 0 * * * /usr/sbin/ntpdate 10.10.10.10;/sbin/hwclock -w;
#配置ssh
cat *.pub >> key
id_dsa id_dsa.pub id_rsa id_rsa.pub key
cat key >> authorized_keys
scp authorized_keys ts03:/home/oracle/.ssh/
#ntp配置
#server
restrict default nomodify
restrict 127.0.0.1
server 127.127.1.0
fudge 127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
#client
server 10.10.10.10
restrict 10.10.10.10 mask 255.255.255.255 nomodify notrap noquery
#配置共享存储
/bin/raw /dev/raw/raw1 /dev/mapper/ocr1
/bin/raw /dev/raw/raw2 /dev/mapper/ocr2
/bin/raw /dev/raw/raw3 /dev/mapper/vot1
/bin/raw /dev/raw/raw4 /dev/mapper/vot2
/bin/raw /dev/raw/raw5 /dev/mapper/vot3
/bin/raw /dev/raw/raw6 /dev/mapper/oradata1
/bin/raw /dev/raw/raw7 /dev/mapper/oradata2
/bin/raw /dev/raw/raw8 /dev/mapper/oradata3
/bin/raw /dev/raw/raw9 /dev/mapper/oradata4
sleep 2
chmod 660 /dev/raw/raw*
chown root:oinstall /dev/raw/raw{1,2}
chown oracle.oinstall /dev/raw/raw{3,4,5,6,7,8,9}
#java
export JAVA_HOME=/usr/jdk
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin
#JREDIR
unset LD_ASSUME_KERNEL
JRE_JAVA=""
JAVA_HOME
#
/oracle/product/10.2.0/OPatch/opatch lsinventory
#vify
cluvfy stage -pre crsinst -n ts03,ts04 -verbose
srvctl status database -d edwprd
srvctl status nodeapps -n host1
srvctl config database
srvctl config nodeapps -n host2 -a -g -s -l
select instance_number,instance_name,parallel,status,database_status,host_name from gv$instance;
#asm