1 2 Previous Next 17 Replies Latest reply: Aug 1, 2012 3:18 PM by Karan Kukreja RSS

    Create a standby controlfile using cold backup

    Karan Kukreja
      Hi All,

      We have to setup a DR for a production database.
      Here we have the coldbackup which backups all the datafiles and the control file from the production database.

      For cloining we generally copy them to another instance and then create controlfile manually. But for setting up as a DR , we would be creating it for standby controlfile.

      I tried to google but I am not able to find a way to create a standby controlfile from the existing controlfile cold backup.


      OS version solaris 10 , database version 11.2.0.1


      Regards
      KK

      Edited by: Kk on Feb 16, 2012 8:51 AM
        • 1. Re: Create a standby controlfile using cold backup
          mseberg
          Hello;

          Would use RMAN and would try to avoid refreshing the Standby Control File. Make sure STANDBY-FILE_MANAGEMENT is set to AUTO,


          Best Regards

          mseberg

          Edited by: mseberg on Feb 17, 2012 2:57 AM
          • 2. Re: Create a standby controlfile using cold backup
            EdStevens
            Kk wrote:
            Hi All,

            We have to setup a DR for a production database.
            Here we have the coldbackup which backups all the datafiles and the control file from the production database.

            For cloining we generally copy them to another instance and then create controlfile manually. But for setting up as a DR , we would be creating it for standby controlfile.

            I tried to google but I am not able to find a way to create a standby controlfile from the existing controlfile cold backup.


            OS version solaris 10 , database version 11.2.0.1


            Regards
            KK
            If it is truely a cold backup, all you have to do is drop all the files into their correct directories (including the cold backup of the (hopefully multiplexed) control file, and start the database. You mention that you are wanting to use if for a standby. I'd set aside the cold backup for the moment and read the docs on setting up a standby database. Don't read it with pre-conceived notions.
            • 3. Re: Create a standby controlfile using cold backup
              Shivananda Rao
              Since you are on 11.2, why don't you make use of the "active database feature" for setting up your standby using RMAN.

              http://www.oracle-base.com/articles/11g/DataGuardSetup_11gR2.php
              • 4. Re: Create a standby controlfile using cold backup
                CKPT
                Kk wrote:
                Hi All,

                We have to setup a DR for a production database.
                Here we have the coldbackup which backups all the datafiles and the control file from the production database.

                For cloining we generally copy them to another instance and then create controlfile manually. But for setting up as a DR , we would be creating it for standby controlfile.

                I tried to google but I am not able to find a way to create a standby controlfile from the existing controlfile cold backup.


                OS version solaris 10 , database version 11.2.0.1


                Regards
                KK

                Edited by: Kk on Feb 16, 2012 8:51 AM
                Try as below

                My version:
                SQL> select * from v$version;
                
                BANNER
                --------------------------------------------------------------------------------
                Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
                PL/SQL Release 11.2.0.1.0 - Production
                CORE    11.2.0.1.0      Production
                TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
                NLSRTL Version 11.2.0.1.0 - Production
                SQL>
                1) Taken backup of current controlfile
                2) Deleted Current controlfiles
                3) Restored using standby clause from current controlfile
                4) Mounted & now controlfile type is Standby

                Try in this way when you have cold backup. :)
                SQL> select controlfile_type from v$database;
                
                CONTROL
                -------
                CURRENT
                     
                RMAN> run
                2> {
                3> allocate channel ch1 device type disk format 'c:\oracle\control%U.bkp';
                4> backup current controlfile;
                5> release channel ch1;
                6> }
                
                using target database control file instead of recovery catalog
                allocated channel: ch1
                channel ch1: SID=63 device type=DISK
                
                Starting backup at 16-FEB-12
                channel ch1: starting full datafile backup set
                channel ch1: specifying datafile(s) in backup set
                including current control file in backup set
                channel ch1: starting piece 1 at 16-FEB-12
                channel ch1: finished piece 1 at 16-FEB-12
                piece handle=C:\ORACLE\CONTROL08N3GEA6_1_1.BKP tag=TAG20120216T230334 comment=NONE
                channel ch1: backup set complete, elapsed time: 00:00:01
                Finished backup at 16-FEB-12
                
                released channel: ch1
                
                RMAN> exit
                
                
                
                RMAN> restore standby controlfile from 'C:\ORACLE\CONTROL08N3GEA6_1_1.BKP';
                
                Starting restore at 16-FEB-12
                using target database control file instead of recovery catalog
                allocated channel: ORA_DISK_1
                channel ORA_DISK_1: SID=66 device type=DISK
                
                channel ORA_DISK_1: restoring control file
                channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
                output file name=C:\ORACLE\ORADATA\ORCL\CONTROL01.CTL
                output file name=C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\CONTROL02.CTL
                Finished restore at 16-FEB-12
                
                
                SQL> alter database mount;
                
                Database altered.
                
                SQL> select controlfile_type from v$database;
                
                CONTROL
                -------
                STANDBY
                
                SQL>
                Some More information:-
                Even if your database backup is old, still you can create a new standby controlfile and restore new controlfile and restore database. Later after starting MRP all will be synchronized. No issues
                SQL> select controlfile_type from v$database;
                
                CONTROL
                -------
                CURRENT
                
                SQL> alter database create standby controlfile as 'c:\oracle\control_stby.ctl';
                
                Database altered.
                
                SQL> $dir c:\oracle\con*
                 Volume in drive C is System
                 Volume Serial Number is 1853-3E21
                
                 Directory of c:\oracle
                
                02/16/2012  11:41 PM         9,748,480 CONTROL_STBY.CTL
                               1 File(s)     19,546,112 bytes
                               0 Dir(s)  177,185,570,816 bytes free
                
                SQL>
                Now Just restore database. You already have backup.
                Or
                If you have opportunity you can go ahead for Duplicate/Duplicate from active database

                Edited by: CKPT on Feb 16, 2012 11:41 PM
                • 5. Re: Create a standby controlfile using cold backup
                  Karan Kukreja
                  Hi All,


                  Thank You for your replies.


                  Hi CKPT,

                  Please confirm if my understanding is correct .


                  1. Dump all the cold backup in another location ,create a controlfile manually and then start the database. -- which is not yet standby.

                  2. Then create a standby controlfile using rman in production database and transfer it to the place where i have started the above database.

                  3. Shutdown the database newly created in step one and then rename the existing controlfile and use the rman command to restore the standby controlfile i brought from production.


                  4. The controlfile which has been restored , even after being created in future as compared to the restored backup would work as mentioned about the MRP Processor.


                  Please suggest on my understanding.


                  Regards
                  Kk
                  • 6. Re: Create a standby controlfile using cold backup
                    CKPT
                    Hi.
                    1. Dump all the cold backup in another location ,create a controlfile manually and then start the database. -- which is not yet standby.
                    Above step is not needed. Directly you can mount standby controlfile.

                    Copy backups to the new location
                    Create a new standby controlfile in primary.
                    Restore standby controlfile & mount it.
                    Restore database
                    Start MRP.
                    • 7. Re: Create a standby controlfile using cold backup
                      NikolayIvankin
                      mseberg wrote:
                      http://www.visi.com/~mseberg/data_guard_on_oracle_10_step_by_step.html
                      Cold backup won't really work as you want the new Standby in sync.
                      I disagree.
                      I'd reinstated over 100 standby DB's (SYNC,MaxAvailability) with the help of user-managed backups (BEGIN.. END BACKUP). But cold backups also are good.
                      Standby controlfiles I created at primary, but there is no any reason why not mount a cold backup and create standby controlfile (especially in case of coinciding pathes).

                      If archived logs aren't deleted from primary, then standby, made by any way, will get them from primary and apply.
                      • 8. Re: Create a standby controlfile using cold backup
                        Karan Kukreja
                        Hi CKPT,

                        Thanks a lot for the quick responses.



                        Out of the steps you have mentioned , i have done the following :

                        Copy backups to the new location
                        Create a new standby controlfile in primary and shipped it to the new location
                        Restore standby controlfile & mount it.

                        Now the db is in mount state.

                        Now , the cold backup is suppose at location /u02 , which command should i run to restore the database since its a cold backup ?

                        Please suggest Sir.

                        Regards
                        Kk
                        • 9. Re: Create a standby controlfile using cold backup
                          mseberg
                          OK.

                          Show me the money, if you are correct can you back it with any documentation? My understanding is the Standby Control will hold all the archived log information for the standby database. If you remove it or refresh it later and replace it from information from the primary database you have a sync issue. Maybe you can fix that, but it seems harder to me.

                          I'm not saying what you say is wrong mind you. But I believe RMAN is the best way to avoid refreshing the Standby Control file. I probably should have given an RMAN answer and left it at that.

                          I also think the less you have to touch the Standby Control file, the better. If you have a document I'm interested.

                          Thank You for your feedback.

                          mseberg
                          • 10. Re: Create a standby controlfile using cold backup
                            CKPT
                            When you have cold backup. So it's just copied files.

                            So now directory structure in primary & standby.

                            You have lot of work when you manage with manually.

                            Put datafiles in location where you want. And then from mount rename datafiles as.

                            Primary: /u01/oradata/prod/example01.dbf
                            Standby: /u02/oradata/stby/example01.dbf


                            From mount

                            Sql> Alter database rename file '/u01/oradata/prod/example01.dbf' to '/u02/oradata/stby/example01.dbf';

                            Like that rename all the datafiles & log files too.

                            Just confirm, I think it's normal datafiles copied from OS. if RMAN let me know.
                            • 11. Re: Create a standby controlfile using cold backup
                              CKPT
                              I'm not saying what you say is wrong mind you. But I believe RMAN is the best way to avoid refreshing the Standby Control file. I probably should have given an RMAN answer and left it at that.
                              @nikolay; mseberg
                              Agree. RMAN is very easy to manage, if directory structure different when managing with manual it's hectic, lot of manual work.

                              Again, when we have automated features available, why should we prefer manual methods?
                              It depends environment to environment.
                              • 12. Re: Create a standby controlfile using cold backup
                                NikolayIvankin
                                mseberg wrote:
                                I also think the less you have to touch the Standby Control file, the better. If you have a document I'm interested.
                                Here is [url http://nikolayivankin.wordpress.com/2012/02/06/dgmgrl-configuration-of-disaster-recovery-in-few-steps/]a little demo, which describes my way. :-)

                                Sure I understand, that this way is not applicable for huge DB's. But up to 50 GB it works very well.

                                Edited by: Nikolay Ivankin on 17.02.2012 13:15
                                • 13. Re: Create a standby controlfile using cold backup
                                  mseberg
                                  Thanks!

                                  Nice blog too.

                                  mseberg
                                  • 14. Re: Create a standby controlfile using cold backup
                                    Karan Kukreja
                                    Hi Nikolay,


                                    i came by to close this thread. Was unable to perform the activity since we are waiting for some 100Gb space.


                                    wanted to save the page that was provided in your link. But it seems it has been removed,overwritten.

                                    Can you please provide the link from your blog so that I can save it.


                                    Regards
                                    KK
                                    1 2 Previous Next