標籤:oracle啟動
650) this.width=650;" src="http://images2015.cnblogs.com/blog/819681/201512/819681-20151202163739424-751270142.jpg" alt="819681-20151202163739424-751270142.jpg" />
1 Oracle啟動選項;
Oracle資料庫在startup啟動時,Oracle將在預設位置$ORACLE_HOME/dbs中尋找初始化參數檔案;Oracle以下面的順序在其中尋找合適的初始設定檔案:
Spfile$ORACLE_SID.ora
Spfile.ora
Init$ORACLE_SID.ora
可以用幾種方式啟動oracle資料庫,不同方式啟動將影響啟動資料庫的程度,啟動狀態由nomount(資料庫未裝載)——>mount(資料庫完成裝載)——>open(資料庫開啟)
1.1 STARTUP NOMOUNT;
SQL> startup nomountORACLE instance started.Total System Global Area 1603411968 bytesFixed Size 2253664 bytesVariable Size 1375734944 bytesDatabase Buffers 218103808 bytesRedo Buffers 7319552 bytes
Oracle讀參數檔案,開啟執行個體,啟動Oracle後台進程,給Oracle分配SGA。此時資料庫狀態為未裝載。
1.2 ALTER DATABASE MOUNT;
SQL> alter database mount;Database altered.
Oracle 開啟並讀取控制檔案,擷取資料檔案和重做記錄檔的名稱和位置。此時資料庫完成裝載。
1.3 ALTER DATABASE OPEN;
SQL> alter database open;Database altered.
Oracle開啟資料檔案和重做記錄檔,至此Oracle可以對外提供服務。
2 通過10046事件查看內部啟動過程
SQL> startup nomount;Total System Global Area 1603411968 bytesFixed Size 2253664 bytesVariable Size 1375734944 bytesDatabase Buffers 218103808 bytesRedo Buffers 7319552 bytesSQL> oradebug setmypidStatement processed.SQL> oradebug tracefile_name/oracle/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_3682.trcSQL> alter session set events‘10046 trace name context forever,level 12‘;Session altered.SQL> alter database mount;Database altered.SQL> alter database open;Database altered.
查看udump檔案
[oracle[email protected] ~]$ more /oracle/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_3682.trc
Trace file /oracle/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_3682.trcOracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsORACLE_HOME = /oracle/app/oracle/product/11.2.0System name: LinuxNode name: rhel6Release: 2.6.32-431.el6.x86_64Version: #1 SMP Sun Nov 10 22:19:54 EST 2013Machine: x86_64VM name: VMWare Version: 6Instance name: orcl
Oracle資料庫mount啟動讀取控制檔案,寫記錄檔
...WAIT #140528657591192: nam=‘control file sequential read‘ ela= 8 file#=0 block#=1 blocks=1 obj#=-1 tim=1502627703012561WAIT #140528657591192: nam=‘control file sequential read‘ ela= 2 file#=1 block#=1 blocks=1 obj#=-1 tim=1502627703012583WAIT #140528657591192: nam=‘control file sequential read‘ ela= 47 file#=0 block#=3 blocks=8 obj#=-1 tim=1502627703012650WAIT #140528657591192: nam=‘control file sequential read‘ ela= 13 file#=1 block#=3 blocks=8 obj#=-1 tim=1502627703012674...WAIT #140528657591192: nam=‘ADR block file read‘ ela= 847 =0 =0 =0 obj#=-1 tim=1502627707123048WAIT #140528657591192: nam=‘ADR block file read‘ ela= 576 =0 =0 =0 obj#=-1 tim=1502627707124068WAIT #140528657591192: nam=‘ADR block file read‘ ela= 562 =0 =0 =0 obj#=-1 tim=1502627707125013WAIT #140528657591192: nam=‘ADR block file read‘ ela= 473 =0 =0 =0 obj#=-1 tim=1502627707125891...
Oracle資料庫open過程讀取控制檔案資訊,與讀取磁碟資料檔案頭部進行對比
alter database openEND OF STMTPARSE #140528657591192:c=0,e=274,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,plh=0,tim=1502627713479605WAIT #140528657591192: nam=‘control file sequential read‘ ela= 8 file#=0 block#=1 blocks=1 obj#=-1 tim=1502627713479904WAIT #140528657591192: nam=‘control file sequential read‘ ela= 4 file#=1 block#=1 blocks=1 obj#=-1 tim=1502627713479922WAIT #140528657591192: nam=‘control file sequential read‘ ela= 2 file#=0 block#=15 blocks=1 obj#=-1 tim=1502627713479931...WAIT #140528657591192: nam=‘Disk file operations I/O‘ ela= 11 FileOperation=2 fileno=1 filetype=2 obj#=-1 tim=1502627713481300WAIT #140528657591192: nam=‘Disk file operations I/O‘ ela= 6 FileOperation=2 fileno=2 filetype=2 obj#=-1 tim=1502627713481317WAIT #140528657591192: nam=‘Disk file operations I/O‘ ela= 4 FileOperation=2 fileno=3 filetype=2 obj#=-1 tim=1502627713481327WAIT #140528657591192: nam=‘Disk file operations I/O‘ ela= 4 FileOperation=2 fileno=4 filetype=2 obj#=-1 tim=1502627713481338WAIT #140528657591192: nam=‘Disk file operations I/O‘ ela= 5 FileOperation=2 fileno=201 filetype=2 obj#=-1 tim=1502627713481351
本文出自 “Sound's Blog” 部落格,請務必保留此出處http://sound.blog.51cto.com/11960199/1955981
深入剖析Oracle啟動過程內部初始化