ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected


SQL*Plus: Release 12.1.0.1.0 Production on Sat Mar 12 01:59:44 2016

Copyright (c) 1982, 2013, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 2505338880 bytes
Fixed Size 2291472 bytes
Variable Size 1493174512 bytes
Database Buffers 989855744 bytes
Redo Buffers 20017152 bytes
Database mounted.
Database opened.
SQL> alter database close;

Database altered.

SQL> select open_mode from v$database;

OPEN_MODE
——————–
MOUNTED

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-16196: database has been previously opened and closed

Solution:

The database close operation is implicit in a database shutdown. The nature of the operation depends on whether the database shutdown is normal or abnormal.
At this stage, the only option for the instance is to shut down, ending the life of this instance.

You can open your db only once. If you would do a close of your db, its not like going backwards. You have to go with the shutdown and then do the startup again.

SQL> shut immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 2505338880 bytes
Fixed Size 2291472 bytes
Variable Size 1493174512 bytes
Database Buffers 989855744 bytes
Redo Buffers 20017152 bytes
Database mounted.
Database opened.
SQL> select open_mode from v$database;

OPEN_MODE
——————–
READ WRITE

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s