Shutdown: active processes prevent shutdown operation

Source: Internet
Author: User

When shutdown immediate is used to shut down the database, Hang is used to view the Alert Log, and shutdown: active processes prevent shutdown operation is encountered. That is to say, some active processes have blocked the current shutdown operation. Slave, the database is a test database, and the database console is not configured. Is there any activity process blocking?

 

1. Scenario Reproduction

SQL> select * from V $ version where rownum <2; banner implements Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-productionsql> @ comm_sess_users; ----> View the sessionnstance Sid serial ID status Oracle user o/s PID session program terminal machine --------------------------------------------------------------- ------------- ------------------------ ----------------------- Sybo 125 5 active sys Oracle 4069 sqlplus@linux3.orasrv.com pts/1 linux3.orasrv. comsql> host; ----> Use host to switch to the OS prompt [Oracle @ linux3 ~] $ Sqlplus/As sysdba -----> log on to sqlplus SQL again> @ comm_sess_users; -----> The following query shows that terminal is displayed as the same terminal and is a sys user, sid 139 is activeinstance Sid serial ID status Oracle user o/s PID session program terminal machine --------- ------ ----------- --------- ---------------- ------------------------ Sybo 125 5 inactive sys Oracle 4069 sqlplus@linux3.orasrv.com PTS/1 linux3.orasrv.com 139 10 active sys Oracle 4152 sqlplus@linux3.orasrv.com pts/1 linux3.orasrv. comsql> @ my_env; ----> View your own Sid spid Sid serial # username program ------------------------ ---------- ------------------- detail 4152 139 10 Oracle oracle@linux3.orasrv.com (TNS V1-V3) SQL> shutdown immediate; ----> shut down the database, hang lived, had to use ctrl-C to terminate the ORA-01013: user requested cancel of current operationsql> shutdown abort; ----> force shut down the database Oracle instance shut down. -- Author: Robinson -- Blog: http://blog.csdn.net/robinson_0612 --> below is the background log information Thu Jul 25 10:56:43 2013 shutting down instance (immediate) Shutting Down instance: further logons disabled ---> the new session cannot be logged into stopping background process qmncthu Jul 25 10:56:43 2013 stopping background process cjq0stopping background process mmnlstopping background process mmonlicense high water mark = 3thu Jul 25 11:01:53 2013 Shutdown: active processes prevent shutdown operation ---> the following error occurs: Thu Jul 25 11:07:01 2013 shutdown: active processes prevent shutdown operationthu Jul 25 11:07:44 2013 starting background process smcothu Jul 25 11:07:44 2013 instance shutdown canceled ---> shutdown is cancel Thu Jul 25 11:07:44 2013 SmCo started with PID = 15, OS id = 4178 Thu Jul 25 11:08:06 2013 shutting down instance (abort) ---> use the abort method to shutdown databaselicense high water mark = 3 user (ospid: 4152 ): terminating the instancetermination issued to instance processes. waiting for the processes to exitinstance termination failed to kill one or more processesinstance terminated by user, pid = 20172thu Jul 25 11:08:16 2013 instance shutdown complete

2. Analysis and Solution
From the above situation, it is because the previous session has not been disconnected, and then the host is used to switch to the OS prompt, resulting in the database cannot be properly closed.
Through further tests, this phenomenon does not exist if multiple non-sys users log on.
Oracle shows that this is not an Oracle bug, but an abnormal database close sequence.
We recommend that you disconnect all connections before shutting down the database. For example, disable dB control first. For details, see the following Oracle document and example.

 

3. Doc ID 416658.1

Shutdown immediate hangs/active processes prevent Shutdown (Doc ID 416658.1)

Applies:
Oracle Server-Enterprise Edition-version: 10.1.0.2 to 11.2.0.2-release: 10.1 to 11.2
Oracle Server-Enterprise Edition-version: 10.1.0.2 to 11.2.0.2 [release: 10.1 to 11.2]
Information in this document applies to any platform.

Symptoms
The 'shutdown immediate' command hangs or is very slow

The Alert Log lists messages like:

Shutdown: Waiting for active cballs to complete. Active processes prevent shutdown operation

Cause
This is not a bug.

If the DB control repository is running on the database target against which shutdown immediate was attempted then an incorrect
Order of events seems used.

You shoshould stop dB control first to get rid of all connections between DB control and the repository database and then shutdown
The database with 'shutdown immediate '.

