jueves, 28 de febrero de 2019

RECOVERY TABLE

RMAN> BACKUP DATABASE PLUS ARCHIVELOG;

SQL>  select name,current_scn from v$database;

NAME   CURRENT_SCN
--------- -----------
ACME       2450131

SQL> connect hr/hr
Connected.

SQL> select tname from tab;

SQL> select tname from tab;

TNAME
--------------------------------------------------------------------------------
EMP_DETAILS_VIEW
LOLITO
REGIONS
LOCATIONS
DEPARTMENTS
JOBS
EMPLOYEES
JOB_HISTORY
COUNTRIES


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

Table created.

SQL> select count(*) from hr.lolito;

  COUNT(*)
----------
       107

SQL> select name,current_scn from v$database;

NAME   CURRENT_SCN
--------- -----------
ACME       2450628

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options
[oracle@localhost ~]$ rman target /

Recovery Manager: Release 12.1.0.1.0 - Production on Thu Feb 28 19:32:32 2019

Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ACME (DBID=2033062067)

RMAN> backup incremental level 1 database plus archivelog;


Starting backup at 28-FEB-19
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=597 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=10 RECID=36 STAMP=1000980063
input archived log thread=1 sequence=11 RECID=37 STAMP=1000994984
input archived log thread=1 sequence=12 RECID=38 STAMP=1001013007
input archived log thread=1 sequence=13 RECID=39 STAMP=1001030417
input archived log thread=1 sequence=14 RECID=40 STAMP=1001052704
input archived log thread=1 sequence=15 RECID=41 STAMP=1001070056
input archived log thread=1 sequence=16 RECID=42 STAMP=1001095452
input archived log thread=1 sequence=17 RECID=43 STAMP=1001109918
input archived log thread=1 sequence=18 RECID=44 STAMP=1001160463
input archived log thread=1 sequence=19 RECID=45 STAMP=1001196087
input archived log thread=1 sequence=20 RECID=46 STAMP=1001214005
input archived log thread=1 sequence=21 RECID=47 STAMP=1001268018
input archived log thread=1 sequence=22 RECID=48 STAMP=1001277588
input archived log thread=1 sequence=23 RECID=49 STAMP=1001277845
input archived log thread=1 sequence=24 RECID=54 STAMP=1001279131
input archived log thread=1 sequence=25 RECID=52 STAMP=1001279130
channel ORA_DISK_1: starting piece 1 at 28-FEB-19
channel ORA_DISK_1: finished piece 1 at 28-FEB-19
piece handle=+FRA/ACME/BACKUPSET/2019_02_28/annnf0_tag20190228t193254_0.285.1001446375 tag=TAG20190228T193254 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting archived log backup set
skipping +FRA/ACME/ARCHIVELOG/2019_02_26/thread_1_seq_1.307.1001280041; file deleted from recovery area to reclaim disk space
channel ORA_DISK_1: backup cancelled because all files were skipped
channel ORA_DISK_1: starting archived log backup set
skipping +FRA/ACME/ARCHIVELOG/2019_02_26/thread_1_seq_1.309.1001280553; file deleted from recovery area to reclaim disk space
channel ORA_DISK_1: backup cancelled because all files were skipped
channel ORA_DISK_1: starting archived log backup set
skipping +FRA/ACME/ARCHIVELOG/2019_02_26/thread_1_seq_26.268.1001279131; file deleted from recovery area to reclaim disk space
channel ORA_DISK_1: backup cancelled because all files were skipped
channel ORA_DISK_1: starting archived log backup set
skipping +FRA/ACME/ARCHIVELOG/2019_02_26/thread_1_seq_2.310.1001280609; file deleted from recovery area to reclaim disk space
skipping +FRA/ACME/ARCHIVELOG/2019_02_26/thread_1_seq_3.311.1001280663; file deleted from recovery area to reclaim disk space
skipping +FRA/ACME/ARCHIVELOG/2019_02_26/thread_1_seq_4.312.1001280669; file deleted from recovery area to reclaim disk space
skipping +FRA/ACME/ARCHIVELOG/2019_02_26/thread_1_seq_5.313.1001280673; file deleted from recovery area to reclaim disk space
skipping +FRA/ACME/ARCHIVELOG/2019_02_26/thread_1_seq_6.314.1001280673; file deleted from recovery area to reclaim disk space
skipping +FRA/ACME/ARCHIVELOG/2019_02_26/thread_1_seq_7.315.1001280837; file deleted from recovery area to reclaim disk space
channel ORA_DISK_1: backup cancelled because all files were skipped
channel ORA_DISK_1: starting archived log backup set
skipping +FRA/ACME/ARCHIVELOG/2019_02_26/thread_1_seq_1.325.1001282577; file deleted from recovery area to reclaim disk space
channel ORA_DISK_1: backup cancelled because all files were skipped
channel ORA_DISK_1: starting archived log backup set
skipping +FRA/ACME/ARCHIVELOG/2019_02_26/thread_1_seq_8.316.1001280837; file deleted from recovery area to reclaim disk space
skipping +FRA/ACME/ARCHIVELOG/2019_02_26/thread_1_seq_9.317.1001280841; file deleted from recovery area to reclaim disk space
skipping +FRA/ACME/ARCHIVELOG/2019_02_26/thread_1_seq_10.320.1001281159; file deleted from recovery area to reclaim disk space
skipping +FRA/ACME/ARCHIVELOG/2019_02_26/thread_1_seq_10.318.1001280841; file deleted from recovery area to reclaim disk space
skipping +FRA/ACME/ARCHIVELOG/2019_02_26/thread_1_seq_11.321.1001281159; file deleted from recovery area to reclaim disk space
skipping +FRA/ACME/ARCHIVELOG/2019_02_26/thread_1_seq_11.319.1001280843; file deleted from recovery area to reclaim disk space
skipping +FRA/ACME/ARCHIVELOG/2019_02_26/thread_1_seq_12.322.1001281159; file deleted from recovery area to reclaim disk space
channel ORA_DISK_1: backup cancelled because all files were skipped
channel ORA_DISK_1: starting archived log backup set
skipping +FRA/ACME/ARCHIVELOG/2019_02_27/thread_1_seq_2.327.1001314807; file deleted from recovery area to reclaim disk space
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=3 RECID=72 STAMP=1001366107
input archived log thread=1 sequence=4 RECID=73 STAMP=1001368964
input archived log thread=1 sequence=5 RECID=74 STAMP=1001412016
input archived log thread=1 sequence=6 RECID=75 STAMP=1001443925
input archived log thread=1 sequence=7 RECID=76 STAMP=1001443989
input archived log thread=1 sequence=8 RECID=77 STAMP=1001446086
input archived log thread=1 sequence=9 RECID=78 STAMP=1001446087
input archived log thread=1 sequence=10 RECID=79 STAMP=1001446089
input archived log thread=1 sequence=11 RECID=80 STAMP=1001446089
input archived log thread=1 sequence=12 RECID=81 STAMP=1001446306
input archived log thread=1 sequence=13 RECID=82 STAMP=1001446309
input archived log thread=1 sequence=14 RECID=83 STAMP=1001446314
input archived log thread=1 sequence=15 RECID=84 STAMP=1001446317
input archived log thread=1 sequence=16 RECID=85 STAMP=1001446373
channel ORA_DISK_1: starting piece 1 at 28-FEB-19
channel ORA_DISK_1: finished piece 1 at 28-FEB-19
piece handle=+FRA/ACME/BACKUPSET/2019_02_28/annnf0_tag20190228t193254_0.292.1001446403 tag=TAG20190228T193254 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 28-FEB-19

