Unable to start after Oracle database is shut down due to exceptions

Source: Internet
Author: User

A system suddenly loses power, and Oracle cannot be started after the system is started. The following error is reported during startup:

ORA-01102 cannot mount database in EXCLUSIVE mode
Error 1102 may be caused by the following possibilities:

1. In the HA system, other nodes have started the instance, occupying resources shared by the two servers (such as bare devices on the disk array;

II. It indicates that some resources are not released when oracle is shut down abnormally. There are several possible causes,

1. oracle shared memory segments or semaphores are not released;

2. oracle background processes (such as SMON, PMON, and DBWn) are not disabled;

3. The files lk <sid> and sgadef <sid>. dbf used to lock the memory are not deleted.

First, although our system is an HA system, the instance of the slave node is always closed. This can be confirmed by checking the database status on the slave node.

Second, because the system power is down, the database is down, and the system is restarted after power is connected. Therefore, we have ruled out the second possible one or two points. The most suspicious is the 3rd point.

Check the $ ORACLE_HOME/dbs directory:

$ Cd $ ORACLE_HOME/dbs
$ Ls sgadef *
Sgadef * not found
$ Ls lk *
LkORA92
Sure enough, the lk <sid> file is not deleted. Delete it

$ Rm lk *
Restart the database.

If you suspect that the shared memory is not released, run the following command:

$ Ipcs-mop
Ipstatus from/dev/kmem as of Thu Jul 6 14:41:43 2006
T ID KEY MODE OWNER GROUP NATTCH CPID LPID
Shared Memory:
M 0 0 × 411c29d6-rw-root 0 899 899
M 1 0 × 4e0c0002-rw-root 2 899 901
M 2 0 × 4120007a-rw-root 2 899 901
M 458755 0 × 0c6629c9-rw-r -- root sys 2 9113 17065
M 4 0 × 06347849-rw-root 1 1661 9150
M 65541 0 xffffffff-rw-r-root 0 1659 1659
M 524294 0x5e100011-rw --- root 1 1811 1811
M 851975 0 × 5fe48aa4-rw-r -- oracle oinstall 66 2017 25076
Then, its ID number clears the shared memory segment:

$ Ipcrm-m 851975
For semaphores, run the following command:

$ Ipcs-sop
Ipstatus from/dev/kmem as of Thu Jul 6 14:44:16 2006
T ID KEY MODE OWNER GROUP
Semaphores:
S 0 0 × 4f1c0139-ra --- root
... ...
S 14 0 × 6c200ad8-ra-root
S 15 0 × 6d200ad8-ra-root
S 16 0 × 6f200ad8-ra-root
S 17 0 xffffffff-ra-r-root
S 18 0 × running c05c7-ra-root
S 19 0 × 00446f6e-ra-r-root
S 20 0 × 00446f6d-ra-r-root
S 21 0 × 00000001-ra-root
S 45078 0 × 67e72b58-ra-r -- oracle oinstall
Based on the semaphore ID, run the following command to clear the semaphore:

$ Ipcrm-s 45078
If the oracle process is not closed, run the following command to find the existing oracle process:

$ Ps-ef | grep ora
Oracle 29976 1 0 Jun 22? 0: 52 ora_dbw0_ora92
Oracle 29978 1 0 Jun 22? 0: 51 ora_dbw1_ora92
Oracle 5128 1 0 Jul 5? 0: 00 oracleora92 (LOCAL = NO)
... ...
Run the kill-9 command to kill the process.

$ Kill-9 <PID>
Summary:

When a 1102 error occurs, check and troubleshoot the error as follows:

1. In the HA system, check whether instances have been started on other nodes;
2. Check whether the oracle process exists. If so, kill the process;
3. Check whether the semaphore exists. If yes, clear the semaphore;
4. Check whether the shared memory segment exists. If yes, clear the shared memory segment;
5. Check whether the lock memory files lk <sid> and sgadef <sid>. dbf exist. If yes, delete the files.

Related Article

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.