Current Database sessions may show:

SQL> select Sid, username, program from V $ session;
Sid username Program
-------------------------------------------------------------
243 system SQL developer
246 sysman oms
247 Oracle @ lgiora09 (q001)
248 Oracle @ lgiora09 (q000)
251 Dbsnmp emagent @ lgiora09 (TNS V1-V3)
252 sysman oms
253 sysman oms
254 Dbsnmp emagent @ lgiora09 (TNS V1-V3)
255 system java.exe
256 sysman oms

Clearly OMS and OEM are connected (Oracle Enterprise Manager Grid Control or dbconsole) via users sysman and Dbsnmp.
These sessions shocould be de-activated (that is to log off any OEM, OMS, sysman and Dbsnmp) before the shutdown immediate is attempted.

Oracle Enterprise Manager, grid control, dbconsole and Agents keep doing internal processing.
This may include a few PLSQL notification procedures running on the database by Database Control like
Begin emd_notification.queue_ready (: 1,: 2,: 3); end;

As per internal documentation of the shutdown immediate, if there are active callthen it wowould wait for all the active callto finish.

Solution
To implement the solution:

1. Given OEM connections are active (sysman and Dbsnmp), de-activate these sessions, I. e. By stopping the agent/dbconsole

2. Then shutdown immediate as normal

-Or-

There may be processes still running and holding locks at the time a shutdown is issued.
Sometimes these are failed jobs or transactions, which are using tively 'zombies', which are not able to receive a signal from Oracle.

If this occurs, the only way to shutdown the database is by doing:

SQL>
Shutdown abort
Startup restrict
Shutdown normal

The startup does any necessary recovery and cleanup, so that a valid cold backup can be taken afterward.

If this issue occurs frequently, it wocould be a good practice to see if there are any active user processes running in V $ session or
V $ process before shutting down the instance.

If the problem persists, and no apparent user processes are active, you can set this event prior to issuing the shutdown command
In order to see what is happening. This will dump a systemstate every 5 minutes while shutdown is hanging

SQL>
Connect/As sysdba
Alter session set events '10400 trace name context forever, level 1 ';

 

More references

For more information about Oracle RAC, see
Use crs_setperm to modify the resource owner and permissions of RAC.
Use crs_profile to manage RAC resource configuration files
RAC database startup and Shutdown
Oracle RAC services
Services in Oracle Database 10g
Migrate datbase from single instance to Oracle RAC
Connect Oracle RAC to a specified instance
Oracle RAC load balancing test (combined with server and client)
Oracle RAC server connection Load Balance)
Load Balance)
Non-Default port listening configuration in Oracle RAC (listener. ora tnsnames. ora)
Oracle RAC Listener Configuration (listener. ora tnsnames. ora)
Configure RAC load balancing and Failover
CRS-1006, CRS-0215 fault case
Installing Oracle 10g RAC Based on Linux (RHEL 5.5)
Use runcluvfy to verify the Oracle RAC installation environment

For more information about the basics and concepts of Oracle network configuration, see:
Configure dynamic service registration for non-default ports
Configure sqlnet. ora to restrict IP Access to Oracle
Configure and manage Oracle listener logs
Set the Oracle listener password (listener)
Configure the Oracle client to connect to the database

For more information about user-managed backup and recovery, see
Oracle cold backup
Oracle Hot Backup
Concept of Oracle backup recovery
Oracle instance recovery
Oracle recovery based on user management
System tablespace management and Backup Recovery
Sysaux tablespace management and recovery
Oracle backup control file recovery (unsing backup controlfile)

For information on RMAN backup recovery and management, see
RMAN overview and architecture
RMAN configuration, Monitoring and Management
Detailed description of RMAN backup
RMAN restoration and recovery
Create and use RMAN catalog
Create RMAN storage script based on catalog
Catalog-based RMAN backup and recovery
RMAN backup path confusion
Use RMAN for recovery from different machine backups (WIN platform)
Use RMAN to migrate a file system database to ASM
Linux RMAN backup shell script
Use RMAN to migrate the database to a different machine

For the Oracle architecture, see
Oracle tablespace and data files
Oracle Password File
Oracle parameter file
Oracle online redo log file)
Oracle Control File)
Oracle archiving logs
Oracle rollback and undo)
Oracle database instance startup and Shutdown Process
Automated Management of Oracle 10g SGA
Oracle instances and Oracle databases (Oracle Architecture)

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.