{"id":6139,"date":"2021-08-10T23:41:24","date_gmt":"2021-08-10T23:41:24","guid":{"rendered":"https:\/\/swiv.com.br\/recovering-tables-using-rman-recover-command\/"},"modified":"2026-05-27T20:02:30","modified_gmt":"2026-05-27T19:02:30","slug":"recovering-tables-using-rman-recover-command","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/08\/10\/recovering-tables-using-rman-recover-command\/","title":{"rendered":"Recovering Tables using RMAN &#8220;RECOVER&#8221; Command"},"content":{"rendered":"\n<p>Em algumas situa\u00e7\u00f5es, recuperar uma tablespace pode representar um esfor\u00e7o grande, caso o n\u00famero de tabelas que precisamos recuperar seja pequena. Nesses casos, podemos usufruir do recurso de recover table atrav\u00e9s do RMAN. Nos bastidores, o Oracle cria um ambiente auxiliar, restaurando apenas as tabelas desejadas, e realiza um export via Data Pump dos objetos desejados. De forma opcional, onde decidimos no momento da emiss\u00e3o do comando, podemos importar os objetos no banco de dados com os nomes originais ou import\u00e1-los em owners,tablespace ou nomes diferentes. Como limita\u00e7\u00e3o, n\u00e3o conseguimos usar este processo em tabelas que pertencem ao owner SYS e nas tablespaces SYSTEM e SYSAUX, al\u00e9m de objetos com constraints NOT NULL n\u00e3o conseguirem ser recuperados usando a op\u00e7\u00e3o de REMAP.<\/p>\n\n\n\n<p>Obviamente as cl\u00e1usulas do comando devem ser consultadas na documenta\u00e7\u00e3o oficial da Oracle, mas podemos ter uma refer\u00eancia nas tabelas abaixo:<\/p>\n\n\n\n<figure class=\"wp-block-table \\&quot;wp-block-table\\&quot;\"><table><tbody><tr><td class=\"has-text-align-\\&quot;center\\&quot;\" data-align=\"\\&quot;center\\&quot;\"><strong>Cl\u00e1usula<\/strong><\/td><td class=\"has-text-align-\\&quot;center\\&quot;\" data-align=\"\\&quot;center\\&quot;\"><strong>Descri\u00e7\u00e3o<\/strong><\/td><\/tr><tr><td class=\"has-text-align-\\&quot;center\\&quot;\" data-align=\"\\&quot;center\\&quot;\">AUXILIARY DESTINATION<\/td><td class=\"has-text-align-\\&quot;center\\&quot;\" data-align=\"\\&quot;center\\&quot;\">Informa o local onde o ambiente auxiliar (e suas estruturas) ser\u00e3o criados<\/td><\/tr><tr><td class=\"has-text-align-\\&quot;center\\&quot;\" data-align=\"\\&quot;center\\&quot;\">UNTIL [SEQUENCE | SCN | TIME]<\/td><td class=\"has-text-align-\\&quot;center\\&quot;\" data-align=\"\\&quot;center\\&quot;\">Informa o ponto no tempo para a recupera\u00e7\u00e3o<\/td><\/tr><\/tbody><\/table><figcaption>Cl\u00e1usulas Mandat\u00f3rias<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-table \\&quot;wp-block-table\\&quot;\"><table><tbody><tr><td class=\"has-text-align-\\&quot;center\\&quot;\" data-align=\"\\&quot;center\\&quot;\"> <strong>Cl\u00e1usula<\/strong> <\/td><td class=\"has-text-align-\\&quot;center\\&quot;\" data-align=\"\\&quot;center\\&quot;\"> <strong>Descri\u00e7\u00e3o<\/strong> <\/td><\/tr><tr><td class=\"has-text-align-\\&quot;center\\&quot;\" data-align=\"\\&quot;center\\&quot;\">DUMP FILE DATAPUMP DESTINATION<\/td><td class=\"has-text-align-\\&quot;center\\&quot;\" data-align=\"\\&quot;center\\&quot;\">Nome e destino do dump que ser\u00e1 gerado. O padr\u00e3o \u00e9: tspitr_&lt;SID&gt;-of-clone_&lt;n&gt;.dmp<\/td><\/tr><tr><td class=\"has-text-align-\\&quot;center\\&quot;\" data-align=\"\\&quot;center\\&quot;\">NOTABLEIMPORT<\/td><td class=\"has-text-align-\\&quot;center\\&quot;\" data-align=\"\\&quot;center\\&quot;\">Op\u00e7\u00e3o para n\u00e3o importar automaticamente o dump no banco target<\/td><\/tr><tr><td class=\"has-text-align-\\&quot;center\\&quot;\" data-align=\"\\&quot;center\\&quot;\">REMAP TABLE<\/td><td class=\"has-text-align-\\&quot;center\\&quot;\" data-align=\"\\&quot;center\\&quot;\">Renomeia as tabelas no banco target<\/td><\/tr><tr><td class=\"has-text-align-\\&quot;center\\&quot;\" data-align=\"\\&quot;center\\&quot;\">REMAP TABLESPACE<\/td><td class=\"has-text-align-\\&quot;center\\&quot;\" data-align=\"\\&quot;center\\&quot;\">Hospeda as tabelas em tablespaces diferentes da original<\/td><\/tr><\/tbody><\/table><figcaption>Cl\u00e1usulas Opcionais<\/figcaption><\/figure>\n\n\n\n<p>Uma vez exposta a parte te\u00f3rica m\u00ednima, vamos aplicar na pr\u00e1tica um exemplo do recurso. Reconhecendo nosso laborat\u00f3rio:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel8 ~]$ rman target \/\n \nRecovery Manager: Release 18.0.0.0.0 - Production on Tue Aug 10 20:05:00 2021\nVersion 18.13.0.0.0\n \nCopyright (c) 1982, 2018, Oracle and\/or its affiliates.  All rights reserved.\n \nconnected to target database: RMANDB (DBID=3825250984)\n \nRMAN&gt; SELECT NAME,OPEN_MODE,LOG_MODE FROM V$DATABASE;\n \nusing target database control file instead of recovery catalog\nNAME      OPEN_MODE            LOG_MODE\n--------- -------------------- ------------\nRMANDB    READ WRITE           ARCHIVELOG\n \nRMAN&gt; REPORT SCHEMA;\n \nReport of database schema for database with db_unique_name RMANDB\n \nList of Permanent Datafiles\n===========================\nFile Size(MB) Tablespace           RB segs Datafile Name\n---- -------- -------------------- ------- ------------------------\n1    880      SYSTEM               YES     \/oracle\/dados\/RMANDB\/datafile\/o1_mf_system_h8nynqfx_.dbf\n2    120      TS_HIPO_CATALOG      NO      \/oracle\/dados\/RMANDB\/datafile\/ts_hipo_catalog.dbf\n3    730      SYSAUX               NO      \/oracle\/dados\/RMANDB\/datafile\/o1_mf_sysaux_h8nyq35q_.dbf\n4    305      UNDOTBS1             YES     \/oracle\/dados\/RMANDB\/datafile\/o1_mf_undotbs1_h8nyrjdr_.dbf\n5    200      TS_CORTEX_CATALOG    NO      \/oracle\/dados\/RMANDB\/datafile\/ts_cortex_catalog.dbf\n7    16       USERS                NO      \/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\n \nList of Temporary Files\n=======================\nFile Size(MB) Tablespace           Maxsize(MB) Tempfile Name\n---- -------- -------------------- ----------- --------------------\n1    69       TEMP                 32767       \/oracle\/dados\/RMANDB\/datafile\/o1_mf_temp_h8nyvt1f_.tmp\n<\/pre><\/div>\n\n\n<p>Realizando o backup do banco de dados:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRMAN&gt; BACKUP DATABASE;\n \nStarting backup at 2021-08-10:20:06:04\nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=88 device type=DISK\nchannel ORA_DISK_1: starting full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\ninput datafile file number=00001 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_system_h8nynqfx_.dbf\ninput datafile file number=00003 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_sysaux_h8nyq35q_.dbf\ninput datafile file number=00004 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_undotbs1_h8nyrjdr_.dbf\ninput datafile file number=00005 name=\/oracle\/dados\/RMANDB\/datafile\/ts_cortex_catalog.dbf\ninput datafile file number=00002 name=\/oracle\/dados\/RMANDB\/datafile\/ts_hipo_catalog.dbf\ninput datafile file number=00007 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\nchannel ORA_DISK_1: starting piece 1 at 2021-08-10:20:06:04\nchannel ORA_DISK_1: finished piece 1 at 2021-08-10:20:07:09\npiece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_08_10\/o1_mf_nnndf_TAG20210810T200604_jk61lwvf_.bkp tag=TAG20210810T200604 comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:01:05\nFinished backup at 2021-08-10:20:07:09\n \nStarting Control File and SPFILE Autobackup at 2021-08-10:20:07:09\npiece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_08_10\/o1_mf_s_1080245229_jk61nygr_.bkp comment=NONE\nFinished Control File and SPFILE Autobackup at 2021-08-10:20:07:12\n<\/pre><\/div>\n\n\n<p>Nossa tabela de refer\u00eancia:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRMAN&gt; SELECT * FROM BSS.PITR;\n \nDESCRICAO\n--------------------------------------------------\nPITR DO BRUNO\n<\/pre><\/div>\n\n\n<p>Coletando o hor\u00e1rio antes de provocar a remo\u00e7\u00e3o da nossa tabela:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRMAN&gt; ALTER SYSTEM SWITCH LOGFILE;\n \nStatement processed\n \nRMAN&gt; SELECT TO_CHAR(SYSDATE,&#039;YYYY-MM-DD:HH24:MI:SS&#039;) FROM DUAL;\n \nTO_CHAR(SYSDATE,&#039;YY\n-------------------\n2021-08-10:20:09:25\n \nRMAN&gt; ALTER SYSTEM SWITCH LOGFILE;\n \nStatement processed\n<\/pre><\/div>\n\n\n<p>Realizando o DROP da nossa tabela:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRMAN&gt; DROP TABLE BSS.PITR;\n\nStatement processed\n<\/pre><\/div>\n\n\n<p>Como o RMAN criar\u00e1 automaticamente uma inst\u00e2ncia auxiliar no processo, precisamos definir um diret\u00f3rio que hospede as estruturas que ser\u00e3o criadas. O meu diret\u00f3rio foi criado conforme abaixo:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel8 oracle]$ pwd\n\/oracle\n&#x5B;oracle@oel8 oracle]$ mkdir TABLE_PITR\n&#x5B;oracle@oel8 oracle]$ cd TABLE_PITR\/\n&#x5B;oracle@oel8 TABLE_PITR]$ pwd\n\/oracle\/TABLE_PITR\n<\/pre><\/div>\n\n\n<p>Apenas para fins did\u00e1ticos, vou realizar um remap_table para um novo novo de tabela. E com um \u00fanico comando RMAN, disparamos a recupera\u00e7\u00e3o de nossa tabela:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel8 TABLE_PITR]$ rman target \/\n \nRecovery Manager: Release 18.0.0.0.0 - Production on Tue Aug 10 20:16:18 2021\nVersion 18.13.0.0.0\n \nCopyright (c) 1982, 2018, Oracle and\/or its affiliates.  All rights reserved.\n \nconnected to target database: RMANDB (DBID=3825250984)\n \nRMAN&gt; RECOVER TABLE BSS.PITR UNTIL TIME &quot;to_date(&#039;2021-08-10:20:09:25&#039;,&#039;YYYY-MM-DD:HH24:MI:SS&#039;)&quot; AUXILIARY DESTINATION &#039;\/oracle\/TABLE_PITR&#039; REMAP TABLE &#039;BSS&#039;.&#039;PITR&#039;: &#039;BSS&#039;.&#039;TABLE_PITR&#039;;\n \nStarting recover at 2021-08-10:20:16:31\nusing target database control file instead of recovery catalog\nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=70 device type=DISK\nRMAN-05026: warning: presuming following set of tablespaces applies to specified point-in-time\n \nList of tablespaces expected to have UNDO segments\nTablespace SYSTEM\nTablespace UNDOTBS1\n \nCreating automatic instance, with SID=&#039;Fvbg&#039;\n \ninitialization parameters used for automatic instance:\ndb_name=RMANDB\ndb_unique_name=Fvbg_pitr_RMANDB\ncompatible=18.0.0\ndb_block_size=8192\ndb_files=200\ndiagnostic_dest=\/oracle\/18.0.0\/base\n_system_trig_enabled=FALSE\nsga_target=1536M\nprocesses=200\ndb_create_file_dest=\/oracle\/TABLE_PITR\nlog_archive_dest_1=&#039;location=\/oracle\/TABLE_PITR&#039;\n#No auxiliary parameter file used\n \n \nstarting up automatic instance RMANDB\n \nOracle instance started\n \nTotal System Global Area    1610612016 bytes\n \nFixed Size                     8658224 bytes\nVariable Size                402653184 bytes\nDatabase Buffers            1191182336 bytes\nRedo Buffers                   8118272 bytes\nAutomatic instance created\n \ncontents of Memory Script:\n{\n# set requested point in time\nset until  time &quot;to_date(&#039;2021-08-10:20:09:25&#039;,&#039;YYYY-MM-DD:HH24:MI:SS&#039;)&quot;;\n# restore the controlfile\nrestore clone controlfile;\n \n# mount the controlfile\nsql clone &#039;alter database mount clone database&#039;;\n \n# archive current online log\nsql &#039;alter system archive log current&#039;;\n}\nexecuting Memory Script\n \nexecuting command: SET until clause\n \nStarting restore at 2021-08-10:20:16:51\nallocated channel: ORA_AUX_DISK_1\nchannel ORA_AUX_DISK_1: SID=39 device type=DISK\n \nchannel ORA_AUX_DISK_1: starting datafile backup set restore\nchannel ORA_AUX_DISK_1: restoring control file\nchannel ORA_AUX_DISK_1: reading from backup piece \/oracle\/fra\/RMANDB\/autobackup\/2021_08_10\/o1_mf_s_1080245229_jk61nygr_.bkp\nchannel ORA_AUX_DISK_1: piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_08_10\/o1_mf_s_1080245229_jk61nygr_.bkp tag=TAG20210810T200709\nchannel ORA_AUX_DISK_1: restored backup piece 1\nchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03\noutput file name=\/oracle\/TABLE_PITR\/RMANDB\/controlfile\/o1_mf_jk6274vr_.ctl\nFinished restore at 2021-08-10:20:16:55\n \nsql statement: alter database mount clone database\n \nsql statement: alter system archive log current\n \ncontents of Memory Script:\n{\n# set requested point in time\nset until  time &quot;to_date(&#039;2021-08-10:20:09:25&#039;,&#039;YYYY-MM-DD:HH24:MI:SS&#039;)&quot;;\n# set destinations for recovery set and auxiliary set datafiles\nset newname for clone datafile  1 to new;\nset newname for clone datafile  4 to new;\nset newname for clone datafile  3 to new;\nset newname for clone tempfile  1 to new;\n# switch all tempfiles\nswitch clone tempfile all;\n# restore the tablespaces in the recovery set and the auxiliary set\nrestore clone datafile  1, 4, 3;\n \nswitch clone datafile all;\n}\nexecuting Memory Script\n \nexecuting command: SET until clause\n \nexecuting command: SET NEWNAME\n \nexecuting command: SET NEWNAME\n \nexecuting command: SET NEWNAME\n \nexecuting command: SET NEWNAME\n \nrenamed tempfile 1 to \/oracle\/TABLE_PITR\/RMANDB\/datafile\/o1_mf_temp_%u_.tmp in control file\n \nStarting restore at 2021-08-10:20:17:02\nusing channel ORA_AUX_DISK_1\n \nchannel ORA_AUX_DISK_1: starting datafile backup set restore\nchannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set\nchannel ORA_AUX_DISK_1: restoring datafile 00001 to \/oracle\/TABLE_PITR\/RMANDB\/datafile\/o1_mf_system_%u_.dbf\nchannel ORA_AUX_DISK_1: restoring datafile 00004 to \/oracle\/TABLE_PITR\/RMANDB\/datafile\/o1_mf_undotbs1_%u_.dbf\nchannel ORA_AUX_DISK_1: restoring datafile 00003 to \/oracle\/TABLE_PITR\/RMANDB\/datafile\/o1_mf_sysaux_%u_.dbf\nchannel ORA_AUX_DISK_1: reading from backup piece \/oracle\/fra\/RMANDB\/backupset\/2021_08_10\/o1_mf_nnndf_TAG20210810T200604_jk61lwvf_.bkp\nchannel ORA_AUX_DISK_1: piece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_08_10\/o1_mf_nnndf_TAG20210810T200604_jk61lwvf_.bkp tag=TAG20210810T200604\nchannel ORA_AUX_DISK_1: restored backup piece 1\nchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:02:06\nFinished restore at 2021-08-10:20:19:08\n \ndatafile 1 switched to datafile copy\ninput datafile copy RECID=49 STAMP=1080245948 file name=\/oracle\/TABLE_PITR\/RMANDB\/datafile\/o1_mf_system_jk627gxj_.dbf\ndatafile 4 switched to datafile copy\ninput datafile copy RECID=50 STAMP=1080245948 file name=\/oracle\/TABLE_PITR\/RMANDB\/datafile\/o1_mf_undotbs1_jk627h2x_.dbf\ndatafile 3 switched to datafile copy\ninput datafile copy RECID=51 STAMP=1080245948 file name=\/oracle\/TABLE_PITR\/RMANDB\/datafile\/o1_mf_sysaux_jk627h2j_.dbf\n \ncontents of Memory Script:\n{\n# set requested point in time\nset until  time &quot;to_date(&#039;2021-08-10:20:09:25&#039;,&#039;YYYY-MM-DD:HH24:MI:SS&#039;)&quot;;\n# online the datafiles restored or switched\nsql clone &quot;alter database datafile  1 online&quot;;\nsql clone &quot;alter database datafile  4 online&quot;;\nsql clone &quot;alter database datafile  3 online&quot;;\n# recover and open database read only\nrecover clone database tablespace  &quot;SYSTEM&quot;, &quot;UNDOTBS1&quot;, &quot;SYSAUX&quot;;\nsql clone &#039;alter database open read only&#039;;\n}\nexecuting Memory Script\n \nexecuting command: SET until clause\n \nsql statement: alter database datafile  1 online\n \nsql statement: alter database datafile  4 online\n \nsql statement: alter database datafile  3 online\n \nStarting recover at 2021-08-10:20:19:09\nusing channel ORA_AUX_DISK_1\n \nstarting media recovery\n \narchived log for thread 1 with sequence 6 is already on disk as file \/oracle\/archives\/1_6_1079643731.dbf\narchived log for thread 1 with sequence 7 is already on disk as file \/oracle\/archives\/1_7_1079643731.dbf\narchived log file name=\/oracle\/archives\/1_6_1079643731.dbf thread=1 sequence=6\narchived log file name=\/oracle\/archives\/1_7_1079643731.dbf thread=1 sequence=7\nmedia recovery complete, elapsed time: 00:00:01\nFinished recover at 2021-08-10:20:19:11\n \nsql statement: alter database open read only\n \ncontents of Memory Script:\n{\n   sql clone &quot;create spfile from memory&quot;;\n   shutdown clone immediate;\n   startup clone nomount;\n   sql clone &quot;alter system set  control_files =\n  &#039;&#039;\/oracle\/TABLE_PITR\/RMANDB\/controlfile\/o1_mf_jk6274vr_.ctl&#039;&#039; comment=\n &#039;&#039;RMAN set&#039;&#039; scope=spfile&quot;;\n   shutdown clone immediate;\n   startup clone nomount;\n# mount database\nsql clone &#039;alter database mount clone database&#039;;\n}\nexecuting Memory Script\n \nsql statement: create spfile from memory\n \ndatabase closed\ndatabase dismounted\nOracle instance shut down\n \nconnected to auxiliary database (not started)\nOracle instance started\n \nTotal System Global Area    1610612016 bytes\n \nFixed Size                     8658224 bytes\nVariable Size                402653184 bytes\nDatabase Buffers            1191182336 bytes\nRedo Buffers                   8118272 bytes\n \nsql statement: alter system set  control_files =   &#039;&#039;\/oracle\/TABLE_PITR\/RMANDB\/controlfile\/o1_mf_jk6274vr_.ctl&#039;&#039; comment= &#039;&#039;RMAN set&#039;&#039; scope=spfile\n \nOracle instance shut down\n \nconnected to auxiliary database (not started)\nOracle instance started\n \nTotal System Global Area    1610612016 bytes\n \nFixed Size                     8658224 bytes\nVariable Size                402653184 bytes\nDatabase Buffers            1191182336 bytes\nRedo Buffers                   8118272 bytes\n \nsql statement: alter database mount clone database\n \ncontents of Memory Script:\n{\n# set requested point in time\nset until  time &quot;to_date(&#039;2021-08-10:20:09:25&#039;,&#039;YYYY-MM-DD:HH24:MI:SS&#039;)&quot;;\n# set destinations for recovery set and auxiliary set datafiles\nset newname for datafile  7 to new;\n# restore the tablespaces in the recovery set and the auxiliary set\nrestore clone datafile  7;\n \nswitch clone datafile all;\n}\nexecuting Memory Script\n \nexecuting command: SET until clause\n \nexecuting command: SET NEWNAME\n \nStarting restore at 2021-08-10:20:20:18\nallocated channel: ORA_AUX_DISK_1\nchannel ORA_AUX_DISK_1: SID=34 device type=DISK\n \nchannel ORA_AUX_DISK_1: starting datafile backup set restore\nchannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set\nchannel ORA_AUX_DISK_1: restoring datafile 00007 to \/oracle\/TABLE_PITR\/FVBG_PITR_RMANDB\/datafile\/o1_mf_users_%u_.dbf\nchannel ORA_AUX_DISK_1: reading from backup piece \/oracle\/fra\/RMANDB\/backupset\/2021_08_10\/o1_mf_nnndf_TAG20210810T200604_jk61lwvf_.bkp\nchannel ORA_AUX_DISK_1: piece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_08_10\/o1_mf_nnndf_TAG20210810T200604_jk61lwvf_.bkp tag=TAG20210810T200604\nchannel ORA_AUX_DISK_1: restored backup piece 1\nchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01\nFinished restore at 2021-08-10:20:20:19\n \ndatafile 7 switched to datafile copy\ninput datafile copy RECID=53 STAMP=1080246019 file name=\/oracle\/TABLE_PITR\/FVBG_PITR_RMANDB\/datafile\/o1_mf_users_jk62flj7_.dbf\n \ncontents of Memory Script:\n{\n# set requested point in time\nset until  time &quot;to_date(&#039;2021-08-10:20:09:25&#039;,&#039;YYYY-MM-DD:HH24:MI:SS&#039;)&quot;;\n# online the datafiles restored or switched\nsql clone &quot;alter database datafile  7 online&quot;;\n# recover and open resetlogs\nrecover clone database tablespace  &quot;USERS&quot;, &quot;SYSTEM&quot;, &quot;UNDOTBS1&quot;, &quot;SYSAUX&quot; delete archivelog;\nalter clone database open resetlogs;\n}\nexecuting Memory Script\n \nexecuting command: SET until clause\n \nsql statement: alter database datafile  7 online\n \nStarting recover at 2021-08-10:20:20:19\nusing channel ORA_AUX_DISK_1\n \nstarting media recovery\n \narchived log for thread 1 with sequence 6 is already on disk as file \/oracle\/archives\/1_6_1079643731.dbf\narchived log for thread 1 with sequence 7 is already on disk as file \/oracle\/archives\/1_7_1079643731.dbf\narchived log file name=\/oracle\/archives\/1_6_1079643731.dbf thread=1 sequence=6\narchived log file name=\/oracle\/archives\/1_7_1079643731.dbf thread=1 sequence=7\nmedia recovery complete, elapsed time: 00:00:01\nFinished recover at 2021-08-10:20:20:21\n \ndatabase opened\n \ncontents of Memory Script:\n{\n# create directory for datapump import\nsql &quot;create or replace directory TSPITR_DIROBJ_DPDIR as &#039;&#039;\n\/oracle\/TABLE_PITR&#039;&#039;&quot;;\n# create directory for datapump export\nsql clone &quot;create or replace directory TSPITR_DIROBJ_DPDIR as &#039;&#039;\n\/oracle\/TABLE_PITR&#039;&#039;&quot;;\n}\nexecuting Memory Script\n \nsql statement: create or replace directory TSPITR_DIROBJ_DPDIR as &#039;&#039;\/oracle\/TABLE_PITR&#039;&#039;\n \nsql statement: create or replace directory TSPITR_DIROBJ_DPDIR as &#039;&#039;\/oracle\/TABLE_PITR&#039;&#039;\n \nPerforming export of tables...\n   EXPDP&gt; Starting &quot;SYS&quot;.&quot;TSPITR_EXP_Fvbg_dEen&quot;:\n   EXPDP&gt; Processing object type TABLE_EXPORT\/TABLE\/TABLE_DATA\n   EXPDP&gt; Processing object type TABLE_EXPORT\/TABLE\/STATISTICS\/TABLE_STATISTICS\n   EXPDP&gt; Processing object type TABLE_EXPORT\/TABLE\/TABLE\n   EXPDP&gt; . . exported &quot;BSS&quot;.&quot;PITR&quot;                                5.070 KB       1 rows\n   EXPDP&gt; Master table &quot;SYS&quot;.&quot;TSPITR_EXP_Fvbg_dEen&quot; successfully loaded\/unloaded\n   EXPDP&gt; ******************************************************************************\n   EXPDP&gt; Dump file set for SYS.TSPITR_EXP_Fvbg_dEen is:\n   EXPDP&gt;   \/oracle\/TABLE_PITR\/tspitr_Fvbg_51439.dmp\n   EXPDP&gt; Job &quot;SYS&quot;.&quot;TSPITR_EXP_Fvbg_dEen&quot; successfully completed at Tue Aug 10 20:20:59 2021 elapsed 0 00:00:22\nExport completed\n \n \ncontents of Memory Script:\n{\n# shutdown clone before import\nshutdown clone abort\n}\nexecuting Memory Script\n \nOracle instance shut down\n \nPerforming import of tables...\n   IMPDP&gt; Master table &quot;SYS&quot;.&quot;TSPITR_IMP_Fvbg_Bugd&quot; successfully loaded\/unloaded\n   IMPDP&gt; Starting &quot;SYS&quot;.&quot;TSPITR_IMP_Fvbg_Bugd&quot;:\n   IMPDP&gt; Processing object type TABLE_EXPORT\/TABLE\/TABLE\n   IMPDP&gt; Processing object type TABLE_EXPORT\/TABLE\/TABLE_DATA\n   IMPDP&gt; . . imported &quot;BSS&quot;.&quot;TABLE_PITR&quot;                          5.070 KB       1 rows\n   IMPDP&gt; Processing object type TABLE_EXPORT\/TABLE\/STATISTICS\/TABLE_STATISTICS\n   IMPDP&gt; Job &quot;SYS&quot;.&quot;TSPITR_IMP_Fvbg_Bugd&quot; successfully completed at Tue Aug 10 20:21:16 2021 elapsed 0 00:00:07\nImport completed\n \n \nRemoving automatic instance\nAutomatic instance removed\nauxiliary instance file \/oracle\/TABLE_PITR\/RMANDB\/datafile\/o1_mf_temp_jk62ckfk_.tmp deleted\nauxiliary instance file \/oracle\/TABLE_PITR\/FVBG_PITR_RMANDB\/onlinelog\/o1_mf_3_jk62fq15_.log deleted\nauxiliary instance file \/oracle\/TABLE_PITR\/FVBG_PITR_RMANDB\/onlinelog\/o1_mf_2_jk62fofb_.log deleted\nauxiliary instance file \/oracle\/TABLE_PITR\/FVBG_PITR_RMANDB\/onlinelog\/o1_mf_1_jk62fods_.log deleted\nauxiliary instance file \/oracle\/TABLE_PITR\/FVBG_PITR_RMANDB\/datafile\/o1_mf_users_jk62flj7_.dbf deleted\nauxiliary instance file \/oracle\/TABLE_PITR\/RMANDB\/datafile\/o1_mf_sysaux_jk627h2j_.dbf deleted\nauxiliary instance file \/oracle\/TABLE_PITR\/RMANDB\/datafile\/o1_mf_undotbs1_jk627h2x_.dbf deleted\nauxiliary instance file \/oracle\/TABLE_PITR\/RMANDB\/datafile\/o1_mf_system_jk627gxj_.dbf deleted\nauxiliary instance file \/oracle\/TABLE_PITR\/RMANDB\/controlfile\/o1_mf_jk6274vr_.ctl deleted\nauxiliary instance file tspitr_Fvbg_51439.dmp deleted\nFinished recover at 2021-08-10:20:21:19\n<\/pre><\/div>\n\n\n<p>O resultado da recupera\u00e7\u00e3o est\u00e1 a\u00ed:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRMAN&gt; SELECT * FROM BSS.TABLE_PITR;\n\nDESCRICAO\n--------------------------------------------------\nPITR DO BRUNO\n<\/pre><\/div>\n\n\n<p>Obs: Este procedimento foi criado pelo senhor Ahmed Baraka (www.ahmedbaraka.com) e foi apenas reproduzido por mim em um laborat\u00f3rio pessoal para fins de aprendizado.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Em algumas situa\u00e7\u00f5es, recuperar uma tablespace pode representar um esfor\u00e7o grande, caso o n\u00famero de tabelas que precisamos recuperar seja pequena. Nesses casos, podemos usufruir do recurso de recover table atrav\u00e9s do RMAN. Nos bastidores, o Oracle cria um ambiente auxiliar, restaurando apenas as tabelas desejadas, e realiza um export via Data Pump dos objetos [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-6139","post","type-post","status-publish","format-standard","hentry","category-backup-recovery"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/6139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=6139"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/6139\/revisions"}],"predecessor-version":[{"id":9064,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/6139\/revisions\/9064"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=6139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=6139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=6139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}