lunes, 14 de diciembre de 2020

RMAN RESTORE TABLE TPITR

 # SCN

RECOVER TABLE TEST.T1
  UNTIL SCN 1853267
  AUXILIARY DESTINATION '/u01/backup'  
  REMAP TABLE 'TEST'.'T1':'T1_PREV';

RECOVER TABLE TEST.T1
  UNTIL SEQUENCE 200
  AUXILIARY DESTINATION '/u01/backup'  
  REMAP TABLE 'TEST'.'T1':'T1_PREV';

# TIME
RECOVER TABLE TEST.T1
  UNTIL TIME "TO_DATE('2020-12-14 19:00', 'YYYY-MM-DD:HH24:MI:SS')"
AUXILIARY DESTINATION '/u01/backup' REMAP TABLE 'TEST'.'T1':'T1_PREV';

TECNOLOGIA TPITR

LABORATORIO RESTORE TABLE UNTIL TIME

SQL> !date

Mon Dec 14 19:13:47 -05 2020

SQL> select current_scn from v$database;

CURRENT_SCN

-----------

    6003465

SQL> connect hr/hr;

Connected.

SQL> 

SQL> update hr.lolito set salary=0, email='NELSONJAVIER63@GMAIL.COM';

107 rows updated.

SQL> commit;

Commit complete.

RMAN> RECOVER TABLE HR.LOLITO UNTIL TIME "TO_DATE('2020-12-14 19:13:47', 'YYYY-MM-DD:HH24:MI:SS')" AUXILIARY DESTINATION '/u01/backup/';

RMAN> RECOVER TABLE HR.LOLITO UNTIL TIME "TO_DATE('2020-12-14 19:13:47', 'YYYY-MM-DD:HH24:MI:SS')" AUXILIARY DESTINATION '/u01/backup/';


Starting recover at 2020-12-14:19:23:07

current log archived

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of recover command at 12/14/2020 19:23:09

RMAN-05063: Cannot recover specified tables

RMAN-05112: table "HR"."LOLITO" already exists


RMAN> RECOVER TABLE HR.LOLITO UNTIL TIME "TO_DATE('2020-12-14 19:13:47', 'YYYY-MM-DD:HH24:MI:SS')" AUXILIARY DESTINATION '/u01/backup/';


Starting recover at 2020-12-14:19:23:49

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=72 device type=DISK

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='pfuh'


initialization parameters used for automatic instance:

db_name=ACME

db_unique_name=pfuh_pitr_ACME

compatible=12.1.0.0.0

db_block_size=8192

db_files=200

sga_target=1G

processes=80

diagnostic_dest=/u01/app/oracle

db_create_file_dest=/u01/backup/

log_archive_dest_1='location=/u01/backup/'

#No auxiliary parameter file used



starting up automatic instance ACME


Oracle instance started


Total System Global Area    1068937216 bytes


Fixed Size                     2296576 bytes

Variable Size                281019648 bytes

Database Buffers             780140544 bytes

Redo Buffers                   5480448 bytes

Automatic instance created


contents of Memory Script:

{

# set requested point in time

set until  time "TO_DATE('2020-12-14 19:13:47', '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';

}

executing Memory Script


executing command: SET until clause


Starting restore at 2020-12-14:19:24:01

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=7 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 +FRA/ACME/AUTOBACKUP/2020_12_14/s_1059158709.366.1059158711

channel ORA_AUX_DISK_1: piece handle=+FRA/ACME/AUTOBACKUP/2020_12_14/s_1059158709.366.1059158711 tag=TAG20201214T184509

channel ORA_AUX_DISK_1: restored backup piece 1

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:06

output file name=/u01/backup/ACME/controlfile/o1_mf_hxj0k64p_.ctl

Finished restore at 2020-12-14:19:24:07


sql statement: alter database mount clone database


sql statement: alter system archive log current


contents of Memory Script:

{

# set requested point in time

set until  time "TO_DATE('2020-12-14 19:13:47', 'YYYY-MM-DD:HH24:MI:SS')";

# set destinations for recovery set and auxiliary set datafiles

set newname for clone datafile  1 to new;

set newname for clone datafile  4 to new;

set newname for clone datafile  3 to new;

set newname for clone tempfile  1 to new;

# switch all tempfiles

switch clone tempfile all;

# restore the tablespaces in the recovery set and the auxiliary set

restore clone datafile  1, 4, 3;

switch clone datafile all;

}