Starting backup at 28-FEB-19
using channel ORA_DISK_1
no parent backup or copy of datafile 3 found
no parent backup or copy of datafile 1 found
no parent backup or copy of datafile 2 found
no parent backup or copy of datafile 4 found
no parent backup or copy of datafile 6 found
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00003 name=+DATA/ACME/DATAFILE/sysaux.257.848597951
input datafile file number=00001 name=+DATA/ACME/DATAFILE/system.258.1000676203
input datafile file number=00002 name=+DATA/ACME/DATAFILE/example.266.1000672081
input datafile file number=00004 name=+DATA/ACME/DATAFILE/undotbs1.260.848598093
input datafile file number=00006 name=+DATA/ACME/DATAFILE/users.259.848598091
channel ORA_DISK_1: starting piece 1 at 28-FEB-19
channel ORA_DISK_1: finished piece 1 at 28-FEB-19
piece handle=+FRA/ACME/BACKUPSET/2019_02_28/nnndn0_tag20190228t193325_0.289.1001446405 tag=TAG20190228T193325 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
Finished backup at 28-FEB-19

Starting backup at 28-FEB-19
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=17 RECID=86 STAMP=1001446460
channel ORA_DISK_1: starting piece 1 at 28-FEB-19
channel ORA_DISK_1: finished piece 1 at 28-FEB-19
piece handle=+FRA/ACME/BACKUPSET/2019_02_28/annnf0_tag20190228t193421_0.302.1001446461 tag=TAG20190228T193421 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 28-FEB-19

Starting Control File and SPFILE Autobackup at 28-FEB-19
piece handle=+FRA/ACME/AUTOBACKUP/2019_02_28/s_1001446462.287.1001446463 comment=NONE
Finished Control File and SPFILE Autobackup at 28-FEB-19

RMAN> exit

QL> connect hr/hr
Connected.
SQL> select tname from tab; 

TNAME
--------------------------------------------------------------------------------
EMP_DETAILS_VIEW
LOLITO
REGIONS
LOCATIONS
DEPARTMENTS
JOBS
EMPLOYEES
JOB_HISTORY
COUNTRIES

9 rows selected.

SQL> show recyclebin;       
SQL> drop table lolito purge;

Table dropped.

SQL> show recyclebin;
SQL> select tname from tab;

TNAME
--------------------------------------------------------------------------------
EMP_DETAILS_VIEW
REGIONS
LOCATIONS
DEPARTMENTS
JOBS
EMPLOYEES
JOB_HISTORY
COUNTRIES

8 rows selected.

[oracle@localhost ~]$ sqlplus '/as sysdba'

SQL*Plus: Release 12.1.0.1.0 Production on Thu Feb 28 19:36:54 2019

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL> select name,current_scn from v$database;

NAME   CURRENT_SCN
--------- -----------
ACME       2450888

SQL> 


[oracle@localhost ~]$ rman target /

Recovery Manager: Release 12.1.0.1.0 - Production on Thu Feb 28 19:39:01 2019

Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ACME (DBID=2033062067)

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

Starting recover at 28-FEB-19
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=592 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='yfFn'

initialization parameters used for automatic instance:
db_name=ACME
db_unique_name=yfFn_pitr_ACME
compatible=12.1.0.0.0
db_block_size=8192
db_files=250
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                293602560 bytes
Database Buffers             767557632 bytes
Redo Buffers                   5480448 bytes
Automatic instance created

