oracle中的mount是什么意思,oraclenomountmountopen直接的关系
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ò)程:啟動(dòng)實(shí)例 - 裝載數(shù)據(jù)庫(kù) - 打開(kāi)
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ò)程:啟動(dòng)實(shí)例 -> 裝載數(shù)據(jù)庫(kù) -> 打開(kāi)數(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ù),不打開(kāi)數(shù)據(jù)庫(kù)
這時(shí)只讀取參數(shù)文件,主要有兩部分工作:一是分配內(nèi)存SGA區(qū),二是啟動(dòng)Oracle后臺(tái)進(jìn)程
如下我們修改oracle參數(shù)文件的名稱,并以nomount 的方式啟動(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的方式啟動(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的方式下,啟動(dòng)過(guò)程只讀取了參數(shù)文件和控制文件。
下面我們打開(kāi)數(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
------------
啟動(dòng)實(shí)例 | mount
(參數(shù)文件) |---------------
| 裝載數(shù)據(jù)庫(kù) | open
(控制文件) |-----------
| 打開(kāi)數(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)有打開(kāi)數(shù)據(jù)文件,該選項(xiàng)可以用來(lái)修改數(shù)據(jù)庫(kù)的運(yùn)行模式或進(jìn)行數(shù)據(jù)庫(kù)恢復(fù)。
總結(jié)
以上是生活随笔為你收集整理的oracle中的mount是什么意思,oraclenomountmountopen直接的关系的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: modbus rtu 协议转DLT645
- 下一篇: 35岁前成功原则