executing Memory Script


executing command: SET until clause


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


renamed tempfile 1 to /u01/backup/ACME/datafile/o1_mf_temp_%u_.tmp in control file


Starting restore at 2020-12-14:19:24:13

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 /u01/backup/ACME/datafile/o1_mf_system_%u_.dbf

channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/backup/ACME/datafile/o1_mf_undotbs1_%u_.dbf

channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/backup/ACME/datafile/o1_mf_sysaux_%u_.dbf

channel ORA_AUX_DISK_1: reading from backup piece +FRA/ACME/BACKUPSET/2020_12_14/nnndf0_tag20201214t184339_0.362.1059158619

channel ORA_AUX_DISK_1: piece handle=+FRA/ACME/BACKUPSET/2020_12_14/nnndf0_tag20201214t184339_0.362.1059158619 tag=TAG20201214T184339

channel ORA_AUX_DISK_1: restored backup piece 1

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:45

Finished restore at 2020-12-14:19:24:59


datafile 1 switched to datafile copy

input datafile copy RECID=11 STAMP=1059161099 file name=/u01/backup/ACME/datafile/o1_mf_system_hxj0kg5n_.dbf

datafile 4 switched to datafile copy

input datafile copy RECID=12 STAMP=1059161099 file name=/u01/backup/ACME/datafile/o1_mf_undotbs1_hxj0kg5t_.dbf

datafile 3 switched to datafile copy

input datafile copy RECID=13 STAMP=1059161099 file name=/u01/backup/ACME/datafile/o1_mf_sysaux_hxj0kg5h_.dbf


contents of Memory Script:

{

# set requested point in time

set until  time "TO_DATE('2020-12-14 19:13:47', 'YYYY-MM-DD:HH24:MI:SS')";

# online the datafiles restored or switched

sql clone "alter database datafile  1 online";

sql clone "alter database datafile  4 online";

sql clone "alter database datafile  3 online";

# recover and open database read only

recover clone database tablespace  "SYSTEM", "UNDOTBS1", "SYSAUX";

sql clone 'alter database open read only';

}

executing Memory Script


executing command: SET until clause


sql statement: alter database datafile  1 online


sql statement: alter database datafile  4 online


sql statement: alter database datafile  3 online


Starting recover at 2020-12-14:19:24:59

using channel ORA_AUX_DISK_1


starting media recovery


archived log for thread 1 with sequence 14 is already on disk as file +FRA/ACME/ARCHIVELOG/2020_12_14/thread_1_seq_14.367.1059158705

archived log for thread 1 with sequence 15 is already on disk as file +FRA/ACME/ARCHIVELOG/2020_12_14/thread_1_seq_15.266.1059160987

archived log file name=+FRA/ACME/ARCHIVELOG/2020_12_14/thread_1_seq_14.367.1059158705 thread=1 sequence=14

archived log file name=+FRA/ACME/ARCHIVELOG/2020_12_14/thread_1_seq_15.266.1059160987 thread=1 sequence=15

media recovery complete, elapsed time: 00:00:09

Finished recover at 2020-12-14:19:25:11


sql statement: alter database open read only


contents of Memory Script:

{

   sql clone "create spfile from memory";

   shutdown clone immediate;

   startup clone nomount;

   sql clone "alter system set  control_files = 

  ''/u01/backup/ACME/controlfile/o1_mf_hxj0k64p_.ctl'' comment=

 ''RMAN set'' scope=spfile";

   shutdown clone immediate;

   startup clone nomount;

# mount database

sql clone 'alter database mount clone database';

}

executing Memory Script


sql statement: create spfile from memory


database closed

database dismounted

Oracle instance shut down


connected to auxiliary database (not started)

Oracle instance started


Total System Global Area    1068937216 bytes


Fixed Size                     2296576 bytes

Variable Size                285213952 bytes

Database Buffers             775946240 bytes

Redo Buffers                   5480448 bytes


sql statement: alter system set  control_files =   ''/u01/backup/ACME/controlfile/o1_mf_hxj0k64p_.ctl'' comment= ''RMAN set'' scope=spfile


Oracle instance shut down


connected to auxiliary database (not started)

