5 Replies Latest reply: Apr 10, 2013 12:12 AM by Hemant K Chitale RSS

    rman backup using control file as repository via networker

    Chewy
      Hi Guys,

      I'm using control file as rman repository. Currently I have this backup running at 8pm nightly:

      backup full filesperset 4 format '/Data_%d_%U/' (database);
      sql 'alter system switch logfile';
      sql 'alter system archive log current';
      crosscheck archivelog all;
      backup format 'arch_%s_%p_%t' archivelog all ;
      delete archivelog all completed before 'sysdate-3';

      And archive log backup running 7am, 11am, 4pm.


      Have a few queries:

      1. Understand that with the above, control file backup will also be included as RMAN automatically includes the control file and SPFILE in backups of datafile 1.
      So in any case when my control file is accidentally deleted from server, I still can restore it from the backup right?
      I believe i will need to set the db id first as control file is my repository. If control is missing, it can identify the control file to restore by setting db id?
      2. my control autobackup is set to off. what is the different between control file backup taken via autobackup as compared to 1?
      understand that controlfile autobackup is good as it will auto backup if there is any change in the db (like created new file, etc). Any other difference?
      3.
      •Run BACKUP CURRENT CONTROLFILE
      •Include a backup of the control file within any backup by using the INCLUDE CURRENT CONTROLFILE option of the BACKUP command
      What is the difference with such backup as compared to controlfile backup taken in item 1 and 2?

      4. lastly, if my control file + datafiles + arch + redo is accidentally deleted at 6pm. I restored the control file taken at yesterday 8pm. Since the control file only consist of backup information of 8pm and before, how do i restore the rest of the arch logs taken at 7am, 11am, 4pm?



      thanks
        • 1. Re: rman backup using control file as repository via networker
          Troll35
          Hi,

          Could you post your Oracle version, it will be easier to give you accurate answer?

          However :
          Restore from autobackup is really the easiest and the fastest way. Extract a controlfile backup from a standard backup file is more complicated. I suggest you try both methods, and you will be convinced that you should choose autobackup.
          And with autobackup enabled, when you add datafiles to your database, you have automatically an autobackup created, which is safe.

          Regarding the 4/, RMAN will apply the archivelog if they are available on the disk, even if the controlfile does not know about them.

          Hope this will help.

          Regards,
          • 2. Re: rman backup using control file as repository via networker
            Chewy
            Hi Guys,
            Apology for the late reply.
            Version is 10.2.0.5.
            Appreciate your help on my queries.

            thanks!
            • 3. Re: rman backup using control file as repository via networker
              Hemant K Chitale
              Since you mention networker, I presume that you copy disk backups to tape as a separate command from networker. Remember to include the controlfile autobackups as well when copying to tape !

              1. Yes, you can restore the controlfile and spfile from the backup. But you will have to manually determine which backup piece contains the controlfile and spfile backups. (In the scenario where you assume that the controlfile is lost, you cannot issue a LIST BACKUP to identify the backuppieces, so you will have to lookup log files to identify the backuppiece !)

              2. A controlfile autobackup will be created in db_recovery_file_dest using OMF. If you don't have this defined, the controlfile autobackup is epxected to go to $ORACLE_HOME/dbs --- although the actual target location can be platform and version dependent.

              3. A BACKUP CONTROLFILE backup creates a separate backupset and backuppiece for the controlfile. In OMF, it goes to the backup directory, not to the autobackup directory.

              4. Without a repository, if your archivelog backups are to disk you can CATALOG them (i.e. run the "CATALOG START WITH /disklocation" command) into the controlfile that you restorted from the 8pm backup. You cannot catalog backuppeices on tape, so it is advicable to use a Repository when backing up to tape directly.


              Hemant K Chitale
              • 4. Re: rman backup using control file as repository via networker
                Chewy
                Hi Hemant,
                Many thanks for the helpful advise.
                Some additional queries that u might be able to advise?

                Since you mention networker, I presume that you copy disk backups to tape as a separate command from networker. Remember to include the controlfile autobackups as well when copying to tape !
                --> The networker will call a batch script located in the os server. The batch script consists of rman command. (will allocate channel sbt tape).
                So i supposed it's direct backup of the DB to tape.

                1. Yes, you can restore the controlfile and spfile from the backup. But you will have to manually determine which backup piece contains the controlfile and spfile backups. (In the scenario where you assume that the controlfile is lost, you cannot issue a LIST BACKUP to identify the backuppieces, so you will have to lookup log files to identify the backuppiece !)
                --> Where can i find the log file? In networker side or db server?
                I supposed i have to set DB ID as well prior to restoring?

                2. A controlfile autobackup will be created in db_recovery_file_dest using OMF. If you don't have this defined, the controlfile autobackup is epxected to go to $ORACLE_HOME/dbs --- although the actual target location can be platform and version dependent.
                --> thanks. if i set the autobackup using sbt_tape channel, i supposed the controlfile will go direct to tape?

                3. A BACKUP CONTROLFILE backup creates a separate backupset and backuppiece for the controlfile. In OMF, it goes to the backup directory, not to the autobackup directory.
                -> thanks

                4. Without a repository, if your archivelog backups are to disk you can CATALOG them (i.e. run the "CATALOG START WITH /disklocation" command) into the controlfile that you restorted from the 8pm backup. You cannot catalog backuppeices on tape, so it is advicable to use a Repository when backing up to tape directly.
                -> Let' say i'm using the control file as repository. I supposed if i set auto backup on, i will not have this problem? As control file will be backup as well whenever there is update to the backup repository?

                thanks!
                • 5. Re: rman backup using control file as repository via networker
                  Hemant K Chitale
                  --> Where can i find the log file? In networker side or db server?
                  I supposed i have to set DB ID as well prior to restoring?
                  RMAN has a SPOOL LOG command to spool the command log. I guess networker would also be capturing a log of the RMAN command output.
                  Yes, you need the DBID before restoring.

                  if i set the autobackup using sbt_tape channel, i supposed the controlfile will go direct to tape?
                  Yes. However, I prefer either CONTROLFILE AUTOBACKUP or BACKUP CONTROLFILE to write to disk as well. It makes it easier to restore the controlfile first.
                  Let' say i'm using the control file as repository. I supposed if i set auto backup on, i will not have this problem? As control file will be backup as well whenever there is update to the backup repository?
                  No, controlfile autobackup is not generated when you only backup archivelogs. So you need to include a BACKUP CONTROLFILE.

                  Hemant K Chitale