SQL> show user
USER is "TOM"
SQL> select * from zam;
ID JMENO HIST_DATE
---------- ---------- ---------
 1 Tom
 2 Matej
SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
 2077404

SQL> drop table zam;
Table dropped.
SQL> purge table zam;
Table purged.
SQL> flashback table reco to before drop;
flashback table reco to before drop
*
ERROR at line 1:
ORA-38305: object not in RECYCLE BIN
RMAN> recover table tom.zam until scn 2077404 auxiliary destination '/u02/fra';
Starting recover at 26-FEB-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=53 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='etsm'
initialization parameters used for automatic instance:
db_name=ORCL12C
db_unique_name=etsm_pitr_ORCL12C
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=/u02/fra
log_archive_dest_1='location=/u02/fra'
#No auxiliary parameter file used
starting up automatic instance ORCL12C
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 2077404;
# 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 26-FEB-14
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 /u02/fra/ORCL12C/backupset/2014_02_26/o1_mf_ncsnf_TAG20140226T090000_9jv7wx5m_.bkp
channel ORA_AUX_DISK_1: piece handle=/u02/fra/ORCL12C/backupset/2014_02_26/o1_mf_ncsnf_TAG20140226T090000_9jv7wx5m_.bkp tag=TAG20140226T090000
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u02/fra/ORCL12C/controlfile/o1_mf_9jvdr4w2_.ctl
Finished restore at 26-FEB-14
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 2077404;
# 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 /u02/fra/ORCL12C/datafile/o1_mf_temp_%u_.tmp in control file
Starting restore at 26-FEB-14
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 /u02/fra/ORCL12C/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u02/fra/ORCL12C/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u02/fra/ORCL12C/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u02/fra/ORCL12C/backupset/2014_02_26/o1_mf_nnndf_TAG20140226T090000_9jv7r2b3_.bkp
channel ORA_AUX_DISK_1: piece handle=/u02/fra/ORCL12C/backupset/2014_02_26/o1_mf_nnndf_TAG20140226T090000_9jv7r2b3_.bkp tag=TAG20140226T090000
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:25
Finished restore at 26-FEB-14
datafile 1 switched to datafile copy
input datafile copy RECID=4 STAMP=840536816 file name=/u02/fra/ORCL12C/datafile/o1_mf_system_9jvdrc5m_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=5 STAMP=840536816 file name=/u02/fra/ORCL12C/datafile/o1_mf_undotbs1_9jvdrc6k_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=6 STAMP=840536816 file name=/u02/fra/ORCL12C/datafile/o1_mf_sysaux_9jvdrc6b_.dbf
contents of Memory Script:
{
# set requested point in time
set until scn 2077404;
# 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 26-FEB-14
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 24 is already on disk as file /u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_24_9jv7wyfw_.arc
archived log for thread 1 with sequence 25 is already on disk as file /u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_25_9jv9fksq_.arc
archived log for thread 1 with sequence 26 is already on disk as file /u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_26_9jv9gjlm_.arc
archived log for thread 1 with sequence 27 is already on disk as file /u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_27_9jvbqb66_.arc
archived log for thread 1 with sequence 28 is already on disk as file /u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_28_9jvcdsk2_.arc
archived log for thread 1 with sequence 29 is already on disk as file /u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_29_9jvd3ql2_.arc
archived log for thread 1 with sequence 30 is already on disk as file /u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_30_9jvd4q97_.arc
archived log for thread 1 with sequence 31 is already on disk as file /u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_31_9jvdowfp_.arc
archived log file name=/u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_24_9jv7wyfw_.arc thread=1 sequence=24
archived log file name=/u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_25_9jv9fksq_.arc thread=1 sequence=25
archived log file name=/u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_26_9jv9gjlm_.arc thread=1 sequence=26
archived log file name=/u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_27_9jvbqb66_.arc thread=1 sequence=27
archived log file name=/u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_28_9jvcdsk2_.arc thread=1 sequence=28
archived log file name=/u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_29_9jvd3ql2_.arc thread=1 sequence=29
archived log file name=/u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_30_9jvd4q97_.arc thread=1 sequence=30
archived log file name=/u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_31_9jvdowfp_.arc thread=1 sequence=31
media recovery complete, elapsed time: 00:00:09
Finished recover at 26-FEB-14
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 =
 ''/u02/fra/ORCL12C/controlfile/o1_mf_9jvdr4w2_.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 = ''/u02/fra/ORCL12C/controlfile/o1_mf_9jvdr4w2_.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 2077404;
# set destinations for recovery set and auxiliary set datafiles
set newname for datafile 5 to new;
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile 5;
switch clone datafile all;
}
executing Memory Script
executing command: SET until clause
executing command: SET NEWNAME
Starting restore at 26-FEB-14
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: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to /u02/fra/ETSM_PITR_ORCL12C/datafile/o1_mf_tools_%u_.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u02/fra/ORCL12C/backupset/2014_02_26/o1_mf_nnndf_TAG20140226T090000_9jv7r2b3_.bkp
channel ORA_AUX_DISK_1: piece handle=/u02/fra/ORCL12C/backupset/2014_02_26/o1_mf_nnndf_TAG20140226T090000_9jv7r2b3_.bkp tag=TAG20140226T090000
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
Finished restore at 26-FEB-14
datafile 5 switched to datafile copy
input datafile copy RECID=8 STAMP=840536856 file name=/u02/fra/ETSM_PITR_ORCL12C/datafile/o1_mf_tools_9jvdw0yh_.dbf
contents of Memory Script:
{
# set requested point in time
set until scn 2077404;
# online the datafiles restored or switched
sql clone "alter database datafile 5 online";
# recover and open resetlogs
recover clone database tablespace "TOOLS", "SYSTEM", "UNDOTBS1", "SYSAUX" delete archivelog;
alter clone database open resetlogs;
}
executing Memory Script
executing command: SET until clause
sql statement: alter database datafile 5 online
Starting recover at 26-FEB-14
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 24 is already on disk as file /u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_24_9jv7wyfw_.arc
archived log for thread 1 with sequence 25 is already on disk as file /u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_25_9jv9fksq_.arc
archived log for thread 1 with sequence 26 is already on disk as file /u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_26_9jv9gjlm_.arc
archived log for thread 1 with sequence 27 is already on disk as file /u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_27_9jvbqb66_.arc
archived log for thread 1 with sequence 28 is already on disk as file /u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_28_9jvcdsk2_.arc
archived log for thread 1 with sequence 29 is already on disk as file /u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_29_9jvd3ql2_.arc
archived log for thread 1 with sequence 30 is already on disk as file /u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_30_9jvd4q97_.arc
archived log for thread 1 with sequence 31 is already on disk as file /u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_31_9jvdowfp_.arc
archived log file name=/u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_24_9jv7wyfw_.arc thread=1 sequence=24
archived log file name=/u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_25_9jv9fksq_.arc thread=1 sequence=25
archived log file name=/u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_26_9jv9gjlm_.arc thread=1 sequence=26
archived log file name=/u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_27_9jvbqb66_.arc thread=1 sequence=27
archived log file name=/u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_28_9jvcdsk2_.arc thread=1 sequence=28
archived log file name=/u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_29_9jvd3ql2_.arc thread=1 sequence=29
archived log file name=/u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_30_9jvd4q97_.arc thread=1 sequence=30
archived log file name=/u02/fra/ORCL12C/archivelog/2014_02_26/o1_mf_1_31_9jvdowfp_.arc thread=1 sequence=31
media recovery complete, elapsed time: 00:00:01
Finished recover at 26-FEB-14
database opened
contents of Memory Script:
{
# create directory for datapump import
sql "create or replace directory TSPITR_DIROBJ_DPDIR as ''
/u02/fra''";
# create directory for datapump export
sql clone "create or replace directory TSPITR_DIROBJ_DPDIR as ''
/u02/fra''";
}
executing Memory Script
sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u02/fra''
sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u02/fra''
Performing export of tables...
 EXPDP> Starting "SYS"."TSPITR_EXP_etsm_eoom":
 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/CONSTRAINT/CONSTRAINT
 EXPDP> Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
 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: '/oradata/orcl12c/example01.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: '/oradata/orcl12c/example01.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 "TOM"."ZAM" 5.898 KB 2 rows
 EXPDP> Master table "SYS"."TSPITR_EXP_etsm_eoom" successfully loaded/unloaded
 EXPDP> ******************************************************************************
 EXPDP> Dump file set for SYS.TSPITR_EXP_etsm_eoom is:
 EXPDP> /u02/fra/tspitr_etsm_98934.dmp
 EXPDP> Job "SYS"."TSPITR_EXP_etsm_eoom" completed with 2 error(s) at Wed Feb 26 10:28:42 2014 elapsed 0 00:00:42
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_etsm_lDgp" successfully loaded/unloaded
 IMPDP> Starting "SYS"."TSPITR_IMP_etsm_lDgp":
 IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE
 IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
 IMPDP> . . imported "TOM"."ZAM" 5.898 KB 2 rows
 IMPDP> Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
 IMPDP> Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
 IMPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
 IMPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
 IMPDP> Job "SYS"."TSPITR_IMP_etsm_lDgp" successfully completed at Wed Feb 26 10:29:01 2014 elapsed 0 00:00:14