Oracle instance started


Total System Global Area    1068937216 bytes


Fixed Size                     2296576 bytes

Variable Size                285213952 bytes

Database Buffers             775946240 bytes

Redo Buffers                   5480448 bytes


sql statement: alter database mount clone database


contents of Memory Script:

{

# set requested point in time

set until  time "TO_DATE('2020-12-14 19:13:47', 'YYYY-MM-DD:HH24:MI:SS')";

# set destinations for recovery set and auxiliary set datafiles

set newname for datafile  6 to new;

# restore the tablespaces in the recovery set and the auxiliary set

restore clone datafile  6;

switch clone datafile all;

}

executing Memory Script


executing command: SET until clause


executing command: SET NEWNAME


Starting restore at 2020-12-14:19:25:46

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=27 device type=DISK


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 00006 to /u01/backup/PFUH_PITR_ACME/datafile/o1_mf_users_%u_.dbf

channel ORA_AUX_DISK_1: reading from backup piece +FRA/ACME/BACKUPSET/2020_12_14/nnndf0_tag20201214t184339_0.362.1059158619

channel ORA_AUX_DISK_1: piece handle=+FRA/ACME/BACKUPSET/2020_12_14/nnndf0_tag20201214t184339_0.362.1059158619 tag=TAG20201214T184339

channel ORA_AUX_DISK_1: restored backup piece 1

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01

Finished restore at 2020-12-14:19:25:49


datafile 6 switched to datafile copy

input datafile copy RECID=15 STAMP=1059161149 file name=/u01/backup/PFUH_PITR_ACME/datafile/o1_mf_users_hxj0nd73_.dbf


contents of Memory Script:

{

# set requested point in time

set until  time "TO_DATE('2020-12-14 19:13:47', 'YYYY-MM-DD:HH24:MI:SS')";

# online the datafiles restored or switched

sql clone "alter database datafile  6 online";

# recover and open resetlogs

recover clone database tablespace  "USERS", "SYSTEM", "UNDOTBS1", "SYSAUX" delete archivelog;

alter clone database open resetlogs;

}

executing Memory Script


executing command: SET until clause


sql statement: alter database datafile  6 online


Starting recover at 2020-12-14:19:25:49

using channel ORA_AUX_DISK_1


starting media recovery


archived log for thread 1 with sequence 14 is already on disk as file +FRA/ACME/ARCHIVELOG/2020_12_14/thread_1_seq_14.367.1059158705

archived log for thread 1 with sequence 15 is already on disk as file +FRA/ACME/ARCHIVELOG/2020_12_14/thread_1_seq_15.266.1059160987

archived log file name=+FRA/ACME/ARCHIVELOG/2020_12_14/thread_1_seq_14.367.1059158705 thread=1 sequence=14

archived log file name=+FRA/ACME/ARCHIVELOG/2020_12_14/thread_1_seq_15.266.1059160987 thread=1 sequence=15

media recovery complete, elapsed time: 00:00:00

Finished recover at 2020-12-14:19:25:51


database opened


contents of Memory Script:

{

# create directory for datapump import

sql "create or replace directory TSPITR_DIROBJ_DPDIR as ''

/u01/backup/''";

# create directory for datapump export

sql clone "create or replace directory TSPITR_DIROBJ_DPDIR as ''

/u01/backup/''";

}

executing Memory Script


sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/backup/''


sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/backup/''


Performing export of tables...

   EXPDP> Starting "SYS"."TSPITR_EXP_pfuh_nDAC":  

   EXPDP> Estimate in progress using BLOCKS method...

   EXPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

   EXPDP> Total estimation using BLOCKS method: 64 KB

   EXPDP> Processing object type TABLE_EXPORT/TABLE/TABLE

   EXPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

   EXPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER

   EXPDP> ORA-39127: unexpected error from call to export_string :=SYS.DBMS_TRANSFORM_EXIMP.INSTANCE_INFO_EXP('AQ$_ORDERS_QUEUETABLE_S','IX',1,1,'12.01.00.00.00',newblock) 

ORA-00376: file 2 cannot be read at this time

ORA-01110: data file 2: '+DATA/ACME/DATAFILE/example.259.1058124367'

ORA-06512: at "SYS.DBMS_TRANSFORM_EXIMP", line 197

ORA-06512: at line 1

