Oracle 例項啟動必須的引數分析(2010-05-06)
本文分析下,一個Oracle例項啟動至少需要幾個引數。
Oracle10g以後例項啟動預設的是spfile檔案,當沒有spfile檔案的時候才去使用pfile檔案。
現在我們來看pfile和spfile檔案丟失的情況下怎麼來重建。
1) alert*.log日誌中查詢啟動過的記錄;
2) vi pfile檔案,寫入一些最基本的引數來啟動資料,把庫先拉起來,再做調整;
舉例:
必須引數db_name
[oracle@dbserver dbs]$ more initlctx.ora
*.db_name='lctx'
SQL> startup pfile='/u01/app/oracle/ora10g/dbs/initlctx.ora';
ORACLE instance started.
Total System Global Area 113246208 bytes
Fixed Size 1218004 bytes
Variable Size 58722860 bytes
Database Buffers 50331648 bytes
Redo Buffers 2973696 bytes
ORA-00205: error in identifying control file, check alert log for more info
SQL>
分析:這個時候資料庫僅載入了記憶體,還沒有nomount成功。
必須引數control_files
[oracle@dbserver dbs]$ more initlctx.ora
*.db_name='lctx'
*.control_files='/u01/app/oracle/oradata/lctx/control01.ctl','/u01/app/oracle/oradata/lctx/control02.ctl','/u01/app/oracle/oradata/l
ctx/control03.ctl'
[oracle@dbserver dbs]$ [oracle@dbserver dbs]$
SQL> startup pfile='/u01/app/oracle/ora10g/dbs/initlctx.ora';
ORACLE instance started.
Total System Global Area 113246208 bytes
Fixed Size 1218004 bytes
Variable Size 58722860 bytes
Database Buffers 50331648 bytes
Redo Buffers 2973696 bytes
ORA-00201: control file version 10.2.0.1.0 incompatible with ORACLE version
10.2.0.0.0
ORA-00202: control file: '/u01/app/oracle/oradata/lctx/control01.ctl'
分析:incompatible引數是必須的,沒有nomount成功,說明引數檔案有問題。
必須引數 incompatible
[oracle@dbserver dbs]$ more initlctx.ora
*.db_name='lctx'
*.control_files='/u01/app/oracle/oradata/lctx/control01.ctl','/u01/app/oracle/oradata/lctx/control02.ctl','/u01/app/oracle/oradata/l
ctx/control03.ctl'
*.compatible='10.2.0.1.0'
[oracle@dbserver dbs]$
SQL> startup pfile='/u01/app/oracle/ora10g/dbs/initlctx.ora';
ORACLE instance started.
Total System Global Area 113246208 bytes
Fixed Size 1218004 bytes
Variable Size 58722860 bytes
Database Buffers 50331648 bytes
Redo Buffers 2973696 bytes
Database mounted.
ORA-01092: ORACLE instance terminated. Disconnection forced
SQL>
分析:資料庫例項被中斷,這個時候作業系統已經沒有了ora程式;
SQL> conn / as sysdba;
Connected to an idle instance.
SQL> startup nomount pfile='/u01/app/oracle/ora10g/dbs/initlctx.ora';
ORACLE instance started.
Total System Global Area 113246208 bytes
Fixed Size 1218004 bytes
Variable Size 58722860 bytes
Database Buffers 50331648 bytes
Redo Buffers 2973696 bytes
SQL>
SQL> alter database mount;
Database altered.
SQL>
SQL> select open_mode from v$database;
OPEN_MODE
----------
MOUNTED
SQL>
分析:可見如果只是讓oracle例項掛載到mount狀態下,只需要以上三個引數就夠了!
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
分析:
Thu May 6 02:44:22 2010
alter database open
Thu May 6 02:44:22 2010
Beginning crash recovery of 1 threads
Thu May 6 02:44:22 2010
Started redo scan
Thu May 6 02:44:22 2010
Completed redo scan
3 redo blocks read, 5 data blocks need recovery
Thu May 6 02:44:22 2010
Started redo application at
Thread 1: logseq 50, block 3
Thu May 6 02:44:22 2010
Recovery of Online Redo Log: Thread 1 Group 1 Seq 50 Reading mem 0
Mem# 0 errs 0: /u01/app/oracle/oradata/lctx/redo01.log
Mem# 1 errs 0: /u01/app/oracle/oradata/lctx/redo01_2.log
Thu May 6 02:44:22 2010
Completed redo application
Thu May 6 02:44:22 2010
Completed crash recovery at
Thread 1: logseq 50, block 6, scn 1478656
5 data blocks read, 5 data blocks written, 3 redo blocks read
Thu May 6 02:44:22 2010
LGWR: STARTING ARCH PROCESSES
ARC0 started with pid=13, OS id=2028
Thu May 6 02:44:22 2010
ARC0: Archival started
ARC1: Archival started
LGWR: STARTING ARCH PROCESSES COMPLETE
ARC1 started with pid=14, OS id=2030
Thu May 6 02:44:22 2010
Thread 1 advanced to log sequence 51
Thu May 6 02:44:22 2010
ARC0: STARTING ARCH PROCESSES
Thu May 6 02:44:22 2010
Thread 1 opened at log sequence 51
Current log# 3 seq# 51 mem# 0: /u01/app/oracle/oradata/lctx/redo03.log
Successful open of redo thread 1
Thu May 6 02:44:22 2010
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Thu May 6 02:44:22 2010
SMON: enabling cache recovery
SMON: enabling tx recovery
Thu May 6 02:44:23 2010
ARC1: Becoming the 'no FAL' ARCH
ARC1: Becoming the 'no SRL' ARCH
Thu May 6 02:44:23 2010
Database Characterset is ZHS16GBK
Thu May 6 02:44:23 2010
ARC2: Archival started
ARC0: STARTING ARCH PROCESSES COMPLETE
ARC0: Becoming the heartbeat ARCH
ARC2 started with pid=15, OS id=2032
Thu May 6 02:44:23 2010
Errors in file /u01/app/oracle/admin/lctx/udump/lctx_ora_2023.trc:
ORA-04031: unable to allocate 4116 bytes of shared memory ("shared pool","select i.obj#,i.ts#,i.file#,...","Typecheck","seg:kggfaAllocSeg")
Thu May 6 02:44:23 2010
Error 4031 happened during db open, shutting down database
USER: terminating instance due to error 4031
Instance terminated by USER, pid = 2023
ORA-1092 signalled during: alter database open...
必須引數
shared_pool_size=67108864
db_cache_size=88080384
[oracle@dbserver dbs]$ cat initlctx.ora
db_name='lctx'
control_files='/u01/app/oracle/oradata/lctx/control01.ctl','/u01/app/oracle/oradata/lctx/control02.ctl','/u01/app/oracle/oradata/lctx/control03.ctl'
compatible='10.2.0.1.0'
shared_pool_size=67108864
db_cache_size=88080384
SQL> startup mount pfile='/u01/app/oracle/ora10g/dbs/initlctx.ora';
ORACLE instance started.
Total System Global Area 184549376 bytes
Fixed Size 1218412 bytes
Variable Size 92276884 bytes
Database Buffers 88080384 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> alter database open;
Database altered.
SQL>
SQL> show parameter dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest string /u01/app/oracle/admin/lctx/adump
background_dump_dest string /u01/app/oracle/admin/lctx/bdump
core_dump_dest string /u01/app/oracle/admin/lctx/cdump
user_dump_dest string /u01/app/oracle/admin/lctx/udump
….
說明:以上幾個dump檔案預設位置$ORACLE_BASE/admin/$DB_NAME/*dump 如果預設有這幾個目錄可以不設定,但是如果沒有,啟動會報錯。、
如:
SQL> startup mount pfile='/u01/app/oracle/ora10g/dbs/initlctx.ora';
ORA-09925: Unable to create audit trail file
Linux Error: 2: No such file or directory
Additional information: 9925
總結:Oracle例項啟動必須的引數如下:
db_name=
control_files=
incompatible=
shared_pool_size=
db_cache_size=
audit_file_dest=
background_dump_dest
core_dump_dest=
user_dump_dest=
除了以上引數,還有些預設引數,如果資料庫例項不是使用預設引數,需要自行設定,具體可以參考以前的alert.log記錄!
[@more@]來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/60144/viewspace-1033420/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle啟動例項時使用引數檔案的順序Oracle
- 啟動oracle例項最少引數Oracle
- Oracle資料庫例項啟動步驟分析Oracle資料庫
- Retrofit 動態引數(非固定引數、非必須引數)(Get、Post請求)
- 一次修改系統引數導至ORACLE無法啟動例項的故障Oracle
- oracle 11G引數檔案之伺服器引數檔案(spfile)與例項啟動的關係Oracle伺服器
- 2 Day DBA-管理Oracle例項-關閉和啟動Oracle例項-使用OEMDC關閉和啟動Oracle例項Oracle
- Oracle例項的啟動和關閉Oracle
- 自動重新啟動oracle例項 for windowsOracleWindows
- 2 Day DBA-管理Oracle例項-關於例項的啟動和關閉-關於例項啟動Oracle
- Oracle建完庫後必須先設好的三個引數Oracle
- oracle多個例項啟動方法Oracle
- ORACLE中帶引數、REF遊標及動態SQL例項OracleSQL
- python呼叫方法必須例項化麼Python
- nginx url必須攜帶引數判定Nginx
- Oracle 11g RAC的ASM例項記憶體引數被修改導致無法啟動OracleASM記憶體
- 可變引數例項
- windows下啟動服務時不啟動oracle例項WindowsOracle
- mysqld或mysqld_safe啟動時必須放在第一位的引數(first argument)MySql
- ts中如何限制方法傳入的引數data必須是陣列,且為偶數項?陣列
- Golang中命名引數的高階使用技巧與例項分析Golang
- oracle例項啟動異常慢案例一Oracle
- oracle 例項啟動和關閉解讀Oracle
- Oracle單例項+ASM啟動與關閉Oracle單例ASM
- 求助:windows啟動時卡住,必須重啟……(轉)Windows
- Oracle 資料庫引數改善例項 - PDM8Oracle資料庫
- Oracle 啟動例程 STARTUP引數說明Oracle
- Oracle Restart啟動資料庫例項故障一例OracleREST資料庫
- 使用SRVCTL啟動例項與使用sqlplus啟動例項的區別SQL
- oracle 10203啟動例項報警Oracle
- Windows下Oracle 11gR2例項啟動WindowsOracle
- 2 Day DBA-管理Oracle例項-關於例項的啟動和關閉-關於例項關閉Oracle
- Window中Oracle服務啟動時並不啟動例項的兩種方法Oracle
- Eclipse 的啟動引數Eclipse
- 2 Day DBA-管理Oracle例項-關於例項的啟動和關閉-管理啟動和關閉許可權Oracle
- Oracle 資料庫例項啟動關閉過程Oracle資料庫
- Oracle11g RAC在例項關閉後自動在啟動例項上歸檔Oracle
- 【02】Oracle資料庫的例項啟動關閉詳解Oracle資料庫