问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

Oracle怎样恢复删除的表空间

发布网友 发布时间:2022-05-02 23:36

我来回答

2个回答

懂视网 时间:2022-05-03 03:57

to_date( ‘2019-08-26 13:50:38‘, ‘yyyy-mm-dd hh24:mi:ss‘)" auxiliary destination ‘/tmp/aux‘; Starting recover at 26-AUG-19 using channel ORA_DISK_1 RMAN-05026: WARNING: presuming following set of tablespaces applies to specified point-in-time List of tablespaces expected to have UNDO segments Tablespace SYSTEM Tablespace UNDOTBS1 Creating automatic instance, with SID=‘qBcb‘ initialization parameters used for automatic instance: db_name=OCM1 db_unique_name=qBcb_tspitr_OCM1 compatible=11.2.0.0.0 db_block_size=8192 db_files=200 sga_target=280M processes=50 db_create_file_dest=/tmp/aux log_archive_dest_1=‘location=/tmp/aux‘ #No auxiliary parameter file used starting up automatic instance OCM1 Oracle instance started Total System Global Area 292278272 bytes Fixed Size 2212736 bytes Variable Size 100666496 bytes Database Buffers 184549376 bytes Redo Buffers 4849664 bytes Automatic instance created Running TRANSPORT_SET_CHECK on recovery set tablespaces TRANSPORT_SET_CHECK completed successfully contents of Memory Script: { # set requested point in time set until time "to_date( ‘2019-08-26 13:50:38‘, ‘yyyy-mm-dd hh24:mi:ss‘)"; # restore the controlfile restore clone controlfile; # mount the controlfile sql clone ‘alter database mount clone database‘; # archive current online log sql ‘alter system archive log current‘; # avoid unnecessary autobackups for structural changes during TSPITR sql ‘begin dbms_backup_restore.AutoBackupFlag(FALSE); end;‘; } executing Memory Script executing command: SET until clause Starting restore at 26-AUG-19 allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: SID=17 device type=DISK channel ORA_AUX_DISK_1: starting datafile backup set restore channel ORA_AUX_DISK_1: restoring control file channel ORA_AUX_DISK_1: reading from backup piece /oracle/app/oracle/flash_recovery_area/OCM1/autobackup/2019_08_26/o1_mf_s_1017323428_gp6ws4qq_.bkp channel ORA_AUX_DISK_1: piece handle=/oracle/app/oracle/flash_recovery_area/OCM1/autobackup/2019_08_26/o1_mf_s_1017323428_gp6ws4qq_.bkp tag=TAG20190826T135028 --这里是从flash_recovery_area中读取的备份数据,在测试此项目时,若关闭flash_recovery_area时,会报取不到备份的问题,后来又打开此功能才不报错,这里需要特殊注意下。 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01 output file name=/tmp/aux/OCM1/controlfile/o1_mf_gp6x7ckg_.ctl Finished restore at 26-AUG-19 sql statement: alter database mount clone database sql statement: alter system archive log current sql statement: begin dbms_backup_restore.AutoBackupFlag(FALSE); end; contents of Memory Script: { # set requested point in time set until time "to_date( ‘2019-08-26 13:50:38‘, ‘yyyy-mm-dd hh24:mi:ss‘)"; plsql <<<-- tspitr_2 declare sqlstatement varchar2(512); offline_not_needed exception; pragma exception_init(offline_not_needed, -01539); begin sqlstatement := ‘alter tablespace ‘|| ‘TBS_TSPITR1‘ ||‘ offline immediate‘; krmicd.writeMsg(6162, sqlstatement); krmicd.execSql(sqlstatement); exception when offline_not_needed then null; end; >>>; plsql <<<-- tspitr_2 declare sqlstatement varchar2(512); offline_not_needed exception; pragma exception_init(offline_not_needed, -01539); begin sqlstatement := ‘alter tablespace ‘|| ‘TBS_TSPITR2‘ ||‘ offline immediate‘; krmicd.writeMsg(6162, sqlstatement); krmicd.execSql(sqlstatement); exception when offline_not_needed then null; end; >>>; # set destinations for recovery set and auxiliary set datafiles set newname for clone datafile 1 to new; set newname for clone datafile 3 to new; set newname for clone datafile 2 to new; set newname for clone tempfile 1 to new; set newname for datafile 5 to "/oracle/app/oracle/oradata/tbs_tspitr1.dbf"; set newname for datafile 6 to "/oracle/app/oracle/oradata/tbs_tspitr2.dbf"; # switch all tempfiles switch clone tempfile all; # restore the tablespaces in the recovery set and the auxiliary set restore clone datafile 1, 3, 2, 5, 6; switch clone datafile all; } executing Memory Script executing command: SET until clause sql statement: alter tablespace TBS_TSPITR1 offline immediate sql statement: alter tablespace TBS_TSPITR2 offline immediate executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME renamed tempfile 1 to /tmp/aux/OCM1/datafile/o1_mf_temp_%u_.tmp in control file Starting restore at 26-AUG-19 using channel ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: starting datafile backup set restore channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set channel ORA_AUX_DISK_1: restoring datafile 00001 to /tmp/aux/OCM1/datafile/o1_mf_system_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00003 to /tmp/aux/OCM1/datafile/o1_mf_undotbs1_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00002 to /tmp/aux/OCM1/datafile/o1_mf_sysaux_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00005 to /oracle/app/oracle/oradata/tbs_tspitr1.dbf channel ORA_AUX_DISK_1: restoring datafile 00006 to /oracle/app/oracle/oradata/tbs_tspitr2.dbf channel ORA_AUX_DISK_1: reading from backup piece /tmp/tempbak/db_OCM1_full_02ua67rv_1_1 channel ORA_AUX_DISK_1: piece handle=/tmp/tempbak/db_OCM1_full_02ua67rv_1_1 tag=TAG20190826T134951 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:35 Finished restore at 26-AUG-19 datafile 1 switched to datafile copy input datafile copy RECID=4 STAMP=1017323925 file name=/tmp/aux/OCM1/datafile/o1_mf_system_gp6x7krl_.dbf datafile 3 switched to datafile copy input datafile copy RECID=5 STAMP=1017323925 file name=/tmp/aux/OCM1/datafile/o1_mf_undotbs1_gp6x7ks5_.dbf datafile 2 switched to datafile copy input datafile copy RECID=6 STAMP=1017323925 file name=/tmp/aux/OCM1/datafile/o1_mf_sysaux_gp6x7ks2_.dbf contents of Memory Script: { # set requested point in time set until time "to_date( ‘2019-08-26 13:50:38‘, ‘yyyy-mm-dd hh24:mi:ss‘)"; # online the datafiles restored or switched sql clone "alter database datafile 1 online"; sql clone "alter database datafile 3 online"; sql clone "alter database datafile 2 online"; sql clone "alter database datafile 5 online"; sql clone "alter database datafile 6 online"; # recover and open resetlogs recover clone database tablespace "TBS_TSPITR1", "TBS_TSPITR2", "SYSTEM", "UNDOTBS1", "SYSAUX" delete archivelog; alter clone database open resetlogs; } executing Memory Script executing command: SET until clause sql statement: alter database datafile 1 online sql statement: alter database datafile 3 online sql statement: alter database datafile 2 online sql statement: alter database datafile 5 online sql statement: alter database datafile 6 online Starting recover at 26-AUG-19 using channel ORA_AUX_DISK_1 starting media recovery archived log for thread 1 with sequence 50 is already on disk as file /oracle/app/oracle/flash_recovery_area/OCM1/archivelog/2019_08_26/o1_mf_1_50_gp6ws2pg_.arc archived log for thread 1 with sequence 51 is already on disk as file /oracle/app/oracle/flash_recovery_area/OCM1/archivelog/2019_08_26/o1_mf_1_51_gp6x7jz7_.arc archived log file name=/oracle/app/oracle/flash_recovery_area/OCM1/archivelog/2019_08_26/o1_mf_1_50_gp6ws2pg_.arc thread=1 sequence=50 archived log file name=/oracle/app/oracle/flash_recovery_area/OCM1/archivelog/2019_08_26/o1_mf_1_51_gp6x7jz7_.arc thread=1 sequence=51 media recovery complete, elapsed time: 00:00:01 Finished recover at 26-AUG-19 database opened contents of Memory Script: { # make read only the tablespace that will be exported sql clone ‘alter tablespace TBS_TSPITR1 read only‘; sql clone ‘alter tablespace TBS_TSPITR2 read only‘; # create directory for datapump import sql "create or replace directory TSPITR_DIROBJ_DPDIR as ‘‘ /tmp/aux‘‘"; # create directory for datapump export sql clone "create or replace directory TSPITR_DIROBJ_DPDIR as ‘‘ /tmp/aux‘‘"; } executing Memory Script sql statement: alter tablespace TBS_TSPITR1 read only sql statement: alter tablespace TBS_TSPITR2 read only sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ‘‘/tmp/aux‘‘ sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ‘‘/tmp/aux‘‘ Performing export of metadata... EXPDP> Starting "SYS"."TSPITR_EXP_qBcb": EXPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE EXPDP> Processing object type TRANSPORTABLE_EXPORT/INDEX EXPDP> Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT EXPDP> Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS EXPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK EXPDP> Master table "SYS"."TSPITR_EXP_qBcb" successfully loaded/unloaded EXPDP> ****************************************************************************** EXPDP> Dump file set for SYS.TSPITR_EXP_qBcb is: EXPDP> /tmp/aux/tspitr_qBcb_14246.dmp EXPDP> ****************************************************************************** EXPDP> Datafiles required for transportable tablespace TBS_TSPITR1: EXPDP> /oracle/app/oracle/oradata/tbs_tspitr1.dbf EXPDP> Datafiles required for transportable tablespace TBS_TSPITR2: EXPDP> /oracle/app/oracle/oradata/tbs_tspitr2.dbf EXPDP> Job "SYS"."TSPITR_EXP_qBcb" successfully completed at 13:59:27 Export completed contents of Memory Script: { # shutdown clone before import shutdown clone immediate # drop target tablespaces before importing them back sql ‘drop tablespace TBS_TSPITR1 including contents keep datafiles‘; sql ‘drop tablespace TBS_TSPITR2 including contents keep datafiles‘; } executing Memory Script database closed database dismounted Oracle instance shut down sql statement: drop tablespace TBS_TSPITR1 including contents keep datafiles sql statement: drop tablespace TBS_TSPITR2 including contents keep datafiles Performing import of metadata... IMPDP> Master table "SYS"."TSPITR_IMP_qBcb" successfully loaded/unloaded IMPDP> Starting "SYS"."TSPITR_IMP_qBcb": IMPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK IMPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE IMPDP> Processing object type TRANSPORTABLE_EXPORT/INDEX IMPDP> Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT IMPDP> Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS IMPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK IMPDP> Job "SYS"."TSPITR_IMP_qBcb" successfully completed at 13:59:45 Import completed contents of Memory Script: { # make read write and offline the imported tablespaces sql ‘alter tablespace TBS_TSPITR1 read write‘; sql ‘alter tablespace TBS_TSPITR1 offline‘; sql ‘alter tablespace TBS_TSPITR2 read write‘; sql ‘alter tablespace TBS_TSPITR2 offline‘; # enable autobackups after TSPITR is finished sql ‘begin dbms_backup_restore.AutoBackupFlag(TRUE); end;‘; } executing Memory Script sql statement: alter tablespace TBS_TSPITR1 read write sql statement: alter tablespace TBS_TSPITR1 offline sql statement: alter tablespace TBS_TSPITR2 read write sql statement: alter tablespace TBS_TSPITR2 offline sql statement: begin dbms_backup_restore.AutoBackupFlag(TRUE); end; Removing automatic instance Automatic instance removed auxiliary instance file /tmp/aux/OCM1/datafile/o1_mf_temp_gp6x8w38_.tmp deleted auxiliary instance file /tmp/aux/OCM1/onlinelog/o1_mf_3_gp6x8smg_.log deleted auxiliary instance file /tmp/aux/OCM1/onlinelog/o1_mf_2_gp6x8r2j_.log deleted auxiliary instance file /tmp/aux/OCM1/onlinelog/o1_mf_1_gp6x8pfr_.log deleted auxiliary instance file /tmp/aux/OCM1/datafile/o1_mf_sysaux_gp6x7ks2_.dbf deleted auxiliary instance file /tmp/aux/OCM1/datafile/o1_mf_undotbs1_gp6x7ks5_.dbf deleted auxiliary instance file /tmp/aux/OCM1/datafile/o1_mf_system_gp6x7krl_.dbf deleted auxiliary instance file /tmp/aux/OCM1/controlfile/o1_mf_gp6x7ckg_.ctl deleted Finished recover at 26-AUG-19 RMAN>    参考于:https://blog.csdn.net/leshami/article/details/70670220

 