ORA-06512: at "SYS.DBMS_METADATA", line 9901

ORA-39127: unexpected error from call to export_string :=SYS.DBMS_TRANSFORM_EXIMP.INSTANCE_INFO_EXP('AQ$_STREAMS_QUEUE_TABLE_S','IX',1,1,'12.01.00.00.00',newblock) 

ORA-00376: file 2 cannot be read at this time

ORA-01110: data file 2: '+DATA/ACME/DATAFILE/example.259.1058124367'

ORA-06512: at "SYS.DBMS_TRANSFORM_EXIMP", line 197

ORA-06512: at line 1

ORA-06512: at "SYS.DBMS_METADATA", line 9901

   EXPDP> . . exported "HR"."LOLITO"                               17.07 KB     107 rows

   EXPDP> Master table "SYS"."TSPITR_EXP_pfuh_nDAC" successfully loaded/unloaded

   EXPDP> ******************************************************************************

   EXPDP> Dump file set for SYS.TSPITR_EXP_pfuh_nDAC is:

   EXPDP>   /u01/backup/tspitr_pfuh_82509.dmp

   EXPDP> Job "SYS"."TSPITR_EXP_pfuh_nDAC" completed with 2 error(s) at Mon Dec 14 19:27:12 2020 elapsed 0 00:00:52

Export completed



contents of Memory Script:

{

# shutdown clone before import

shutdown clone abort

}

executing Memory Script


Oracle instance shut down


Performing import of tables...

   IMPDP> Master table "SYS"."TSPITR_IMP_pfuh_pkrj" successfully loaded/unloaded

   IMPDP> Starting "SYS"."TSPITR_IMP_pfuh_pkrj":  

   IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE

   IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

   IMPDP> . . imported "HR"."LOLITO"                               17.07 KB     107 rows

   IMPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

   IMPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER

   IMPDP> Job "SYS"."TSPITR_IMP_pfuh_pkrj" successfully completed at Mon Dec 14 19:28:00 2020 elapsed 0 00:00:30

Import completed



Removing automatic instance

Automatic instance removed

auxiliary instance file /u01/backup/ACME/datafile/o1_mf_temp_hxj0m83n_.tmp deleted

auxiliary instance file /u01/backup/PFUH_PITR_ACME/onlinelog/o1_mf_3_hxj0nj8c_.log deleted

auxiliary instance file /u01/backup/PFUH_PITR_ACME/onlinelog/o1_mf_2_hxj0nhnq_.log deleted

auxiliary instance file /u01/backup/PFUH_PITR_ACME/onlinelog/o1_mf_1_hxj0nh58_.log deleted

auxiliary instance file /u01/backup/PFUH_PITR_ACME/datafile/o1_mf_users_hxj0nd73_.dbf deleted

auxiliary instance file /u01/backup/ACME/datafile/o1_mf_sysaux_hxj0kg5h_.dbf deleted

auxiliary instance file /u01/backup/ACME/datafile/o1_mf_undotbs1_hxj0kg5t_.dbf deleted

auxiliary instance file /u01/backup/ACME/datafile/o1_mf_system_hxj0kg5n_.dbf deleted

auxiliary instance file /u01/backup/ACME/controlfile/o1_mf_hxj0k64p_.ctl deleted

auxiliary instance file tspitr_pfuh_82509.dmp deleted

Finished recover at 2020-12-14:19:28:06

RMAN> 

TECNOLOGIA TPITR

LABORATORIO RESTORE TABLE SCN 

SQL> create table hr.lolito as (select * from hr.employees); 

RMAN> RECOVER TABLE HR.LOLITO UNTIL SCN 6223707 AUXILIARY DESTINATION '/u01/backup/';

Starting recover at 14-DEC-20

using target database control file instead of recovery catalog

current log archived

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of recover command at 12/14/2020 18:58:42

RMAN-05063: Cannot recover specified tables

RMAN-05112: table "HR"."LOLITO" already exists


RMAN> RECOVER TABLE HR.LOLITO UNTIL SCN 6223707 AUXILIARY DESTINATION '/u01/backup/';


Starting recover at 14-DEC-20

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=50 device type=DISK

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='haer'


initialization parameters used for automatic instance:

db_name=ORCL

db_unique_name=haer_pitr_ORCL

