[oracle@dg02 ~]$, Catalog the copied data file on server 1 (primary). During the restore operation, RMAN creates backup sets, on the physical standby database, of the files that need to be restored and then transfers these backup sets to the target database over the network. restoring datafile 00006 to /opt/oracle/oradata/std1/logmnrts.dbf Take the following steps to perform backups directly to tape, by default: In this scenario, full backups are taken weekly, with incremental backups taken daily on the standby database. For example, if RMAN backs up the database with the unique name of standby1, then standby1 is associated with this backup. If the value of the DB_UNIQUE_NAME initialization parameter changes for a database, then the same change must be made in the Oracle Data Guard environment. ORA-01144: File size (4325376 blocks) exceeds maximum of 4194303 blocks. Use the CROSSCHECK command to validate and update file status in the recovery catalog schema. 125 1 67 A 10-MAR-2008 10:21:52 +DATA/dg10g/archivelog/2008_04_10/thread_1_seq_67.284.683807227 The RMAN commands used to perform daily backups directly to tape resynchronize the information from all other databases in the Oracle Data Guard environment. document.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() ); step2. RMAN> exit; step4. How to check which events are set on the oracle database ? control_files string /opt/oracle/oradata/physical_s RMAN uses a recovery catalog to track filenames for all database files in an Oracle Data Guard environment. [oracle@dg01 ~]$ rman catalog=rcat/rcat@STD1.31 target=sys/oracle@STD1.21 On the first day this command is run there is no roll forward because there is no incremental level 1 yet. BACKUP DEVICE TYPE DISK INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'OSS' DATABASE. 2.backup control file from primary db SQL> create tablespace rcat datafile /opt/oracle/oradata/rcat01.dbf size 50M; input datafile fno=00004 name=/opt/oracle/oradata/std1/tools01.dbf do you rebuild the standby database. td1.ctl piece handle=/opt/oracle/rman/std1_05grapd8_1_1 tag=TAG20050805T132104 params=NULL Deletes archived logs according to the log deletion policy set by the CONFIGURE ARCHIVELOG DELETION POLICY command. All rights reserved. Redo Buffers 667648 bytes. RMAN considers the incremental backups on disk and tape as eligible to recover the image copies. Oracle Database Backup and Recovery Reference for more information about the RMAN CROSSCHECK command. channel ORA_DISK_1: finished piece 1 at 05-AUG-05 input datafile fno=00001 name=/opt/oracle/oradata/std1/system01.dbf You can restore an entire database, data files, control files, spfile, or tablespaces. Likewise, when a new plugged in tablespace is added to the primary database, the data files are treated like new data files at the primary. Machine A: 172.16.100.29 Linux ES3 For information about how to recover from the loss of online redo log files in other circumstances, see Oracle Database Backup and Recovery User's Guide. As of Oracle Database 18c, you can refresh a standby database over the network using one RMAN command, RECOVER STANDBY DATABASE.
Recovery from Loss of Files on the Primary or Standby Database, Recovery from Loss of Online Redo Log Files, Incomplete Recovery of the Primary Database, Actions Needed on Standby After TSPITR or Tablespace Plugin at Primary. ASMCMD [+] > rm data/dg10g/datafile/SYSTEM.281.683806229 The fast recovery area is a single storage location on a file system or Oracle Automatic Storage Management (Oracle ASM) disk group where all files needed for recovery reside. RMAN> register database; SQL> conn / as sysdba Propose: Backup db from physical standby db by using RMAN, recove datafile of primary standby db. You can create backup strategies using Oracle Recovery Manager (RMAN) with Oracle Data Guard and standby databases. Great. These RMAN configurations are recommended at a standby database where backups are not done. SQL> startup mount, step5. mv product/9.2.0/dbs/spfilestd1.ora /tmp/orabak/ SYSTEM.281.683806229 RMAN> recover database; Starting recover at 05-AUG-05 10:19:45 SYS@dg10g> alter database recover managed standby database disconnect from session; Elapsed: 00:00:07.03 Connected to an idle instance. Regards,
At the end we open the primary database with resetlogs, what will be the status of standby database? channel ORA_DISK_1: finished piece 1 at 05-AUG-05 ARCH CLOSING Database mounted.
Actions Needed On a Standby After a PDB PITR On a Primary for information about actions needed on a standby after a PDB PITR on a primary, Actions Needed on Standby After TSPITR or Tablespace Plugin at Primary for information about actions needed on a standby after TSPITR or tablespace plugin at the primary. channel ORA_DISK_1: specifying datafile(s) to restore from backup set Only the primary database must be explicitly registered using the REGISTER DATABASE command. After a file is cataloged by the target database, the file is associated with the target database. UNNAMED File Error in standby after adding new file to primary database ORA-01111, ORA-01110, ORA-01157, How to find username who executed query based on sql_id (addm report). In this scenario, you can still use the general strategies described in Recovery Scenarios in an Oracle Data Guard Environment, with the following exceptions: Backup files created by RMAN must be tagged with the local system name, and with RESTORE operations that tag must be used to restrict RMAN from selecting backups taken on the same host. restoring datafile 00008 to /opt/oracle/oradata/std1/logmnrts_3.dbf datafile copy filename=/home/oracle/backup/data_D-DG10G_I-3174575825_TS-SYSTEM_FNO-1_1akc44pg.rman
Had I been able to do a COMPLETE Recovery, I could have simply resumed DataGuard between the Primary and the Standby. The DBA can then take action, such as increasing the recovery area space limit, adding disk hardware, or decreasing the retention period. great article this is the first article I have seen on how to use the standby database to recover the primary. but i cant use it to restore on my primary database. input datafile copy recid=36 stamp=683808283 filename=/home/oracle/backup/data_D-DG10G_I- 2. Oracle Database Backup and Recovery User's Guide for more information about RMAN concepts and about using RMAN in an Oracle Data Guard environment, Oracle Database Backup and Recovery Reference for detailed information about RMAN commands. Similarly, during recovery operations, only disk backups associated with the database and files on tape are considered as sources for backups. Rolls forward level 0 copy of the database by applying the level 1 incremental backup taken the day before. piece handle=/opt/oracle/rman/std1_05grapd8_1_1 comment=NONE Database opened. All Rights Reserved. File metadata is deleted for all successfully deleted files associated with the current target database (or for files that are not associated with any known database). 610MB 38.1MB/s 00:16 Machine C: 6. Dataguard will know and recover standby pass the resetlog point. In case of primary fail, failover to standby is the standard solution to recover db. 3. Use the RMAN CONFIGURE command to set the RMAN configurations. 2) why in step 7 isnt the control file on the standby current. channel ORA_DISK_1: starting datafile backupset restore 2. db_unique_name is not a problem. Oracle Database Backup and Recovery User's Guide for more information about RMAN configurations, Oracle Database Backup and Recovery Reference for more information about the RMAN CONFIGURE command. You can associate these backups with any other existing database by using the CHANGE BACKUP RESET DB_UNIQUE_NAME command. 7. A recovery catalog does not have the space limitations of the control file and can store more historical data about backups. Appendix scenario:backup and recover the primary database with redo logs channel ORA_DISK_1: restored backup piece 1 tag=TAG20080410T103215 recid=25 stamp=683807601 10:47:39 SYS@dg10g> select database_role from v$database; Confirm that database on server 2 is still in managed recovery mode. move system tablespaces file to another space (LogOut/ Backs up any backup sets created as a result of incremental backup creation. output filename=/opt/oracle/product/9.2.0/dbs/spfilestd1.ora Logic told me that the relationship between a primary database and its physical standby databases would mean that there should be no problems. The following RMAN configurations are recommended at the primary database: This configuration lets you keep the backups necessary to perform database recovery to any point in time within the specified number of days. The SET DBID command is required only if you are not connected to a database as TARGET. channel ORA_DISK_1: starting piece 1 at 05-AUG-05 Finished backup at 05-AUG-05, 4.delete datafile, control files and spfile from primary db channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: sid=14 devtype=DISK I am an Oracle Database Specialist in Singapore. SQL> conn / as sysdba SQL> grant connect, resource, recovery_catalog_owner to rcat; Machine A: In the example script just shown, the previous day's incremental level 1 was tagged OSS. Please forgive me if I'm too busy to reply your comments in time. If a backupset is taken from a standby database then that backup set will be known to the primary database through the catalog. connected to target database: DG10G (DBID=3174575825), using target database control file instead of recovery catalog, specification does not match any archive log in the recovery catalog, Showing contents of RMAN repository on server 2, Recovery Manager: Release 10.2.0.4.0 Production on Fri Mar 10 10:25:16 2008. Be aware that when a CDB PITR is performed on a standby, any pluggable databases (PDBs) that were in a disabled state before the CDB PITR become enabled. step2.
connected to target database: STD1 (DBID=3008965527) restoring datafile 00008 to /opt/oracle/oradata/std1/logmnrts_3.dbf test recover on primary datafile mv oradata/std1/*.dbf /tmp/orabak/ These data files cannot be automatically created at the standby. 6.startup primary db with no spfile ARCH CONNECTED However, if the database filenames are not the same on the primary and standby databases that were never resynchronized, then the RESTORE and RECOVER commands you use are slightly different. Backs up only the data files that have not yet been backed up. ls -l /opt/oracle/oradata/std1/* ASMCMD [+] > ls data/dg10g/datafile File sharing attributes state that files on disk are accessible only at the database with which they are associated, whereas all files on tape are assumed to be accessible by all databases. An additional advantage is that the time-to-recover is reduced because the image copy is updated with the latest block changes and fewer redo logs are required to bring the database back to the current state. SQL> startup nomount Changing the DB_UNIQUE_NAME Initialization Parameter for a Database. Machine A: Database Buffers 419430400 bytes rman catalog=rcat/rcat@std1_31 target=sys/oracle@std1_29 piece handle=/opt/oracle/rman/std1_03grae2o_1_1 comment=NONE Machine C: If you are certain of the configuration and still want to change status metadata for unavailable files, you can use the CHANGE RESET DB_UNIQUE_NAME command to change metadata for association of files with the database and execute the CROSSCHECK command to update status metadata to EXPIRED. For example, you can restore a standby control file on a primary database and a primary control file on a physical standby database. 10:27:06 SYS@dg10g> alter system switch logfile; 10:27:23 SYS@dg10g> select process, status from v$managed_standby; PROCESS STATUS I dont think its in datafile headers. By default, in an Oracle Data Guard environment, the recovery catalog considers disk backups as accessible only to the database with which it is associated, whereas tape backups created on one database are accessible to all databases. 10:19:16 SYS@dg10g> startup nomount These files include the control file, archived logs, online redo logs, flashback logs, and RMAN backups. using channel ORA_DISK_1 rman catalog=rcat/rcat@STD1.31 Oracle's Media Management Layer (MML) API lets third-party vendors build a media manager, software that works with RMAN and the vendor's hardware to allow backups to sequential media devices such as tape drives. What is SCAN listener and how it works in Oracle RAC 11gR2 ? Start the standby instance in the NOMOUNT state using the same parameter files with which the standby was operating earlier. input filename=/opt/oracle/product/9.2.0/dbs/cntrlstd1.dbf RMAN> restore controlfile; using channel ORA_DISK_1 Those methods are no longer necessary as of Oracle Database 12c. create recovery catalog on Machine C If a file could not be successfully deleted, you can use the FORCE option to remove the file's metadata. RMAN backs up data file 1 on standby1 to /sbyhost/disk2/df1.dbf on the standby host and also to tape. Set the following initialization parameters to configure the fast recovery area: Oracle Database Backup and Recovery User's Guide for more information about configuring a fast recovery area. ORA-01110: data file 1: +DATA/dg10g/datafile/system.281.683806229, Copying data file copy backed up on server 2 (standby) to server 1, [oracle@dg02 ~]$ scp backup/data_D-DG10G_I-3174575825_TS-SYSTEM_FNO-1_1akc44pg.rman dg01:./backup/ channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:15 media recovery complete
+ASM The files in an Oracle Data Guard environment (data files, archived logs, backup pieces, image copies, and proxy copies) are associated with a database through use of the DB_UNIQUE_NAME parameter. channel ORA_DISK_1: restore complete If a file associated with another database is successfully inspected, its metadata in the recovery catalog is also changed to AVAILABLE. Thanks As of Oracle Database 12c, RMAN lets you restore or recover files by connecting, over the network, to a physical standby database that contains the required files. When a standby database is completely removed from an Oracle Data Guard environment, the database information in the recovery catalog can also be removed after you connect to another database in the same Oracle Data Guard environment. Repeat this process until the state of the database is verified to be correct. Till now im thinking offloading (Generating reports using SELECT + backups) can be performed in Active Datagaurd only where standby database would open in read only mode but you proved backups can be taken in the standby database even if the database is in mounted state, Thanks for the information. 10:22:25 SYS@dg10g>, Showing contents of RMAN repository on server 1, Recovery Manager: Release 10.2.0.4.0 Production on Fri Mar 10 10:25:23 2008, Copyright (c) 1982, 2007, Oracle. ASMCMD [+] > exit RMAN and Oracle Data Guard can be used together to simplify the administration of an Oracle Data Guard configuration. Update : This method can also be used to restore a Standby to another server as an independent Primary, except that you must decide the Recovery Point (ArchiveLog Sequence# and make those ArchiveLogs available either from the Standby server or the actual source Primary server). exit Oracle Database Backup and Recovery User's Guide for more information about RMAN TSPITR. You can restore and recover files over the network by connecting to a physical standby database that contains the required files. Copyright (c) 1982, 2007, Oracle. RMAN-06054: media recovery requesting unknown log: thread 1 scn 252823. input datafile fno=00006 name=/opt/oracle/oradata/std1/logmnrts.dbf The following is an example of using the RECOVER STANDBY DATABASE command. restoring datafile 00003 to /opt/oracle/oradata/std1/indx01.dbf starting media recovery Therefore, it is important that the value supplied for DB_UNIQUE_NAME be unique for each database in an Oracle Data Guard environment. channel ORA_DISK_1: starting piece 1 at 05-AUG-05 channel ORA_DISK_1: specifying datafile(s) to restore from backup set It will be done from alter database recover managed standby database disconnect from session; as well. I do have two questions: 1) is it possible to do this if you are not using a recovery catalog?
This is the recommended procedure when the standby database is behind the desired incomplete recovery time, and Flashback Database is not enabled on the primary or standby databases: Recover the standby database to the desired point in time. These Oracle Database configurations are recommended on every primary and standby database in the Oracle Data Guard environment. Copyright (c) 1982, 2007, Oracle. Youd better backup the controlfile and datafiles at the same time. The catalog also records where the online redo logs, standby redo logs, tempfiles, archived redo logs, backup sets, and image copies are created. The backups that were associated with the database that was unregistered are still usable by other databases. Archived redo logs can be used to recover the database to any point in either day. Backups of standby control files and nonstandby control files are interchangeable. The CHANGE command is useful when disk backups or archived logs are transferred from one database to another and you want to use them on the database to which they were transferred. Fixed Size 2085872 bytes Alternatively, you can start by recovering the standby database to a point that you know is before the target time, and then open the database in read-only mode to examine the state of the data. As of Oracle Database 11g, the recovery catalog can resynchronize the file names from each standby database site. ORACLE instance started. These configurations make the following assumptions: The standby database is a physical standby database, and backups are taken only on the standby database. 10:40:19 @> conn / as sysdba allocated channel: ORA_DISK_1 channel ORA_DISK_1: restored backup piece 1 Earlier, my Primary was at SCN 12770765, now (with the INCOMPLETE Recovery) it has been recovered to some transaction at around SCN 12773005 or thereabouts (because the OPEN RESETLOGS also increments the SCN). The FROM SERVICE clause specifies the name of a primary service. Well, there is one restriction that seems pretty important: the fact that you cannot CATALOG backupsets in 9i. Alex. Complimentary session for PerformanceTuning. For example, for a RECOVER COPY operation, RMAN considers only image copies that are associated with the database as eligible to be recovered. Finished restore at 05-AUG-05. You must install Oracle Secure Backup or third-party media management software to use RMAN with sequential media devices. UNDOTBS1.278.682752907 To illustrate the differences in backup accessibility, assume that databases prod and standby1 reside on different hosts. Use LogMiner or another means to identify the time or SCN at which all the data in the database is known to be good. By default, RMAN associates files whose SITE_KEY is null with the target database. Total System Global Area 612368384 bytes Similarly, you can back up a tablespace on a primary database and restore and recover it on a physical standby database. Finished recover at 05-AUG-05, database opened Oracle Database Backup and Recovery User's Guide for more information about managing a recovery catalog. channel ORA_DISK_1: restored backup piece 1 2. Explanations for what each command in the script does are as follows: Resynchronizes the information from all other database sites (primary and other standby databases) in the Oracle Data Guard setup that are known to recovery catalog. piece handle=/opt/oracle/rman/std1_04grae3f_1_1 comment=NONE Backups of the SPFILE can only be restored to the database from which they were backed up. Connect RMAN to the standby database (as target database) and to the recovery manager. Use the following procedure to perform incomplete recovery on the primary database: After this process, all standby database instances must be reestablished in the Oracle Data Guard configuration. On the first day this script is run, if no level 0 backups are found, then a level 0 backup is created. Perform a complete backup of the database on all systems to perform recovery operations. Machine B: 172.16.100.21 Linux ES3 You can also flashback a PDB on a standby. Use a server parameter file (SPFILE) so that it can be backed up to save instance parameters in backups. Take the following steps to perform daily backups directly to tape: These commands also create a level 1 incremental backup of the database, including all archived logs.
ALex. It shows optional usage of the PFILE clause to specify a parameter file for the standby database (used when the spfile is not available).
Copyright (c) 1982, 2007, Oracle. I would think that if you are using the standby to recover the primary that this would be the current control file. oracle@dg01s password: These logs can be used to roll the database back to an earlier point in time, without requiring a complete restore. A recovery catalog is a database schema used by RMAN to store metadata about one or more Oracle databases. Oracle Database Backup and Recovery Users Guide for more information about using the RECOVER STANDBY DATABASE command to refresh a physical standby database with changes made to the primary database, RMAN supports point-in-time recovery (PITR) of a multitenant container database (CDB) at a standby. A backup remains associated with the database that created it unless you use the CHANGE RESET DB_UNIQUE_NAME to associate the backup with a different database. mv oradata/std1/redo*.log /tmp/orabak/, sftp 172.16.100.21 Change), You are commenting using your Facebook account. If you need information about using them, refer to Oracle Database 11g documentation.
The fast recovery area on the standby database can serve as a disk cache for tape backup. Files that are brought online or offline as a result of an ALTER PLUGGABLE DATABASE [ENABLE | DISABLE] operation remain in that state even if you flashback the database to a point before the operation was performed.
Database Buffers 419430400 bytes 10:21:30 SYS@dg10g> startup channel ORA_DISK_1: sid=9 devtype=DISK Incase of all control/dbf/redo files lost, best option would be to failover to standby database and rebuild the standby. The last three commands list archive logs, database file names, and RMAN configuration information for a database with a DB_UNIQUE_NAME of BOSTON. build Machine A as primary db and Machine B as standby db, create another db on Machine C Use CHANGE command options such as AVAILABLE, UNAVAILABLE, KEEP, and UNCATALOG to make backups available or unavailable for restore and recovery purposes, and to keep or remove their metadata. channel ORA_DISK_1: starting piece 1 at 05-AUG-05 starting full resync of recovery catalog In effect, flashing back a PDB on a standby rewinds the data files for the PDB to a previous point in time, as if restoring a backup of the PDB. USERS.280.683476541 Thus, I have restored from a Standby backup as of SCN 12445248 on server ora19cs1, where the ORACLE_SID and file names were STDBYDB to SCN 12773005 as a new Primary on server ora19cP1 where the ORACLE_SID and file names are ORCLCDB. The RMAN recovery catalog, after connecting to that database instance, knows both the old and new value for DB_UNIQUE_NAME. A new standby is automatically registered in the recovery catalog when you connect to a standby database or when the CONFIGURE DB_UNIQUE_NAME command is used to configure the connect identifier. restoring datafile 00007 to /opt/oracle/oradata/std1/newlogminer.dbf