oracle基于表空间的恢复

标签:sse   time   constrain   create   read   during   csdn   undo   byte   

热心网友 时间:2022-05-03 01:05

Oracle怎样恢复删除的表空间
PRM-DUL 可以直接从Oracle .DBF数据文件中抽取出表的数据。

Oracle DBA神器:PRM灾难恢复工具,Schema级别数据恢复。PRM For Oracle Database – schema级别oracle数据库数据恢复特性 ,PRM即ParnassusData Recovery Manager是企业级别Oracle数据库灾难恢复工具。PRM可以在无备份的情况下恢复被truncated掉的表,也可以恢复无法打开的Oracle数据库(Alter Database Open失败)中的数据。
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
水利水电工程单元工程施工质量验收评定标准——土石方工程(SL 631... 关于水利水电工程项目划分的规程有哪些?划分的越细越好,感谢大家的帮 ... 水利水电工程的单位工程包括哪些工程? 尖子生学案:生物高中选修3目录 U盘传了数据怎么删除电脑记录如何清除电脑上U盘使用记录 把u盘插电脑怎么删掉记忆如何删掉电脑上插过U盘的记录 win7清除u盘记录 如何清理win7电脑u盘痕迹如何清除电脑上U盘使用记录 麦当劳和华莱士的外卖电话是什么? 一文详解ISO/IEC20000信息技术服务管理体系认证好处、材料、流程 苹果手机和平板的处理器(什么A4 A5 A6之类)是苹果自己研发、生产的吗 如何远程家里的电脑 潘迎紫版片头曲的歌词是什么? 平板现在最好的处理器是什么? 如果给武则天写一篇碑文,你会怎么写? 诸子百家的创始人都是谁? 君子文化创始人是谁? 《一代女皇》歌词的解释! 吴越文化创始人谁? 气宇非凡是慧根,唐朝女皇武则天什么歌 平板电脑的CPU,GPU都指什么? 大唐女皇武则天是什么歌名 陈正松文化创始人是? 朝鲜文化创始人是谁?汉武帝是如何征服他的? 中国传统文化中道家和儒家的创始人(代表人物)是谁 儒家文化创始人 笑果文化的创始人是谁? 儒家文化的创始人 文化人类学创始人泰勒赞成和推崇过什么观点 笑果文化4个创始人是谁? 开过了红绿灯往前走了点然后路中间左掉头有事吗? 过红绿灯三十米又掉头了,算违章吗? 红绿灯路口掉头,没注意到是红灯,整个车身都过了停止线前面去了才刹车停止等绿灯才掉头走的? 删掉了微信好友,但是又不知道和手机号,怎么加回? 梦见瀑布,潭,大蛇,贝壳,大珍珠 删除微信好友不记得怎么加回来? 阿玛尼满天星哪个颜色好看 阿玛尼LSF什么色系适合亚洲人啊 我肤色偏白 用3.5是不是太白了 网购价格大概是多少啊 苹果6plus手写在哪里? iphone6plus怎样添加日文手写 Oracle表空间被删除如何恢复 qq空间里的私密日志 删除了怎么恢复 QQ私密日志删除了怎么恢复 qq私密日志误删怎么找回? 防止光污染的措施是? 如何预防光污染 3D眼罩干嘛用的? 如何防治光污染 eefit的3D眼罩有什么功效吗? 不容忽视的“光污染”,该如何避免?