1. 程式人生 > >ORA-01157 和 ORA-01110錯誤

ORA-01157 和 ORA-01110錯誤

ORA-01157 cannot identify datafile name - file not found

Cause The background process was not able to find one of the datafiles. The database will prohibit access to this file but other files will be unaffected. However, the first instance to open the database will need to access all online datafiles. Accompanying messages from the operating system will describe why the file was not found.
Action Make the file available to the database. Then either open the database or do ALTER SYSTEM CHECK datafiles. See also your operating system-specific Oracle documentation.

錯誤:

在啟動資料庫時出現ORA-01157,ORA-01110或作業系統級錯誤例如ORA-07360,

在關閉資料庫(使用shutdown normal或shutdown immediate) 時將導致錯誤ORA

-01116,ORA-01110以及作業系統級錯誤ORA-07368

解決:

以下有兩種解決方案:

1.使用者的表空間可以被輕易地重建

即最近匯出的物件是可用的或表空間中的物件可以被輕易地重建等.在

這種情況下,最簡單的方法是offline並刪除該資料檔案,刪除表空間並

重建表空間以及所有的物件.

svrmgrl> startup mount

svrmgrl> alter database datafile filename offline drop;

svrmgrl> alter database open;

svrmgrl> drop tablespace tablespace_name including contents;

重建表空間及所有物件.

2.使用者的表空間不能夠被輕易地重建

在大多數情況下,重建表空間是不可能及太辛苦的工作.方法是倒備份及做介

質恢復.如果您的系統執行在NOARCHIVELOG模式下,則只有丟失的資料

在online redo log中方可被恢復。

步驟如下:

1)Restore the lost datafile from a backup

2)svrmgrl> startup mount

3)svrmgrl> select v1.group#,member,sequence#,first_change#

> from v$log v1,v$logfile v2

> where v1.group#=v2.group#;

4)如果資料庫執行在NOARCHIVELOG模式下則:

svrmgrl> select file#,change# from v$recover_file;

如果 CHANGE# 大於最小的FIRST_CHANGE#則資料檔案可以被恢復。

如果 CHANGE# 小於最小的FIRST_CHANGE#則資料檔案不可恢復。 恢復最近一

次的全備份或採用方案一.

5)svrmgrl> recover datafile filename;

6)確認恢復成功

7)svrmgrl> alter database open resetlogs;

3.只讀表空間無需做介質恢復,只要將備份恢復即可.唯一的例外是:

表空間在最後一次備份後被改為read-write 模式

表空間在最後一次備份後被改為read-only 模式

在這種情況下,均需進行介質恢復