Incomplete Recovery After Drop Tablespace.
Hi...some technical help required.
I was trying a hands-on for incomplete recovery. That is drop a tablespace and then retrieve back until 1 second before drop statement.
The Steps were like this...
1) Shutdown Immediate;
2) Copy all *.ctl, *.dbf, logfiles into a different folder <nis_back>
3) Startup;
4) Enter 3-4 Records and Commit. Table is in <USER> Tablespace.
5) 3 times "alter system switch logfile;"
5) drop tablespace users;
6) shutdown;
7) Check the Alter Log and find the time when tablespace dropped.
Suppose time when dropped is -> 21-Aug 10:30:45 AM. (HH:MM:SS)
7) copy back only *.dbf, *.ctl files from backup folder <nis_back>
8) startup mount;
9) alter database recover automatic until time '2002-08-21:10:30:40';
10) <<Statement Process>> Message Comes.
11) alter database open resetlogs;
When I open the table into which I inserted records just before dropping the tablespace I dont see the records (Inseretd in Step - 4) but the tablespace is back.
Now My Concern -> Why did the 3-4 record which I inserted in step 4 did not get restored from the archieve log ?
Hope to hear from you all soon.
Thanks in advance.
Regards
Nishit
After step 5, try ALTER SYSTEM ARCHIVELOG ALL
Naveen
Hi...some technical help required.
I was trying a hands-on for incomplete recovery. That is drop a tablespace and then retrieve back until 1 second before drop statement.
The Steps were like this...
1) Shutdown Immediate;
2) Copy all *.ctl, *.dbf, logfiles into a different folder <nis_back>
3) Startup;
4) Enter 3-4 Records and Commit. Table is in <USER> Tablespace.
5) 3 times "alter system switch logfile;"
5) drop tablespace users;
6) shutdown;
7) Check the Alter Log and find the time when tablespace dropped.
Suppose time when dropped is -> 21-Aug 10:30:45 AM. (HH:MM:SS)
7) copy back only *.dbf, *.ctl files from backup folder <nis_back>
8) startup mount;
9) alter database recover automatic until time '2002-08-21:10:30:40';
10) <<Statement Process>> Message Comes.
11) alter database open resetlogs;
When I open the table into which I inserted records just before dropping the tablespace I dont see the records (Inseretd in Step - 4) but the tablespace is back.
Now My Concern -> Why did the 3-4 record which I inserted in step 4 did not get restored from the archieve log ?
Hope to hear from you all soon.
Thanks in advance.
Regards
Nishit
Similar Messages
-
Incomplete recovery after open resetlogs
hi gurus
Every sunday,consistent backups are performed on your database.Because of a user error,you performed an incomplete recovery on Tuesday and opened the database with RESETLOGS option.
A user error occurs again on Thursday,whick necessitates an incomplete recovery.Sunday's bakcup is the most recent backup avaliable.
what would you do in this scenario?
A. recovery cannot be performed because backup was not performed after the last incomplete recovery.
B. restore all backups from Sunday's backup,and then perform an incomplete recovery up to the point in time when the user error occured Thursday.
C. restore all the files from Sunday's backup,and then recover up to the point in time when the RESETLOGS operation was performed on Tuesday.
D. restore all the file from Sunday's backup, and open the database to reset the database to the point in time when the backup was performed on Sunday.
I choose C but answer gives B. what do u think?
thank u in advance.As of oracle 10g, it is possible to restore and recover across RESETLOGS operations: see http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/flashptr006.htm#sthref667. So B is correct for 10g or 11g.
-
Automatic deleting of datafiles after DROP TABLESPACE
Lazy junior dba question. How can i order oracle to delete files automaticly after deleting them from control file (like drop tablespace command)?
What technology/approach should I use? Can ASM help me?
Thnaks.Well, ideally after issuing
DROP TABLESPACE <TBS_NAME> INCLUDING CONTENTS AND DATAFILES; the datafiles corresponding to that tablespace should get deleted automatically. Although, in my case, sometimes it gets deleted automatically, but sometimes it doesn't(Windows Server).
Comments from others will be useful.
Regards,
Anand -
Unable to drop datafile after dropping tablespace
Hi All,
Trying to Drop tablespace with Datafile, command used is as below
drop tablespace tims_db including contents and datafiles;
this was executed successfully, but still the datafile exists... tried dropping from OS, but unable to delete the file... associated trace alert logs are as below
Dump file c:\oracle\admin\ocprd\udump\ocprd_ora_4236.trc
Mon Feb 06 03:40:58 2012
ORACLE V9.2.0.6.0 - Production vsnsta=0
vsnsql=12 vsnxtr=3
Windows 2000 Version 5.0 Service Pack 4, CPU type 586
Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
Windows 2000 Version 5.0 Service Pack 4, CPU type 586
Redo thread mounted by this instance: 1
Oracle process number: 14
Windows thread id: 4236, image: ORACLE.EXE
*** 2012-02-06 03:40:58.562
*** SESSION ID:(52.7127) 2012-02-06 03:40:58.500
ORA-01259: unable to delete datafile E:\ORACLE\ORADATA\OCPRD\TIMSDB01.DBF
ORA-27056: skgfrdel: could not delete file
OSD-04024: Unable to delete file.
O/S-Error: (OS 32) The process cannot access the file because it is being used by another process.
OS : Windows 2000
DB : Oracle 9i
Please help
Thanksuser1687821 wrote:
As this is a production instance, we need approval to bounce it, If you are sure this file isn't needed - unlock with unlocker and move to some place for a while. Then kill it or kill it immediatly.
Secondly will the database ask for missing datafile when restarted the database even if it is not listed in dba_data_files...?If your tbs drop was successfull - everything will be fine -
Clarification on Incomplete recovery
Hi Friends,
Just clarification on 2 Things on incomplete recovery.
Undo tablespace (datafiles):
I lost current undo tablespace datafile but i have datafiles from backup,archived logs,current control file,online redo log and still can i perform complete recovery ?
because complete recovery means= restore datafiles from backup +roll forward (online redo logs which is available) and roll back (current undo datafile , the current file is not available but only the backup undo datafiles is available)
so in this case how will the roll forward happen? so is this in complete recovery?
Control Files:
My control files got lost but i have control trace file , dbf files(inclusing undo),archived logs,online redo logs. in this case i won't lose any data but since i am recreating control file i will perform open reset logs (new incarnation) so is this considered as in complete recovery (though my data is intact - all committed but the DB is incarnated)
so what is complete recovery?
DB should not be incarnated? (or) DB should have only commited data (or) both
Regards,
DB839396 wrote:
Hi Friends,
Just clarification on 2 Things on incomplete recovery.
Undo tablespace (datafiles):
I lost current undo tablespace datafile but i have datafiles from backup,archived logs,current control file,online redo log and still can i perform complete recovery ?
because complete recovery means= restore datafiles from backup +roll forward (online redo logs which is available) and roll back (current undo datafile , the current file is not available but only the backup undo datafiles is available)
so in this case how will the roll forward happen? so is this in complete recovery? If you have all the back up filles, archive logs and you have lost the undo tablespace data file, you would be still doing the complete recovery only. What makes you think that it would be an incomplete recovery?
>
Control Files:
My control files got lost but i have control trace file , dbf files(inclusing undo),archived logs,online redo logs. in this case i won't lose any data but since i am recreating control file i will perform open reset logs (new incarnation) so is this considered as in complete recovery (though my data is intact - all committed but the DB is incarnated)
so what is complete recovery?
DB should not be incarnated? (or) DB should have only commited data (or) bothRead the reply of Rp!
Aman.... -
Possible drop tablespace PSAPSR3702 after upgrade EHP5
Hi experts,
Can I drop tablespace PSAPSR3702 after upgrade EHP5? I cannot found this point in EHP5 installation documents as in the EHP4 documents
My system is running on Oracle
Thanks & Regards,
Luong
Edited by: LuongDK on Aug 25, 2011 4:40 AMHi LuongDK,
If you see clearly after refresh your DB size stat, you should see PSAPSR3701 is empty OR with very small size compare to PSAPSR3702.
Therefore, you should drop PSAPSR3701 and NOT PSAPSR3702. You can confirm by ensuring no entry for PSAPSR3701 in table TAORA & IAORA.
Thanks,
Nicholas Chang -
A problem about incomplete recovery
All,
I'm a freshman for oracle knowledge and skill. I'm simulating the incomplete recovery for database. Here are my scenarios and steps:
1. In database "db1", there is a table named "tb1" has 2 records, the whole database running on archive log mode and has 3 redo log groups(each group contains one member) ---- status "A"
2. Make a cold backup for all datafiles, controlfiles and redo logs;
3. startup database again, and insert 3 records into "tb1", then switch log file at least 3 times. Get the frist change number form latest archived log. ---- status "B"
4. after the 3rd step over, drop a tablespace named "indx" and do a switching log file operation again.
5. shutdow database immediate and restore all the backuped datafile and controlfiles, not including the redo logs and startup database with mount option.
6. run recover command to execute the incomplete recovery to database.
whatever using "recover until time '<almost close the drop operating time>" or "recover until change number", I only got the status "A" after open the database, not status "B". But as my understanding and some reference from books, it should return to status "B" which includes the newer 3 records.
Now, I adhere some alert logs at below (the number 54878 is the latest change number in archived log files before dropping that tablespace)
alter database recover until change 54878
Tue Jul 03 17:30:34 2007
Media Recovery Start
Media Recovery Not Required
Completed: alter database recover until change 54878
Tue Jul 03 17:31:35 2007
alter database open resetlogs
Tue Jul 03 17:31:35 2007
RESETLOGS after complete recovery through change 54742
why the recovery use change number 54742 but not 54878 I expected. Did I go the correct steps for this incomplete recovery. Does anyone can give me some piece of advice to resolve this problemAre you using 'recover using backup controlfile'...???????????
If not, it will take the restored controlfiles as the latest copy and will only recover up to the SCN in there.
Using the above, Oracle will simply ignore the SCN in the controlfile, since it knows its an old controlfile and should recover beyond the restored controfile.. -
Recovery lost undo tablespace and Redo log
Recovery undo tablespace
[email protected]> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.e
[email protected]> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
[ora920@tkyte-pc-isdn ora920]$ ls
control01.ctl cwmlite01.dbf indx01.dbf redo02.log redo0B.log temp01.dbf
users01.dbf
control02.ctl drsys01.dbf odm01.dbf redo03.log redo0C.log tools01.dbf
xdb01.dbf
control03.ctl example01.dbf redo01.log redo0A.log system01.dbf undotbs01.dbf
[ora920@tkyte-pc-isdn ora920]$ mv undotbs01.dbf undotbs01.dbf.xxx
[ora920@tkyte-pc-isdn ora920]$ sqlplus /nolog
SQL*Plus: Release 9.2.0.1.0 - Production on Sat Sep 28 08:33:29 2002
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
idle> connect / as sysdba
Connected to an idle instance.
idle> startup
ORACLE instance started.
Total System Global Area 143725064 bytes
Fixed Size 451080 bytes
Variable Size 109051904 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 2 - see DBWR trace file
ORA-01110: data file 2: '/usr/oracle/ora920/OraHome1/oradata/ora920/undotbs01.dbf'
idle> show parameter undo
NAME TYPE VALUE
undo_management string AUTO
undo_retention integer 10800
undo_suppress_errors boolean FALSE
undo_tablespace string UNDOTBS1
idle> alter system set undo_management = manual scope=spfile;
System altered.
Note: disabling the undo tablespace here, this'll let us go back to "rollback segments"
and we'll use the system RBS to get back on our feet
idle> shutdown
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
idle> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
[ora920@tkyte-pc-isdn ora920]$ !sql
sqlplus /nolog
SQL*Plus: Release 9.2.0.1.0 - Production on Sat Sep 28 08:35:34 2002
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
idle> connect / as sysdba;
Connected to an idle instance.
idle> startup
ORACLE instance started.
Total System Global Area 143725064 bytes
Fixed Size 451080 bytes
Variable Size 109051904 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 2 - see DBWR trace file
ORA-01110: data file 2: '/usr/oracle/ora920/OraHome1/oradata/ora920/undotbs01.dbf'
Note: we still have to get rid of that thing..
idle> alter database datafile '/usr/oracle/ora920/OraHome1/oradata/ora920/undotbs01.dbf'
2 offline drop;
Database altered.
idle> alter database open;
Database altered.
idle> drop tablespace undotbs1;
Tablespace dropped.
idle> create UNDO tablespace undotbs1
2 datafile '/usr/oracle/ora920/OraHome1/oradata/ora920/undotbs01.dbf' size 25m
3 autoextend on next 1m maxsize 1024m;
Tablespace created.
idle> alter system set undo_management = auto scope=spfile;
System altered.
Now, we've put the undo tablespace "back" by creating a new one. Just bounce...
idle> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
idle> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
[ora920@tkyte-pc-isdn ora920]$ !sql
sqlplus /nolog
SQL*Plus: Release 9.2.0.1.0 - Production on Sat Sep 28 08:40:51 2002
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
idle> connect / as sysdba;
Connected to an idle instance.
idle> startup
ORACLE instance started.
Total System Global Area 143725064 bytes
Fixed Size 451080 bytes
Variable Size 109051904 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
idle> show parameter undo
NAME TYPE VALUE
undo_management string AUTO
undo_retention integer 10800
undo_suppress_errors boolean FALSE
undo_tablespace string UNDOTBS1
idle>
and we are right back where we started from
RECOVERY REDO TABLESPACE
STARTUP MOUNT;
RESTORE DATABASE;
RECOVER DATABASE UNTIL SEQUENCE $v_seq THREAD 1;
ALTER DATABASE OPEN RESETLOGS;[email protected] wrote:
just ignore first one like title
Alter database open resetlog is not necessary to open database ?
Regards
kmphttp://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/osrecov.htm#i1007426
About Opening with the RESETLOGS Option
The RESETLOGS option is always required after incomplete media recovery or recovery using a backup control file.
You did not do an incomplete media recovery nor a recovery using a backup control file. -
TSPITR - Recover a Dropped Tablespace aborting due dependency over XDB.
I found an issue using TSPITR to Recover a Dropped Tablespace when XML DB (XDB) is installed on a different tablespace from "SYSAUX".
During execution of TSPITR RMAN use Data Pump to export/import Tablespace Metadata as Data Pump has dependency over XDB views and related objects and XDB is installed on a set of tablespace not included on dummy database then EXPDP fails.
Errors raised ORA-39123, ORA-00376, ORA-01110.
I didn't found any limitation about XDB location on documentation or MoS.
This looks like a Oracle Bug.
See this:
XDB installed on TABLESPACE XDB.
SQL> select owner,tablespace_name
from dba_segments
where owner='XDB'
GROUP BY owner,tablespace_name ;
OWNER TABLESPACE_NAME
XDB XDBDropping Tablespace SOE.
SQL> select to_char(sysdate,'dd-mm-yyyy hh24:mi:ss') actual_date from dual;
ACTUAL_DATE
17-12-2012 11:57:44
SQL> drop tablespace SOE including contents and datafiles;
Tablespace dropped.Restoring Dropped Tablespace.
RMAN> list backup tag TAG20121217T112226;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
69 Full 995.61M DISK 00:02:41 17-12-2012 11:25:07
BP Key: 69 Status: AVAILABLE Compressed: YES Tag: TAG20121217T112226
Piece Name: +DG_16M/prod/backupset/2012_12_17/nnndf0_tag20121217t112226_0.286.802264947
List of Datafiles in backup set 69
File LV Type Ckp SCN Ckp Time Name
1 Full 1628648 17-12-2012 11:22:26 +DS8000_DG/prod/datafile/system.349.799325249
2 Full 1628648 17-12-2012 11:22:26 +DS8000_DG/prod/datafile/sysaux.348.799325249
3 Full 1628648 17-12-2012 11:22:26 +DS8000_DG/prod/datafile/undotbs1.347.799325251
4 Full 1628648 17-12-2012 11:22:26 +DS8000_DG/prod/datafile/users.335.799325251
5 Full 1628648 17-12-2012 11:22:26 +DS8000_DG/prod/datafile/audit_aux.287.799330083
6 Full 1628648 17-12-2012 11:22:26
7 Full 1628648 17-12-2012 11:22:26 +DS8000_DG/prod/datafile/xdb.311.801410833
RMAN>
run{
SET NEWNAME FOR DATAFILE 6 TO "+DS8000_DG";
RECOVER TABLESPACE SOE
UNTIL TIME "to_date('17-12-2012 11:55:00','dd/mm/yyyy hh24:mi:ss')"
AUXILIARY DESTINATION '/u01/app/oracle/flash_recovery_area01/stage_area_tspitr';
executing command: SET NEWNAME
Starting recover at 17-12-2012 12:01:29
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 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='FCox'
initialization parameters used for automatic instance:
db_name=PROD
db_unique_name=FCox_tspitr_PROD
compatible=11.2.0.0.0
db_block_size=8192
db_files=200
sga_target=280M
processes=50
db_create_file_dest=/u01/app/oracle/flash_recovery_area01/stage_area_tspitr
log_archive_dest_1='location=/u01/app/oracle/flash_recovery_area01/stage_area_tspitr'
#No auxiliary parameter file used
starting up automatic instance PROD
Oracle instance started
Total System Global Area 292278272 bytes
Fixed Size 2220880 bytes
Variable Size 109055152 bytes
Database Buffers 176160768 bytes
Redo Buffers 4841472 bytes
Automatic instance created
List of tablespaces that have been dropped from the target database:
Tablespace SOE
contents of Memory Script:
# set requested point in time
set until time "to_date('17-12-2012 11:55:00','dd/mm/yyyy hh24:mi:ss')";
# restore the controlfile
restore clone controlfile;
# mount the controlfile
sql clone 'alter database mount clone database';
# archive current online log
sql 'alter system archive log current';
# 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 17-12-2012 12:01:46
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=16 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 +DG_16M/prod/autobackup/2012_12_17/s_802265113.276.802265115
channel ORA_AUX_DISK_1: piece handle=+DG_16M/prod/autobackup/2012_12_17/s_802265113.276.802265115 tag=TAG20121217T112513
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:05
output file name=/u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/controlfile/o1_mf_8dy9ghpz_.ctl
Finished restore at 17-12-2012 12:01:52
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 time "to_date('17-12-2012 11:55:00','dd/mm/yyyy hh24:mi:ss')";
# set destinations for recovery set and auxiliary set datafiles
set newname for clone datafile 1 to new;
set newname for clone datafile 3 to new;
set newname for clone datafile 2 to new;
set newname for clone tempfile 1 to new;
set newname for datafile 6 to
"+DS8000_DG";
# switch all tempfiles
switch clone tempfile all;
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile 1, 3, 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
renamed tempfile 1 to /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_temp_%u_.tmp in control file
Starting restore at 17-12-2012 12:01:58
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/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002 to /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to +DS8000_DG
channel ORA_AUX_DISK_1: reading from backup piece +DG_16M/prod/backupset/2012_12_17/nnndf0_tag20121217t112226_0.286.802264947
channel ORA_AUX_DISK_1: piece handle=+DG_16M/prod/backupset/2012_12_17/nnndf0_tag20121217t112226_0.286.802264947 tag=TAG20121217T112226
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:09:15
Finished restore at 17-12-2012 12:11:13
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=802267873 file name=+DS8000_DG/prod/datafile/soe.487.802267321
datafile 1 switched to datafile copy
input datafile copy RECID=6 STAMP=802267873 file name=/u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_system_8dy9gs09_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=7 STAMP=802267873 file name=/u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_undotbs1_8dy9ov17_.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=8 STAMP=802267873 file name=/u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_sysaux_8dy9hxsc_.dbf
contents of Memory Script:
# set requested point in time
set until time "to_date('17-12-2012 11:55:00','dd/mm/yyyy hh24:mi:ss')";
# 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 2 online";
sql clone "alter database datafile 6 online";
# recover and open resetlogs
recover clone database tablespace "SOE", "SYSTEM", "UNDOTBS1", "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 2 online
sql statement: alter database datafile 6 online
Starting recover at 17-12-2012 12:11:14
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 15 is already on disk as file +DG_16M/prod/archivelog/2012_12_17/thread_1_seq_15.277.802267317
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=14
channel ORA_AUX_DISK_1: reading from backup piece +DG_16M/prod/backupset/2012_12_17/annnf0_tag20121217t112512_0.264.802265113
channel ORA_AUX_DISK_1: piece handle=+DG_16M/prod/backupset/2012_12_17/annnf0_tag20121217t112512_0.264.802265113 tag=TAG20121217T112512
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/app/oracle/flash_recovery_area01/stage_area_tspitr/1_14_801941068.dbf thread=1 sequence=14
channel clone_default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area01/stage_area_tspitr/1_14_801941068.dbf RECID=141 STAMP=802267877
archived log file name=+DG_16M/prod/archivelog/2012_12_17/thread_1_seq_15.277.802267317 thread=1 sequence=15
media recovery complete, elapsed time: 00:00:01
Finished recover at 17-12-2012 12:11:19
database opened
contents of Memory Script:
# make read only the tablespace that will be exported
sql clone 'alter tablespace SOE read only';
# create directory for datapump import
sql "create or replace directory TSPITR_DIROBJ_DPDIR as ''
/u01/app/oracle/flash_recovery_area01/stage_area_tspitr''";
# create directory for datapump export
sql clone "create or replace directory TSPITR_DIROBJ_DPDIR as ''
/u01/app/oracle/flash_recovery_area01/stage_area_tspitr''";
executing Memory Script
sql statement: alter tablespace SOE read only
sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/app/oracle/flash_recovery_area01/stage_area_tspitr''
sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/app/oracle/flash_recovery_area01/stage_area_tspitr''
Performing export of metadata...
EXPDP> Starting "SYS"."TSPITR_EXP_FCox":
EXPDP> ORA-39123: Data Pump transportable tablespace job aborted
ORA-00376: file 7 cannot be read at this time
ORA-01110: data file 7: '+DS8000_DG/prod/datafile/xdb.311.801410833'
Removing automatic instance
shutting down automatic instance
database closed
database dismounted
Oracle instance shut down
Automatic instance removed
auxiliary instance file /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_temp_8dyb0qok_.tmp deleted
auxiliary instance file /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/onlinelog/o1_mf_3_8dyb0kfp_.log deleted
auxiliary instance file /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/onlinelog/o1_mf_2_8dyb0fm9_.log deleted
auxiliary instance file /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/onlinelog/o1_mf_1_8dyb07xv_.log deleted
auxiliary instance file /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_sysaux_8dy9hxsc_.dbf deleted
auxiliary instance file /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_undotbs1_8dy9ov17_.dbf deleted
auxiliary instance file /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_system_8dy9gs09_.dbf deleted
auxiliary instance file /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/controlfile/o1_mf_8dy9ghpz_.ctl deleted
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 12/17/2012 12:12:19
RMAN-06962: Error received during export of metadata
RMAN-06965: Datapump job has stopped
RMAN-06960: EXPDP> Job "SYS"."TSPITR_EXP_FCox" stopped due to fatal error at 12:12:02
RMAN>If I drop tablespace SOE and XDB on Target database and try to restore both (SOE,XDB) export will succeeds but during IMPORT Metadata RMAN will faill due XDB dependency.
In my view, they (mean Oracle) need find way to include XDB Tablespace at DUMMY database only to export (EXPDP) Metadata purposes.
If someone get a workaround for this error will be grateful.
P.S: This is not a Production environment and will soon open a SR on Oracle Support.Hi Michael,
I did not find solution to use TSPITR to recover dropped tablespace if XML DB is installed in a non-default tablespace (i.e outside of SYSAUX).
As far I could understand, the only way to perform this RESTORE is using the old fashion. By creating clone database excluding all unnecessary tablespace, exporting and importing metadata from desired tablespace manually.
Since Oracle has not solved the issue I created my own workaround.
@All
If someone is able to use TSPITR to restore dropped tablespace when XDB is installed in a non-default tablespace, please let me know!!!
The procedure below is supported on All Oracle Version since 10.1 until 11.2.
I DON'T RECOMMEND to create AUXILIARY (clone) database using the same server from TARGET because you can damage the TARGET database.
On this example I'm using same server.
See this example:
### ON TARGET DATABASE
SQL> select count(1) SEG_COUNT from dba_segments where tablespace_name='SOE';
SEG_COUNT
32
SQL> ! date
Wed Dec 19 15:08:11 GMT-02:00 2012
SQL> drop tablespace soe including contents and datafiles;
Tablespace dropped.
### CHECK TABLESPACE TO BE EXCLUDED FROM RESTORE
SQL> select tablespace_name
from dba_tablespaces
where tablespace_name not in ('SYSTEM','SYSAUX','UNDOTBS1','SOE','XDB','TEMP');
TABLESPACE_NAME
USERS
AUDIT_AUX
### CHECK BACKUP ON TARGET DATABASE
RMAN> list backup completed between "sysdate-1" and "sysdate";
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
95 Full 986.56M DISK 00:03:18 19-12-2012 14:41:59
BP Key: 95 Status: AVAILABLE Compressed: YES Tag: TAG20121219T143840
Piece Name: /fra/PROD/backupset/2012_12_19/o1_mf_nnndf_TAG20121219T143840_8f3vdn3q_.bkp
List of Datafiles in backup set 95
File LV Type Ckp SCN Ckp Time Name
1 Full 1675258 19-12-2012 14:38:42 +DS8000_DG/prod/datafile/system.349.799325249
2 Full 1675258 19-12-2012 14:38:42 +DS8000_DG/prod/datafile/sysaux.348.799325249
3 Full 1675258 19-12-2012 14:38:42 +DS8000_DG/prod/datafile/undotbs1.347.799325251
4 Full 1675258 19-12-2012 14:38:42 +DS8000_DG/prod/datafile/users.335.799325251
5 Full 1675258 19-12-2012 14:38:42 +DS8000_DG/prod/datafile/audit_aux.287.799330083
6 Full 1675258 19-12-2012 14:38:42
7 Full 1675258 19-12-2012 14:38:42 +DS8000_DG/prod/datafile/xdb.311.801410833
BS Key Size Device Type Elapsed Time Completion Time
96 1.16M DISK 00:00:00 19-12-2012 14:42:08
BP Key: 96 Status: AVAILABLE Compressed: YES Tag: TAG20121219T144208
Piece Name: /fra/PROD/backupset/2012_12_19/o1_mf_annnn_TAG20121219T144208_8f3vm0k3_.bkp
List of Archived Logs in backup set 96
Thrd Seq Low SCN Low Time Next SCN Next Time
1 8 1675198 19-12-2012 14:38:25 1675365 19-12-2012 14:42:07
BS Key Type LV Size Device Type Elapsed Time Completion Time
97 Full 7.52M DISK 00:00:02 19-12-2012 14:42:11
BP Key: 97 Status: AVAILABLE Compressed: NO Tag: TAG20121219T144209
Piece Name: /fra/PROD/autobackup/2012_12_19/o1_mf_s_802449729_8f3vm2cc_.bkp
SPFILE Included: Modification time: 19-12-2012 14:36:30
SPFILE db_unique_name: PROD
Control File Included: Ckp SCN: 1675376 Ckp time: 19-12-2012 14:42:09
RMAN>
### PREPARING ENV
cp $ORACLE_HOME/dbs/orapwprod $ORACLE_HOME/dbs/orapwtspitr
cd $ORACLE_HOME/dbs
## Creating INIT from TSPITR Instance
vi inittspitr.ora
DB_NAME=prod
DB_UNIQUE_NAME=tspitr
CONTROL_FILES=/stage_area_tspitr/PROD/controlfile/control01.ctl
REMOTE_LOGIN_PASSWORDFILE=exclusive
COMPATIBLE =11.2.0
DB_BLOCK_SIZE=8192
memory_target=700M
streams_pool_size=100M
### creating stage area to deploy database
mkdir -p /fra/stage_area_tspitr/PROD
cd /fra/stage_area_tspitr/PROD
mkdir controlfile datafile onlinelog
#### RESTORING DATABASE TSPITR
export ORACLE_SID=tspitr
$ rman target /
RMAN> startup nomount
Oracle instance started
Total System Global Area 730714112 bytes
Fixed Size 2225088 bytes
Variable Size 553651264 bytes
Database Buffers 167772160 bytes
Redo Buffers 7065600 bytes
RMAN> restore controlfile from '/fra/PROD/autobackup/2012_12_19/o1_mf_s_802449729_8f3vm2cc_.bkp';
Starting restore at 19-12-2012 15:16:27
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=146 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output file name=/fra/stage_area_tspitr/PROD/controlfile/control01.ctl
Finished restore at 19-12-2012 15:16:31
RMAN> startup mount
database is already started
database mounted
released channel: ORA_DISK_1
### REPORT SCHEMA TO GET DATAFILE NUMBER TO BE RESTORED
RMAN> report schema;
RMAN-06139: WARNING: control file is not current for REPORT SCHEMA
Report of database schema for database with db_unique_name TSPITR
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
1 700 SYSTEM *** +DS8000_DG/prod/datafile/system.349.799325249
2 600 SYSAUX *** +DS8000_DG/prod/datafile/sysaux.348.799325249
3 200 UNDOTBS1 *** +DS8000_DG/prod/datafile/undotbs1.347.799325251
4 5 USERS *** +DS8000_DG/prod/datafile/users.335.799325251
5 100 AUDIT_AUX *** +DS8000_DG/prod/datafile/audit_aux.287.799330083
6 0 SOE *** +DS8000_DG/tspitr/datafile/soe.368.802445265
7 100 XDB *** +DS8000_DG/prod/datafile/xdb.311.801410833
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
1 385 TEMP 32767 +DS8000_DG/prod/tempfile/temp.300.799325437
RMAN>
### GET LOGFILE NAME to RENAME to new location.
$ sqlplus / as sysdba
SQL> select member from v$logfile;
MEMBER
+DS8000_DG/prod/onlinelog/group_1.330.802352807
+DS8000_DG/prod/onlinelog/group_2.331.802352815
+DS8000_DG/prod/onlinelog/group_3.321.802352821
run {
set newname for datafile 1 to '/fra/stage_area_tspitr/PROD/datafile/datafiles_%U';
set newname for datafile 2 to '/fra/stage_area_tspitr/PROD/datafile/datafiles_%U';
set newname for datafile 3 to '/fra/stage_area_tspitr/PROD/datafile/datafiles_%U';
set newname for datafile 7 to '/fra/stage_area_tspitr/PROD/datafile/datafiles_%U';
set newname for datafile 6 to "+DS8000_DG";
restore datafile 1,2,3,7,6 from tag 'TAG20121219T143840' ;
switch datafile 1;
switch datafile 2;
switch datafile 3;
switch datafile 7;
switch datafile 6;
switch tempfile all;
set until time "to_date('19-12-2012 14:42:00','dd-mm-yyyy hh24:mi:ss')";
recover database SKIP TABLESPACE "USERS", "AUDIT_AUX" delete archivelog;
## Renaming ONLINELOG
sql "alter database rename file ''+DS8000_DG/prod/onlinelog/group_1.330.802352807'' to ''/fra/stage_area_tspitr/PROD/onlinelog/group1.rdo''";
sql "alter database rename file ''+DS8000_DG/prod/onlinelog/group_2.331.802352815'' to ''/fra/stage_area_tspitr/PROD/onlinelog/group2.rdo''";
sql "alter database rename file ''+DS8000_DG/prod/onlinelog/group_3.321.802352821'' to ''/fra/stage_area_tspitr/PROD/onlinelog/group3.rdo''";
alter database open resetlogs;
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 19-12-2012 15:32:13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-SYSTEM_FNO-1
channel ORA_DISK_1: restoring datafile 00002 to /fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-SYSAUX_FNO-2
channel ORA_DISK_1: restoring datafile 00003 to /fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-UNDOTBS1_FNO-3
channel ORA_DISK_1: restoring datafile 00007 to /fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-XDB_FNO-7
channel ORA_DISK_1: restoring datafile 00006 to +DS8000_DG
channel ORA_DISK_1: reading from backup piece /fra/PROD/backupset/2012_12_19/o1_mf_nnndf_TAG20121219T143840_8f3vdn3q_.bkp
channel ORA_DISK_1: piece handle=/fra/PROD/backupset/2012_12_19/o1_mf_nnndf_TAG20121219T143840_8f3vdn3q_.bkp tag=TAG20121219T143840
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:12:35
Finished restore at 19-12-2012 15:44:48
datafile 1 switched to datafile copy
input datafile copy RECID=6 STAMP=802453489 file name=/fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-SYSTEM_FNO-1
datafile 2 switched to datafile copy
input datafile copy RECID=8 STAMP=802453489 file name=/fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-SYSAUX_FNO-2
datafile 3 switched to datafile copy
input datafile copy RECID=10 STAMP=802453489 file name=/fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-UNDOTBS1_FNO-3
datafile 7 switched to datafile copy
input datafile copy RECID=12 STAMP=802453489 file name=/fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-XDB_FNO-7
datafile 6 switched to datafile copy
input datafile copy RECID=14 STAMP=802453489 file name=+DS8000_DG/tspitr/datafile/soe.304.802452733
renamed tempfile 1 to /fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-TEMP_FNO-1 in control file
executing command: SET until clause
Starting recover at 19-12-2012 15:44:49
using channel ORA_DISK_1
Executing: alter database datafile 4 offline
Executing: alter database datafile 5 offline
starting media recovery
archived log for thread 1 with sequence 8 is already on disk as file +DS8000_DG/prod/onlinelog/group_2.331.802352815
archived log file name=+DS8000_DG/prod/onlinelog/group_2.331.802352815 thread=1 sequence=8
media recovery complete, elapsed time: 00:00:02
Finished recover at 19-12-2012 15:44:55
sql statement: alter database rename file ''+DS8000_DG/prod/onlinelog/group_1.330.802352807'' to ''/fra/stage_area_tspitr/PROD/onlinelog/group1.rdo''
sql statement: alter database rename file ''+DS8000_DG/prod/onlinelog/group_2.331.802352815'' to ''/fra/stage_area_tspitr/PROD/onlinelog/group2.rdo''
sql statement: alter database rename file ''+DS8000_DG/prod/onlinelog/group_3.321.802352821'' to ''/fra/stage_area_tspitr/PROD/onlinelog/group3.rdo''
database opened
## Exporting Tablespace Metadata
RMAN >
run {
sql 'alter tablespace SOE read only';
# create directory for datapump export
sql "create or replace directory TSPITR_DIROBJ_DPDIR as ''/fra/stage_area_tspitr''";
# grant on directory to SYSTEM
sql "grant read,write on directory TSPITR_DIROBJ_DPDIR to system";
# exporting metadata
host "expdp system/oracle@localhost:1521/tspitr DIRECTORY=TSPITR_DIROBJ_DPDIR DUMPFILE=exp_transport_soe.dmp TRANSPORT_FULL_CHECK=Y TRANSPORT_TABLESPACES=SOE";
using target database control file instead of recovery catalog
sql statement: alter tablespace SOE read only
sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/fra/stage_area_tspitr''
sql statement: grant read,write on directory TSPITR_DIROBJ_DPDIR to system
Export: Release 11.2.0.3.0 - Production on Wed Dec 19 15:53:02 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, Oracle Label Security, OLAP,
Data Mining, Oracle Database Vault and Real Application Testing options
Starting "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01": system/********@localhost:1521/tspitr DIRECTORY=TSPITR_DIROBJ_DPDIR DUMPFILE=exp_transport_soe.dmp TRANSPORT_FULL_CHECK=Y TRANSPORT_TABLESPACES=SOE
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/INDEX/INDEX
Processing object type TRANSPORTABLE_EXPORT/INDEX/FUNCTIONAL_INDEX/INDEX
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/INDEX/STATISTICS/FUNCTIONAL_INDEX/INDEX_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Master table "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded
Dump file set for SYSTEM.SYS_EXPORT_TRANSPORTABLE_01 is:
/fra/stage_area_tspitr/exp_transport_soe.dmp
Datafiles required for transportable tablespace SOE:
+DS8000_DG/tspitr/datafile/soe.304.802452733
Job "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at 15:54:28
host command complete
## Stop Database and destroy it to make sure that Datafile 6 will not be used by this database;
RMAN>
run {
shutdown immediate;
## removing controlfile and SYSTEM Tablespace to make sure that database will not be opened
host "rm -f /fra/stage_area_tspitr/PROD/controlfile/control01.ctl /fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-SYSTEM_FNO-1";
database closed
database dismounted
Oracle instance shut down
host command complete
## TARGET Database
## Plugging Tablespace on TARGET database.
$ export ORACLE_SID=prod
$ rman target /
run {
# create directory for datapump import
sql "create or replace directory TSPITR_DIROBJ_DPDIR as ''/fra/stage_area_tspitr''";
# grant on directory to SYSTEM
sql "grant read,write on directory TSPITR_DIROBJ_DPDIR to system";
host "impdp system/oracle@localhost:1521/prod DIRECTORY=TSPITR_DIROBJ_DPDIR DUMPFILE=exp_transport_soe.dmp TRANSPORT_DATAFILES=''+DS8000_DG/tspitr/datafile/soe.304.802452733''";
sql "alter tablespace soe read write";
sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/fra/stage_area_tspitr''
sql statement: grant read,write on directory TSPITR_DIROBJ_DPDIR to system
Import: Release 11.2.0.3.0 - Production on Wed Dec 19 16:09:30 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, Oracle Label Security, OLAP,
Data Mining, Oracle Database Vault and Real Application Testing options
Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01": system/********@localhost:1521/prod DIRECTORY=TSPITR_DIROBJ_DPDIR DUMPFILE=exp_transport_soe.dmp TRANSPORT_DATAFILES=+DS8000_DG/tspitr/datafile/soe.304.802452733
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/INDEX/INDEX
Processing object type TRANSPORTABLE_EXPORT/INDEX/FUNCTIONAL_INDEX/INDEX
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/INDEX/STATISTICS/FUNCTIONAL_INDEX/INDEX_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at 16:10:03
host command complete
sql statement: alter tablespace soe read write
### Recompiling Invalid Objects and Checking objects from tablespace SOE
$ sqlplus / as sysdba
SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql
TIMESTAMP
COMP_TIMESTAMP UTLRP_BGN 2012-12-19 16:10:34
OBJECTS WITH ERRORS
0
ERRORS DURING RECOMPILATION
0
Function created.
PL/SQL procedure successfully completed.
Function dropped.
PL/SQL procedure successfully completed.
SQL> select count(1) SEG_COUNT from dba_segments where tablespace_name='SOE';
SEG_COUNT
32
SQL> SELECT COUNT(1) OBJ_INVALID FROM DBA_OBJECTS WHERE STATUS != 'VALID';
OBJ_INVALID
0
## PERFORM A FULL BACKUP AFTER RESTORE TABLESPACE.Regards,
Levi Pereira -
Hi guys
As a DBA, we must to know about all backup and recover strategies. Today i was trying to simulate a recover from a lost of current relog group.
In order to deal with this situation, we need to perform an incomplete recovery.
The following steps were used to simulate a lost of current redo log and recover from it
1) Shutdown abort
2) delete all redo log files
3) open database to show there was an error in relog file
4) replace the existng datafiles with backup datafiles
5) recover database using backup control file until cancel
6) alter database open resetlogs
After the above steps, the database was able to operate as normal.
After that, i tried to perform incremental level 0 (backup incremental level 0 database plus archivelog delete input) to backup the database and archive and i got an error message :
"error identifying file c:\ARC00002.001"
"unable to open file"
"<OS 2 > The system cannot find the file specified"
I am sure that the archived file does not exist at the first place_
Can anyone tell me why this kind of error occur even you have successful performed incomplete recovery and how to solve this kind of situation.Unless you were sloppy enough to put all of your log groups into a single directory on a single disk and lucky enough to have something bad happen while the database was down what you did doesn't truly simulate reality.
Here's reality.
Scenario 1:
1. Database is open and transactions are taking place ... code a simple PL/SQL loop
2. Query the database and look at your log files status values in v$log
3. Drop an inactive log
4. Issue an ALTER SYSTEM SWITCH LOGFILE until something breaks.
Scenario 2:
1. Database is open and transactions are taking place ... code a simple PL/SQL loop
2. Query the database and look at your log files status values in v$log
3. Drop an active log
4. Issue an ALTER SYSTEM SWITCH LOGFILE until something breaks.
Scenario 1:
1. Database is open and transactions are taking place ... code a simple PL/SQL loop
2. Query the database and look at your log files status values in v$log
3. Drop the current log
4. Issue an ALTER SYSTEM SWITCH LOGFILE until something breaks.
Be prepared to deal with all three scenarios. -
Partial Recovery - Skip UNDO Tablespace
Hi,
I was performing a partial database recovery using skip tablespace option using RMAN. I was wondering if I can skip undo tablespace.
I was not able to conclude whether I can do that? If not, why?
As per my understanding,
1. Datafiles are restored - If they have any uncommited data, then archive logs which will be applied for media recovery, will have the undo data to perform those roll backward.
2. While performing media reccovery using archive logs, it will generate it's own undo data.
Why do we need the stale undo data (generated till datafiles restoration point)?
Thanks,
Janak AgrawalSoli,
Thread that you have specified, talks about datafiles which does not have any uncommitted data (As the database was normally shutdown). In this case, we can drop and recreate the undo tablespace.
But I am talking about a past point-in-time recovery using RMAN, where the datafiles which will be restored may have the uncommitted data. To rollback these uncommited trnasactions, will we have data in next archivelogs, which will be used for media recovery or the data (needed to rollback) will have only in undo tablespace. Let me give you an example.
At 9 am I want to restore the datbase till 8.15 AM. Full backup is available till 8 AM and then from 8 to 8:15 arvhive logs are available. While doing recovery, datafiles will be restored till 8 AM. If at 8 AM there is some uncommitted data in datafiles, will it require data from undo tablespace to rollback or first archive log after 8 AM w'd take care of roll back? If archive logs can take care of rollback, why can't I skip the undo tablespace while doing recovery?
Santosh,
As you mentioned, UNDO data will require for read-consistency. But the same data will be available in archive logs (which will require after datafiles restore) which can generate their own UNDO data.
Please clarify. I am sorry if I am missing anything here.
Thanks,
Janak Agrawal -
Is this cause for incomplete recovery?
Hi.
I read here http://download.oracle.com/docs/cd/B10501_01/server.920/a96519/recov.htm#1004797 and other places, the reasons for incomplete recovery. I see that "if a user drops a table.." we would consider incomplete recovery. That "data loss" means we need to recover ...
Yet what if the user simply deletes some rows from a table? If the user does not commit, do we still need to do incomplete recovery? Similarly, if the user does not commit, is that a reason for not using incomplete recovery?
Sorry for splitting hairs - but its important!
Thanks,
DAHi,
>>t if those few rows are gone forever (a committed delete), we would have to at least consider incomplete recovery??
The same thing ...
It is 12:00 AM and the EMP table was deleted or updated by mistake at 11:45 AM
Then you can:
1) shutdown the database and make a backup
2) restore all datafiles from most recent backup
3) mount the database
4) recover the database like below:
SQL> recover database until time '2008-03-30:11:44:00'
5) synchronize the datafile with control files and redo log files like below:
SQL> alter database open resetlogs
6) Make a backup of your databaseIn this case, time-based recovery, also called point-in-time recovery (PITR), recovers the data up to a specified point in time.
Ps: Disadvantage of using this method: Any data entered after the recovery time (11:44 AM) will need to be reentered ...
Cheers
Legatti -
Incomplete recovery in Oracle 10g
hello,
I have been trying Incomplete recovery in oracle 10g. The steps i did were.
1. Set the database in archivelog mode.
2. shutdown immediate
3. Take physical copies of control files, datafiles and redo files
4. open the database.
5. Insert three rows in test table and commit. (and note the time )
6. shutdown abort
7. copy the restored datafiles to the desired location
8. startup mount
9 recover database until time (the time noted in step 5)
10. alter database open resetlogs
After doing this, i still do not get the three records inserted in step 5.
Can anyone suggest why this is so ? am i missing something. ?
Thanx.
TruptiHello,
Thank you for the prompt reply.
I did what you suggested. Here are the output.
16:17:52 SQL> select * from testing.test;
NO
1
2
3
4
17:09:26 SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
*** Here i took a backup of all files.
17:10:16 SQL> startup mount;
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 788224 bytes
Variable Size 66058496 bytes
Database Buffers 100663296 bytes
Redo Buffers 262144 bytes
Database mounted.
17:13:45 SQL> alter database open;
Database altered.
17:14:07 SQL> alter system switch logfile;
System altered.
17:14:17 SQL> select * from testing.test;
NO
1
2
3
4
17:14:25 SQL> insert into testing.test values(5);
1 row created.
17:14:40 SQL> insert into testing.test values(6);
1 row created.
17:14:43 SQL> insert into testing.test values(7);
1 row created.
17:14:45 SQL> commit;
Commit complete.
17:14:47 SQL> alter system switch logfile;
System altered.
17:14:50 SQL> insert into testing.test values(8);
1 row created.
17:14:55 SQL> insert into testing.test values(9);
1 row created.
17:14:57 SQL> insert into testing.test values(10);
1 row created.
17:15:00 SQL> commit;
Commit complete.
17:15:02 SQL> alter system switch logfile;
System altered.
17:15:04 SQL> shutdown abort;
ORACLE instance shut down.
*** Here i restored the datafiles
17:15:15 SQL> startup mount;
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 788224 bytes
Variable Size 66058496 bytes
Database Buffers 100663296 bytes
Redo Buffers 262144 bytes
Database mounted.
17:18:09 SQL> recover database until time '2004-12-05:17:14:45';
ORA-00279: change 402561 generated at 12/05/2004 17:10:03 needed for thread 1
ORA-00289: suggestion :
G:\ORACLE10G\ORADATA\NEWTEST\ARCHIVE\ARC00002_0544119450.001
ORA-00280: change 402561 for thread 1 is in sequence #2
17:18:43 Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
Log applied.
Media recovery complete.
17:19:20 SQL>
17:19:51 SQL> alter database open resetlogs;
Database altered.
17:20:33 SQL> select * from testing.test;
NO
1
2
3
4 -
Hi,
I am using oracle database 10g(10.2.0.10) in RHEL5. I want to perform a point in time recovery a datafile from backup. Through RMAN i issued the following command
RMAN> run{
2> sql "alter session set nls_date_format=''dd-mon-yyyy hh24:mi:ss''";
3> set until time '21-aug-2011 13:04:00';
4> restore datafile 4;
5> recover datafile 4;
6> alter database open resetlogs;}
But RMAN performed complete recovery. Again i deleted the datafile and restore the datafile from backup. Now i issued the following command in SQL prompt
SQL> alter session set nls_date_format='dd-mon-yyyy hh24:mi:ss';
Session altered.
SQL>recover datafile '/u01/app/oracle/oradata/ORATESTDB/datafile/o1_mf_users_751h7fmh_.dbf' UNTIL TIME '21-aug-2011 13:04:00';
ORA-00274: illegal recovery option UNTIL
It shows the above error. But i am able to perform Incomplete recovery of whole database using the same RMAN command as shown above.
Does datafile point-in-time recovery is not possible?????? or Is there anything wrong in my approach?????
Regards,
007A Datafile cannot be recovered to a point in time that is incosistent with the rest of the database.
(why ? Data Integrity !!!! A table with multiple extents may span multiple datafiles. You cannot have some extents with data as of 12:05 and other extents in another datafile recovered with data as of 10:05 !! Even if it is a single datafile tablespace, you will be violating referential integrity (whether enforced or not) if, say, the SALES table has entries upto 12:05 but the SALES_LINES table has entries upto 10:05 !!)
You can do a Tablespace Point In Time Recovery using an Auxiliary Instance and then copy the whole tablespace back. You have to ensure that Integrity is maintained.
Hemant K Chitale -
Incomplete Recovery and Read Only
Ok, I seem to be missing something. I've performed an incoplete recovery to a specified SCN. Everything is great if I open the database with resetlogs. But, the documentation (see quote below) says I can open the database as read only to check the recovery before I do the "resetlogs". However, I get the error (RMAN-01009) when I try to open the database read only. Can anyone explain?
Oracle Database Concepts (B14220-02) - 15 Backup and Recovery:
Before using the OPEN RESETLOGS command to open the database in read/write mode after an incomplete recovery, it is a good idea to first open the database in read-only mode, and inspect the data to make sure that the database was recovered to the correct point. If the recovery was done to the wrong point, then it is easier to re-run the recovery if no OPEN RESETLOGS has been done. If you open the database read-only and discover that not enough recovery was done, then just run the recovery again to the desired time. If you discover that too much recovery was done, then you must restore the database again and re-run the recovery.
The script I ran:
run
set until restore point r1;
restore database;
recover database;
}To generate the exception RMAN-01009 it appears you are trying to open the database using RMAN ... try it with SQL*Plus ... and if you have a problem post the full error message not just your impression of it along with the corresponding section of the alert log and full version number.
Maybe you are looking for
-
Cost Component structure field and table names
Hey all, i need to code a BADI to push value of one column in cost component structure to another column in ccs for only order settlements.. any idea how to do this?? i am very new to abap please take it easy on ur answer.. i coulndt even find in whi
-
No. of Rows in an internal table
Dear Friends, Please let me know which ABAP System Field shall give me the no. of rows in an internal table. If it is sy-dbcnt kindly provide an example on how to use it in a program. Regards, Alok.
-
I have a gen 1 ipod touch. Yesterday it began stopping for no reason at all.
My ipod touch is stopping after playing for a few mintes. These are items that I have downloaded and are playing, not streaming
-
Dock frozen, taking 100% CPU, 50gb swap
My dock is frozen and shows 100% cpu use (that is, 100% of one core). It gradually takes more and more memory until I run out of hard disk space. Killing the process does nothing - it immediately comes back at 100% of cpu and starts eating the memo
-
Invalid URL in tutorial - any ideas?
Has anyone gone thru the 'Automated Invocation of a .NET Web Service' tutorial available in OTN? This tutorial lists a sample webservice URL that is accessed. However, it is invalid. http://hosting001.vs.k2unisys.net/Weather/PDCWebService/WeatherServ