一、啓動Oracle DB 實例:NOMOUNT
在
建立數據庫期間、從新建立控制文件期間,或執行某些備份和恢復方案期間,一般只在NOMOUNT模式下啓動實例。
啓動實例過程包括執行如下任務:
• 按如下順序搜索$ORACLE_HOME/dbs中具備特定名稱的文件:
1. 搜索spfile<SID>.ora。
2. 若是未找到spfile<SID>.ora,則搜索spfile.ora。
3. 若是未找到spfile.ora,則搜索init<SID>.ora。
這是包含實例初始化參數的文件。使用STARTUP指定PFILE參數可覆蓋默認行爲。
• 分配SGA
• 啓動後臺進程
• 打開alert_<SID>.log文件和跟蹤文件
注:SID是用於標識實例的系統ID(例如ORCL)。
命令:
sys@TEST0924> startup nomount;
ORACLE instance started.
Total System Global Area 2505338880 bytes
Fixed Size 2230952 bytes
Variable Size 620758360 bytes
Database Buffers 1862270976 bytes
Redo Buffers 20078592 bytes
alert_test0924.log日誌查看:
Wed Oct 02 16:33:04 2013
Adjusting the default value of parameter parallel_max_servers
from 320 to 135 due to the value of parameter processes (150)
Starting ORACLE instance (normal)
****************** Large Pages Information *****************
Total Shared Global Region in Large Pages = 0 KB (0%)
Large Pages used by this instance: 0 (0 KB)
Large Pages unused system wide = 0 (0 KB) (alloc incr 16 MB)
Large Pages configured system wide = 0 (0 KB)
Large Page size = 2048 KB
RECOMMENDATION:
Total Shared Global Region size is 2402 MB. For optimal performance,
prior to the next instance restart increase the number
of unused Large Pages by atleast 1201 2048 KB Large Pages (2402 MB)
system wide to get 100% of the Shared
Global Region allocated with Large pages
***********************************************************
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Picked latch-free SCN scheme 3
Using LOG_ARCHIVE_DEST_1 parameter default value as USE_DB_RECOVERY_FILE_DEST
Autotune of undo retention is turned on.
IMODE=BR
ILAT =27
LICENSE_MAX_USERS = 0
SYS auditing is disabled
Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options.
ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1
System name: Linux
Node name: rtest.localdomain
Release: 2.6.18-308.el5
Version: #1 SMP Fri Jan 27 17:17:51 EST 2012
Machine: x86_64
VM name: VMWare Version: 6
Using parameter settings in server-side spfile /u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfiletest0924.ora
System parameters with non-default values:
processes = 150
shared_pool_size = 496M
sga_target = 2400M
control_files = "/u01/app/oracle/oradata/test0924/control01.ctl"
control_files = "/u01/app/oracle/fast_recovery_area/test0924/control02.ctl"
db_block_size = 8192
db_keep_cache_size = 48M
compatible = "11.2.0.0.0"
db_recovery_file_dest = "/u01/app/oracle/fast_recovery_area"
db_recovery_file_dest_size= 4122M
undo_tablespace = "UNDOTBS2"
remote_login_passwordfile= "EXCLUSIVE"
db_domain = ""
dispatchers = "(PROTOCOL=TCP) (SERVICE=test0924XDB)"
audit_file_dest = "/u01/app/oracle/admin/test0924/adump"
audit_trail = "DB"
db_name = "test0924"
open_cursors = 300
pga_aggregate_target = 798M
sec_max_failed_login_attempts= 2
diagnostic_dest = "/u01/app/oracle"
Wed Oct 02 16:33:04 2013
PMON started with pid=2, OS id=14904
Wed Oct 02 16:33:04 2013
PSP0 started with pid=3, OS id=14906
Wed Oct 02 16:33:05 2013
VKTM started with pid=4, OS id=14908 at elevated priority
VKTM running at (1)millisec precision with DBRM quantum (100)ms
Wed Oct 02 16:33:05 2013
GEN0 started with pid=5, OS id=14912
Wed Oct 02 16:33:05 2013
DIAG started with pid=6, OS id=14914
Wed Oct 02 16:33:05 2013
DBRM started with pid=7, OS id=14916
Wed Oct 02 16:33:05 2013
DIA0 started with pid=8, OS id=14918
Wed Oct 02 16:33:05 2013
MMAN started with pid=9, OS id=14920
Wed Oct 02 16:33:06 2013
DBW0 started with pid=10, OS id=14922
Wed Oct 02 16:33:06 2013
LGWR started with pid=11, OS id=14924
Wed Oct 02 16:33:06 2013
CKPT started with pid=12, OS id=14926
Wed Oct 02 16:33:06 2013
SMON started with pid=13, OS id=14928
Wed Oct 02 16:33:06 2013
RECO started with pid=14, OS id=14930
Wed Oct 02 16:33:06 2013
MMON started with pid=15, OS id=14932
Wed Oct 02 16:33:06 2013
MMNL started with pid=16, OS id=14934
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
starting up 1 shared server(s) ...
ORACLE_BASE from environment = /u01/app/oracle
二、啓動Oracle DB 實例:MOUNT
數據庫裝載過程包括執行如下任務:
• 將數據庫與之前啓動的實例關聯
•
定位並打開參數文件中指定的控制文件
• 經過讀取控制文件來獲取數據文件和聯機重作日誌文件的名稱和狀態(可是,此時不會執行檢查來驗證是否存在數據文件和聯機重作日誌文件)。
要執行特定的維護操做,則啓動實例,而後裝載數據庫,但不打開該數據庫。
例如,在執行如下任務期間必須裝載數據庫,但不得打開數據庫:
• 重命名數據文件(打開數據庫時可重命名脫機表空間的數據文件)。
• 啓用和禁用聯機重作日誌文件歸檔選項
• 執行完整的數據庫恢復
注:即便發出了OPEN請求,數據庫仍可能處於MOUNT模式下。這是由於可能須要以某種方式恢復數據庫。若是在MOUNT狀態下執行恢復,將打開重作日誌進行讀取,並打開數據文件讀取須要恢復的塊,以及在恢復期間根據須要寫入塊。
命令:
ys@TEST0924> alter database mount;
Database altered.
alert_test0924.log日誌查看:
ed Oct 02 16:34:21 2013
alter database mount
Wed Oct 02 16:34:25 2013
Successful mount of redo thread 1, with mount id 2721621517
Database mounted in Exclusive Mode
Lost write protection disabled
Completed: alter database mount
三、啓動Oracle DB 實例:OPEN
數據庫操做正常意味着
實例已啓動、數據庫已裝載且已打開。在數據庫操做正常時,任何有效用戶均可鏈接到數據庫,並且可執行典型數據訪問操做。
打開數據庫過程包括執行如下任務:
• 打開數據文件
• 打開聯機重作日誌文件
若是嘗試打開數據庫時任一數據文件或聯機重作日誌文件不存在,則Oracle 服務器返回錯誤。
在最後這個階段,Oracle 服務器會驗證是否能夠打開全部數據文件和聯機重作日誌文件,還會檢查數據庫的一致性。若有必要,系統監視器(SMON) 後臺進程將啓動實例恢復。能夠在受限模式下啓動數據庫實例,以便只讓有管理權限的用戶使用該實例。要在受限模式下啓動實例,可在「Advanced Startup Options(高級啓動選項)」頁上選擇「Restrict access to database(限制對數據庫的訪問)」選項。
或者在啓動Open模式時,添加restrict關鍵字:startup restrict,
設置或取消受限狀態:alter system enable\disable restricted session;
命令:
sys@TEST0924> alter database open;
Database altered.
alert_test0924.log日誌查看:
Wed Oct 02 16:35:45 2013
alter database open
Wed Oct 02 16:35:45 2013
LGWR: STARTING ARCH PROCESSES
Wed Oct 02 16:35:45 2013
ARC0 started with pid=20, OS id=15283
ARC0: Archival started
LGWR: STARTING ARCH PROCESSES COMPLETE
ARC0: STARTING ARCH PROCESSES
Wed Oct 02 16:35:46 2013
ARC1 started with pid=21, OS id=15296
Wed Oct 02 16:35:46 2013
ARC2 started with pid=22, OS id=15298
Wed Oct 02 16:35:46 2013
ARC3 started with pid=23, OS id=15300
ARC1: Archival started
ARC2: Archival started
ARC2: Becoming the 'no FAL' ARCH
ARC2: Becoming the 'no SRL' ARCH
ARC1: Becoming the heartbeat ARCH
Thread 1 opened at log sequence 55
Current log# 1 seq# 55 mem# 0: /u01/app/oracle/oradata/test0924/redo01.log
Successful open of redo thread 1
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Wed Oct 02 16:35:46 2013
SMON: enabling cache recovery
[14939] Successfully onlined Undo Tablespace 5.
Undo initialization finished serial:0 start:627239824 end:627239864 diff:40 (0 seconds)
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
SMON: enabling tx recovery
Database Characterset is AL32UTF8
No Resource Manager plan active
Starting background process FBDA
Wed Oct 02 16:35:47 2013
FBDA started with pid=24, OS id=15302
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
Wed Oct 02 16:35:47 2013
QMNC started with pid=25, OS id=15304
Completed: alter database open
Wed Oct 02 16:35:47 2013
db_recovery_file_dest_size of 4122 MB is 48.29% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Wed Oct 02 16:35:47 2013
Starting background process CJQ0
Wed Oct 02 16:35:47 2013
CJQ0 started with pid=26, OS id=15318
ARC3: Archival started
ARC0: STARTING ARCH PROCESSES COMPLETE
四、啓動選項:示例
此幻燈片顯示用於啓動數據庫的SQL*Plus 語法。
1.startup:啓動實例,將數據庫文件與該實例關聯,而後裝載並打開數據庫。
2alter database nomount:啓動實例,但不裝載數據庫。
3.alter database mount:裝載處於NOMOUNT狀態的數據庫。
4alter database open :打開處於MOUNT狀態的數據庫。
來源:http://blog.csdn.net/rlhua/article/details/12237245