進入# vi /etc/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
#set oracle environment
ORACLE_HOME=/u01/product/oracle;export ORACLE_HOME
ORACLE_SID=ABCD;export ORACLE_SID=ABCD
su oracle -c "/u01/product/oracle/bin/sqlplus /nolog <
startup nomount;
alter database mount standby database;
exit
EOF"
ORACLE_HOME=/u01/product/oracle;export ORACLE_HOME
ORACLE_SID=123;export ORACLE_SID=123
su oracle -c "/u01/product/oracle/bin/sqlplus /nolog <
startup nomount;
alter database mount standby database;
exit
EOF"
#su oracle -c "/u01/product/oracle/bin/lsnrctl <
#exit
#EOF"
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12137615/viewspace-600638/ ,如需转载,请注明出处,否则将追究法律责任。