kods.net » oracle,oracle home,oracle database » Oracle automatically activated under linux and stop

Oracle automatically activated under linux and stop

Oracle modify the system configuration file / etc / oratab
/ etc / oratab format: SID: ORACLE_HOME: AUTO
AUTO field is set to the Y (upper case), the only way, oracle and dbstart own dbshut be able to play a role. I am for:
$ ORACLE_SID: $ ORACLE_HOME: Y
ORACLE_SID and ORACLE_HOME here is under the oracle user environment variables, in different computers have different values. When you open the / etc / oratab time, changed a bit on the list.
Services in the preparation of the script / etc / rc.d / init.d directory oracle file created as a startup script, which reads as follows:
#! / bin / bash
# chkconfig: 2345 50 10
# description: Start and stop Oracle Database and monitoring procedures
# / Etc / rc.d / init.d / oracle
# Check how to implement the script file
case "$ 1" in
start)
echo-n "Starting Oracle Databases:"
echo "------------------------------------------------ ----">> / var / log / oracle
date + "!% T% a% D: Starting Oracle Databases as part of system up.">> / var / log / oracle
echo "------------------------------------------------ ----">> / var / log / oracle
su - ora-c dbstart>> / var / log / oracle
echo "Done."
echo-n "Starting Oracle Listeners:"
su - ora-c "lsnrctl start">> / var / log / oracle
# su - oracle "sqlplus / nolog" <
# connect / as sysdba
# startup
# exit
echo "Done."
echo ""
echo "------------------------------------------------ ----">> / var / log / oracle
date + "!% T% a% D: Finished.">> / var / log / oracle
echo "------------------------------------------------ ----">> / var / log / oracle
touch / var / lock / subsys / oracle
;;
stop)
echo-n "Shutting Down Oracle Listeners:"
echo "------------------------------------------------ ----">> / var / log / oracle
date + "!% T% a% D: Shutting Down Oracle Databases as part of system down.">> / var / log / oracle
echo "------------------------------------------------ ----">> / var / log / oracle
su - ora-c "lsnrctl stop">> / var / log / oracle
echo "Done."
rm-f / var / lock / subsys / oracle
echo-n "Shutting Down Oracle Databases:"
su - ora-c dbshut>> / var / log / oracle
echo "Done."
echo ""
echo "------------------------------------------------ ----">> / var / log / oracle
date + "!% T% a% D: Finished.">> / var / log / oracle
echo "------------------------------------------------ ----">> / var / log / oracle
;;
restart)
echo-n "Restarting Oracle Databases:"
echo "------------------------------------------------ ----">> / var / log / oracle
date + "!% T% a% D: Restarting Oracle Databases as part of system up.">> / var / log / oracle
echo "------------------------------------------------ ----">> / var / log / oracle
su - ora-c dbstop>> / var / log / oracle
su - ora-c dbstart>> / var / log / oracle
echo "Done."
echo-n "Restarting Oracle Listeners:" # $ 0 stop
su - ora-c "lsnrctl stop">> / var / log / oracle # $ 0 start
su - ora-c "lsnrctl start">> / var / log / oracle
echo "Done."
echo ""
echo "------------------------------------------------ ----">> / var / log / oracle
date + "!% T% a% D: Finished.">> / var / log / oracle
echo "------------------------------------------------ ----">> / var / log / oracle
touch / var / lock / subsys / oracle
;;
*)
echo "Usage: oracle (start | stop | restart)"
exit 1
esac
In the oracle user, enter the contents of As, and then save out as a result of the startup script, the need for the implementation of authority; the implementation of the command chmod a + x oracle grant execute permissions oracle.
The establishment of service connection
ln-s / etc / rc.d / init.d / oracle / etc/rc.d/rc2.d/S50oracle
ln-s / etc / rc.d / init.d / oracle / etc/rc.d/rc3.d/S50oracle
ln-s / etc / rc.d / init.d / oracle / etc/rc.d/rc5.d/S50oracle
ln-s / etc / rc.d / init.d / oracle / etc/rc.d/rc0.d/K10oracle
ln-s / etc / rc.d / init.d / oracle / etc/rc.d/rc6.d/K10oracle
chkconfig - add oracle (added to the system services)
chkconfig - levle 2345 oracle on (with the system to start)
Test
Run. / Oracle start (service oracle start) command to see if can start the database, if not, view the log, find out the reasons when I have encountered in the implementation of the following error message may
Can''t find init file for Database "linuxdb".
Database "linuxdb" NOT started.
By looking at $ (ORACLE_HOME) / bin / dbstart the script, based on erroneous information to find the statement, that the system lacked a
$ (ORACLE_HOME) / dbs / init $ (ORACLE_SID). Ora profile solution
sqlplus "/ as sysdba"
create pfile from spfile;
And then on the successful implementation.
Linux restart the host to see whether the database automatically activated.

Note: oracle scripts dbstart own Listeners contains scripts to start, so I think that should be above the startup script to remove the phrase listeners, otherwise they will be in error, but this error does not affect the start.
Digg Technorati StumbleUpon Mixx del.icio.us Reddit BlinkList Furl YahooMyWeb

Tags: oracle, oracle home, oracle database, sid oracle, oracle user, configuration file, environment variables, lt, script file, sqlplus nolog, linux, quot quot, oracle databases, startup script, different computers, home auto, upper case, auto auto, system configuration, listeners

Permalink: http://www.kods.netwww.kods.net/oracle-automatically-activated-under-linux-and-stop/

Leave a reply