compatible=12.1.0.0.0

db_block_size=8192

db_files=200

sga_target=1G

processes=80

diagnostic_dest=/u01/app/oracle

db_create_file_dest=/u01/backup/

log_archive_dest_1='location=/u01/backup/'

#No auxiliary parameter file used



starting up automatic instance ORCL


Oracle instance started


Total System Global Area    1068937216 bytes


Fixed Size                     2296576 bytes

Variable Size                281019648 bytes

Database Buffers             780140544 bytes

Redo Buffers                   5480448 bytes

Automatic instance created


contents of Memory Script:

{

# set requested point in time

set until  scn 6223707;

# 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';

}

executing Memory Script


executing command: SET until clause


Starting restore at 14-DEC-20

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=7 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 /u01/app/oracle/fast_recovery_area/ORCL/autobackup/2020_12_14/o1_mf_s_1059158574_hxhy3zj0_.bkp

channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2020_12_14/o1_mf_s_1059158574_hxhy3zj0_.bkp tag=TAG20201214T184254

channel ORA_AUX_DISK_1: restored backup piece 1

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01

output file name=/u01/backup/ORCL/controlfile/o1_mf_hxhz3two_.ctl

Finished restore at 14-DEC-20


sql statement: alter database mount clone database


sql statement: alter system archive log current


contents of Memory Script:

{

# set requested point in time

set until  scn 6223707;

# set destinations for recovery set and auxiliary set datafiles

set newname for clone datafile  1 to new;

set newname for clone datafile  5 to new;

set newname for clone datafile  4 to new;

set newname for clone datafile  3 to new;

set newname for clone tempfile  1 to new;

# switch all tempfiles

switch clone tempfile all;

# restore the tablespaces in the recovery set and the auxiliary set

restore clone datafile  1, 5, 4, 3;

switch clone datafile all;

}

executing Memory Script


executing command: SET until clause


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


renamed tempfile 1 to /u01/backup/ORCL/datafile/o1_mf_temp_%u_.tmp in control file


Starting restore at 14-DEC-20

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 /u01/backup/ORCL/datafile/o1_mf_system_%u_.dbf

channel ORA_AUX_DISK_1: restoring datafile 00005 to /u01/backup/ORCL/datafile/o1_mf_system_%u_.dbf

channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/backup/ORCL/datafile/o1_mf_undotbs1_%u_.dbf

channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/backup/ORCL/datafile/o1_mf_sysaux_%u_.dbf

channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/ORCL/backupset/2020_12_14/o1_mf_nnnd0_TAG20201214T184159_hxhy27q3_.bkp

channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2020_12_14/o1_mf_nnnd0_TAG20201214T184159_hxhy27q3_.bkp tag=TAG20201214T184159

channel ORA_AUX_DISK_1: restored backup piece 1

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:05

Finished restore at 14-DEC-20


datafile 1 switched to datafile copy

input datafile copy RECID=7 STAMP=1059159666 file name=/u01/backup/ORCL/datafile/o1_mf_system_hxhz41lk_.dbf

datafile 5 switched to datafile copy

input datafile copy RECID=8 STAMP=1059159666 file name=/u01/backup/ORCL/datafile/o1_mf_system_hxhz41lw_.dbf

datafile 4 switched to datafile copy

input datafile copy RECID=9 STAMP=1059159666 file name=/u01/backup/ORCL/datafile/o1_mf_undotbs1_hxhz41lo_.dbf

datafile 3 switched to datafile copy

input datafile copy RECID=10 STAMP=1059159666 file name=/u01/backup/ORCL/datafile/o1_mf_sysaux_hxhz41l5_.dbf


contents of Memory Script:

{

# set requested point in time

set until  scn 6223707;

# online the datafiles restored or switched

sql clone "alter database datafile  1 online";

sql clone "alter database datafile  5 online";

sql clone "alter database datafile  4 online";

sql clone "alter database datafile  3 online";

# recover and open database read only

recover clone database tablespace  "SYSTEM", "UNDOTBS1", "SYSAUX";

sql clone 'alter database open read only';

}

executing Memory Script


executing command: SET until clause


sql statement: alter database datafile  1 online


sql statement: alter database datafile  5 online


sql statement: alter database datafile  4 online


sql statement: alter database datafile  3 online


Starting recover at 14-DEC-20

