Automatic TSPITR 11.2.0.3 (dropped user)

RMAN> recover tablespace tmp1 until scn 2038705 auxiliary destination='/tmp';

Starting recover at 18-OCT-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=58 instance=rac1 device type=DISK
RMAN-05026: WARNING: presuming following set of tablespaces applies to specified poi                                          nt-in-time

List of tablespaces expected to have UNDO segments
Tablespace SYSTEM
Tablespace UNDOTBS1
Tablespace UNDOTBS2

Creating automatic instance, with SID='AfDt'

initialization parameters used for automatic instance:
db_name=RAC
db_unique_name=AfDt_tspitr_RAC
compatible=11.2.0.0.0
db_block_size=8192
db_files=200
sga_target=280M
processes=50
db_create_file_dest=/tmp
log_archive_dest_1='location=/tmp'
#No auxiliary parameter file used


starting up automatic instance RAC

Oracle instance started

Total System Global Area     292278272 bytes

Fixed Size                     2227744 bytes
Variable Size                100663776 bytes
Database Buffers             184549376 bytes
Redo Buffers                   4837376 bytes
Automatic instance created


List of tablespaces that have been dropped from the target database:
Tablespace tmp1

contents of Memory Script:
{
# set requested point in time
set until  scn 2038705;
# restore the controlfile
restore clone controlfile;
# mount the controlfile
sql clone 'alter database mount clone database';
# archive current online log
sql 'alter system archive log current';
# avoid unnecessary autobackups for structural changes during TSPITR
sql 'begin dbms_backup_restore.AutoBackupFlag(FALSE); end;';
}
executing Memory Script

executing command: SET until clause

Starting restore at 18-OCT-15
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=25 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 +RAC01_ORAFLSH/rac/backupset/2015_01_29/ncsnf0_tag20150129t152408_0.266.870276465
channel ORA_AUX_DISK_1: piece handle=+RAC01_ORAFLSH/rac/backupset/2015_01_29/ncsnf0_tag20150129t152408_0.266.870276465 tag=TAG20150129T152408
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
output file name=/tmp/RAC/controlfile/o1_mf_c27wd32b_.ctl
Finished restore at 18-OCT-15

sql statement: alter database mount clone database

sql statement: alter system archive log current

sql statement: begin dbms_backup_restore.AutoBackupFlag(FALSE); end;

