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

Tuesday, 27.05.2008 – Dejan

Ako pokuŇ°avate uraditi¬†prebacivanje primarne baze u standby bazu, moŇĺe se desiti da dobijete ovu greŇ°ku:
ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected

Prebacivanje (switchover) primarne baze u standby je moguńáe bez problema ukoliko u koloni v$database.SWITCHOVER_STATUS stoji vrijednost TO STANDBY. MeńĎutim, ukoliko stoji vrijednost SESSIONS ACTIVE, onda ńáe naredba “alter database commit to switchover to physical standby” javiti gorenavedenu greŇ°ku.

SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
SESSIONS ACTIVE

SQL> alter database commit to switchover to physical standby;
alter database commit to switchover to physical standby;
*
ERROR at line 1:
ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected

Listu aktivnih korisnika moŇĺete dobiti pomońáu ovog upita:

SQL> select sid, process, program 
from v$session 
where type = 'USER' and sid <> (select distinct sid from v$mystat);

       SID PROCESS      PROGRAM
---------- ------------ --------------------
       468 2340:3416    racgimon.exe
       469 2340:3392    racgimon.exe
       470 2340:1548    racgimon.exe
       501 2340:3392    racgimon.exe

RjeŇ°enje je dodati klauzulu “WITH SESSION SHUTDOWN“, nakon ńćega ńáe postupak prebacivanja (switchover) biti uspjeŇ°an:

SQL> alter database commit to switchover to physical standby with session shutdown;

Ova naredba ńáe prvo obustaviti sve korisnińćke radnje, pa tek potom obaviti prebacivanje¬†primarne baze u standby bazu.

Napomena: U ovom sluńćaju smo racgimon.exe mogli zaustaviti i naredbom:

racgimon stop <instanca>
ili
racgimon stopd <ime_baze>

Post a Comment