/***
功能描述
一般在oracle standby数据库上,都安装有多个oracle数据库的备库,这些standby很可能在版本上都不相同,本文旨在简化机器启动时的启动管理操作.
***/
编写一个脚本,在机器启动时,手动执行,或者放入rc.local中配置自动执行,都是一种非常可行的方案vi startora.sh
##########################◆◆◆◆begin◆◆◆◆##########################
#!/bin/bash
# description: Half Startup Script for oracle Databases
L_DIR_NAME=`dirname $0`
LOG=$PWD/startup.$(date +%Y%m%d%H%M%S).log
export ORACLE_BASE=/oracle
export ORACLE_HOME=$ORACLE_BASE/product/ods/10.2.0/Db_1
export PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/etc
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
$ORACLE_HOME/bin/lsnrctl start >> $LOG 2>&1
export ORACLE_SID=orcl
echo "Start Oracle DataBase $ORACLE_SID Begin" >>$LOG
$ORACLE_HOME/bin/sqlplus /nolog <> $LOG 2>&1
connect / as sysdba
startup
alter database recover managed standby database disconnect;
quit
EOF
export ORACLE_SID=orcl2
echo "Start Oracle DataBase $ORACLE_SID Begin" >>$LOG
$ORACLE_HOME/bin/sqlplus /nolog <> $LOG 2>&1
connect / as sysdba
startup
alter database recover managed standby database disconnect;
quit
EOF
echo "Start Oracle DataBase $ORACLE_SID End" >>$LOG