Start an Oracle database instance in Linux

Source: Internet
Author: User

Start an Oracle database instance in Linux: Step 1: Start the listener; Step 2: Start the database instance.

I. How to start a database instance
1. Go to sqlplus to start the instance
Su-oracle -- "switch to oracle user"
Lsnrctl start -- "enable listener"
Sqlplus/nolog -- "go to sqlplus"
SQL> conn/as sysdba -- "connect to sysdba"
Connected to an idle instance.
SQL> startup -- "Start database instance"
SQL> shutdown immediate -- "close database instance"
SQL> exit
[Oracle @ RedHat ~] $ Lsnrctl stop -- "Disable listener"
2. Start and close database instances with dbstart and dbshut

Start lsnrctl start
Start instance dbstart

It is convenient to start the database using the dbstart command. However, after installing oracle on linux, the following error may be reported when you use the dbstart command for the first time:

ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener
Usage:/u01/app/oracle/product/10.2.0/db_1/bin/dbstart ORACLE_HOME
 
Cause:
The settings of ORACLE_HOME_LISTNER in the dbstart and dbshut script files are incorrect. Open the two files and find them: Use vi to edit dbstart, ORACLE_HOME_LISTNER = $1, and change it
ORACLE_HOME_LISTNER = $ ORACLE_HOME


Save and exit. Then run dbstart again. No error is reported, but no response is returned. ps the process and no oracle process. This means that the oracle instance has not started properly.

The reason for this is that the setting of/etc/oratab is incorrect. We can find that
Zgz:/home/oracle/product/10g: N
The last setting is "N" (there is only one instance in my environment, so there is only one line of configuration statement). We need to change "N" to "Y ".

After the above work is done, dbstart can be used normally:

[Oracle @ redhat bin] $ lsnrctl start -- "start listener"
[Oracle @ redhat bin] $ dbstart -- "Start database instance"
Processing Database instance "zgz": log file/home/oracle/product/10g/startup. log
[Oracle @ redhat bin] $ dbshut -- "close database instance"
[Oracle @ redhat bin] $ lsnrctl stop -- "Disable listener"

Ii. How to enable the database instance and the linux system together
Add the following statement to/etc/rc. d/rc. local to start the instance of the same system:
Su-oracle-c "lsnrctl start"
Su-oracle-c "dbstart"

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.