Import completed
Removing automatic instance
Automatic instance removed
auxiliary instance file /u02/fra/ORCL12C/datafile/o1_mf_temp_9jvdvd3q_.tmp deleted
auxiliary instance file /u02/fra/ETSM_PITR_ORCL12C/onlinelog/o1_mf_4_9jvdwh4s_.log deleted
auxiliary instance file /u02/fra/ETSM_PITR_ORCL12C/onlinelog/o1_mf_3_9jvdwdgr_.log deleted
auxiliary instance file /u02/fra/ETSM_PITR_ORCL12C/onlinelog/o1_mf_2_9jvdwcgv_.log deleted
auxiliary instance file /u02/fra/ETSM_PITR_ORCL12C/onlinelog/o1_mf_1_9jvdw955_.log deleted
auxiliary instance file /u02/fra/ETSM_PITR_ORCL12C/datafile/o1_mf_tools_9jvdw0yh_.dbf deleted
auxiliary instance file /u02/fra/ORCL12C/datafile/o1_mf_sysaux_9jvdrc6b_.dbf deleted
auxiliary instance file /u02/fra/ORCL12C/datafile/o1_mf_undotbs1_9jvdrc6k_.dbf deleted
auxiliary instance file /u02/fra/ORCL12C/datafile/o1_mf_system_9jvdrc5m_.dbf deleted
auxiliary instance file /u02/fra/ORCL12C/controlfile/o1_mf_9jvdr4w2_.ctl deleted
auxiliary instance file tspitr_etsm_98934.dmp deleted
Finished recover at 26-FEB-14
 SQL> select * from zam;
ID JMENO HIST_DATE
---------- ---------- ---------
 1 Tom
 2 Matej


          
            


Komentáře