contents of Memory Script:
{
# set requested point in time
set until  scn 2038705;
# set destinations for recovery set and auxiliary set datafiles
set newname for clone datafile  1 to new;
set newname for clone datafile  3 to new;
set newname for clone datafile  5 to new;
set newname for clone datafile  2 to new;
set newname for clone tempfile  1 to new;
set newname for datafile  6 to new;
# switch all tempfiles
switch clone tempfile all;
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile  1, 3, 5, 2, 6;
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

executing command: SET NEWNAME

renamed tempfile 1 to /tmp/RAC/datafile/o1_mf_temp_%u_.tmp in control file

Starting restore at 18-OCT-15
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /tmp/RAC/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /tmp/RAC/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00005 to /tmp/RAC/datafile/o1_mf_undotbs2_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002 to /tmp/RAC/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to +RAC01_ORADATA
channel ORA_AUX_DISK_1: reading from backup piece +RAC01_ORAFLSH/rac/backupset/2015_01_29/nnndf0_tag20150129t152408_0.265.870276251
channel ORA_AUX_DISK_1: piece handle=+RAC01_ORAFLSH/rac/backupset/2015_01_29/nnndf0_tag20150129t152408_0.265.870276251 tag=TAG20150129T152408
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:02:47
Finished restore at 18-OCT-15

datafile 6 switched to datafile copy
input datafile copy RECID=6 STAMP=893431549 file name=+RAC01_ORADATA/rac/datafile/tmp1.272.893431377
datafile 1 switched to datafile copy
input datafile copy RECID=7 STAMP=893431550 file name=/tmp/RAC/datafile/o1_mf_system_c27wdk1y_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=8 STAMP=893431550 file name=/tmp/RAC/datafile/o1_mf_undotbs1_c27wdkbp_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=9 STAMP=893431550 file name=/tmp/RAC/datafile/o1_mf_undotbs2_c27wdkbk_.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=10 STAMP=893431550 file name=/tmp/RAC/datafile/o1_mf_sysaux_c27wdk22_.dbf

contents of Memory Script:
{
# set requested point in time
set until  scn 2038705;
# online the datafiles restored or switched
sql clone "alter database datafile  1 online";
sql clone "alter database datafile  3 online";
sql clone "alter database datafile  5 online";
sql clone "alter database datafile  2 online";
sql clone "alter database datafile  6 online";
# recover and open resetlogs
recover clone database tablespace  "TMP1", "SYSTEM", "UNDOTBS1", "UNDOTBS2", "SYSAUX" delete archivelog;
alter clone database open resetlogs;
}
executing Memory Script

executing command: SET until clause

sql statement: alter database datafile  1 online

sql statement: alter database datafile  3 online

sql statement: alter database datafile  5 online

sql statement: alter database datafile  2 online

sql statement: alter database datafile  6 online

Starting recover at 18-OCT-15
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 26 is already on disk as file +RAC01_ORAFLSH/rac/archivelog/2015_01_29/thread_1_seq_26.267.870276759
archived log file name=+RAC01_ORAFLSH/rac/archivelog/2015_01_29/thread_1_seq_26.267.870276759 thread=1 sequence=26
media recovery complete, elapsed time: 00:00:02
Finished recover at 18-OCT-15

database opened

contents of Memory Script:
{
# make read only the tablespace that will be exported
sql clone 'alter tablespace  TMP1 read only';
# create directory for datapump import
sql "create or replace directory TSPITR_DIROBJ_DPDIR as ''
/tmp''";
# create directory for datapump export
sql clone "create or replace directory TSPITR_DIROBJ_DPDIR as ''
/tmp''";
}
executing Memory Script

sql statement: alter tablespace  TMP1 read only

sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/tmp''

sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/tmp''

Performing export of metadata...
   EXPDP> Starting "SYS"."TSPITR_EXP_AfDt":
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
   EXPDP> Master table "SYS"."TSPITR_EXP_AfDt" successfully loaded/unloaded
   EXPDP> ******************************************************************************
   EXPDP> Dump file set for SYS.TSPITR_EXP_AfDt is:
   EXPDP>   /tmp/tspitr_AfDt_34031.dmp
   EXPDP> ******************************************************************************
   EXPDP> Datafiles required for transportable tablespace TMP1:
   EXPDP>   +RAC01_ORADATA/rac/datafile/tmp1.272.893431377
   EXPDP> Job "SYS"."TSPITR_EXP_AfDt" successfully completed at 15:29:39
Export completed


contents of Memory Script:
{
# shutdown clone before import
shutdown clone immediate
}
executing Memory Script

database closed
database dismounted
Oracle instance shut down

Performing import of metadata...
   IMPDP> Master table "SYS"."TSPITR_IMP_AfDt" successfully loaded/unloaded
   IMPDP> Starting "SYS"."TSPITR_IMP_AfDt":
   IMPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
   IMPDP> ORA-39123: Data Pump transportable tablespace job aborted
ORA-29342: user TU does not exist in the database

Removing automatic instance
Automatic instance removed
auxiliary instance file /tmp/RAC/datafile/o1_mf_temp_c27wn1to_.tmp deleted
auxiliary instance file /tmp/RAC/onlinelog/o1_mf_6_c27wmdhx_.log deleted
auxiliary instance file /tmp/RAC/onlinelog/o1_mf_5_c27wm6gw_.log deleted
auxiliary instance file /tmp/RAC/onlinelog/o1_mf_4_c27wm32x_.log deleted
auxiliary instance file /tmp/RAC/onlinelog/o1_mf_3_c27wm0kr_.log deleted
auxiliary instance file /tmp/RAC/onlinelog/o1_mf_2_c27wlwm4_.log deleted
auxiliary instance file /tmp/RAC/onlinelog/o1_mf_1_c27wlrk7_.log deleted
auxiliary instance file /tmp/RAC/datafile/o1_mf_sysaux_c27wdk22_.dbf deleted
auxiliary instance file /tmp/RAC/datafile/o1_mf_undotbs2_c27wdkbk_.dbf deleted
auxiliary instance file /tmp/RAC/datafile/o1_mf_undotbs1_c27wdkbp_.dbf deleted
auxiliary instance file /tmp/RAC/datafile/o1_mf_system_c27wdk1y_.dbf deleted
auxiliary instance file /tmp/RAC/controlfile/o1_mf_c27wd32b_.ctl deleted
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 10/18/2015 15:30:44
RMAN-06963: Error received during import of metadata
RMAN-06965: Datapump job has stopped
RMAN-06961:    IMPDP> Job "SYS"."TSPITR_IMP_AfDt" stopped due to fatal error at 15:30:34

RMAN> exit


Recovery Manager complete.
[oracle@rac01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Sun Oct 18 15:56:49 2015

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> grant dba to tu identified by t;
Grant succeeded.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
[oracle@rac01 ~]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Sun Oct 18 15:57:22 2015

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

connected to target database: RAC (DBID=2454340081)

RMAN> exit


Recovery Manager complete.
[oracle@rac01 ~]$ rman target / <<EOF
> recover tablespace tmp1 until scn 2038705 auxiliary destination='/tmp';
> EOF
Recovery Manager: Release 11.2.0.3.0 - Production on Sun Oct 18 15:57:52 2015

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

connected to target database: RAC (DBID=2454340081)

RMAN>
Starting recover at 18-OCT-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=91 instance=rac1 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
Tablespace UNDOTBS2

Creating automatic instance, with SID='anCu'

initialization parameters used for automatic instance:
db_name=RAC
db_unique_name=anCu_tspitr_RAC
compatible=11.2.0.0.0
db_block_size=8192
db_files=200
sga_target=280M
processes=50
db_create_file_dest=/tmp
log_archive_dest_1='location=/tmp'
#No auxiliary parameter file used


starting up automatic instance RAC

Oracle instance started

Total System Global Area     292278272 bytes

Fixed Size                     2227744 bytes
Variable Size                100663776 bytes
Database Buffers             184549376 bytes
Redo Buffers                   4837376 bytes
Automatic instance created


List of tablespaces that have been dropped from the target database:
Tablespace tmp1

contents of Memory Script:
{
# set requested point in time
set until  scn 2038705;
# restore the controlfile
restore clone controlfile;
# mount the controlfile
sql clone 'alter database mount clone database';
# archive current online log
sql 'alter system archive log current';
# avoid unnecessary autobackups for structural changes during TSPITR
sql 'begin dbms_backup_restore.AutoBackupFlag(FALSE); end;';
}
executing Memory Script

executing command: SET until clause

Starting restore at 18-OCT-15
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=24 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 +RAC01_ORAFLSH/rac/backupset/2015_01_29/ncsnf0_tag20150129t152408_0.266.870276465
channel ORA_AUX_DISK_1: piece handle=+RAC01_ORAFLSH/rac/backupset/2015_01_29/ncsnf0_tag20150129t152408_0.266.870276465 tag=TAG20150129T152408
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:11
output file name=/tmp/RAC/controlfile/o1_mf_c27ygq3g_.ctl
Finished restore at 18-OCT-15

sql statement: alter database mount clone database

sql statement: alter system archive log current

sql statement: begin dbms_backup_restore.AutoBackupFlag(FALSE); end;

contents of Memory Script:
{
# set requested point in time
set until  scn 2038705;
# set destinations for recovery set and auxiliary set datafiles
set newname for clone datafile  1 to new;
set newname for clone datafile  3 to new;
set newname for clone datafile  5 to new;
set newname for clone datafile  2 to new;
set newname for clone tempfile  1 to new;
set newname for datafile  6 to new;
# switch all tempfiles
switch clone tempfile all;
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile  1, 3, 5, 2, 6;
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

executing command: SET NEWNAME

renamed tempfile 1 to /tmp/RAC/datafile/o1_mf_temp_%u_.tmp in control file

Starting restore at 18-OCT-15
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /tmp/RAC/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /tmp/RAC/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00005 to /tmp/RAC/datafile/o1_mf_undotbs2_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002 to /tmp/RAC/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to +RAC01_ORADATA
channel ORA_AUX_DISK_1: reading from backup piece +RAC01_ORAFLSH/rac/backupset/2015_01_29/nnndf0_tag20150129t152408_0.265.870276251
channel ORA_AUX_DISK_1: piece handle=+RAC01_ORAFLSH/rac/backupset/2015_01_29/nnndf0_tag20150129t152408_0.265.870276251 tag=TAG20150129T152408
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:02:27
Finished restore at 18-OCT-15

datafile 6 switched to datafile copy
input datafile copy RECID=6 STAMP=893433659 file name=+RAC01_ORADATA/rac/datafile/tmp1.273.893433511
datafile 1 switched to datafile copy
input datafile copy RECID=7 STAMP=893433659 file name=/tmp/RAC/datafile/o1_mf_system_c27yh5xr_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=8 STAMP=893433659 file name=/tmp/RAC/datafile/o1_mf_undotbs1_c27yh791_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=9 STAMP=893433659 file name=/tmp/RAC/datafile/o1_mf_undotbs2_c27yh78x_.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=10 STAMP=893433659 file name=/tmp/RAC/datafile/o1_mf_sysaux_c27yh5z6_.dbf

contents of Memory Script:
{
# set requested point in time
set until  scn 2038705;
# online the datafiles restored or switched
sql clone "alter database datafile  1 online";
sql clone "alter database datafile  3 online";
sql clone "alter database datafile  5 online";
sql clone "alter database datafile  2 online";
sql clone "alter database datafile  6 online";
# recover and open resetlogs
recover clone database tablespace  "TMP1", "SYSTEM", "UNDOTBS1", "UNDOTBS2", "SYSAUX" delete archivelog;
alter clone database open resetlogs;
}
executing Memory Script

executing command: SET until clause

sql statement: alter database datafile  1 online

sql statement: alter database datafile  3 online

sql statement: alter database datafile  5 online

sql statement: alter database datafile  2 online

sql statement: alter database datafile  6 online

Starting recover at 18-OCT-15
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 26 is already on disk as file +RAC01_ORAFLSH/rac/archivelog/2015_01_29/thread_1_seq_26.267.870276759
archived log file name=+RAC01_ORAFLSH/rac/archivelog/2015_01_29/thread_1_seq_26.267.870276759 thread=1 sequence=26
media recovery complete, elapsed time: 00:00:03
Finished recover at 18-OCT-15

database opened

contents of Memory Script:
{
# make read only the tablespace that will be exported
sql clone 'alter tablespace  TMP1 read only';
# create directory for datapump import
sql "create or replace directory TSPITR_DIROBJ_DPDIR as ''
/tmp''";
# create directory for datapump export
sql clone "create or replace directory TSPITR_DIROBJ_DPDIR as ''
/tmp''";
}
executing Memory Script

sql statement: alter tablespace  TMP1 read only

sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/tmp''

sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/tmp''

Performing export of metadata...
   EXPDP> Starting "SYS"."TSPITR_EXP_anCu":
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
   EXPDP> Master table "SYS"."TSPITR_EXP_anCu" successfully loaded/unloaded
   EXPDP> ******************************************************************************
   EXPDP> Dump file set for SYS.TSPITR_EXP_anCu is:
   EXPDP>   /tmp/tspitr_anCu_22352.dmp
   EXPDP> ******************************************************************************
   EXPDP> Datafiles required for transportable tablespace TMP1:
   EXPDP>   +RAC01_ORADATA/rac/datafile/tmp1.273.893433511
   EXPDP> Job "SYS"."TSPITR_EXP_anCu" successfully completed at 16:04:39
Export completed


contents of Memory Script:
{
# shutdown clone before import
shutdown clone immediate
}
executing Memory Script

database closed
database dismounted
Oracle instance shut down

Performing import of metadata...
   IMPDP> Master table "SYS"."TSPITR_IMP_anCu" successfully loaded/unloaded
   IMPDP> Starting "SYS"."TSPITR_IMP_anCu":
   IMPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
   IMPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE
   IMPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
   IMPDP> Job "SYS"."TSPITR_IMP_anCu" successfully completed at 16:05:37
Import completed


contents of Memory Script:
{
# make read write and offline the imported tablespaces
sql 'alter tablespace  TMP1 read write';
sql 'alter tablespace  TMP1 offline';
# enable autobackups after TSPITR is finished
sql 'begin dbms_backup_restore.AutoBackupFlag(TRUE); end;';
}
executing Memory Script

sql statement: alter tablespace  TMP1 read write

sql statement: alter tablespace  TMP1 offline

sql statement: begin dbms_backup_restore.AutoBackupFlag(TRUE); end;

Removing automatic instance
Automatic instance removed
auxiliary instance file /tmp/RAC/datafile/o1_mf_temp_c27yot6v_.tmp deleted
auxiliary instance file /tmp/RAC/onlinelog/o1_mf_6_c27yobt7_.log deleted
auxiliary instance file /tmp/RAC/onlinelog/o1_mf_5_c27yo59g_.log deleted
auxiliary instance file /tmp/RAC/onlinelog/o1_mf_4_c27yo309_.log deleted
auxiliary instance file /tmp/RAC/onlinelog/o1_mf_3_c27ynzgp_.log deleted
auxiliary instance file /tmp/RAC/onlinelog/o1_mf_2_c27ynvt2_.log deleted
auxiliary instance file /tmp/RAC/onlinelog/o1_mf_1_c27ynq8w_.log deleted
auxiliary instance file /tmp/RAC/datafile/o1_mf_sysaux_c27yh5z6_.dbf deleted
auxiliary instance file /tmp/RAC/datafile/o1_mf_undotbs2_c27yh78x_.dbf deleted
auxiliary instance file /tmp/RAC/datafile/o1_mf_undotbs1_c27yh791_.dbf deleted
auxiliary instance file /tmp/RAC/datafile/o1_mf_system_c27yh5xr_.dbf deleted
auxiliary instance file /tmp/RAC/controlfile/o1_mf_c27ygq3g_.ctl deleted
Finished recover at 18-OCT-15
RMAN>

Recovery Manager complete.
SQL> alter tablespace tmp1 online;

Tablespace altered.

SQL> select count(*) from tu.t;

  COUNT(*)
----------
     74593

Комментариев нет:

Отправить комментарий

Update BLOB

set define off DECLARE    vb1 CLOB := 'long text';    vb2 CLOB :=                 'long text';    vb3 CLOB :=              ...