No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

OceanStor BCManager 6.5.0 eReplication User Guide 02

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Verifying the LUN Protected Group Consistency Script (Oracle)

Verifying the LUN Protected Group Consistency Script (Oracle)

A self-defined script is not provided by eReplication, so the script provider must ensure the script correctness. Before configuring the script, ensure that the script has been verified.

During the script verification, the database is frozen and unfrozen repeatedly, which affects services. Therefore, you are advised to create a non-service Oracle database for the verification.

Freeze Script (Windows)

The sample_freeze.bat script is used as an example. Pay attention to the following points:
  • sample_freeze.bat is used to enable hot standby for the Oracle database.
  • When running the script in Windows, create a batch processing file, copy the script content into the file, and then run the file. Otherwise, the batch processing window will exit.
  1. Log in to the production application server as an administrator.
  2. On the CLI, access the %AGENT_ROOT%\bin\thirdparty directory.
  3. Run the sample_freeze.bat <PID><AGENT_ROOT> command to run the freeze script.

    NOTE:
    • PID: unique ID of the script execution. You are advised to enter a large number.
    • AGENT_ROOT: the installation root directory of the Agent.

  4. Run the sqlplus / as sysdba command to connect to the database instance through OS authentication.

    C:\Agent \bin\thirdparty>set ORACLE_SID=dbFS
    C:\Agent \bin\thirdparty>sqlplus / as sysdba
    
    SQL*Plus: Release 12.1.0.1.0 Production on Fri Mar 18 10:53:03 2016
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
    

  5. Run the select * from v$backup command to check whether the script has been executed successfully.

    SQL> select * from v$backup;
    
         FILE# STATUS                CHANGE# TIME               CON_ID
    ---------- ------------------ ---------- -------------- ----------
             1 ACTIVE                4789490 18-3-16              0
             3 ACTIVE                4789490 18-3-16              0
             5 ACTIVE                4789490 18-3-16              0
             6 ACTIVE                4789490 18-3-16              0
    
    NOTE:

    If STATUS is ACTIVE, hot standby has been enabled for the Oracle database, and the script has been executed successfully.

  6. Run the alter database end backup command to change the database.

    SQL> alter database end backup;
    
    Database altered.
    

  7. Run the select * from v$backup command to disable hot standby.

    SQL> select * from v$backup;
    
         FILE# STATUS                CHANGE# TIME               CON_ID
    ---------- ------------------ ---------- -------------- ----------
             1 NOT ACTIVE            4795771 18-3-16              0
             3 NOT ACTIVE            4795771 18-3-16              0
             5 NOT ACTIVE            4795771 18-3-16              0
             6 NOT ACTIVE            4795771 18-3-16              0
    
    NOTE:

    If STATUS is NOT ACTIVE, hot standby has been disabled for the Oracle database.

Unfreeze Script (Windows)

The sample_unfreeze.bat script is used as an example. Pay attention to the following points:
  • sample_unfreeze.bat is used to disable hot standby for the Oracle database. Run this script only after sample_freeze.bat is executed successfully. Otherwise, executing sample_unfreeze.bat will fail.
  • When running the script in Windows, create a batch processing file, copy the script content into the file, and then run the file. Otherwise, the batch processing window will exit.
  1. Log in to the production application server as an administrator.
  2. On the CLI, access the %AGENT_ROOT%\bin\thirdparty directory.
  3. Run the sample_freeze.bat <PID><AGENT_ROOT> command to run the freeze script.

    NOTE:
    • PID: unique ID of the script execution. You are advised to enter a large number.
    • AGENT_ROOT: the installation root directory of the Agent.

  4. Run the sample_unfreeze.bat <PID><AGENT_ROOT> command to run the unfreeze script.

    NOTE:
    • PID: unique ID of the script execution. You are advised to enter a large number.
    • AGENT_ROOT: the installation root directory of the Agent.

  5. Run the sqlplus / as sysdba command to connect to the database instance through OS authentication.

    C:\Agent \bin\thirdparty>set ORACLE_SID=dbFS
    C:\Agent \bin\thirdparty>sqlplus / as sysdba
    
    SQL*Plus: Release 12.1.0.1.0 Production on Fri Mar 18 10:53:03 2016
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
    

  6. Run the select * from v$backup command to check whether the script has been executed successfully.

    SQL> select * from v$backup;
    
         FILE# STATUS                CHANGE# TIME               CON_ID
    ---------- ------------------ ---------- -------------- ----------
             1 NOT ACTIVE            4794422 18-3-16              0
             3 NOT ACTIVE            4794422 18-3-16              0
             5 NOT ACTIVE            4794422 18-3-16              0
             6 NOT ACTIVE            4794422 18-3-16              0
    
    NOTE:

    If STATUS is NOT ACTIVE, hot standby has been disabled for the Oracle database, and the script has been executed successfully. If STATUS is ACTIVE, run the alter database end backup command and then disable hot standby for the Oracle database.

Frozen/Unfrozen State Query Script (Windows)

The sample_queryfreezestate.bat script is used as an example. Pay attention to the following points:
  • sample_queryfreezestate.bat is used to query the hot standby status of the Oracle database. The sample_freeze.bat and sample_unfreeze.bat scripts can be used to check the script execution result.
  • When running the script in Windows, create a batch processing file, copy the script content into the file, and then run the file. Otherwise, the batch processing window will exit.
  1. Log in to the production application server as an administrator.
  2. On the CLI, access the %AGENT_ROOT%\bin\thirdparty directory.
  3. Run the frozen/unfrozen state query script.

    #Query the frozen state.
    sample_freeze.bat<PID><AGENT_ROOT>
    sample_queryfreezestate.bat<PID><AGENT_ROOT>
    sample_unfreeze.bat<PID><AGENT_ROOT>
    #Query the unfrozen state.
    sample_queryfreezestate.bat<PID><AGENT_ROOT>
    #An example of querying the hot standby status.
    sample_freeze.bat 10000 "C:\Agent"
    sample_queryfreezestate.bat 10000 "C:\Agent"
    sample_unfreeze.bat 10000 "C:\Agent"
    
    #An example of querying whether hot standby is disabled for the Oracle database.
    sample_queryfreezestate.bat 10000 "C:\Agent"
    
    NOTE:
    • PID: unique ID of the script execution. You are advised to enter a large number.
    • AGENT_ROOT: the installation root directory of the Agent.

  4. View the hot standby status of the Oracle database.

    C:\Agent \bin\thirdparty>type ..\..\tmp\RST10000.txt
    0
    C:\Agent \bin\thirdparty>
    
    NOTE:

    View the RST10000.txt file. If 0 is displayed, hot standby has been enabled for the Oracle database. If 1 is displayed, hot standby has been disabled for the Oracle database.

Freeze Script (Non-Windows)

The sample_freeze.sh script is used as an example. It is used to enable hot standby for the Oracle database.

  1. Log in to the production application server as user root.
  2. Run the cd /home/rdadmin/Agent/bin/thirtparty command to access the directory for storing the script.
  3. Run the sh sample_freeze.sh <PID><AGENT_ROOT> command to run the freeze script.

    NOTE:
    • PID: unique ID of the script execution. You are advised to enter a large number.
    • AGENT_ROOT: the installation root directory of the Agent. The directory is /home/rdadmin/Agent for a non-Solaris operating system.

  4. Run the su - oracle command to switch to user Oracle.
  5. Run the sqlplus / as sysdba command to connect to the database instance through OS authentication.

    oracle@linux2:~> export ORACLE_SID=dbFS
    oracle@linux2:~> sqlplus / as sysdba
    
    SQL*Plus: Release 12.1.0.1.0 Production on Fri Mar 18 14:20:18 2016
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
    

  6. Run the select * from v$backup command to check whether the script has been executed successfully.

    SQL> select * from v$backup;
    
         FILE# STATUS		 CHANGE# TIME	       CON_ID
    ---------- ------------------ ---------- --------- ----------
    	 1 ACTIVE		 3106121 18-MAR-16	    0
    	 3 ACTIVE		 3106121 18-MAR-16	    0
    	 4 ACTIVE		 3106121 18-MAR-16	    0
    	 6 ACTIVE		 3106121 18-MAR-16	    0
    
    NOTE:

    If STATUS is ACTIVE, hot standby has been enabled for the Oracle database, and the script has been executed successfully.

  7. Run the alter database end backup command to change the database.

    SQL> alter database end backup;
    
    Database altered.
    

  8. Run the select * from v$backup command to disable hot standby.

    SQL> select * from v$backup;
    
         FILE# STATUS		 CHANGE# TIME	       CON_ID
    ---------- ------------------ ---------- --------- ----------
    	 1 NOT ACTIVE		 3108004 18-MAR-16	    0
    	 3 NOT ACTIVE		 3108004 18-MAR-16	    0
    	 4 NOT ACTIVE		 3108004 18-MAR-16	    0
    	 6 NOT ACTIVE		 3108004 18-MAR-16	    0
    
    NOTE:

    If STATUS is NOT ACTIVE, hot standby has been disabled for the Oracle database.

Unfreeze Script (Non-Windows)

The sample_unfreeze.sh script is used as an example. It is used to disable hot standby for the Oracle database. Run this script only after sample_freeze.sh is executed successfully. Otherwise, executing sample_unfreeze.sh will fail.

  1. Log in to the production application server as user root.
  2. Run the cd /home/rdadmin/Agent/bin/thirtparty command to access the directory for storing the script.
  3. Run the sh sample_freeze.sh <PID><AGENT_ROOT> command to run the freeze script.

    NOTE:
    • PID: unique ID of the script execution. You are advised to enter a large number.
    • AGENT_ROOT: the installation root directory of the Agent. The directory is /home/rdadmin/Agent for a non-Solaris operating system.

  4. Run the sh sample_unfreeze.sh <PID><AGENT_ROOT> command to run the unfreeze script.

    NOTE:
    • PID: unique ID of the script execution. You are advised to enter a large number.
    • AGENT_ROOT: the installation root directory of the Agent. The directory is /home/rdadmin/Agent for a non-Solaris operating system.

  5. Run the su - oracle command to switch to user Oracle.
  6. Run the sqlplus / as sysdba command to connect to the database instance through OS authentication.

    oracle@linux2:~> export ORACLE_SID=dbFS
    oracle@linux2:~> sqlplus / as sysdba
    
    SQL*Plus: Release 12.1.0.1.0 Production on Fri Mar 18 14:20:18 2016
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
    

  7. Run the select * from v$backup command to check whether the script has been executed successfully.

    SQL> select * from v$backup;
    
         FILE# STATUS		 CHANGE# TIME	       CON_ID
    ---------- ------------------ ---------- --------- ----------
    	 1 NOT ACTIVE		 3106121 18-MAR-16	    0
    	 3 NOT ACTIVE		 3106121 18-MAR-16	    0
    	 4 NOT ACTIVE		 3106121 18-MAR-16	    0
    	 6 NOT ACTIVE		 3106121 18-MAR-16	    0
    
    NOTE:

    If STATUS is NOT ACTIVE, hot standby has been disabled for the Oracle database, and the script has been executed successfully. If STATUS is ACTIVE, run the alter database end backup command and then disable hot standby for the Oracle database.

Frozen/Unfrozen State Query Script (Non-Windows)

The sample_queryfreezestate.sh script is used as an example. It is used to query the hot standby status of the Oracle database. The sample_freeze.sh and sample_unfreeze.sh scripts can be used to check the script execution result.

  1. Log in to the production application server as user root.
  2. Run the cd /home/rdadmin/Agent/bin/thirtparty command to access the directory for storing the script.
  3. Run the frozen/unfrozen state query script.

    #Query the frozen state.
    sh sample_freeze.sh<PID><AGENT_ROOT>
    sh sample_queryfreezestate.sh<PID><AGENT_ROOT>
    sh sample_unfreeze.sh<PID><AGENT_ROOT> 
    
    #Query the unfrozen state.
    sh sample_queryfreezestate.sh<PID><AGENT_ROOT>
    #An example of querying the hot standby status.
    sh sample_freeze.sh 10000 /home/rdadmin/Agent
    sh sample_queryfreezestate.sh 10000 /home/rdadmin/Agent
    sh sample_unfreeze.sh 10000 /home/rdadmin/Agent
    
    #An example of querying whether hot standby is disabled for the Oracle database.
    sh sample_queryfreezestate.sh 10000 /home/rdadmin/Agent
    NOTE:
    • PID: unique ID of the script execution. You are advised to enter a large number.
    • AGENT_ROOT: the installation root directory of the Agent. The directory is /home/rdadmin/Agent for a non-Solaris operating system.

  4. View the hot standby status of the Oracle database.

    linux2:/home/rdadmin/Agent/bin/thirdparty # cat ../../tmp/RST10000.txt 
    0
    linux2:/home/rdadmin/Agent/bin/thirdparty #
    
    NOTE:

    View the RST10000.txt file. If 0 is displayed, hot standby has been enabled for the Oracle database. If 1 is displayed, hot standby has been disabled for the Oracle database.

Translation
Download
Updated: 2019-05-21

Document ID: EDOC1100075861

Views: 10831

Downloads: 55

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next