新聞中心
以下的文章主要是對Oracle啟動(dòng)方式與相關(guān)的Oracle命令參數(shù)進(jìn)行相關(guān)匯總,希望你在瀏覽完以下的文章會(huì)對Oracle啟動(dòng)方式與相關(guān)的Oracle命令參數(shù)的實(shí)際應(yīng)用加深印象。以下就是相關(guān)內(nèi)容的介紹。

成都創(chuàng)新互聯(lián)是專業(yè)的石家莊網(wǎng)站建設(shè)公司,石家莊接單;提供網(wǎng)站設(shè)計(jì)制作、網(wǎng)站建設(shè),網(wǎng)頁設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行石家莊網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴(kuò)展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來合作!
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)過程:啟動(dòng)實(shí)例 -> 裝載數(shù)據(jù)庫 -> 打開數(shù)據(jù)庫
與之對應(yīng)的讀取相應(yīng)文件的順序: 參數(shù)文件 -> 控制文件 -> 數(shù)據(jù)文件
我們驗(yàn)證一下這些步驟的區(qū)別:
startup nomount
使用nomount方式啟動(dòng)數(shù)據(jù)庫時(shí),表示只啟動(dòng)數(shù)據(jù)庫實(shí)例,不裝載數(shù)據(jù)庫,不打開數(shù)據(jù)庫
這時(shí)只讀取參數(shù)文件,主要有兩部分工作:一是分配內(nèi)存SGA區(qū),二是啟動(dòng)Oracle后臺(tái)進(jìn)程
如下我們修改Oracle參數(shù)文件的名稱,并以nomount 的方式Oracle啟動(dòng)數(shù)據(jù)庫
這里需要將pfile,spfile 都進(jìn)行修改,數(shù)據(jù)庫默認(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的方式下修改控制文件名稱,并沒有報(bào)錯(cuò)。說明在nomount的方式下,并沒有讀取控制文件。
繼續(xù)以上的步驟,我們以mount的方式啟動(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ù)庫時(shí),需要讀取控制文件確定數(shù)據(jù)文件的位置。
繼續(xù)上面的例子,我們將控制文件修改正確,使數(shù)據(jù)庫可以正確的找到控制文件,
我們修改數(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的方式下,并沒有報(bào)錯(cuò)。說明在mount的方式下,啟動(dòng)過程只讀取了參數(shù)文件和控制文件。
下面我們打開數(shù)據(jù)庫。
- 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ù)庫的啟動(dòng)過程以及Oracle啟動(dòng)過程中每一步驟的所做的工作和讀取的文件。
總結(jié)如下:Oracle按照如下過程啟動(dòng)數(shù)據(jù)庫
nomount
啟動(dòng)實(shí)例 | mount
(參數(shù)文件) | 裝載數(shù)據(jù)庫 | open
(控制文件) | 打開數(shù)據(jù)庫
(數(shù)據(jù)文件)
1.nomount方式下還沒有讀取控制文件,該選項(xiàng)用于在數(shù)據(jù)庫的控制文件全部損壞,需要重新創(chuàng)建數(shù)據(jù)庫控制文件或創(chuàng)建一個(gè)新的數(shù)據(jù)庫時(shí)使用。
2.mount 選項(xiàng)下并沒有打開數(shù)據(jù)文件,該選項(xiàng)可以用來修改數(shù)據(jù)庫的運(yùn)行模式或進(jìn)行數(shù)據(jù)庫恢復(fù)。
文章名稱:深入Oracle啟動(dòng)方式的實(shí)際應(yīng)用
標(biāo)題路徑:http://www.dlmjj.cn/article/dhihdgo.html


咨詢
建站咨詢
