oracle下實(shí)現(xiàn)恢復(fù)一個(gè)丟失的數(shù)據(jù)文件的代碼
更新時(shí)間:2008年01月02日 19:11:24 作者:
oracle下實(shí)現(xiàn)恢復(fù)一個(gè)丟失的數(shù)據(jù)文件的代碼
如果您目前擁有一個(gè)冷備份,但是缺少了其中的一個(gè)數(shù)據(jù)文件,但你目前存在所有的歸檔,如果您要恢復(fù)數(shù)據(jù)文件,可以參考以下的示例:
[oracle@jumper eygle]$ sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Sun Aug 20 01:22:50 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.
Total System Global Area 252777592 bytes
Fixed Size 451704 bytes
Variable Size 134217728 bytes
Database Buffers 117440512 bytes
Redo Buffers 667648 bytes
Database mounted.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 3 - see DBWR trace file
ORA-01110: data file 3: '/opt/oracle/oradata/eygle/eygle02.dbf'
SQL> alter database create datafile 3 as '/opt/oracle/oradata/eygle/eygle02.dbf';
Database altered.
SQL> select name from v$datafile;
NAME
-------------------------------------------------------
/opt/oracle/oradata/eygle/system01.dbf
/opt/oracle/oradata/eygle/undotbs01.dbf
/opt/oracle/oradata/eygle/eygle02.dbf
/opt/oracle/oradata/eygle/eygle01.dbf
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01113: file 3 needs media recovery
ORA-01110: data file 3: '/opt/oracle/oradata/eygle/eygle02.dbf'
SQL> recover datafile 3;
Media recovery complete.
SQL> alter database open;
Database altered.
SQL>
復(fù)制代碼 代碼如下:
[oracle@jumper eygle]$ sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Sun Aug 20 01:22:50 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.
Total System Global Area 252777592 bytes
Fixed Size 451704 bytes
Variable Size 134217728 bytes
Database Buffers 117440512 bytes
Redo Buffers 667648 bytes
Database mounted.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 3 - see DBWR trace file
ORA-01110: data file 3: '/opt/oracle/oradata/eygle/eygle02.dbf'
SQL> alter database create datafile 3 as '/opt/oracle/oradata/eygle/eygle02.dbf';
Database altered.
SQL> select name from v$datafile;
NAME
-------------------------------------------------------
/opt/oracle/oradata/eygle/system01.dbf
/opt/oracle/oradata/eygle/undotbs01.dbf
/opt/oracle/oradata/eygle/eygle02.dbf
/opt/oracle/oradata/eygle/eygle01.dbf
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01113: file 3 needs media recovery
ORA-01110: data file 3: '/opt/oracle/oradata/eygle/eygle02.dbf'
SQL> recover datafile 3;
Media recovery complete.
SQL> alter database open;
Database altered.
SQL>
相關(guān)文章
淺談oracle rac和分布式數(shù)據(jù)庫(kù)的區(qū)別
這篇文章主要介紹了oracle rac和分布式數(shù)據(jù)庫(kù)的區(qū)別的相關(guān)內(nèi)容,小編覺(jué)得挺不錯(cuò)的,這里給大家分享下,需要的朋友可以參考。2017-10-10
巧妙解決Oracle NClob讀寫(xiě)問(wèn)題(經(jīng)驗(yàn)分享)
下面小編就為大家?guī)?lái)一篇巧妙解決Oracle NClob讀寫(xiě)問(wèn)題(經(jīng)驗(yàn)分享)。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2017-10-10
Oracle數(shù)據(jù)庫(kù)中使用正則表達(dá)式的超詳細(xì)教程
正則表達(dá)式是一種描述簡(jiǎn)單和復(fù)雜的搜索和處理模式的方法,下面這篇文章主要給大家介紹了關(guān)于Oracle數(shù)據(jù)庫(kù)中使用正則表達(dá)式的超詳細(xì)教程,文中通過(guò)代碼介紹的非常詳細(xì),需要的朋友可以參考下2024-08-08
Oracle通過(guò)遞歸查詢父子兄弟節(jié)點(diǎn)方法示例
這篇文章主要給大家介紹了關(guān)于Oracle如何通過(guò)遞歸查詢父子兄弟節(jié)點(diǎn)的相關(guān)資料,遞歸查詢對(duì)各位程序員來(lái)說(shuō)應(yīng)該都不陌生,文中通過(guò)示例代碼介紹的非常詳細(xì),需要的朋友可以參考借鑒,下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧。2018-01-01
Oracle表中重復(fù)數(shù)據(jù)去重的方法實(shí)例詳解
這篇文章主要介紹了Oracle表中重復(fù)數(shù)據(jù)去重的方法實(shí)例詳解的相關(guān)資料,需要的朋友可以參考下2017-07-07
oracle中的ID號(hào)實(shí)現(xiàn)自增長(zhǎng)的方法
這篇文章主要介紹了oracle中的ID號(hào)如何實(shí)現(xiàn)自增長(zhǎng),利用序列產(chǎn)生主鍵值,需要的朋友可以參考下2014-05-05

