Setting up oracle start-stop service in linux system

Now many database servers are installed with Linux systems, for example, Oracle database, after installation, it will not start with the Linux system. Then you can write a script to achieve this function.
1 Configure monitoring After
installing oracle, you can configure the monitoring service, which is convenient for users to connect remotely. Change ORACLE_HOME_LISTNER=$1 to ORACLE_HOME_LISTNER in the following two paths
/opt/oracle/app/product/11.2.0/dbhome_1/bin/dbstart
/opt/oracle/app/product/11.2.0/dbhome_1/bin/dbshut
=$ORACLE_HOME. (You can use the search function of vi)




2 Modify /etc/oratab
to modify the system configuration file /etc/oratab to make dbstart and dbshut take effect. Execute vi /etc/oratab in the terminal, change orcl: /opt/oracle/app/product/11.2.0/dbhome_1:N to
orcl: /opt/oracle/app/product/11.2.0/dbhome_1:Y. Re-execute the two scripts
/opt/oracle/oraInventory/orainstRoot.sh
/opt/oracle/app/product/11.2.0/dbhome_1/root.sh


3 Create the script
  Enter su - root in the terminal to switch to the system administrator account, then execute the touch /etc/init.d/dbora command to create a script. Then execute chmod 775 /etc/init.d/dbora, then enter chown yupont:oinstall -R / etc/init.d/dbora , assigned to yupont user read and write script permissions, switch to oracle user, edit as shown below. When finished, switch to command mode, save and exit.





4 Add the self-starting service
Switch to the root user, and execute the chkconfig –-level 2345 dbora on command in the /etc/init.d directory to add dbora to the self-starting service.
5 Verify the service
Restart the system and log in to the yupont account. As shown in the figure below, the dbora script takes effect.





Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326491368&siteId=291194637