溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

深入剖析Oracle啟動(dòng)過(guò)程內(nèi)部初始化

發(fā)布時(shí)間:2020-06-01 21:36:37 來(lái)源:網(wǎng)絡(luò) 閱讀:894 作者:Sound_ 欄目:關(guān)系型數(shù)據(jù)庫(kù)

深入剖析Oracle啟動(dòng)過(guò)程內(nèi)部初始化

1 Oracle啟動(dòng)選項(xiàng);

Oracle數(shù)據(jù)庫(kù)在startup啟動(dòng)時(shí),Oracle將在默認(rèn)位置$ORACLE_HOME/dbs中查找初始化參數(shù)文件;Oracle以下面的順序在其中尋找合適的初始化文件:


Spfile$ORACLE_SID.ora


Spfile.ora


Init$ORACLE_SID.ora

可以用幾種方式啟動(dòng)oracle數(shù)據(jù)庫(kù),不同方式啟動(dòng)將影響啟動(dòng)數(shù)據(jù)庫(kù)的程度,啟動(dòng)狀態(tài)由nomount(數(shù)據(jù)庫(kù)未裝載)——>mount(數(shù)據(jù)庫(kù)完成裝載)——>open(數(shù)據(jù)庫(kù)打開(kāi))


1.1 STARTUP NOMOUNT;

SQL> startup nomount
ORACLE instance started.

Total System Global Area 1603411968 bytes
Fixed Size		    2253664 bytes
Variable Size		 1375734944 bytes
Database Buffers	  218103808 bytes
Redo Buffers		    7319552 bytes

Oracle讀參數(shù)文件,打開(kāi)實(shí)例,啟動(dòng)Oracle后臺(tái)進(jìn)程,給Oracle分配SGA。此時(shí)數(shù)據(jù)庫(kù)狀態(tài)為未裝載。


1.2 ALTER DATABASE MOUNT;

SQL> alter database mount;

Database altered.

Oracle 打開(kāi)并讀取控制文件,獲取數(shù)據(jù)文件和重做日志文件的名稱和位置。此時(shí)數(shù)據(jù)庫(kù)完成裝載。


1.3 ALTER DATABASE OPEN;

SQL> alter database open;

Database altered.

Oracle打開(kāi)數(shù)據(jù)文件和重做日志文件,至此Oracle可以對(duì)外提供服務(wù)。


2 通過(guò)10046事件查看內(nèi)部啟動(dòng)過(guò)程

SQL> startup nomount;

Total System Global Area 1603411968 bytes
Fixed Size		    2253664 bytes
Variable Size		 1375734944 bytes
Database Buffers	  218103808 bytes
Redo Buffers		    7319552 bytes
SQL> oradebug setmypid
Statement processed.
SQL> oradebug tracefile_name
/oracle/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_3682.trc
SQL> 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@rhel6 ~]$ 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.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORACLE_HOME = /oracle/app/oracle/product/11.2.0
System name:    Linux
Node name:      rhel6
Release:        2.6.32-431.el6.x86_64
Version:        #1 SMP Sun Nov 10 22:19:54 EST 2013
Machine:        x86_64
VM name:        VMWare Version: 6
Instance name: orcl

Oracle數(shù)據(jù)庫(kù)mount啟動(dòng)讀取控制文件,寫(xiě)日志文件

...
WAIT #140528657591192: nam='control file sequential read' ela= 8 file#=0 block#=1 blocks
=1 obj#=-1 tim=1502627703012561
WAIT #140528657591192: nam='control file sequential read' ela= 2 file#=1 block#=1 blocks
=1 obj#=-1 tim=1502627703012583
WAIT #140528657591192: nam='control file sequential read' ela= 47 file#=0 block#=3 block
s=8 obj#=-1 tim=1502627703012650
WAIT #140528657591192: nam='control file sequential read' ela= 13 file#=1 block#=3 block
s=8 obj#=-1 tim=1502627703012674
...
WAIT #140528657591192: nam='ADR block file read' ela= 847  =0  =0  =0 obj#=-1 tim=150262
7707123048
WAIT #140528657591192: nam='ADR block file read' ela= 576  =0  =0  =0 obj#=-1 tim=150262
7707124068
WAIT #140528657591192: nam='ADR block file read' ela= 562  =0  =0  =0 obj#=-1 tim=150262
7707125013
WAIT #140528657591192: nam='ADR block file read' ela= 473  =0  =0  =0 obj#=-1 tim=150262
7707125891
...

Oracle數(shù)據(jù)庫(kù)open過(guò)程讀取控制文件信息,與讀取磁盤(pán)數(shù)據(jù)文件頭部進(jìn)行對(duì)比

alter database open
END OF STMT
PARSE #140528657591192:c=0,e=274,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,plh=0,tim=1502627713
479605
WAIT #140528657591192: nam='control file sequential read' ela= 8 file#=0 block#=1 blocks
=1 obj#=-1 tim=1502627713479904
WAIT #140528657591192: nam='control file sequential read' ela= 4 file#=1 block#=1 blocks
=1 obj#=-1 tim=1502627713479922
WAIT #140528657591192: nam='control file sequential read' ela= 2 file#=0 block#=15 block
s=1 obj#=-1 tim=1502627713479931
...
WAIT #140528657591192: nam='Disk file operations I/O' ela= 11 FileOperation=2 fileno=1 f
iletype=2 obj#=-1 tim=1502627713481300
WAIT #140528657591192: nam='Disk file operations I/O' ela= 6 FileOperation=2 fileno=2 fi
letype=2 obj#=-1 tim=1502627713481317
WAIT #140528657591192: nam='Disk file operations I/O' ela= 4 FileOperation=2 fileno=3 fi
letype=2 obj#=-1 tim=1502627713481327
WAIT #140528657591192: nam='Disk file operations I/O' ela= 4 FileOperation=2 fileno=4 fi
letype=2 obj#=-1 tim=1502627713481338
WAIT #140528657591192: nam='Disk file operations I/O' ela= 5 FileOperation=2 fileno=201 
filetype=2 obj#=-1 tim=1502627713481351


向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI