8 Replies Latest reply: Jun 21, 2013 1:01 AM by Thunder2777 RSS

    Starting Physically Standby Database in Mount Mode

    Thunder2777

      Hi All

       

      I have configured Data Guard using Oracle 10g 10.2.0.4.0 (64 bits) on Windows 2008 Server (64 bits) Release 2 Enterprise.

      Data guard configuration was OK as the message from "Enable Configuration DG1" was "SUCCESS" for both

      Primary and Standby Database. I have also set both Databases and TNS to start Automatically whenever Windows Starts.

      The Problem is as long as the Standby Server is running, there is No issue.

      But when we Restarts the Backup Server, Physically Standby Database is Started and TNS is also Started,

      but Archives  are not received until I physically do the following steps so that it can received the Archives.

      1. SQL> startup nomount;                                                                                                                
      2. SQL> alter database mount standby database;                                                                 
      3. SQL> alter database recover managed standby database disconnect from session;

      Is there a way to start Physically Standby Database in Mount mode when windows started.

       

      Regards

      Thunder2777

        • 1. Re: Starting Physically Standby Database in Mount Mode
          Mihael

          You can create a windows task and schedule it at system startup. The task will use your script.

          • 2. Re: Starting Physically Standby Database in Mount Mode
            Thunder2777

            Thanks Mihael

             

            You mean that i will create a file with .bat extension for windows e.g.

            StartOracle.bat

             

            cmd                                             ----For Command Prompt

            set oracle_sid=umisbk                   ---For Settings Oracle SID

            sqlplus / as sysdba/oracle              ---For Login Database

            startup nomount;                            

            alter database mount standby database;            

             

            Then saving it as a Batch file. After that I include it to Windows Scheduled task for every time Windows Start.

            Will These commands work?

            Regards

            Thunder2777

            • 3. Re: Starting Physically Standby Database in Mount Mode
              Mihael

              1. Create file with sql commands, for example, start.sql :

              spool start.lst

              connect / as sysdba

              startup nomount

              alter database mount standby database;

              alter database recover managed standby database disconnect;

              spool off

              exit

               

              2. Create command file, for example, start.bat :

              set ORACLE_HOME=...

              set ORACLE_SID=...

              sqlplus /nolog @start.sql

               

              3. Create windows task

              • 4. Re: Starting Physically Standby Database in Mount Mode
                Thunder2777

                Thanks Mihael for such a Detail Reply.

                 

                Let me Try and then I will get back to you

                for further Instructions or saying you Thanks.

                 

                Regards

                Thunder2777

                • 5. Re: Starting Physically Standby Database in Mount Mode
                  Thunder2777

                  Hi Mihael

                  I have created 2 files. 1 Bat file 2nd sql file which contains all commands as written above.

                   

                  When I execute start.bat file

                   

                  1. set ORACLE_HOME=C:\oracle\product\10.2.0\db_1

                  2. set ORACLE_SID=UMISBK

                  3. sqlplus / nolog@start.sql

                   

                  1 & 2 executed properly. At 3 it just display SQL help for login as shown below.

                   

                  SQL*Plus: Release 10.2.0.4.0 - Production

                   

                  Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

                   

                  Usage 1: sqlplus -H | -V

                   

                      -H             Displays the SQL*Plus version and the usage help.

                      -V             Displays the SQL*Plus version.

                   

                  Usage 2: sqlplus [ [<option>] [<logon>] [<start>] ]

                   

                    <option> is: [-C <version>] [-L] [-M "<options>"] [-R <level>] [-S]

                  ...

                   

                  It Did Not execute start.sql file to excute sql commands.

                   

                  Regards

                  Thunder2777

                  • 6. Re: Starting Physically Standby Database in Mount Mode
                    Mahir M. Quluzade

                    Hi,

                     

                    You must start SQL file with  this .bat file :

                     

                    1) create a batch file on NT oraclestart.bat as follows

                     

                    set ORACLE_HOME=C:\oracle\product\10.2.0\db_1

                    set ORACLE_SID=UMISBK

                    sqlplus sys/password as sysdba  @C:\Start.sql

                     

                    2) create a Start.sql file as follows

                     

                    spool c:\Result.txt

                    startup mount

                    alter database recover managed standby database disconnect;

                    select name,db_unique_name, open_mode, database_role from v$database;

                    select process from v$managed_standby where process like 'MR%';

                    spool off;

                    exit;

                     

                    Regards

                    Mahir M. Quluzade

                    • 7. Re: Starting Physically Standby Database in Mount Mode
                      Mihael

                       

                      3. sqlplus / nolog@start.sql

                       

                      1 & 2 executed properly. At 3 it just display SQL help for login as shown below.

                       

                       

                      do not put space between "/" and "nolog" :

                      sqlplus /nolog @start.sql

                      • 8. Re: Starting Physically Standby Database in Mount Mode
                        Thunder2777

                        Thanks Mihael

                        Now Both (Mihael, Mahir M. Quluzade) Solutions are working

                        except in Mihael case,

                        I have to specify the path to SQL file e.g. @c:\start.sql.

                         

                        Regards

                        Thunder2777