Chinaunix首页 | 论坛 | 博客
  • 博客访问: 32673
  • 博文数量: 11
  • 博客积分: 490
  • 博客等级: 下士
  • 技术积分: 105
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-18 13:19
文章分类
文章存档

2008年(11)

我的朋友
最近访客

分类: Oracle

2008-04-18 13:33:51

   修復丟失的datafile

原因:因某些datafile(/THAWS_D01/cyms01.dbf)被誤刪了,導致DB無法啓動;

處理過程:

附註.. 被刪掉的 file 再也回不來了.. 只能先把 DB 開啟來.. 不見的部分再自己補建回去

1. 進去sqlplus

$ sqlplus /nolog

SQL>conn/as sysdba

SQL>startup;

出現錯誤信息:ORA-01081: cannot start already-running ORACLE - shut it down first

再用SQL語句查看DB的狀態:select status, instance_name from v$instance ;

 

2.再把DB shutown immediate

出現ORA-01109database not open

    Database dismounted.

ORACLE instance shut down.

 

3.然後再把DB startup;

   SQL> startup nomount數據庫啓動時只啓動實例,不安裝數據庫,不打開數據庫

結果:ORACLE instance started.

Total System Global Area  591396864 bytes

Fixed Size                  2074504 bytes

Variable Size             390072440 bytes

Database Buffers          192937984 bytes

Redo Buffers                6311936 bytes

3. SQL> alter database mount數據庫由不安裝數據庫改爲安裝數據庫;

SQL> alter database open ; 數據庫由不打開數據庫改爲打開數據庫;

結果:ERROR at line 1:

ORA-01157: cannot identify/lock data file 7 - see DBWR trace file

ORA-01110: data file 7: '/THAWS_D01/cyms01.dbf'

SQL> alter database datafile '/THAWS_D01/cyms01.dbf' offline drop ; 刪除Datafile(cyms01.dbf):

SQL> alter database datafile '/THAWS_D01/cyms01.dbf' offline drop ;

結果:Database altered.

5.SQL>alter database open ;再次打開數據庫;

SQLalter database open ;

結果:ERROR at line 1:

ORA-01157: cannot identify/lock data file 8 - see DBWR trace file

ORA-01110: data file 8: '/THAWS_D01/cyms_idx01.dbf'

SQL> alter database datafile  '/THAWS_D01/cyms_idx01.dbf' offline drop ; 刪除Datafile(cyms_idx01.dbf):

SQL> alter database datafile  '/THAWS_D01/cyms_idx01.dbf' offline drop ;

結果:Database altered.

7.SQL>alter database open ;再次打開數據庫;

SQL>alter database open ;

結果:Database altered.

8.正常 shutdown DB

SQLshutdown immediate ;

結果:Database closed.

Database dismounted.

ORACLE instance shut down.

9.正常start DB

SQLstartup;

SQL> startup;

結果:ORACLE instance started.

 

Total System Global Area  591396864 bytes

Fixed Size                  2074504 bytes

Variable Size             377489528 bytes

Database Buffers          205520896 bytes

Redo Buffers                6311936 bytes

Database mounted.

Database opened.

 

阅读(792) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:oracle資料庫備份與恢復

给主人留下些什么吧!~~