Home » RDBMS Server » Backup & Recovery » RMAN restore validate
RMAN restore validate [message #305507] Tue, 11 March 2008 01:56 Go to next message
coolbalaga
Messages: 24
Registered: September 2006
Junior Member
Hello,

I am using an rman restore database validate. Wanted to know how the validation is done by the oracle.

Does it restore to some location and verify it ? or what it does ?

Thanks in advance.
Re: RMAN restore validate [message #305512 is a reply to message #305507] Tue, 11 March 2008 02:13 Go to previous messageGo to next message
Michel Cadot
Messages: 68650
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
From doc Database Backup and Recovery Reference, RESTORE command:
Quote:
RESTORE... VALIDATE causes RMAN to select existing backups that it would use to perform a RESTORE operation, and scan them all to ensure that they are present and free of corruption.

Quote:
VALIDATE: Lets RMAN decide which backup sets, datafile copies, and archived logs need to be restored, and then scans them to verify their contents. No files are restored. Use VALIDATE to verify that the backups required to restore the specified files are intact and usable.

Regards
Michel

[Updated on: Tue, 11 March 2008 02:15]

Report message to a moderator

Re: RMAN restore validate [message #305753 is a reply to message #305512] Tue, 11 March 2008 21:09 Go to previous messageGo to next message
trantuananh24hg
Messages: 744
Registered: January 2007
Location: Ha Noi, Viet Nam
Senior Member
One question, Michel..

What is the kind of archive logfile which the RMAN looks for if backup plus archivelog? The archive logfile in archive_destintion folder or the archive logfile within backup pieces? And can I delete/remove all of archive logfiles in archive folder after RMAN backup full plus archive logfile?

RMAN>run{
backup database plus archivelog;
delete noprompt obsolete;
}


Thank you for your clarification!
Re: RMAN restore validate [message #305799 is a reply to message #305753] Wed, 12 March 2008 01:22 Go to previous messageGo to next message
Michel Cadot
Messages: 68650
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1/ during backup it searches for archived log in all log_archive_dest% parameters

2/ To automatically delete archived logs after backup you can use (and omit the "delete obsolete" statement):
backup database plus archivelog delete input;


Regards
Michel

Re: RMAN restore validate [message #305835 is a reply to message #305799] Wed, 12 March 2008 03:00 Go to previous messageGo to next message
trantuananh24hg
Messages: 744
Registered: January 2007
Location: Ha Noi, Viet Nam
Senior Member
Thank you for your reply, Michel!

I am sorry for my obscure question. I meant that

1/ When I backup full with..
RMAN> run{
backup database plus archivelog;
}


It means that the RMAN would backup full plus all of available archive log files. However, when the DB crashs (assume that but I hope it never happen), I must use RMAN to restore and recovery DB. And, with the backup full at 10/02/2008, the DB crashs at 11/02/2008, what will happend if I delete all of archive log files at 10/02/2008 after I'd ran backup before?

To clarify, I make an example
SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     60
Next log sequence to archive   62
Current log sequence           62
SQL> show parameter log_archive_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest                     string      c:\archive_TEST

SQL>host
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>rman catalog=rman/rman@meta target=sys/test@test

Recovery Manager: Release 10.2.0.1.0 - Production on Wed Mar 12 14:43:37 2008

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

connected to target database: TEST (DBID=1943616714)
connected to recovery catalog database

RMAN> list archivelog all;

List of Archived Log Copies
Key     Thrd Seq     S Low Time  Name
------- ---- ------- - --------- ----
4509    1    61      A 12-MAR-08 C:\FLASHBACK_TEST\TEST\ARCHIVELOG\2008_03_12\O1
_MF_1_61_3XGP94N0_.ARC
4508    1    61      A 12-MAR-08 C:\ARCHIVE_TEST\ARC00061_0646915963.001
RMAN> run{
2> backup database plus archivelog;
3> delete noprompt obsolete;
4> }

Starting backup at 12-MAR-08
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=150 devtype=DISK
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=61 recid=188 stamp=649163803
input archive log thread=1 sequence=62 recid=190 stamp=649176282
channel ORA_DISK_1: starting piece 1 at 12-MAR-08
channel ORA_DISK_1: finished piece 1 at 12-MAR-08
piece handle=C:\BACKUP_TEST\BACKUPTEST_DB_19JB396U_41_1 tag=TAG20080312T144445 c
omment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
Finished backup at 12-MAR-08

Starting backup at 12-MAR-08
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00004 name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\USERS01.DBF
input datafile fno=00001 name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\SYSTEM01.DBF

input datafile fno=00005 name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\EXPIRED.DBF
input datafile fno=00002 name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\UNDOTBS01.DB
F
input datafile fno=00003 name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\SYSAUX01.DBF

channel ORA_DISK_1: starting piece 1 at 12-MAR-08
channel ORA_DISK_1: finished piece 1 at 12-MAR-08
piece handle=C:\BACKUP_TEST\BACKUPTEST_DB_1AJB3974_42_1 tag=TAG20080312T144451 c
omment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:45
Finished backup at 12-MAR-08

Starting backup at 12-MAR-08
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=63 recid=192 stamp=649176458
channel ORA_DISK_1: starting piece 1 at 12-MAR-08
channel ORA_DISK_1: finished piece 1 at 12-MAR-08
piece handle=C:\BACKUP_TEST\BACKUPTEST_DB_1BJB39CD_43_1 tag=TAG20080312T144740 c
omment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 12-MAR-08

Starting Control File and SPFILE Autobackup at 12-MAR-08
piece handle=C:\FLASHBACK_TEST\TEST\AUTOBACKUP\2008_03_12\O1_MF_S_649176465_3XH2
O2XS_.BKP comment=NONE
Finished Control File and SPFILE Autobackup at 12-MAR-08

RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
using channel ORA_DISK_1
no obsolete backups found

RMAN> list backup of database;


List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4529    Full    1.05G      DISK        00:02:39     12-MAR-08
        BP Key: 4531   Status: AVAILABLE  Compressed: NO  Tag: TAG20080312T14445
1
        Piece Name: C:\BACKUP_TEST\BACKUPTEST_DB_1AJB3974_42_1
  List of Datafiles in backup set 4529
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 18774326422 12-MAR-08 C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\SYSTE
M01.DBF
  2       Full 18774326422 12-MAR-08 C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\UNDOT
BS01.DBF
  3       Full 18774326422 12-MAR-08 C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\SYSAU
X01.DBF
  4       Full 18774326422 12-MAR-08 C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\USERS
01.DBF
  5       Full 18773776232 27-FEB-08 C:\ORACLE\PRODUCT\10.2.0\ORADATA\EXPIRED.DB
F


OKie, I have one full backup with archive logfile right now.
What's happend if I delete all of archive logfile in c:\archive_TEST?

RMAN> exit


Recovery Manager complete.

C:\>dir c:\archive_TEST
 Volume in drive C is ORADBA
 Volume Serial Number is D44E-7DCA

 Directory of c:\archive_TEST

03/12/2008  02:47 PM    <DIR>          .
03/12/2008  02:47 PM    <DIR>          ..
03/12/2008  11:16 AM        10,934,784 ARC00061_0646915963.001
03/12/2008  02:44 PM         2,016,256 ARC00062_0646915963.001
03/12/2008  02:47 PM             3,072 ARC00063_0646915963.001
01/31/2008  04:44 PM           143,360 ARC_00002_0645463556.ARC001
               4 File(s)     13,097,472 bytes
               2 Dir(s)   2,028,089,344 bytes free

C:\>delete c:\archive_test\*.*
'delete' is not recognized as an internal or external command,
operable program or batch file.

C:\>del c:\archive_test\*.*
c:\archive_test\*.*, Are you sure (Y/N)? y

C:\>dir c:\archive_test
 Volume in drive C is ORADBA
 Volume Serial Number is D44E-7DCA

 Directory of c:\archive_test

03/12/2008  02:52 PM    <DIR>          .
03/12/2008  02:52 PM    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)   2,041,192,448 bytes free

C:\>rman catalog=rman/rman@meta target=sys/test@test

Recovery Manager: Release 10.2.0.1.0 - Production on Wed Mar 12 14:52:37 2008

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

connected to target database: TEST (DBID=1943616714)
connected to recovery catalog database

RMAN> crosscheck archivelog all;

allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=159 devtype=DISK
validation succeeded for archived log
archive log filename=C:\FLASHBACK_TEST\TEST\ARCHIVELOG\2008_03_12\O1_MF_1_61_3XG
P94N0_.ARC recid=188 stamp=649163803
validation failed for archived log
archive log filename=C:\ARCHIVE_TEST\ARC00061_0646915963.001 recid=187 stamp=649
163803
validation succeeded for archived log
archive log filename=C:\FLASHBACK_TEST\TEST\ARCHIVELOG\2008_03_12\O1_MF_1_62_3XH
2H9WS_.ARC recid=190 stamp=649176282
validation failed for archived log
archive log filename=C:\ARCHIVE_TEST\ARC00062_0646915963.001 recid=189 stamp=649
176282
validation failed for archived log
archive log filename=C:\ARCHIVE_TEST\ARC00063_0646915963.001 recid=191 stamp=649
176458
validation succeeded for archived log
archive log filename=C:\FLASHBACK_TEST\TEST\ARCHIVELOG\2008_03_12\O1_MF_1_63_3XH
2NT4D_.ARC recid=192 stamp=649176458
Crosschecked 6 objects


RMAN> delete archivelog all;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=159 devtype=DISK

List of Archived Log Copies
Key     Thrd Seq     S Low Time  Name
------- ---- ------- - --------- ----
4509    1    61      A 12-MAR-08 C:\FLASHBACK_TEST\TEST\ARCHIVELOG\2008_03_12\O1
_MF_1_61_3XGP94N0_.ARC
4508    1    61      X 12-MAR-08 C:\ARCHIVE_TEST\ARC00061_0646915963.001
4517    1    62      A 12-MAR-08 C:\FLASHBACK_TEST\TEST\ARCHIVELOG\2008_03_12\O1
_MF_1_62_3XH2H9WS_.ARC
4516    1    62      X 12-MAR-08 C:\ARCHIVE_TEST\ARC00062_0646915963.001
4526    1    63      X 12-MAR-08 C:\ARCHIVE_TEST\ARC00063_0646915963.001
4527    1    63      A 12-MAR-08 C:\FLASHBACK_TEST\TEST\ARCHIVELOG\2008_03_12\O1
_MF_1_63_3XH2NT4D_.ARC

Do you really want to delete the above objects (enter YES or NO)? y
deleted archive log
archive log filename=C:\FLASHBACK_TEST\TEST\ARCHIVELOG\2008_03_12\O1_MF_1_61_3XG
P94N0_.ARC recid=188 stamp=649163803
deleted archive log
archive log filename=C:\ARCHIVE_TEST\ARC00061_0646915963.001 recid=187 stamp=649
163803
deleted archive log
archive log filename=C:\FLASHBACK_TEST\TEST\ARCHIVELOG\2008_03_12\O1_MF_1_62_3XH
2H9WS_.ARC recid=190 stamp=649176282
deleted archive log
archive log filename=C:\ARCHIVE_TEST\ARC00062_0646915963.001 recid=189 stamp=649
176282
deleted archive log
archive log filename=C:\ARCHIVE_TEST\ARC00063_0646915963.001 recid=191 stamp=649
176458
deleted archive log
archive log filename=C:\FLASHBACK_TEST\TEST\ARCHIVELOG\2008_03_12\O1_MF_1_63_3XH
2NT4D_.ARC recid=192 stamp=649176458
Deleted 6 objects

RMAN>


Oap, sorry, I am stupid, instead of using RMAN to delete archivelog, I removed them by OS command, but it will be related the second and third question..

2/ Will the RMAN restore and recovery successfully if my DB will crash tomorrow?

3/ I delete all of archivelog files (or backup files) instead of using RMAN, the purpose that I did are decreasing my disk size (of course, I will copy them to the other storage), however, I did not really remove them. Some time in the future, if DB will be crashed, I think, I can copy them right back, and use the RMAN command crosscheck to determind all of backup and archive logfiles.

Am I wrong or right?
Thank you for your clarificaton!

[Updated on: Wed, 12 March 2008 03:02]

Report message to a moderator

Re: RMAN restore validate [message #305857 is a reply to message #305835] Wed, 12 March 2008 03:58 Go to previous messageGo to next message
Michel Cadot
Messages: 68650
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1/ If you delete your archived logs before backing them up then you can recover until the last backed up archived logs and no more.

2/ RMAN automatically restores the backed up archived logs it needs to recover

3/ Yes, you can manually "restore" the archived logs by copying them from another location you saved them without RMAN.

Regards
Michel
Re: RMAN restore validate [message #306117 is a reply to message #305857] Wed, 12 March 2008 21:11 Go to previous messageGo to next message
trantuananh24hg
Messages: 744
Registered: January 2007
Location: Ha Noi, Viet Nam
Senior Member
Thank you, Michel!
Re: RMAN restore validate [message #308672 is a reply to message #306117] Tue, 25 March 2008 03:11 Go to previous message
ora_zhp
Messages: 10
Registered: September 2007
Junior Member
you can restore archived redo logs manually if you
wish, in order to save the time needed to restoroe these files later during the RECOVER command, or if you want to store the restored archived redo log files in some new location.

RUN
{
SET ARCHIVELOG DESTINATION TO '/oracle/temp_restore';
RESTORE ARCHIVELOG ALL;
# restore and recover datafiles as needed
.
.
.
}
Previous Topic: cloning the database using netapps backup
Next Topic: clone database using hot backup on windows
Goto Forum:
  


Current Time: Mon May 13 21:45:31 CDT 2024