In Oracle 11g, SYS connection prevents database Shutdown

Source: Internet
Author: User

In the past, I found that 11 GB of Oracle had this problem and had not been very concerned about it. When I closed the database today, I found that Oracle could not be shut down normally for a long time.

The following error message is displayed when you query the database in the background:

SHUTDOWN: Active processes prevent shutdown operation


Check the background process of the database, and no connection is found to occupy a large amount of resources. In fact, there is only one local connection in the database:

Bash-3.00 $ ps-ef | grep into lerac11g2
Oracle 22273 22272 0 19:59:51? 0: 00 then lerac11g2 (DESCRIPTION = (LOCAL = YES) (ADDRESS = (PROTOCOL = beq )))
Oracle 29307 22520 0 20:09:28 pts/2 grep limit lerac11g2


After checking, it seems that the current SYS connection has not exited, but another sqlplus command is directly started through the HOST command, and the shutdown immediate operation is executed in it, in this case, shutdown immediate will be hang:

$ Sqlplus "/as sysdba"
SQL * Plus: Release 11.1.0.6.0-Production on Friday August 22 19:49:35 2008
Copyright (c) 1982,200 7, Oracle. All rights reserved.
Connect:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0-64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
And Real Application Testing options
SQL> shutdown the immediate database has been disabled. The database has been detached.
The ORACLE routine has been disabled.
SQL> startup
The ORACLE routine has been started.
Total System Global Area 1.7108E + 10 bytes
Fixed Size 2101632 bytes
Variable Size 3344420480 bytes
Database Buffers 1.3757E + 10 bytes
The Redo Buffers 4431872 bytes database has been loaded. The database has been opened.


Start another session, log on to the database as SYS, and then try to close the database:

SQL> shutdown the immediate database has been disabled. The database has been detached.
The ORACLE routine has been disabled.

The database can be shut down normally. Then, according to the description above, switch to the Host Command Line in sqlplus, start a new sqlplus, and execute shutdown immediate:


SQL> startup
The ORACLE routine has been started.
Total System Global Area 1.7108E + 10 bytes
Fixed Size 2101632 bytes
Variable Size 3344420480 bytes
Database Buffers 1.3757E + 10 bytes
The Redo Buffers 4431872 bytes database has been loaded. The database has been opened.
SQL> select count (*) from v $ session;
COUNT (*)
----------
36
SQL> host
$ Sqlplus "/as sysdba"
SQL * Plus: Release 11.1.0.6.0-Production on Friday August 22 19:59:51 2008
Copyright (c) 1982,200 7, Oracle. All rights reserved.
Connect:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0-64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
And Real Application Testing options
SQL> shutdown immediate


As expected, the command is shut down by hang. Check the alert file to see the above prompt.

Exit the current session, return to the original session, and re-connect to close the database:

SQL> shutdown immediate
^ CORA-01013: the user requested to cancel the current operation
SQL> exit from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0-64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
And Real Application Testing options disconnected
$ Exit
SQL> shutdown immediate
ORA-03135: Lost connection
SQL> conn/as sysdba is connected.
SQL> shutdown the immediate database has been disabled. The database has been detached.
The ORACLE routine has been disabled.


The 920 database does not have this problem:

[Oracle @ bjtest ~] $ Sqlplus "/as sysdba"
SQL * Plus: Release 9.2.0.4.0-Production on Saturday August 23 04:14:36 2008
Copyright (c) 1982,200 2, Oracle Corporation. All rights reserved.
Already connected to the idle routine.
SQL> host
[Oracle @ bjtest ~] $ Ps-ef | grep ora
Root 3804 3792 0 Jul18? 00:00:29 hald-addon-storage: polling/dev/hda
Root 26417 26385 0 00:00:00 pts/1 su-oracle
Oracle 26418 26417 0 00:00:00 pts/1-bash
Oracle 26451 26418 0 00:00:00 pts/1 sqlplus
Oracle 26452 26451 0? 00:00:00 oraclebjtest (DESCRIPTION = (LOCAL = YES) (ADDRESS = (PROTOCOL = beq )))
Oracle 26453 26451 0 00:00:00 pts/1/bin/bash
Oracle 26481 26453 0 00:00:00 pts/1 ps-ef
Oracle 26482 26453 0 00:00:00 pts/1 grep ora
[Oracle @ bjtest ~] $ Exit
Exit
SQL> startup
The ORACLE routine has been started.
Total System Global Area 9415145752 bytes
Fixed Size 755992 bytes
Variable Size 822083584 bytes
Database Buffers 8589934592 bytes
The Redo Buffers 2371584 bytes database has been loaded. The database has been opened.
SQL> host
[Oracle @ bjtest ~] $ Sqlplus "/as sysdba"
SQL * Plus: Release 9.2.0.4.0-Production on Saturday August 23 04:15:08 2008
Copyright (c) 1982,200 2, Oracle Corporation. All rights reserved.
Connect:
Oracle9i Enterprise Edition Release 9.2.0.4.0-64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0-Production
SQL> shutdown the immediate database has been disabled. The database has been detached.
The ORACLE routine has been disabled.
SQL> exit from Oracle9i Enterprise Edition Release 9.2.0.4.0-64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
Disconnects from JServer Release 9.2.0.4.0-Production
[Oracle @ bjtest ~] $ Exit
Exit
SQL> exit
ERROR:
ORA-03113: End of file for communication channel
From Oracle9i Enterprise Edition Release 9.2.0.4.0-64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
Disconnects from JServer Release 9.2.0.4.0-Production (complex)

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.