Saturday, 22 May 2021

Open Oracle Database with Delay Option

Found an interesting event, that helps to open the database with delay option. The event db_open_begin delay (opening database with delay)  is undocumented event ( read unsupported )

and it will do exactly what is says e.g. open database with delay. Although alter database open command is executed it will wait for specified interval before opening database.


So here is scenario:

SQL> startup mount;

ORACLE instance started.



Total System Global Area 2853115766 bytes
Fixed Size                  2517065 bytes
Variable Size            1980352752 bytes
Database Buffers          822415232 bytes
Redo Buffers               15993728 bytes
Database mounted.

SQL> oradebug setmypid

Statement processed.

SQL> oradebug event db_open_begin delay=20

Statement processed.

SQL> set timing on
SQL> alter database open;



Database altered.



Elapsed: 00:00:21.51


Database was opened after approx 21 sec ( 20 sec delay and 1.51sec to run all oracle code related to opening database  starting with  bootstrap$  object. )


alter system command will work too:

SQL> alter system set events 'db_open_begin delay =20';


No comments:

Post a Comment