How Does oracle Automatically Start Multiple Data instances?

Source: Internet
Author: User

Oracle automatically starts database instances in many ways. The following describes the two most common methods for oracle to automatically start multiple data instances.

An existing machine requires oracle to automatically start multiple data instances, such as DB1 and DB2
Method 1:

 
 
  1. export ORACLE_SID=DB1 
  2. sqlplus ‘/as sysdba' <<!  
  3. startup  
  4. exit  
  5. !  
  6.    
  7. export ORACLE_SID=DB2 
  8. sqlplus ‘/as sysdba' <<!  
  9. startup  
  10. exit  

For different listening ports, the method for starting the listening port is lsnctl start listener1/linsterner2/
About listener? You can view the configuration file through lsnctl status, and then edit it.
 
If the port is the same, you only need to start lsnctl start.
 
You can change SID startup for web configuration startup.

 
 
  1. export ORACLE_SID=DB1 
  2. emctl start dbconsole 

Method 2: automatically start an oracle data instance at startup)
Modify the/etc/oratab file and change N to Y after the name of the instance to be started.
: G/N/s // Y/g change all N to Y
Then write a shell script.

 
 
  1. cd /etc/init.d  
  2.  
  3. vi oracle.sh  
  4.  
  5. #!/bin/bash  
  6. case "$1" in  
  7. start)  
  8.     date >>/var/log/oracle  
  9.     echo -e "\nThe oracle will start\n">/var/log/oracle  
  10.     su - oracle -c "lsnrctl start;dbstart;emctl start dbconsole;exit;">>/var/log/oracle  
  11.     echo -e "The oracle started">>/var/log/oracle  
  12. ;;  
  13. stop)  
  14.      date >>/var/log/oracle  
  15.     echo -e "\nThe oracle will stop\n">/var/log/oracle  
  16.     su - oracle -c "dbshut;emctl stop dbconsole;lsnrctl stop;exit;">>/var/log/oracle  
  17.     echo -e "The oracle stoped">>/var/log/oracle  
  18. ;;  
  19. restart)  
  20.     $0 stop  
  21.     $0 start  
  22. ;;  
  23. *)  
  24.     echo -e "usage $0 {start|stop|restart}"  
  25.     exit 1  
  26. esac  

Save.

 
 
  1. chmod +x oracle.sh  
  2. ln -s oracle.sh /etc/rc.d/rc3.d/S99oracle  
  3. ln -s oracle.sh /etc/rc.d/rc5.d/S99oracle  
  4. ln -s oracle.sh /etc/rc.d/rc0.d/K01oracle  
  5. ln -s oracle.sh /etc/rc.d/rc6.d/K01oracle 

In this way, multiple oracle instances can be automatically started.
 

Oracle conversion functions

Oracle string connection method

Implementation of Oracle fuzzy query

JAVA Implementation of Oracle Storage Process Creation

Oracle Stored Procedure debugging method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.