Auto-start Oracle at Boot Time
Introduction:
This add Oracle Database Start to the boot sequence.
Aim:
To save us having to manually start Oracle when we reboot.
Requirements:
Orale is installed and at least one database has been built.
Procedure:
Set autostart in the oratab file:
- Log in as oracle.
- Open Terminal.
- $ cd /etc
- $ vi oratab
- At the bottom of this file, there is a line for each created database reading something like; [SID]:[ORACLE_HOME]:N. Change the 'N' at the end of each line to 'Y'. e.g. change:
sta:/u01/app/oracle/10.2.0.1/db01:N whs:/u01/app/oracle/10.2.0.1/db01:N |
- to:
sta:/u01/app/oracle/10.2.0.1/db01:Y whs:/u01/app/oracle/10.2.0.1/db01:Y |
- Save and exit.
- $ cd $ORACLE_HOME/bin
- $ vi dbstart
- Find the line 'ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle' - note that 'LISTENER is mis-spelled.
- Change the path to the full Oracle Home path; '/u01/app/oracle/10.2.0.1/db01'
- Save and exit.
- In a terminal:
- $ su - root
- Enter root's password.
- # cd /etc/init.d
- Create a new boot script:
- # vi oracle10g
- Put the following code into this script:
- Best; download this (right-click the link and choose -Save Page As...-.
- Or; cut and paste the following code:
#!/bin/sh |
- Save and exit.
- Make the script executable:
- # chmod 755 oracle10g
- Test the script:
- # ./oracle10g start
- This will return with chora data if it installed and then a startup message for each available database:
Processing Database instance "sta": log file /u01/app/oracle/10.2.0.1/db01/start up.log Processing Database instance "whs": log file /u01/app/oracle/10.2.0.1/db01/start up.log |
- # ./oracle10g restart
- The instances restart.
- # ./oracle10g stop
- The instances are stopped.
- Add the script to the boot sequence:
- # chkconfig --add oracle10g
- Reboot the server and check the Oracle instances are auto-started.
- Log in as oracle.
- Open Terminal.
- $ ps -ef | grep ora_pmon | grep -v grep
- This should return with a process line for each running database:
oracle 2454 1 0 11:22 ? 00:00:00 ora_pmon_sta oracle 2514 1 0 11:22 ? 00:00:00 ora_pmon_whs |
0 Comments:
Post a Comment
<< Home