Friday, July 17, 2020

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

For me, the reason of this error was that I tried to open a standby database and then tried to start the managed recovery in order to utilize active dataguard feature. First, I cancelled the managed recovery, then opened the standby database, and as soon as I execute the command to start managed recovery process, ORA-01093 popped up; as you can see below.

SQL> alter database recover managed standby database cancel;
Database altered.

SQL> alter database open;
Database altered.
SQL> alter database recover managed standby database using current logfile disconnect;
alter database recover managed standby database using current logfile disconnect
*
ERROR at line 1:
ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected

Alert log file showed messages as follows.
CLOSE: 1 or more sessions failed to shutdown.
Active process 2980 user 'SYSTEM' program 'ORACLE.EXE (SHAD)'
CLOSE: Active sessions prevent database close operation
CLOSE: Error 1093 during database close
ORA-1093 signalled during: alter database recover managed standby database using current logfile disconnect...
Fri Jan 26 11:27:58 2018
ksvcreate: Process(m000) creation failed
Fri Jan 26 11:28:00 2018
ksvcreate: Process(m000) creation failed

Solution
The problem in this case was that I had another command prompt open where I was connected to the database as SYSDBA. And in current window I was trying to OPEN the database and enable the Managed Recovery of my standby database. I closed the other SQLPLUS session which was sitting idle, and then again I tried enabling the managed recovery, and I was successful this time.
Always make sure that you have only one SYSDBA session opened with your standby database before you can try enabling managed recovery process.

No comments:

Post a Comment

Popular Posts - All Times