How do I delay opening a database?

Time:2021-11-25

[email protected]> set timing on
[email protected]> startup mount;
ORACLE instance started.

Total System Global Area 676491264 bytes
Fixed Size 2256192 bytes
Variable Size 239076032 bytes
Database Buffers 427819008 bytes
Redo Buffers 7340032 bytes
Database mounted.
[email protected]> oradebug setmypid
Statement processed.
[email protected]> set timing on
[email protected]> oradebug event db_open_begin delay=20
Statement processed.

[email protected]> alter database open ;
Database altered.

Elapsed: 00:00:21.64
[email protected]> select sysdate from dual ;

SYSDATE

2021-06-02 08:59:32

Elapsed: 00:00:00.00

–//Check the record of alter:
alter database open
–//Wait 20 seconds before execution and use the following information.
Wed Jun 02 08:59:30 2021
LGWR: STARTING ARCH PROCESSES
Wed Jun 02 08:59:30 2021
ARC0 started with pid=22, OS id=36296
ARC0: Archival started
LGWR: STARTING ARCH PROCESSES COMPLETE
ARC0: STARTING ARCH PROCESSES
Thread 1 opened at log sequence 1173
Current log# 2 seq# 1173 mem# 0: /mnt/ramdisk/book/redo02.log
Successful open of redo thread 1
Wed Jun 02 08:59:31 2021
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Wed Jun 02 08:59:31 2021
SMON: enabling cache recovery
Wed Jun 02 08:59:31 2021
ARC1 started with pid=23, OS id=36298
[36291] Successfully onlined Undo Tablespace 2.
Undo initialization finished serial:0 start:1054168652 end:1054168722 diff:70 (0 seconds)
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
SMON: enabling tx recovery
Database Characterset is ZHS16GBK
No Resource Manager plan active
replication_dependency_tracking turned off (no async multimaster replication found)
WARNING: AQ_TM_PROCESSES is set to 0. System operation might be adversely affected.

–//However, the following effects are implemented ingameIn the same way:
[email protected]> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
[email protected]> startup mount;
ORACLE instance started.
Total System Global Area 676491264 bytes
Fixed Size 2256192 bytes
Variable Size 239076032 bytes
Database Buffers 427819008 bytes
Redo Buffers 7340032 bytes
Database mounted.

[email protected]> set timing on
[email protected]> alter system set events ‘db_open_begin delay=10’ ;
System altered.
Elapsed: 00:00:00.00

[email protected]> alter database open;
Database altered.
Elapsed: 00:00:11.63

–//alert:
alter database open
Wed Jun 02 09:06:39 2021
LGWR: STARTING ARCH PROCESSES
Wed Jun 02 09:06:39 2021
ARC0 started with pid=22, OS id=36475
ARC0: Archival started
LGWR: STARTING ARCH PROCESSES COMPLETE
ARC0: STARTING ARCH PROCESSES
Thread 1 opened at log sequence 1173
Current log# 2 seq# 1173 mem# 0: /mnt/ramdisk/book/redo02.log
Successful open of redo thread 1
Wed Jun 02 09:06:40 2021
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Wed Jun 02 09:06:40 2021
SMON: enabling cache recovery
Wed Jun 02 09:06:40 2021
ARC1 started with pid=23, OS id=36477
[36469] Successfully onlined Undo Tablespace 2.
Undo initialization finished serial:0 start:1054597802 end:1054597862 diff:60 (0 seconds)
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g www.sangpi.comfile header compatibility for tablespace encryption completed
SMON: enabling tx recovery
Database Characterset is ZHS16GBK
No Resource Manager plan active
replication_dependency_tracking turned off (no async multimaster replication found)
WARNING: AQ_TM_PROCESSES is set to 0. System operation might be adversely affected.