Whenever the database server restarts, restart the database for monitoring and instance, especially in the case of server power-down restart, routine maintenance. Can the instance and listener start as the service starts, like Windows Server? The answer is of course yes, we can use the Oracle-provided Dbstart file to set up the Oracle database to boot from. The Setup method is as follows:
(1), first of all to ensure that oracle_home and other environment variables are configured, similar to the following:
Vi. bash_profileoracle_base=/u01/app/oracleoracle_home= $ORACLE _base/product/11.2.0/db_1path= $ORACLE _home/bin:$ Pathexport oracle_base Oracle_home PATH
(2), edit the Dbstart file in the $oracle_home/bin directory, find oracle_home_listner=$1, modify it to oracle_home_listner= $ORACLE _home.
(3), edit the Oratab file in the/etc directory, locate the orcl:/u01/app/oracle/product/11.2.0/db_1:n, and modify it to: orcl:/u01/app/oracle/product/11.2.0/ Db_1:y.
(4), edit the rc.local boot file in the/ETC/RC.D directory, add the database self-startup script Dbstart. Note: The step must be switched to root for execution.
vi/etc/rc.d/rc.local# Start Database Listener, there are spaces must be quoted SU-ORACLE-LC "/u01/app/oracle/product/11.2.0/db_1/bin/lsnrctl start" # Launch instance su -Oracle-lc/u01/app/oracle/product/11.2.0/db_1/bin/dbstart
(5), restart check whether the configuration is successful.
Configure the Oracle Database for boot