contents of Memory Script:
{
# set requested point in time
set until  scn 2450628;
# 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 28-FEB-19
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=111 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/2019_02_28/s_1001443991.305.1001443991
channel ORA_AUX_DISK_1: piece handle=+FRA/ACME/AUTOBACKUP/2019_02_28/s_1001443991.305.1001443991 tag=TAG20190228T185311
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04
output file name=/u01/backup/ACME/controlfile/o1_mf_g7jzzxy4_.ctl
Finished restore at 28-FEB-19

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 2450628;
# 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 28-FEB-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 /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/2019_02_28/nnndf0_tag20190228t185243_0.336.1001443965
channel ORA_AUX_DISK_1: piece handle=+FRA/ACME/BACKUPSET/2019_02_28/nnndf0_tag20190228t185243_0.336.1001443965 tag=TAG20190228T185243
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 28-FEB-19

datafile 1 switched to datafile copy
input datafile copy RECID=4 STAMP=1001446989 file name=/u01/backup/ACME/datafile/o1_mf_system_g7k004cn_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=5 STAMP=1001446989 file name=/u01/backup/ACME/datafile/o1_mf_undotbs1_g7k004ct_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=6 STAMP=1001446989 file name=/u01/backup/ACME/datafile/o1_mf_sysaux_g7k004cj_.dbf

contents of Memory Script:
{
# set requested point in time
set until  scn 2450628;
# 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 28-FEB-19
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 10 is already on disk as file +FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_10.281.1001446089
archived log for thread 1 with sequence 11 is already on disk as file +FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_11.283.1001446089
archived log for thread 1 with sequence 12 is already on disk as file +FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_12.267.1001446307
archived log for thread 1 with sequence 13 is already on disk as file +FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_13.266.1001446309
archived log for thread 1 with sequence 14 is already on disk as file +FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_14.280.1001446315
archived log for thread 1 with sequence 15 is already on disk as file +FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_15.301.1001446317
archived log for thread 1 with sequence 16 is already on disk as file +FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_16.299.1001446373
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=7
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=8
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=9
channel ORA_AUX_DISK_1: reading from backup piece +FRA/ACME/BACKUPSET/2019_02_28/annnf0_tag20190228t193254_0.292.1001446403
channel ORA_AUX_DISK_1: piece handle=+FRA/ACME/BACKUPSET/2019_02_28/annnf0_tag20190228t193254_0.292.1001446403 tag=TAG20190228T193254
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
archived log file name=/u01/backup/1_7_1001281158.dbf thread=1 sequence=7
archived log file name=/u01/backup/1_8_1001281158.dbf thread=1 sequence=8
archived log file name=/u01/backup/1_9_1001281158.dbf thread=1 sequence=9
archived log file name=+FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_10.281.1001446089 thread=1 sequence=10
archived log file name=+FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_11.283.1001446089 thread=1 sequence=11
archived log file name=+FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_12.267.1001446307 thread=1 sequence=12
archived log file name=+FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_13.266.1001446309 thread=1 sequence=13
archived log file name=+FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_14.280.1001446315 thread=1 sequence=14
archived log file name=+FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_15.301.1001446317 thread=1 sequence=15
archived log file name=+FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_16.299.1001446373 thread=1 sequence=16
media recovery complete, elapsed time: 00:00:05
Finished recover at 28-FEB-19

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_g7jzzxy4_.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                297796864 bytes
Database Buffers             763363328 bytes
Redo Buffers                   5480448 bytes

sql statement: alter system set  control_files =   ''/u01/backup/ACME/controlfile/o1_mf_g7jzzxy4_.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                297796864 bytes
Database Buffers             763363328 bytes
Redo Buffers                   5480448 bytes

sql statement: alter database mount clone database

contents of Memory Script:
{
# set requested point in time
set until  scn 2450628;
# 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 28-FEB-19
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=8 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/YFFN_PITR_ACME/datafile/o1_mf_users_%u_.dbf
channel ORA_AUX_DISK_1: reading from backup piece +FRA/ACME/BACKUPSET/2019_02_28/nnndf0_tag20190228t185243_0.336.1001443965
channel ORA_AUX_DISK_1: piece handle=+FRA/ACME/BACKUPSET/2019_02_28/nnndf0_tag20190228t185243_0.336.1001443965 tag=TAG20190228T185243
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 28-FEB-19

datafile 6 switched to datafile copy
input datafile copy RECID=8 STAMP=1001447199 file name=/u01/backup/YFFN_PITR_ACME/datafile/o1_mf_users_g7k07gmn_.dbf

contents of Memory Script:
{
# set requested point in time
set until  scn 2450628;
# 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 28-FEB-19
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 10 is already on disk as file +FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_10.281.1001446089
archived log for thread 1 with sequence 11 is already on disk as file +FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_11.283.1001446089
archived log for thread 1 with sequence 12 is already on disk as file +FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_12.267.1001446307
archived log for thread 1 with sequence 13 is already on disk as file +FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_13.266.1001446309
archived log for thread 1 with sequence 14 is already on disk as file +FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_14.280.1001446315
archived log for thread 1 with sequence 15 is already on disk as file +FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_15.301.1001446317
archived log for thread 1 with sequence 16 is already on disk as file +FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_16.299.1001446373
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=7
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=8
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=9
channel ORA_AUX_DISK_1: reading from backup piece +FRA/ACME/BACKUPSET/2019_02_28/annnf0_tag20190228t193254_0.292.1001446403
channel ORA_AUX_DISK_1: piece handle=+FRA/ACME/BACKUPSET/2019_02_28/annnf0_tag20190228t193254_0.292.1001446403 tag=TAG20190228T193254
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
archived log file name=/u01/backup/1_7_1001281158.dbf thread=1 sequence=7
channel clone_default: deleting archived log(s)
archived log file name=/u01/backup/1_7_1001281158.dbf RECID=80 STAMP=1001447201
archived log file name=/u01/backup/1_8_1001281158.dbf thread=1 sequence=8
channel clone_default: deleting archived log(s)
archived log file name=/u01/backup/1_8_1001281158.dbf RECID=82 STAMP=1001447202
archived log file name=/u01/backup/1_9_1001281158.dbf thread=1 sequence=9
channel clone_default: deleting archived log(s)
archived log file name=/u01/backup/1_9_1001281158.dbf RECID=81 STAMP=1001447201
archived log file name=+FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_10.281.1001446089 thread=1 sequence=10
archived log file name=+FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_11.283.1001446089 thread=1 sequence=11
archived log file name=+FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_12.267.1001446307 thread=1 sequence=12
archived log file name=+FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_13.266.1001446309 thread=1 sequence=13
archived log file name=+FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_14.280.1001446315 thread=1 sequence=14
archived log file name=+FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_15.301.1001446317 thread=1 sequence=15
archived log file name=+FRA/ACME/ARCHIVELOG/2019_02_28/thread_1_seq_16.299.1001446373 thread=1 sequence=16
media recovery complete, elapsed time: 00:00:02
Finished recover at 28-FEB-19

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_yfFn_oyeA":  
   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.266.1000672081'
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.266.1000672081'
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_yfFn_oyeA" successfully loaded/unloaded
   EXPDP> ******************************************************************************
   EXPDP> Dump file set for SYS.TSPITR_EXP_yfFn_oyeA is:
   EXPDP>   /u01/backup/tspitr_yfFn_52443.dmp
   EXPDP> Job "SYS"."TSPITR_EXP_yfFn_oyeA" completed with 2 error(s) at Thu Feb 28 19:47:28 2019 elapsed 0 00:00:25
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_yfFn_ijqa" successfully loaded/unloaded
   IMPDP> Starting "SYS"."TSPITR_IMP_yfFn_ijqa":  
   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_yfFn_ijqa" successfully completed at Thu Feb 28 19:48:28 2019 elapsed 0 00:00:22
Import completed


Removing automatic instance
Automatic instance removed
auxiliary instance file /u01/backup/ACME/datafile/o1_mf_temp_g7k017st_.tmp deleted
auxiliary instance file /u01/backup/YFFN_PITR_ACME/onlinelog/o1_mf_3_g7k07qcd_.log deleted
auxiliary instance file /u01/backup/YFFN_PITR_ACME/onlinelog/o1_mf_2_g7k07q53_.log deleted
auxiliary instance file /u01/backup/YFFN_PITR_ACME/onlinelog/o1_mf_1_g7k07pyb_.log deleted
auxiliary instance file /u01/backup/YFFN_PITR_ACME/datafile/o1_mf_users_g7k07gmn_.dbf deleted
auxiliary instance file /u01/backup/ACME/datafile/o1_mf_sysaux_g7k004cj_.dbf deleted
auxiliary instance file /u01/backup/ACME/datafile/o1_mf_undotbs1_g7k004ct_.dbf deleted
auxiliary instance file /u01/backup/ACME/datafile/o1_mf_system_g7k004cn_.dbf deleted
auxiliary instance file /u01/backup/ACME/controlfile/o1_mf_g7jzzxy4_.ctl deleted
auxiliary instance file tspitr_yfFn_52443.dmp deleted
Finished recover at 28-FEB-19

RMAN> exit


Recovery Manager complete.

SQL> connect hr/hr;
Connected.
SQL> select tname from tab;

TNAME
--------------------------------------------------------------------------------
COUNTRIES
JOB_HISTORY
EMPLOYEES
JOBS
DEPARTMENTS
LOCATIONS
REGIONS
EMP_DETAILS_VIEW
LOLITO

9 rows selected.

SQL> connect hr/hr;
Connected.
SQL> select tname from tab;

TNAME
--------------------------------------------------------------------------------
COUNTRIES
JOB_HISTORY
EMPLOYEES
JOBS
DEPARTMENTS
LOCATIONS
REGIONS
EMP_DETAILS_VIEW
LOLITO

9 rows selected.

SQL> select count(*) from hr.lolito;

  COUNT(*)
----------
       107

SQL> 


OTRO METODO DE RESTAURACION


[oracle@localhost ~]$ rman target /

Recovery Manager: Release 12.1.0.1.0 - Production on Mon May 4 20:52:32 2020

Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ACME (DBID=2033062067)

RMAN> RECOVER TABLE HR.LOLITO UNTIL SEQUENCE 27 AUXILIARY DESTINATION '/u01/backup/';

Starting recover at 04-MAY-20
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=66 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='fjxD'

initialization parameters used for automatic instance:
db_name=ACME
db_unique_name=fjxD_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  logseq 27 thread 1;
# 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 04-MAY-20
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=21 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_05_04/s_1039544686.262.1039544687
channel ORA_AUX_DISK_1: piece handle=+FRA/ACME/AUTOBACKUP/2020_05_04/s_1039544686.262.1039544687 tag=TAG20200504T182446
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:13
output file name=/u01/backup/ACME/controlfile/o1_mf_hc1krprp_.ctl
Finished restore at 04-MAY-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  logseq 27 thread 1;
# 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;
set newname for clone tempfile  2 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

executing command: SET NEWNAME

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

Starting restore at 04-MAY-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/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_05_04/nnndf0_tag20200504t182329_0.275.1039544609
channel ORA_AUX_DISK_1: piece handle=+FRA/ACME/BACKUPSET/2020_05_04/nnndf0_tag20200504t182329_0.275.1039544609 tag=TAG20200504T182329
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:06
Finished restore at 04-MAY-20

datafile 1 switched to datafile copy
input datafile copy RECID=16 STAMP=1039553681 file name=/u01/backup/ACME/datafile/o1_mf_system_hc1krz4s_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=17 STAMP=1039553681 file name=/u01/backup/ACME/datafile/o1_mf_undotbs1_hc1krz50_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=18 STAMP=1039553681 file name=/u01/backup/ACME/datafile/o1_mf_sysaux_hc1krz4o_.dbf

contents of Memory Script:
{
# set requested point in time
set until  logseq 27 thread 1;
# 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 04-MAY-20
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 22 is already on disk as file +FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_22.298.1039544685
archived log for thread 1 with sequence 23 is already on disk as file +FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_23.272.1039550065
archived log for thread 1 with sequence 24 is already on disk as file +FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_24.266.1039550071
archived log for thread 1 with sequence 25 is already on disk as file +FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_25.279.1039550075
archived log for thread 1 with sequence 26 is already on disk as file +FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_26.293.1039550077
archived log file name=+FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_22.298.1039544685 thread=1 sequence=22
archived log file name=+FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_23.272.1039550065 thread=1 sequence=23
archived log file name=+FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_24.266.1039550071 thread=1 sequence=24
archived log file name=+FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_25.279.1039550075 thread=1 sequence=25
archived log file name=+FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_26.293.1039550077 thread=1 sequence=26
media recovery complete, elapsed time: 00:00:09
Finished recover at 04-MAY-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/ACME/controlfile/o1_mf_hc1krprp_.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_hc1krprp_.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  logseq 27 thread 1;
# 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 04-MAY-20
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/FJXD_PITR_ACME/datafile/o1_mf_users_%u_.dbf
channel ORA_AUX_DISK_1: reading from backup piece +FRA/ACME/BACKUPSET/2020_05_04/nnndf0_tag20200504t182329_0.275.1039544609
channel ORA_AUX_DISK_1: piece handle=+FRA/ACME/BACKUPSET/2020_05_04/nnndf0_tag20200504t182329_0.275.1039544609 tag=TAG20200504T182329
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 04-MAY-20

datafile 6 switched to datafile copy
input datafile copy RECID=20 STAMP=1039553744 file name=/u01/backup/FJXD_PITR_ACME/datafile/o1_mf_users_hc1kwzw9_.dbf

contents of Memory Script:
{
# set requested point in time
set until  logseq 27 thread 1;
# 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 04-MAY-20
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 22 is already on disk as file +FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_22.298.1039544685
archived log for thread 1 with sequence 23 is already on disk as file +FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_23.272.1039550065
archived log for thread 1 with sequence 24 is already on disk as file +FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_24.266.1039550071
archived log for thread 1 with sequence 25 is already on disk as file +FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_25.279.1039550075
archived log for thread 1 with sequence 26 is already on disk as file +FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_26.293.1039550077
archived log file name=+FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_22.298.1039544685 thread=1 sequence=22
archived log file name=+FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_23.272.1039550065 thread=1 sequence=23
archived log file name=+FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_24.266.1039550071 thread=1 sequence=24
archived log file name=+FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_25.279.1039550075 thread=1 sequence=25
archived log file name=+FRA/ACME/ARCHIVELOG/2020_05_04/thread_1_seq_26.293.1039550077 thread=1 sequence=26
media recovery complete, elapsed time: 00:00:01
Finished recover at 04-MAY-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_fjxD_sunw":  
   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.257.1038425975'
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.257.1038425975'
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_fjxD_sunw" successfully loaded/unloaded
   EXPDP> ******************************************************************************
   EXPDP> Dump file set for SYS.TSPITR_EXP_fjxD_sunw is:
   EXPDP>   /u01/backup/tspitr_fjxD_71835.dmp
   EXPDP> Job "SYS"."TSPITR_EXP_fjxD_sunw" completed with 2 error(s) at Mon May 4 20:57:54 2020 elapsed 0 00:01:19
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_fjxD_EpBc" successfully loaded/unloaded
   IMPDP> Starting "SYS"."TSPITR_IMP_fjxD_EpBc":  
   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_fjxD_EpBc" successfully completed at Mon May 4 21:00:59 2020 elapsed 0 00:01:13
Import completed


Removing automatic instance
Automatic instance removed
auxiliary instance file /u01/backup/ACME/datafile/o1_mf_temp_hc1kvkgk_.tmp deleted
auxiliary instance file /u01/backup/ACME/datafile/o1_mf_temp_hc1kvkrg_.tmp deleted
auxiliary instance file /u01/backup/FJXD_PITR_ACME/onlinelog/o1_mf_3_hc1kx3v9_.log deleted
auxiliary instance file /u01/backup/FJXD_PITR_ACME/onlinelog/o1_mf_2_hc1kx378_.log deleted
auxiliary instance file /u01/backup/FJXD_PITR_ACME/onlinelog/o1_mf_1_hc1kx2jw_.log deleted
auxiliary instance file /u01/backup/FJXD_PITR_ACME/datafile/o1_mf_users_hc1kwzw9_.dbf deleted
auxiliary instance file /u01/backup/ACME/datafile/o1_mf_sysaux_hc1krz4o_.dbf deleted
auxiliary instance file /u01/backup/ACME/datafile/o1_mf_undotbs1_hc1krz50_.dbf deleted
auxiliary instance file /u01/backup/ACME/datafile/o1_mf_system_hc1krz4s_.dbf deleted
auxiliary instance file /u01/backup/ACME/controlfile/o1_mf_hc1krprp_.ctl deleted
auxiliary instance file tspitr_fjxD_71835.dmp deleted
Finished recover at 04-MAY-20

RMAN> 




sábado, 23 de febrero de 2019

RMAN SYSBACKUP


SQL> grant sysbackup to hr;

Grant succeeded.


[oracle@localhost dbs]$ rman target "'hr/hr as sysbackup'"

Recovery Manager: Release 12.1.0.1.0 - Production on Sat Feb 23 11:06:50 2019

Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ACME (DBID=2033062067)

RMAN>

SIN ARCHIVO DE CONTROL

Una opción es recuperar el archivo de control desde el archivo de log de RMAN. Cada copia de seguridad que se ejecuta genera un archivo de log el cual contiene los nombres y números de cada archivo de datos. Extrayendo esta información puede crearse un archivo de control nuevo sobre el cual se puede realizar catalogación de piezas y recuperación de la base de datos hasta un punto en el tiempo.

 El archivo de log muestra en qué pieza se encuentra cada uno de los archivos de datos a restaurar como lo muestra el texto en colores


...
RMAN> 2> 3> 4> 5> 6> 7>
starting full resync of recovery catalog
full resync complete
allocated channel: ch1
channel ch1: SID=409 device type=DISK
allocated channel: ch2
channel ch2: SID=600 device type=DISK
Starting backup at 08/05/2014 21:10:14
channel ch1: starting compressed full datafile backup set
channel ch1: specifying datafile(s) in backup set
input datafile file number=00014 name=+DG_DATA/fonpetp/datafile/ts_fonpet_movim.dbf
input datafile file number=00012 name=+DG_DATA/fonpetp/datafile/ts_fonpet_movim_02.dbf
input datafile file number=00002 name=+DG_DATA/fonpetp/datafile/sysaux01.dbf
input datafile file number=00006 name=+DG_DATA/fonpetp/datafile/indic_fonpet_param.dbf
input datafile file number=00009 name=+DG_DATA/fonpetp/datafile/ts_fonpet_param.dbf
input datafile file number=00001 name=+DG_DATA/fonpetp/datafile/system01.dbf
input datafile file number=00004 name=+DG_DATA/fonpetp/datafile/users01.dbf
channel ch1: starting piece 1 at 08/05/2014 21:10:16
channel ch2: starting compressed full datafile backup set
channel ch2: specifying datafile(s) in backup set
input datafile file number=00010 name=+DG_DATA/fonpetp/datafile/ts_fonpet_movim_01.dbf
input datafile file number=00005 name=+DG_DATA/fonpetp/datafile/indic_fonpet_movim_01.dbf
input datafile file number=00013 name=+DG_DATA/fonpetp/datafile/ts_fonpet_rep.dbf
input datafile file number=00015 name=+DG_DATA/fonpetp/datafile/ts_fonpet_movim_2.dbf
input datafile file number=00011 name=+DG_DATA/fonpetp/datafile/indic_fonpet_movim_02.dbf
input datafile file number=00007 name=+DG_DATA/fonpetp/datafile/indic_fonpet_movim.dbf
input datafile file number=00003 name=+DG_DATA/fonpetp/datafile/undotbs101.dbf
input datafile file number=00008 name=+DG_DATA/fonpetp/datafile/indic_fonpet_movim_reorg0.dbf
channel ch2: starting piece 1 at 08/05/2014 21:10:18
channel ch2: finished piece 1 at 08/05/2014 21:23:13
piece handle=/u03/backups/rman/fonpetp/full_FONPETP_v5p7q2ho_1_1_20140508.bak tag=TAG20140508T211014 comment=NONE
channel ch2: backup set complete, elapsed time: 00:12:55
channel ch1: finished piece 1 at 08/05/2014 21:31:23
piece handle=/u03/backups/rman/fonpetp/full_FONPETP_v4p7q2hn_1_1_20140508.bak tag=TAG20140508T211014 comment=NONE
channel ch1: backup set complete, elapsed time: 00:21:07
Finished backup at 08/05/2014 21:31:23
...


Se prepara el bloque de comandos PLSQL que restaura los archivos usando el paquete DBMS_BACKUP_RESTORE y la información obtenida del archivo de log. Aunque se puede hacer para todos los archivos en un solo bloque, se recomienda hacerlo por cada archivo. Nótese que en el archivo de log aparece el nombre de la pieza en donde se encuentra cada archivo de datos para construir el bloque.


[oracle@bdprod logs]$ sqlplus dba_fonpet as sysdba
Password:
Connected.
SYS@fonpetp> startup nomount;
ORACLE instance started.
Total System Global Area 1.0422E+10 bytes
Fixed Size    2237448 bytes
Variable Size 5670702072 bytes
Database Buffers 4731174912 bytes
Redo Buffers   18120704 bytes
SQL> DECLARE
  v_dev varchar2(50);
  v_done boolean;
  type t_fileTable is table of varchar2(255) index by binary_integer;
  v_fileTable t_fileTable;
  v_maxPieces number:=2;
BEGIN
  v_fileTable(1):='/u02/backup/rman/full_FONPETP_v5p7q2ho_1_1_20140508.bak';
  v_maxPieces:=2;
  v_dev:=sys.dbms_backup_restore.deviceAllocate(type=>null, ident=>'d1');
  sys.dbms_backup_restore.restoreSetDatafile;
  --dbms_backup_restore.RestoreDatafileTo(dfnumber => 1);
  dbms_backup_restore.RestoreDatafileTo( 1,'+DG_DATA/fonpetd/datafile/system01.dbf',0,'SYSTEM');
  FOR i IN 1..v_maxPieces LOOP
        sys.dbms_backup_restore.restoreBackupPiece(done=>v_done, handle=>v_fileTable(i), params=>null);
        IF v_done THEN
                GOTO all_done;
        END IF;
  END LOOP;
  <>
  sys.dbms_backup_restore.deviceDeallocate;
END;
/


Puede realizarse seguimiento de la restauración de cada archivo de datos usando la vista v$session_longops;


SYS@fonpetd>  select opname, time_remaining/60 mins
  2  from v$session_longops
  3  where time_remaining > 0;
OPNAME                                                                 MINS
---------------------------------------------------------------- ----------
RMAN: full datafile restore                                      4.31666667


En caso que sea necesario crear los directorios faltantes se procede desde asmcmd


[oracle@bddesarrollo rman]$ asmcmd mkdir +DG_FRA/fonpetp/
[oracle@bddesarrollo rman]$ asmcmd mkdir +DG_FRA/fonpetp/onlinelog/


Si la restauración se realiza con un nuevo nombre será necesario cambiar el parámetro db_name y las rutas respectivas, validar su existencia igualmente. En caso contrario que se desee conservar en nombre de la base de datos este paso no es necesario este paso.


SYS@fonpett> create pfile='/tmp/init.ora' from spfile='+DG_DATA/fonpett/spfilefonpett.ora';
File created.
SYS@fonpett> startup force nomount;
ORACLE instance started.
Total System Global Area 3206836224 bytes
Fixed Size    2232640 bytes
Variable Size 1493176000 bytes
Database Buffers 1694498816 bytes
Redo Buffers   16928768 bytes
SYS@fonpett> show parameter db_name
NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name      string FONPETP
SYS@fonpett> exit
Disconnected from Oracle Database 11g Release 11.2.0.3.0 - 64bit Production
[oracle@bdpruebas ~]$ vi /tmp/init.ora
"/tmp/init.ora" 28L, 976C
*.audit_file_dest='/u01/app/oracle/admin/fonpett/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='+DG_DATA/fonpett/control01.ctl','+DG_FRA/fonpett/control02.ctl'
*.db_block_size=8192
*.db_create_file_dest='+DG_DATA'
*.db_domain=''
*.db_name='FONPETT'
*.db_unique_name='FONPETT'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=fonpettXDB)'
*.open_cursors=300
*.pga_aggregate_target=1073741824
*.processes=400
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=445
*.sga_target=3221225472
*.standby_file_management='MANUAL'
*.undo_tablespace='UNDOTBS1'
17,1All892019879 65432
:q!
[oracle@bdpruebas ~]$ . oraenv
ORACLE_SID = [fonpett] ? fonpett
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@bdpruebas ~]$ sqlplus dba_fonpet as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Mon Jun 16 14:35:33 2014
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Enter password: *********
Connected to:
Oracle Database 11g Release 11.2.0.3.0 - 64bit Production
With the Automatic Storage Management option
SYS@fonpett> startup force nomount pfile='/tmp/init.ora';
ORACLE instance started.
Total System Global Area 3206836224 bytes
Fixed Size    2232640 bytes
Variable Size 1493176000 bytes
Database Buffers 1694498816 bytes
Redo Buffers   16928768 bytes
SYS@fonpett> show parameter db_name
NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name      string FONPETT
SYS@fonpett> create spfile from pfile='/tmp/init.ora';
File created.
SYS@fonpett> startup force nomount;
ORACLE instance started.
Total System Global Area 3206836224 bytes
Fixed Size    2232640 bytes
Variable Size 1493176000 bytes
Database Buffers 1694498816 bytes
Redo Buffers   16928768 bytes
SYS@fonpett> show parameter db_name
NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name      string FONPETP
SYS@fonpett> exit
Disconnected from Oracle Database 11g Release 11.2.0.3.0 - 64bit Production


Se procede con la preparación y ejecución del comando para crear el archivo de control desde SQL Plus


[oracle@bdprod restaurar]$ sqlplus dba_fonpet as sysdba
Connected.
SYS@fonpetp> startup force nomount;
ORACLE instance started.
Total System Global Area 1.0422E+10 bytes
Fixed Size    2237448 bytes
Variable Size 5670702072 bytes
Database Buffers 4731174912 bytes
Redo Buffers   18120704 bytes
SYSfonpetp> CREATE CONTROLFILE SET DATABASE "FONPETT" RESETLOGS ARCHIVELOG
MAXLOGFILES 32 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 2920
LOGFILE
       GROUP  1 ('+DG_DATA/fonpett/onlinelog/redo01a.rdo','+DG_FRA/fonpett/onlinelog/redo01b.rdo') SIZE 50M BLOCKSIZE 512,
       GROUP  2 ('+DG_DATA/fonpett/onlinelog/redo02a.rdo','+DG_FRA/fonpett/onlinelog/redo02b.rdo') SIZE 50M BLOCKSIZE 512,
       GROUP  3 ('+DG_DATA/fonpett/onlinelog/redo03a.rdo','+DG_FRA/fonpett/onlinelog/redo03b.rdo') SIZE 50M BLOCKSIZE 512,
       GROUP  4 ('+DG_DATA/fonpett/onlinelog/redo04a.rdo','+DG_FRA/fonpett/onlinelog/redo04b.rdo') SIZE 50M BLOCKSIZE 512,
       GROUP  5 ('+DG_DATA/fonpett/onlinelog/redo05a.rdo','+DG_FRA/fonpett/onlinelog/redo05b.rdo') SIZE 50M BLOCKSIZE 512,
       GROUP  6 ('+DG_DATA/fonpett/onlinelog/redo06a.rdo','+DG_FRA/fonpett/onlinelog/redo06b.rdo') SIZE 50M BLOCKSIZE 512,
       GROUP  7 ('+DG_DATA/fonpett/onlinelog/redo07a.rdo','+DG_FRA/fonpett/onlinelog/redo07b.rdo') SIZE 50M BLOCKSIZE 512,
       GROUP  8 ('+DG_DATA/fonpett/onlinelog/redo08a.rdo','+DG_FRA/fonpett/onlinelog/redo08b.rdo') SIZE 50M BLOCKSIZE 512,
       GROUP  9 '+DG_DATA/fonpett/onlinelog/redolog1.stb' SIZE 50M BLOCKSIZE 512,
       GROUP 10 '+DG_DATA/fonpett/onlinelog/redolog2.stb' SIZE 50M BLOCKSIZE 512,
       GROUP 11 '+DG_DATA/fonpett/onlinelog/redolog3.stb' SIZE 50M BLOCKSIZE 512,
       GROUP 13 '+DG_DATA/fonpett/onlinelog/redolog4.stb' SIZE 50M BLOCKSIZE 512,
       GROUP 14 '+DG_DATA/fonpett/onlinelog/redolog5.stb' SIZE 50M BLOCKSIZE 512,
       GROUP 15 '+DG_DATA/fonpett/onlinelog/redolog6.stb' SIZE 50M BLOCKSIZE 512,
       GROUP 16 '+DG_DATA/fonpett/onlinelog/redolog7.stb' SIZE 50M BLOCKSIZE 512,
       GROUP 17 '+DG_DATA/fonpett/onlinelog/redolog8.stb' SIZE 50M BLOCKSIZE 512,
       GROUP 18 '+DG_DATA/fonpett/onlinelog/redolog9.stb' SIZE 50M BLOCKSIZE 512
DATAFILE
       '+DG_DATA/fonpett/datafile/system01.dbf',
       '+DG_DATA/fonpett/datafile/systaux01.dbf',
       '+DG_DATA/fonpett/datafile/undotbs101.dbf',
       '+DG_DATA/fonpett/datafile/users01.dbf',
       '+DG_DATA/fonpett/datafile/indic_fonpet_movim_01.dbf',
       '+DG_DATA/fonpett/datafile/indic_fonpet_param.dbf',
       '+DG_DATA/fonpett/datafile/indic_fonpet_movim.dbf',
       '+DG_DATA/fonpett/datafile/indic_fonpet_movim_reorg0.dbf',
       '+DG_DATA/fonpett/datafile/ts_fonpet_param.dbf',
       '+DG_DATA/fonpett/datafile/ts_fonpet_movim_01.dbf',
       '+DG_DATA/fonpett/datafile/indic_fonpet_movim_02.dbf',
       '+DG_DATA/fonpett/datafile/ts_fonpet_movim_02.dbf',
       '+DG_DATA/fonpett/datafile/ts_fonpet_rep.dbf',
       '+DG_DATA/fonpett/datafile/ts_fonpet_movim.dbf',
       '+DG_DATA/fonpett/datafile/ts_fonpet_movim_2.dbf'
CHARACTER SET WE8ISO8859P1
;
Control file created.


Validar que todos los archivos de daros se encuentren matriculados en el archivo de control con tamaño y en estado ONLINE o RECOVER


SYS@fonpett> set lines 2000 pages 1000
SYS@fonpett> col name format a79
SYS@fonpett> select name, bytes, status from v$datafile;
NAME     BYTES STATUS
------------------------------------------------------------------------------- ---------- -------
+DG_DATA/fonpett/datafile/system01.dbf                  1126170624 SYSTEM
+DG_DATA/fonpett/datafile/systaux01.dbf                 1986002944 RECOVER
+DG_DATA/fonpett/datafile/undotbs101.dbf                3191865344 RECOVER
+DG_DATA/fonpett/datafile/users01.dbf                    187432960 RECOVER
+DG_DATA/fonpett/datafile/indic_fonpet_movim_01.dbf     5309988864 RECOVER
+DG_DATA/fonpett/datafile/indic_fonpet_param.dbf         594214912 RECOVER
+DG_DATA/fonpett/datafile/indic_fonpet_movim.dbf        3463774208 RECOVER
+DG_DATA/fonpett/datafile/indic_fonpet_movim_reorg0.dbf 2621440000 RECOVER
+DG_DATA/fonpett/datafile/ts_fonpet_param.dbf            104857600 RECOVER
+DG_DATA/fonpett/datafile/ts_fonpet_movim_01.dbf        8678146048 RECOVER
+DG_DATA/fonpett/datafile/indic_fonpet_movim_02.dbf     5146411008 RECOVER
+DG_DATA/fonpett/datafile/ts_fonpet_movim_02.dbf        3145728000 RECOVER
+DG_DATA/fonpett/datafile/ts_fonpet_rep.dbf             5242880000 RECOVER
+DG_DATA/fonpett/datafile/ts_fonpet_movim.dbf           3.4318E+10 RECOVER
+DG_DATA/fonpett/datafile/ts_fonpet_movim_2.dbf         5242880000 RECOVER
15 rows selected.


Se procede con la catalogación de piezas para recover.


[oracle@bddesarrollo dbs]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Jun 12 14:33:59 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: FONPETD (DBID=2150325182, not open)
RMAN> catalog start with '/u02/backup/rman';
using target database control file instead of recovery catalog
searching for all files that match the pattern /u02/backup/rman
List of Files Unknown to the Database
=====================================
File Name: /u02/backup/rman/full_FONPETP_v5p7q2ho_1_1_20140508.bak
File Name: /u02/backup/rman/full_FONPETP_v4p7q2hn_1_1_20140508.bak
File Name: /u02/backup/rman/archivelog_FONPETP_vcp7q44p_1_1_20140508.bak
Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u02/backup/rman/full_FONPETP_v5p7q2ho_1_1_20140508.bak
File Name: /u02/backup/rman/full_FONPETP_v4p7q2hn_1_1_20140508.bak
File Name: /u02/backup/rman/archivelog_FONPETP_vcp7q44p_1_1_20140508.bak


Se define el punto de restauración, en este caso usando el último archivelog y se restauran los archive logs respectivos. Nótese que en la columna “Next SCN” aparece el número de SCN hasta el cual puede restaurarse la base de datos usando archive logs que equivale al punto de restauración de las 21:31:27


RMAN> list backup of archivelog all;
List of Backup Sets
===================
BS Key  Size       Device Type Elapsed Time Completion Time   
------- ---------- ----------- ------------ -------------------
2       262.36M    DISK        00:00:00     08/05/2014 21:37:29
        BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: TAG20140508T213135
        Piece Name: /u02/backup/rman/archivelog_FONPETP_vcp7q44p_1_1_20140508.bak
  List of Archived Logs in backup set 2
  Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
  ---- ------- ---------- ------------------- ---------- ---------
  1    3580    68215578   08/05/2014 11:03:22 68218390   08/05/2014 11:17:05
  1    3581    68218390   08/05/2014 11:17:05 68219047   08/05/2014 11:17:11
  1    3582    68219047   08/05/2014 11:17:11 68220601   08/05/2014 11:25:59
  1    3583    68220601   08/05/2014 11:25:59 68221736   08/05/2014 11:32:42
  1    3584    68221736   08/05/2014 11:32:42 68225001   08/05/2014 11:56:51
  1    3585    68225001   08/05/2014 11:56:51 68228020   08/05/2014 12:17:07
  1    3586    68228020   08/05/2014 12:17:07 68233698   08/05/2014 12:59:44
  1    3587    68233698   08/05/2014 12:59:44 68234397   08/05/2014 12:59:50
  1    3588    68234397   08/05/2014 12:59:50 68235608   08/05/2014 13:05:11
  1    3589    68235608   08/05/2014 13:05:11 68245134   08/05/2014 14:26:51
  1    3590    68245134   08/05/2014 14:26:51 68255946   08/05/2014 16:01:05
  1    3591    68255946   08/05/2014 16:01:05 68257325   08/05/2014 16:08:14
  1    3592    68257325   08/05/2014 16:08:14 68260491   08/05/2014 16:31:42
  1    3593    68260491   08/05/2014 16:31:42 68264133   08/05/2014 17:00:07
  1    3594    68264133   08/05/2014 17:00:07 68277112   08/05/2014 18:44:19
  1    3595    68277112   08/05/2014 18:44:19 68287826   08/05/2014 20:17:55
  1    3596    68287826   08/05/2014 20:17:55 68295909   08/05/2014 21:31:27
RMAN> restore archivelog all;
Starting restore at 12-JUN-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=200 device type=DISK
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3580
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3581
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3582
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3583
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3584
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3585
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3586
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3587
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3588
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3589
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3590
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3591
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3592
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3593
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3594
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3595
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3596
channel ORA_DISK_1: reading from backup piece /u02/backup/rman/archivelog_FONPETP_vcp7q44p_1_1_20140508.bak
channel ORA_DISK_1: piece handle=/u02/backup/rman/archivelog_FONPETP_vcp7q44p_1_1_20140508.bak tag=TAG20140508T213135
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 12-JUN-14
RMAN> exit;


A este punto los archive logs han quedado restaurados en el ASM (+DG_FRA/fonpetd/archivelog). Finalmente se realiza recover usando la metodología backup controlfile. Se debe especificar como punto de restauración SCN-1 para llegar al punto de consistencia que ofrece el backup.


SQL> alter database mount;
SQL> recover database using backup controlfile until change 68295908;
ORA-00279: change 68294119 generated at 05/08/2014 21:10:16 needed for thread 1
ORA-00289: suggestion :
+DG_FRA/fonpetd/archivelog/2014_06_12/thread_1_seq_3596.271.850055727
ORA-00280: change 68294119 for thread 1 is in sequence #3596
Specify log: {=suggested | filename | AUTO | CANCEL}
+DG_FRA/fonpetd/archivelog/2014_06_12/thread_1_seq_3596.271.850055727
Log applied.
Media recovery complete.


Se realiza apertura de la base de datos en modo solo lectura y se ejecuta una consulta al diccionario de datos para validar que está efectivamente accediendo a los archivos de datos sin problema. Se baja la instancia y se inicia de nuevo para dejar dando servicio.


SYS@fonpett> alter database open read only;
Database altered.
SYS@fonpetd> select name, bytes, status from v$datafile;
NAME                                                              BYTES STATUS
------------------------------------------------------------ ---------- -------
+DG_DATA/fonpetd/datafile/system01.dbf                       1168113664 SYSTEM
+DG_DATA/fonpetd/datafile/systaux01.dbf                      1986002944 ONLINE
+DG_DATA/fonpetd/datafile/undotbs101.dbf                     3191865344 ONLINE
+DG_DATA/fonpetd/datafile/users01.dbf                         187432960 ONLINE
+DG_DATA/fonpetd/datafile/indic_fonpet_movim_01.dbf          5309988864 ONLINE
+DG_DATA/fonpetd/datafile/indic_fonpet_param.dbf              594214912 ONLINE
+DG_DATA/fonpetd/datafile/indic_fonpet_movim.dbf             3463774208 ONLINE
+DG_DATA/fonpetd/datafile/indic_fonpet_movim_reorg0.dbf      2621440000 ONLINE
+DG_DATA/fonpetd/datafile/ts_fonpet_param.dbf                 104857600 ONLINE
+DG_DATA/fonpetd/datafile/ts_fonpet_movim_01.dbf             8678146048 ONLINE
+DG_DATA/fonpetd/datafile/indic_fonpet_movim_02.dbf          5146411008 ONLINE
+DG_DATA/fonpetd/datafile/ts_fonpet_movim_02.dbf             3145728000 ONLINE
+DG_DATA/fonpetd/datafile/ts_fonpet_rep.dbf                  5242880000 ONLINE
+DG_DATA/fonpetd/datafile/ts_fonpet_movim.dbf                3.4318E+10 ONLINE
+DG_DATA/fonpetd/datafile/ts_fonpet_movim_2.dbf              5242880000 ONLINE
SYS@fonpett> select count(*) from dba_segments;
  COUNT(*)
----------
      6046
SYS@fonpett> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@fonpett> startup mount;
ORACLE instance started.
Total System Global Area 3206836224 bytes
Fixed Size                  2232640 bytes
Variable Size            1493176000 bytes
Database Buffers         1694498816 bytes
Redo Buffers               16928768 bytes
Database mounted.
SYS@fonpetd> alter database open resetlogs;
Database altered.
SYS@fonpetd> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@fonpetd> startup
ORACLE instance started.