In a Linux system, after the Oracle database service is installed, it is not as if it were under the Windows system, and the Oracle service starts automatically with the system startup by default. Linux system, it is necessary for users to manually set up, in order to achieve automatic start of Oracle boot. This article will show you step by step how to set it up.
Install Oracle's Linux system (rhel7.4, Oracle 11g for example)
Method/Step 1, Prerequisites: You have correctly installed the Oracle service on your Linux system and can start normally using manual mode.
查看ORACLE_HOME是否设置$ echo $ORACLE_HOME/u01/app/oracle/product/11.2.0/dbhome_1
执行dbstart 数据库自带启动脚本[[email protected] ~]$ cd $ORACLE_HOME[[email protected] dbhome_1]$ cd bin/[[email protected] bin]$ dbstartORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener Usage: /u01/app/oracle/product/11.2.0/db_1/bin/dbstart ORACLE_HOME错误提示:ORACLE_HOME_LISTNER 没有设置[[email protected] bin]$ ll | grep dbs-rwxr-x---. 1 oracle oinstall 6088 1月 1 2000 dbshut-rwxr-x---. 1 oracle oinstall 13892 12月 11 16:01 dbstart编辑 dbstart,将ORACLE_HOME_LISTNER=$1修改成 ORACLE_HOME_LISTNER=$ORACLE_HOME 前提是$ORACLE_HOME环境设置正确[[email protected] bin]$ vi dbstart ORACLE_HOME_LISTNER=/u01/app/oracle/product/11.2.0/dbhome_1
2. Edit the file using the VI editor/etc/oratab
dbca建库时都会自动创建/etc/oratab文件#vi /etc/oratab将“orcl:/u01/app/oracle/product/12.1.0/dbhome_1:N”,改为“orcl:/u01/app/oracle/product/12.1.0/dbhome_1:Y”。修改完成后,保存退出
* * Description: * *ORCL is the instance name;/u01/app/oracle/product/12.1.0/dbhome1 is the Oracle installation directory and varies depending on the installation.
3. Edit the/etc/rc.d/rc.local startup file and add the database startup script Dbstart
#vi /etc/rc.d/rc.local末尾添加:su oracle -lc "/u01/app/oracle/product/12.1.0/dbhome_1/bin/lsnrctl start"su oracle -lc /u01/app/oracle/product/12.1.0/dbhome_1/bin/dbstart
* * Description: * */u01/app/oracle/product/12.1.0/dbhome1 is the Oracle installation directory, to be modified according to the actual situation.
4, restart the host, view the database and monitoring is self-booting
Set up Oracle boot automatically under Linux system