今天測試部門的人叫我過去,說是數(shù)據(jù)庫當(dāng)了,起不來了。
我過去看了看情況,做了如下操作
SQL
> shutdown immediate
數(shù)據(jù)庫已經(jīng)關(guān)閉。
已經(jīng)卸載數(shù)據(jù)庫。
Oracle 例程已經(jīng)關(guān)閉。
SQL
> startup
ORACLE 例程已經(jīng)啟動(dòng)。
Total System Global Area 135338868 bytes
Fixed Size 4534Array2 bytes
Variable Size 10Array051Array04 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
數(shù)據(jù)庫裝載完畢。
ORA-010Array2: ORACLE 例程終止。強(qiáng)行斷開連接
表面上看不出問題,我查看alert_oracas.log文件
SYS auditing is disabled
Starting up ORACLE RDBMS Version: Array.2.0.1.0.
System parameters with non-default values:
processes = 150
timed_statistics = TRUE
shared_pool_size = 50331648
bitsCN.nET中國網(wǎng)管博客
large_pool_size = 8388608
Java_pool_size = 33554432
control_files = f:\oracle\oradata\oracas\CONTROL01.CTL, f:\oracle\oradata\oracas\CONTROL02.CTL, f:\oracle\oradata\oracas\CONTROL03.CTL
db_block_size = 81Array2
db_cache_size = 25165824
compatible = Array.2.0.0.0
db_file_multiblock_read_count= 16
fast_start_mttr_target = 300
undo_management = AUTO
undo_tablespace = UNDOSTB1
undo_retention = 10800
remote_login_passwordfile= EXCLUSIVE
db_domain =
instance_name = oracas
dispatchers = (PROTOCOL=TCP) (SERVICE=oracasXDB)
job_queue_processes = 10
hash_join_enabled = TRUE
background_dump_dest = f:\oracle\admin\oracas\bdump
user_dump_dest = f:\oracle\admin\oracas\udump
core_dump_dest = f:\oracle\admin\oracas\cdump
bitsCN.Com
sort_area_size = 524288
db_name = oracas
open_cursors = 300
star_transformation_enabled= FALSE
query_rewrite_enabled = FALSE
pga_aggregate_target = 1ArrayArray22Array44
aq_tm_processes = 1
PMON started with pid=2
DBW0 started with pid=3
LGWR started with pid=4
CKPT started with pid=5
SMON started with pid=6
RECO started with pid=7
CJQ0 started with pid=8
QMN0 started with pid=Array
Mon Apr 18 17:30:25 2005
starting up 1 shared server(s) ...
starting up 1 dispatcher(s) for network address ’(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))’...
Mon Apr 18 17:30:26 2005
ALTER DATABASE MOUNT
Mon Apr 18 17:30:30 2005
Successful mount of redo thread 1, with mount id 2424210674.
Mon Apr 18 17:30:30 2005
Database mounted in Exclusive Mode.
Completed: ALTER DATABASE MOUNT
Mon Apr 18 17:30:30 2005
中國網(wǎng)管聯(lián)盟
ALTER DATABASE OPEN
Mon Apr 18 17:30:32 2005
Thread 1 opened at log sequence 105
Current log# 2 seq# 105 mem# 0: F:\ORACLE\ORADATA\ORACAS\REDO02.LOG
Successful open of redo thread 1.
Mon Apr 18 17:30:32 2005
SMON: enabling cache recovery
Mon Apr 18 17:30:34 2005
Errors in file f:\oracle\admin\oracas\udump\oracas_ora_3404.trc:
ORA-30012: 撤消表空間 ’UNDOSTB1’ 不存在或類型不正確
Mon Apr 18 17:30:34 2005
Error 30012 happened during db open, shutting down database
USER: terminating instance due to error 30012
Mon Apr 18 17:30:35 2005
Errors in file f:\oracle\admin\oracas\bdump\oracas_smon_ArrayArray6.trc:
ORA-30012: undo tablespace ’’ does not exist or of wrong type
Mon Apr 18 17:30:35 2005
Errors in file f:\oracle\admin\oracas\bdump\oracas_pmon_3500.trc:
ORA-30012: undo tablespace ’’ does not exist or of wrong type
Instance terminated by USER, pid = 3404
ORA-10Array2 signalled during: ALTER DATABASE OPEN...
于是我查看了以下信息來確認(rèn)undo表空間的問題
SQL
> conn sys/sys@oracas as sysdba
已連接到空閑例程。
SQL
> startup mount
ORACLE 例程已經(jīng)啟動(dòng)。
Total System Global Area 135338868 bytes
Fixed Size 4534Array2 bytes
Variable Size 10Array051Array04 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
數(shù)據(jù)庫裝載完畢。
SQL
> select name from v$datafile;
NAME
------------------------------------------------------------------------
F:\ORACLE\ORADATA\ORACAS\SYSTEM01.DBF
F:\ORACLE\ORADATA\ORACAS\UNDOTBS01.DBF
F:\ORACLE\ORADATA\ORACAS\CWMLITE01.DBF
F:\ORACLE\ORADATA\ORACAS\DRSYS01.DBF
F:\ORACLE\ORADATA\ORACAS\EXAMPLE01.DBF
F:\ORACLE\ORADATA\ORACAS\INDX01.DBF
F:\ORACLE\ORADATA\ORACAS\ODM01.DBF
F:\ORACLE\ORADATA\ORACAS\TOOLS01.DBF
F:\ORACLE\ORADATA\ORACAS\USERS01.DBF
F:\ORACLE\ORADATA\ORACAS\XDB01.DBF
D:\ORADATA\ORACAS\TSCAS11.DBF
E:\ORADATA\ORACAS\TFCAS12.DBF
D:\ORADATA\ORACAS\TSCAS21.DBF
E:\ORADATA\ORACAS\TFCAS22.DBF
D:\ORADATA\ORACAS\TSCAS31.DBF
E:\ORADATA\ORACAS\TFCAS32.DBF
D:\ORADATA\ORACAS\TSCAS41.DBF
E:\ORADATA\ORACAS\TFCAS42.DBF
D:\ORADATA\ORACAS\TSCASINDX1.DBF
E:\ORADATA\ORACAS\TSCASINDX2.DBF
D:\ORADATA\ORACAS\TFCAS13.DBF
D:\ORADATA\ORACAS\TFCAS14.DBF
D:\ORADATA\ORACAS\TFCAS23.DBF
D:\ORADATA\ORACAS\TFCAS24.DBF
E:\ORADATA\ORACAS\TSCASINDX12.DBF
E:\ORADATA\ORACAS\TSCASINDX13.DBF
E:\ORADATA\ORACAS\TSCASINDX24.DBF
E:\ORADATA\ORACAS\TSCASINDX25.DBF
C:\SNAPSHOT01.DBF
C:\TSCAS1.DBF
已選擇30行。
SQL
> show parameter undo
中國網(wǎng)管聯(lián)盟
NAME TYPE VALUE
------------------------------------ ----------- -----------------------
undo_management string AUTO
undo_retention integer 10800
undo_suppress_errors boolean FALSE
undo_tablespace string UNDOSTB1
SQL
> select name from v$tablespace;
NAME
------------------------------
CWMLITE
DRSYS
EXAMPLE
INDX
ODM
SYSTEM
TOOLS
UNDOTBS1
USERS
XDB
TEMP
TSCAS1
TSCAS2
TSCAS3
TSCAS4
TSCASINDX1
TSCASINDX2
SNAPSHOT_TS
已選擇18行。
當(dāng)時(shí)沒有自己看問題,就以為是undo文件損壞了,決定重建。
注意:后來才發(fā)現(xiàn)這里以后的操作是饒了一個(gè)解決問題的彎路。
由于不open沒有辦法重新創(chuàng)建undo 表空間,所以決定先用系統(tǒng)默認(rèn)的undo表空間來啟動(dòng),然后重建undo
中國網(wǎng)管聯(lián)盟
表空間,具體操作如下:
SQL
> create pfile from spfile;
文件已創(chuàng)建。
修改pfile文件
#*.undo_management=’AUTO’
#*.undo_tablespace=’UNDOSTB1’
undo_management=manual
undo_tablespace=’system’
關(guān)閉數(shù)據(jù)庫,并且從目錄F:\oracle\oraArray2\database下去掉SPFILEORACAS.ORA文件
重新啟動(dòng)
SQL
> shutdown immediate
ORA-0110Array: 數(shù)據(jù)庫未打開
已經(jīng)卸載數(shù)據(jù)庫。
ORACLE 例程已經(jīng)關(guān)閉。
SQL
> startup mount
ORACLE 例程已經(jīng)啟動(dòng)。
Total System Global Area 135338868 bytes
Fixed Size 4534Array2 bytes
Variable Size 10Array051Array04 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
數(shù)據(jù)庫裝載完畢。
SQL
> alter database open;
數(shù)據(jù)庫已更改。
查看表空間信息
SQL
> show parameter undo
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string MANUAL
undo_retention integer 10800
undo_suppress_errors boolean FALSE
undo_tablespace string system
SQL
> select name from v$tablespace;
NAME
------------------------------
CWMLITE
DRSYS
EXAMPLE
INDX
ODM
SYSTEM
TOOLS
UNDOTBS1
USERS
XDB
TEMP
TSCAS1
TSCAS2
TSCAS3
TSCAS4
TSCASINDX1
TSCASINDX2
SNAPSHOT_TS
并且打開圖形界面查看,這時(shí)候才發(fā)現(xiàn)undo表空間的名字是UNDOTBS1
其實(shí)早就能發(fā)現(xiàn)的,大家以后分析問題一定不要太快下結(jié)論,要自己分析。。。
于是做以下操作改變undo 表空間的名字
SQL
> create spfile from pfile;
文件已創(chuàng)建。
SQL
> shutdown immediate
數(shù)據(jù)庫已經(jīng)關(guān)閉。
已經(jīng)卸載數(shù)據(jù)庫。
ORACLE 例程已經(jīng)關(guān)閉。
SQL
> startup
ORACLE 例程已經(jīng)啟動(dòng)。
Total System Global Area 135338868 bytes
Fixed Size 4534Array2 bytes
Variable Size 10Array051Array04 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
數(shù)據(jù)庫裝載完畢。
數(shù)據(jù)庫已經(jīng)打開。
SQL
> show parameter undo
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
bitscn.com
undo_management string MANUAL
undo_retention integer 10800
undo_suppress_errors boolean FALSE
undo_tablespace string system
SQL
> alter database set undo_management=auto;
alter database set undo_management=auto
*
ERROR 位于第 1 行:
ORA-02231: 缺少或無效的 ALTER DATABASE 選項(xiàng)
SQL
> alter database set undo_management=auto scope=spfile;
alter database set undo_management=auto scope=spfile
*
ERROR 位于第 1 行:
ORA-02231: 缺少或無效的 ALTER DATABASE 選項(xiàng)
SQL
> alter system set undo_management=auto scope=spfile;
系統(tǒng)已更改。
SQL
> alter system set undo_tablespace=’undotbs1’ scope=spfile;
中國網(wǎng)管論壇
重啟驗(yàn)證:
SQL
> shutdown immediate
數(shù)據(jù)庫已經(jīng)關(guān)閉。
已經(jīng)卸載數(shù)據(jù)庫。
ORACLE 例程已經(jīng)關(guān)閉。
SQL
> startup
ORACLE 例程已經(jīng)啟動(dòng)。
Total System Global Area 135338868 bytes
Fixed Size 4534Array2 bytes
Variable Size 10Array051Array04 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
數(shù)據(jù)庫裝載完畢。
數(shù)據(jù)庫已經(jīng)打開。
SQL
> create fpile from spfile;
create fpile from spfile
*
ERROR 位于第 1 行:
ORA-00Array01: 無效 CREATE 命令
SQL
> create pfile from spfile;
文件已創(chuàng)建。
SQL
> show parameter undo
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string AUTO
undo_retention integer 10800
undo_suppress_errors boolean FALSE
undo_tablespace string undotbs1
發(fā)現(xiàn)已經(jīng)好使了
教訓(xùn)總結(jié):其實(shí)只要一開始分析下v$tablespace就能發(fā)現(xiàn)是undo表空間的名字錯(cuò)了,很快就能解決的。
不過我上面這種方法可以用于undo表空間文件corrupt的情況:)
?
?
原文出自:http://www.sudu.cn/info/html/edu/20051203/216446.html
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061
微信掃一掃加我為好友
QQ號(hào)聯(lián)系: 360901061
您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元

