RAC 主动关闭数据库及直接关闭集群之间的关闭区别
1.主动关闭数据库
$ORACLE_HOME/bin/srvctl stop instance -d ractstdb -n ractst2
使用以上命令关闭的情况下,查看alert日志:
2025-02-17T17:20:48.128507+08:00
Shutting down ORACLE instance (immediate) (OS id: 7133)
2025-02-17T17:20:48.129091+08:00
Shutdown is initiated by oraagent.bin@ractst2 (TNS V1-V3).
2025-02-17T17:20:49.396822+08:00
Stopping background process SMCO
2025-02-17T17:20:50.442051+08:00
Shutting down instance: further logons disabled
2025-02-17T17:20:50.543916+08:00
Stopping background process CJQ0
2025-02-17T17:20:50.687896+08:00
Killed process oracle@ractst2 (Q001) with pid is 104, OS pid 4850
Stopping background process MMNL
2025-02-17T17:20:50.689023+08:00
Process termination requested for pid 4850 [source = rdbms], [info = 2] [request issued by pid: 7133, uid: 1001]
2025-02-17T17:20:50.695226+08:00
Process termination requested for pid 4855 [source = rdbms], [info = 2] [request issued by pid: 4846, uid: 1001]
2025-02-17T17:20:51.688515+08:00
Stopping background process MMON
2025-02-17T17:20:54.750707+08:00
alter pluggable database all close immediate
2025-02-17T17:20:54.784135+08:00
MESDB(3):JIT: pid 7133 requesting stop
2025-02-17T17:20:54.901938+08:00
MESDB(3):Stopped service mesdb
MESDB(3):Buffer Cache flush deferred for PDB 3
Pluggable database MESDB closed
Completed: alter pluggable database all close immediate
PDB$SEED(2):JIT: pid 7133 requesting stop
PDB$SEED(2):Buffer Cache flush deferred for PDB 2
License high water mark = 7
Dispatchers and shared servers shutdown
Data Pump shutdown on PDB: 1 in progress
2025-02-17T17:20:55.228770+08:00
Process termination requested for pid 4626 [source = rdbms], [info = 2] [request issued by pid: 7133, uid: 1001]
2025-02-17T17:20:58.109200+08:00
Stopping Emon pool
alter pluggable database all close immediate
Completed: alter pluggable database all close immediate
alter pluggable database all close immediate
Completed: alter pluggable database all close immediate
2025-02-17T17:20:59.147894+08:00
IM on ADG: Start of Empty Journal
IM on ADG: End of Empty Journal
Stopping background process RCBG
2025-02-17T17:21:04.155034+08:00
Stopping Emon pool
2025-02-17T17:21:06.008688+08:00
stopping change tracking
2025-02-17T17:21:06.077423+08:00
Redo thread 2 internally disabled at seq 414 (LGWR)
Shutting down archive processes
2025-02-17T17:21:06.078338+08:00
TT00 (PID:3878): Gap Manager exiting
2025-02-17T17:21:06.165987+08:00
ARC1 (PID:3884): Archiving disabled T-2.S-414
2025-02-17T17:21:06.288925+08:00
ARC1 (PID:3884): Archived Log entry 866 added for T-2.S-414 ID 0x6d40ae2c LAD:1
2025-02-17T17:21:07.078173+08:00
Archiving is disabled
2025-02-17T17:21:07.078549+08:00
ARC2 (PID:3886): ARCH shutting down
2025-02-17T17:21:07.078647+08:00
ARC0 (PID:3880): ARCH shutting down
2025-02-17T17:21:07.078634+08:00
ARC1 (PID:3884): ARCH shutting down
2025-02-17T17:21:07.078693+08:00
ARC2 (PID:3886): Archival stopped
2025-02-17T17:21:07.078787+08:00
ARC0 (PID:3880): Archival stopped
2025-02-17T17:21:07.078785+08:00
ARC3 (PID:3888): ARCH shutting down
2025-02-17T17:21:07.078890+08:00
ARC1 (PID:3884): Archival stopped
2025-02-17T17:21:07.079082+08:00
ARC3 (PID:3888): Archival stopped
2025-02-17T17:21:08.090347+08:00
Thread 2 closed at log sequence 414
Successful close of redo thread 2
2025-02-17T17:21:08.112562+08:00
Entire Buffer Cache invalidation started
Entire Buffer Cache invalidation completed
Shutting down archive processes
Archiving is disabled
.... (PID:7133): Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
2025-02-17T17:21:08.805187+08:00
SUCCESS: diskgroup DATA was dismounted
NOTE: Database dismounted; ASMB process exiting
NOTE: ASMB clearing idle groups before exit
2025-02-17T17:21:09.399901+08:00
JIT: pid 7133 requesting stop
2025-02-17T17:21:09.401036+08:00
Stopping background process VKTM
2025-02-17T17:21:09.408979+08:00
.... (PID:7133): Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
JIT: pid 7133 requesting stop
2025-02-17T17:21:09.570460+08:00
NOTE: Shutting down MARK background process
2025-02-17T17:21:11.019469+08:00
Stopping background process RBAL
2025-02-17T17:21:13.813017+08:00
freeing rdom 3
freeing the fusion rht of pdb 3
freeing the pdb enqueue rht
freeing rdom 2
freeing the fusion rht of pdb 2
freeing the pdb enqueue rht
freeing rdom 0
freeing the fusion rht of pdb 0
2025-02-17T17:21:19.175285+08:00
Instance shutdown complete (OS id: 7133)
可以看到其关闭方式为immediate;
2.直接关闭集群
/grid/app/19.9.0/grid/bin/crsctl stop crs
查看alert日志:
2025-02-17T17:26:13.002445+08:00
Shutting down ORACLE instance (abort) (OS id: 13137)
2025-02-17T17:26:13.002571+08:00
Shutdown is initiated by oraagent.bin@ractst2 (TNS V1-V3).
License high water mark = 6
USER (ospid: 13137): terminating the instance
2025-02-17T17:26:14.067925+08:00
Instance terminated by USER, pid = 13137
2025-02-17T17:26:14.700710+08:00
Instance shutdown complete (OS id: 13137)
可以看到其直接使用的是abort选项关闭数据库。
总结:
使用srvctl 关闭数据库使用的为immediate,时间慢点,但是数据安全,
直接使用crsctl stop crs直接关闭的情况下,oracle用abort来关闭,特点就是时间快,数据不友好。