archivelog下不需要热备也能完全恢复损坏或者被删除的datafile(原创)

来源:互联网 发布:nx软件下载 编辑:程序博客网 时间:2024/05/22 13:57
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

prerequisite:被删除的表空间创建时开始,一直在archivelog模式下

恢复具体操作如下:
SQL>archiveloglist;
Databaselogmode             ArchiveMode
Automaticarchival            Enabled
Archivedestination           F:/oracle/ora92/RDBMS
Oldestonlinelogsequence    23
Nextlogsequencetoarchive  25
Currentlogsequence          25

SQL>altertablespacebackuptestoffline;
altertablespacebackuptestoffline
*
ERRORatline1:
ORA-01109:databasenotopen


SQL>alterdatabasedatafile'f:/backup.dbf'offline;

Databasealtered.

SQL>alterdatabaseopen;

Databasealtered.

SQL>altertablespacebackuptestofflineimmediate;

Tablespacealtered.

SQL>select*fromv$recover_file;

    FILE#ONLINE ONLINE_ERROR                                                               CHANGE#TIME
------------------------------------------------------------------------------------------------------------
       11OFFLINEOFFLINEFILENOTFOUND                                                            0

SQL>alterdatabasecreatedatafile'f:/backup.dbf'as'f:/backup.dbf';

Databasealtered.

SQL>select*fromv$recover_file;

    FILE#ONLINE ONLINE_ERROR                                                               CHANGE#TIME
------------------------------------------------------------------------------------------------------------
       11OFFLINEOFFLINE                                                                     307470603-NOV-041<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
原创粉丝点击