using channel ORA_AUX_DISK_1


starting media recovery


archived log for thread 1 with sequence 12 is already on disk as file /u01/app/oracle/fast_recovery_area/ORCL/archivelog/2020_12_14/o1_mf_1_12_hxhz1klk_.arc

archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2020_12_14/o1_mf_1_12_hxhz1klk_.arc thread=1 sequence=12

media recovery complete, elapsed time: 00:00:00

Finished recover at 14-DEC-20


sql statement: alter database open read only


contents of Memory Script:

{

   sql clone "create spfile from memory";

   shutdown clone immediate;

   startup clone nomount;

   sql clone "alter system set  control_files = 

  ''/u01/backup/ORCL/controlfile/o1_mf_hxhz3two_.ctl'' comment=

 ''RMAN set'' scope=spfile";

   shutdown clone immediate;

   startup clone nomount;

# mount database

sql clone 'alter database mount clone database';

}

executing Memory Script


sql statement: create spfile from memory


database closed

database dismounted

Oracle instance shut down


connected to auxiliary database (not started)

Oracle instance started


Total System Global Area    1068937216 bytes


Fixed Size                     2296576 bytes

Variable Size                285213952 bytes

Database Buffers             775946240 bytes

Redo Buffers                   5480448 bytes


sql statement: alter system set  control_files =   ''/u01/backup/ORCL/controlfile/o1_mf_hxhz3two_.ctl'' comment= ''RMAN set'' scope=spfile


Oracle instance shut down


connected to auxiliary database (not started)

Oracle instance started


Total System Global Area    1068937216 bytes


Fixed Size                     2296576 bytes

Variable Size                285213952 bytes

Database Buffers             775946240 bytes

Redo Buffers                   5480448 bytes


sql statement: alter database mount clone database


contents of Memory Script:

{

# set requested point in time

set until  scn 6223707;

# set destinations for recovery set and auxiliary set datafiles

set newname for datafile  6 to new;

# restore the tablespaces in the recovery set and the auxiliary set

restore clone datafile  6;

switch clone datafile all;

}

executing Memory Script


executing command: SET until clause


executing command: SET NEWNAME


Starting restore at 14-DEC-20

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=20 device type=DISK


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 00006 to /u01/backup/HAER_PITR_ORCL/datafile/o1_mf_users_%u_.dbf

channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/ORCL/backupset/2020_12_14/o1_mf_nnnd0_TAG20201214T184159_hxhy27q3_.bkp

channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2020_12_14/o1_mf_nnnd0_TAG20201214T184159_hxhy27q3_.bkp tag=TAG20201214T184159

channel ORA_AUX_DISK_1: restored backup piece 1

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01

Finished restore at 14-DEC-20


datafile 6 switched to datafile copy

input datafile copy RECID=12 STAMP=1059159701 file name=/u01/backup/HAER_PITR_ORCL/datafile/o1_mf_users_hxhz743t_.dbf


contents of Memory Script:

{

# set requested point in time

set until  scn 6223707;

# online the datafiles restored or switched

sql clone "alter database datafile  6 online";

# recover and open resetlogs

recover clone database tablespace  "USERS", "SYSTEM", "UNDOTBS1", "SYSAUX" delete archivelog;

alter clone database open resetlogs;

}

executing Memory Script


executing command: SET until clause


sql statement: alter database datafile  6 online


Starting recover at 14-DEC-20

using channel ORA_AUX_DISK_1


starting media recovery


archived log for thread 1 with sequence 12 is already on disk as file /u01/app/oracle/fast_recovery_area/ORCL/archivelog/2020_12_14/o1_mf_1_12_hxhz1klk_.arc

archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2020_12_14/o1_mf_1_12_hxhz1klk_.arc thread=1 sequence=12

media recovery complete, elapsed time: 00:00:00

Finished recover at 14-DEC-20


database opened


contents of Memory Script:

{

# create directory for datapump import

sql "create or replace directory TSPITR_DIROBJ_DPDIR as ''

/u01/backup/''";

# create directory for datapump export

sql clone "create or replace directory TSPITR_DIROBJ_DPDIR as ''

/u01/backup/''";

}

executing Memory Script


sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/backup/''


sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/backup/''


