新聞中心
以下的文章主要是對(duì)Oracle啟動(dòng)的方式與其相關(guān)的命令參數(shù)的匯總,以及對(duì)一些常用常用參數(shù)的介紹,如果你對(duì)這些相關(guān)的實(shí)際操作感興趣的話,你就可以瀏覽以下的文章了,下面就是文章的具體內(nèi)容描述。

Oracle的啟動(dòng)方式:
- startup nomount
- startup mount
- startup open (startup的默認(rèn)選項(xiàng))
其他常用的參數(shù):read only ,read write ,force,restrict
這些參數(shù)可以一起使用,比如 startup 與 startup open read write 是一樣的效果。
Oracle的啟動(dòng)過(guò)程:?jiǎn)?dòng)實(shí)例 -> 裝載數(shù)據(jù)庫(kù) -> 打開數(shù)據(jù)庫(kù)
與之對(duì)應(yīng)的讀取相應(yīng)文件的順序: 參數(shù)文件 -> 控制文件 -> 數(shù)據(jù)文件
我們驗(yàn)證一下這些步驟的區(qū)別:
- startup nomount
使用nomount方式啟動(dòng)數(shù)據(jù)庫(kù)時(shí),表示只啟動(dòng)數(shù)據(jù)庫(kù)實(shí)例,不裝載數(shù)據(jù)庫(kù),不打開數(shù)據(jù)庫(kù)
這時(shí)只讀取參數(shù)文件,主要有兩部分工作:一是分配內(nèi)存SGA區(qū),二是啟動(dòng)Oracle后臺(tái)進(jìn)程
如下我們修改Oracle參數(shù)文件的名稱,并以nomount 的方式Oracle啟動(dòng)數(shù)據(jù)庫(kù)
這里需要將pfile,spfile 都進(jìn)行修改,數(shù)據(jù)庫(kù)默認(rèn)使用spfile啟動(dòng),在找不到spfile時(shí)用pfile啟動(dòng)。
- [Oracle@localhost dbs]$ pwd
- /Oracle/orc10g/product/10.1.0/db_1/dbs
- [Oracle@localhost dbs]$ mv initorcl.ora initorcl1.ora
- [Oracle@localhost dbs]$ mv spfileorcl.ora spfileorcl1.ora
- SYS@orcl>shutdown abort
- Oracle instance shut down.
- SYS@orcl>startup nomount
- ORA-01078: failure in processing system parameters
- LRM-00109: could not open parameter file
'/Oracle/orc10g/product/10.1.0/db_1/dbs/initorcl.ora'- SYS@orcl>
保持參數(shù)文件正確,修改控制文件名稱
- [Oracle@localhost orcl]$ pwd
- /Oracle/orc10g/oradata/orcl
- [Oracle@localhost orcl]$ mv control01.ctl control01a.ctl
- [Oracle@localhost orcl]$ mv control02.ctl control02a.ctl
- [Oracle@localhost orcl]$ mv control03.ctl control03a.ctl
- .....
- SYS@orcl>startup nomount
- Oracle instance started.
- Total System Global Area 167772160 bytes
- Fixed Size 778212 bytes
- Variable Size 61874204 bytes
- Database Buffers 104857600 bytes
- Redo Buffers 262144 bytes
- SYS@orcl>
在nomount的方式下修改控制文件名稱,并沒(méi)有報(bào)錯(cuò)。說(shuō)明在nomount的方式下,并沒(méi)有讀取控制文件。
繼續(xù)以上的步驟,我們以mount的方式Oracle啟動(dòng):
- SYS@orcl>alter database mount;
- alter database mount
- *
- ERROR at line 1:
- ORA-00205: error in identifying controlfile, check alert log for more info
裝載數(shù)據(jù)庫(kù)時(shí),需要讀取控制文件確定數(shù)據(jù)文件的位置。
繼續(xù)上面的例子,我們將控制文件修改正確,使數(shù)據(jù)庫(kù)可以正確的找到控制文件,
我們修改數(shù)據(jù)文件的名稱.
- [Oracle@localhost orcl]$ mv tp_test.dbf tp_test1.dbf
- .....
- SYS@orcl>startup mount
- Oracle instance started.
- Total System Global Area 167772160 bytes
- Fixed Size 778212 bytes
- Variable Size 61874204 bytes
- Database Buffers 104857600 bytes
- Redo Buffers 262144 bytes
- Database mounted.
雖然我修改了數(shù)據(jù)文件,但是在mount的方式下,并沒(méi)有報(bào)錯(cuò)。說(shuō)明在mount的方式下,Oracle啟動(dòng)過(guò)程只讀取了參數(shù)文件和控制文件。
下面我們打開數(shù)據(jù)庫(kù)。
- SYS@orcl>alter database open
- 2 ;
- alter database open
- *
- ERROR at line 1:
- ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
- ORA-01110: data file 5: '/Oracle/orc10g/oradata/orcl/tp_test.dbf'
提示我們找不到tp_test.dbf這個(gè)文件了。
至此我們大概的了解了數(shù)據(jù)庫(kù)的啟動(dòng)過(guò)程以及啟動(dòng)過(guò)程中每一步驟的所做的工作和讀取的文件。
總結(jié)如下:Oracle按照如下過(guò)程啟動(dòng)數(shù)據(jù)庫(kù)
nomount
Oracle啟動(dòng)實(shí)例 | mount
(參數(shù)文件) |---------------
| 裝載數(shù)據(jù)庫(kù) | open
(控制文件) |-----------
| 打開數(shù)據(jù)庫(kù)
(數(shù)據(jù)文件)
1.nomount方式下還沒(méi)有讀取控制文件,該選項(xiàng)用于在數(shù)據(jù)庫(kù)的控制文件全部損壞,需要重新創(chuàng)建數(shù)據(jù)庫(kù)控制文件或創(chuàng)建一個(gè)新的數(shù)據(jù)庫(kù)時(shí)使用。
2.mount 選項(xiàng)下并沒(méi)有打開數(shù)據(jù)文件,該選項(xiàng)可以用來(lái)修改數(shù)據(jù)庫(kù)的運(yùn)行模式或進(jìn)行數(shù)據(jù)庫(kù)恢復(fù)。
上述的相關(guān)內(nèi)容就是對(duì)Oracle啟動(dòng)方式的描述,希望會(huì)給你帶來(lái)一些幫助在此方面。
本文名稱:Oracle啟動(dòng)的方式和命令參數(shù)的匯總
文章網(wǎng)址:http://m.5511xx.com/article/dhioegd.html


咨詢
建站咨詢
