一 startup.sh
oradata-->$ sh /u01/startup.sh
#!/bin/sh
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
export PATH=$PATH:$HOME/bin
$ORACLE_HOME/bin/sqlplus /nolog <
connect / as sysdba;
startup;
exit;
EOF
$ORACLE_HOME/bin/lsnrctl <
start
exit
EOF
二 shutdown.sh
#!/bin/sh
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
export PATH=$PATH:$HOME/bin
$ORACLE_HOME/bin/lsnrctl <
stop
exit
EOF
$ORACLE_HOME/bin/sqlplus /nolog <
connect / as sysdba;
alter system checkpoint;
shutdown immediate;
exit;
EOF
三 編輯 /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
#oracle auto startup
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
export PATH=$PATH:$HOME/bin
su - oracle -c "/u01/app/oracle/product/10.2.0/db_1/bin/sqlplus /nolog <
connect / as sysdba
startup;
exit
EOF"
su - oracle -c "/u01/app/oracle/product/10.2.0/db_1/bin/lsnrctl <
start
exit
EOF"
=========================================================================
#set oracle environment
ORACLE_HOME=/u01/product/oracle;export ORACLE_HOME
ORACLE_SID=wind;export ORACLE_SID
su oracle -c "/u01/product/oracle/bin/sqlplus /nolog <
connect / as sysdba
startup nomount;
alter database mount standby database;
alter database recover managed standby database disconnect from session;
exit
EOF"
ORACLE_HOME=/u01/product/oracle;export ORACLE_HOME
ORACLE_SID=qis;export ORACLE_SID
su oracle -c "/u01/product/oracle/bin/sqlplus /nolog <
connect / as sysdba
startup nomount;
alter database mount standby database;
alter database recover managed standby database disconnect from session;
exit
EOF"
su oracle -c "/u01/product/oracle/bin/lsnrctl <
start
exit
EOF"
阅读(1042) | 评论(0) | 转发(0) |