Performing export of tables...

   EXPDP> Starting "SYS"."TSPITR_EXP_haer_peEB":  

   EXPDP> Estimate in progress using BLOCKS method...

   EXPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

   EXPDP> Total estimation using BLOCKS method: 64 KB

   EXPDP> Processing object type TABLE_EXPORT/TABLE/TABLE

   EXPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

   EXPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER

   EXPDP> ORA-39127: unexpected error from call to export_string :=SYS.DBMS_TRANSFORM_EXIMP.INSTANCE_INFO_EXP('AQ$_ORDERS_QUEUETABLE_S','IX',1,1,'12.01.00.00.00',newblock) 

ORA-00376: file 2 cannot be read at this time

ORA-01110: data file 2: '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_example_hwjdb5y7_.dbf'

ORA-06512: at "SYS.DBMS_TRANSFORM_EXIMP", line 197

ORA-06512: at line 1

ORA-06512: at "SYS.DBMS_METADATA", line 9901

ORA-39127: unexpected error from call to export_string :=SYS.DBMS_TRANSFORM_EXIMP.INSTANCE_INFO_EXP('AQ$_STREAMS_QUEUE_TABLE_S','IX',1,1,'12.01.00.00.00',newblock) 

ORA-00376: file 2 cannot be read at this time

ORA-01110: data file 2: '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_example_hwjdb5y7_.dbf'

ORA-06512: at "SYS.DBMS_TRANSFORM_EXIMP", line 197

ORA-06512: at line 1

ORA-06512: at "SYS.DBMS_METADATA", line 9901

   EXPDP> . . exported "HR"."LOLITO"                               17.07 KB     107 rows

   EXPDP> Master table "SYS"."TSPITR_EXP_haer_peEB" successfully loaded/unloaded

   EXPDP> ******************************************************************************

   EXPDP> Dump file set for SYS.TSPITR_EXP_haer_peEB is:

   EXPDP>   /u01/backup/tspitr_haer_59331.dmp

   EXPDP> Job "SYS"."TSPITR_EXP_haer_peEB" completed with 2 error(s) at Mon Dec 14 19:03:12 2020 elapsed 0 00:00:50

Export completed



contents of Memory Script:

{

# shutdown clone before import

shutdown clone abort

}

executing Memory Script


Oracle instance shut down


Performing import of tables...

   IMPDP> Master table "SYS"."TSPITR_IMP_haer_pAbb" successfully loaded/unloaded

   IMPDP> Starting "SYS"."TSPITR_IMP_haer_pAbb":  

   IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE

   IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

   IMPDP> . . imported "HR"."LOLITO"                               17.07 KB     107 rows

   IMPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

   IMPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER

   IMPDP> Job "SYS"."TSPITR_IMP_haer_pAbb" successfully completed at Mon Dec 14 19:03:56 2020 elapsed 0 00:00:30

Import completed



Removing automatic instance

Automatic instance removed

auxiliary instance file /u01/backup/ORCL/datafile/o1_mf_temp_hxhz666l_.tmp deleted

auxiliary instance file /u01/backup/HAER_PITR_ORCL/onlinelog/o1_mf_3_hxhz774g_.log deleted

auxiliary instance file /u01/backup/HAER_PITR_ORCL/onlinelog/o1_mf_2_hxhz76pt_.log deleted

auxiliary instance file /u01/backup/HAER_PITR_ORCL/onlinelog/o1_mf_1_hxhz76cr_.log deleted

auxiliary instance file /u01/backup/HAER_PITR_ORCL/datafile/o1_mf_users_hxhz743t_.dbf deleted

auxiliary instance file /u01/backup/ORCL/datafile/o1_mf_sysaux_hxhz41l5_.dbf deleted

auxiliary instance file /u01/backup/ORCL/datafile/o1_mf_undotbs1_hxhz41lo_.dbf deleted

auxiliary instance file /u01/backup/ORCL/datafile/o1_mf_system_hxhz41lw_.dbf deleted

auxiliary instance file /u01/backup/ORCL/datafile/o1_mf_system_hxhz41lk_.dbf deleted

auxiliary instance file /u01/backup/ORCL/controlfile/o1_mf_hxhz3two_.ctl deleted

auxiliary instance file tspitr_haer_59331.dmp deleted

Finished recover at 14-DEC-20


RMAN> 



No hay comentarios: