Oracle

Before configuring DR services, check the database and storage environments at the production end where Oracle databases reside. If any environment does not meet requirements, modify its configurations.

Public Check Items

The following configuration items must be checked and configured on databases at the production end.

  1. When an Oracle database runs Windows, ensure the password of the Oracle database contains only letters, digits, tildes (~), underscores (_), hyphens (-), pounds (#), dollar signs ($), and asterisks (*).
  2. When the host where an Oracle database resides runs Linux, AIX, or HP-UX, the mount points of the file system used by the database cannot be nested. For example, mount points /testdb/ and /testdb/database1/ are nested.
  3. When a database environment is configured at the production end where hosts running Red Hat Linux are deployed and the hosts are connected to storage arrays through Fibre Channel links, check whether the systool software is installed on the production host and DR host.

    Run the rpm -qa | grep sysfsutil command to check whether the systool software has been installed on the hosts.

    • If the command output contains sysfsutils, for example, sysfsutils-2.0.0-6, the software has been installed on the host.
    • If the command output does not contain sysfsutils, the software is not installed on the host. In this case, obtain the software package from the installation CD-ROM of Red Hat Linux to install the sysfsutils software.

    Red Hat Linux 6.3 for x86_64 and the systool software package sysfsutils-2.1.0-6.1.el6.x86_64.rpm are used as examples. The installation command is subject to the actual environment.

  4. Check and configure environment variables of the databases.

    The eReplication Agent starts to protect the data consistency of an Oracle database only after you have configured environment variables for the Oracle database. Configure environment variables prior to the installation of the eReplication Agent. Otherwise, restart the eReplication Agent after you configure environment variables to make them effective. For detailed operations, see System Maintenance > System Maintenance Commands > Starting the eReplication Agent in the OceanStor BCManager 8.2.0 eReplication User Guide.

    • To configure environment variables for an Oracle database in Windows, perform the following steps:
      1. Log in to the application server as a user with the administrator rights.
      2. Check whether environment variables have been configured.

        Right-click My Computer and choose Properties from the drop-down list. On the Advanced tab page, click Environment Variables. If environment variables have been configured, a dialog box similar to Figure 1 is displayed. Check whether the PATH variable is the bin directory of the Oracle database.

        Figure 1 Environment variables
    • To configure environment variables for an Oracle database running a non-Windows operating system, perform the following steps:
      1. The following uses the Oracle 12g R1 database as an example to describe how to configure environment variables in Linux. Log in to the application server as user root.
      2. Run the su -oracle command to switch to user oracle.
      3. Run the echo $ORACLE_BASE command to ensure that ORACLE_BASE has been configured.
        oracle@linux:~> echo $ORACLE_BASE 
        /u01/app/oracle
      4. Run the echo $ORACLE_HOME command to ensure that ORACLE_HOME has been configured.
        oracle@linux:~> echo $ORACLE_HOME 
        /u01/app/oracle/product/12.1.0/dbhome_1
      5. Run the echo $PATH command to ensure that ORACLE_HOME/bin has been added in the PATH variable.
        oracle@linux:~> echo $PATH 
        /u01/app/oracle/product/12.1.0/dbhome_1/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin 
      6. Run the exit command to log user oracle out.
      7. Run the su -grid command to switch to user grid.
      8. Run the echo $ORACLE_HOME command to ensure that ORACLE_HOME has been configured.
        grid@linux:~> echo $ORACLE_HOME 
        /u01/app/12.1.0/grid/

        In Oracle 11g R2 or later, environmental variable ORACLE_HOME must be configured f user grid.

      9. Run the echo $PATH command to ensure that ORACLE_HOME/bin has been added in the PATH variable.
        grid@linux:~> echo $PATH /u01/app/12.1.0/grid//bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin
      10. Run the exit command to log user grid out.
      11. Run the su - rdadmin command to switch to user rdadmin.
      12. Run the echo $SHELL command to view the default shell type of user rdadmin.

        The shell type can be bash, ksh, or csh. Table 1 describes configuration files that need to be modified based on shell types of operating systems.

        Before configuring environment variables, check the default shell type of user rdadmin on the eReplication Agent. If the shell type is bash, modify the .profile or .bash_profile file under the rdadmin home directory. If the shell type is csh, modify the .cshrc file under the rdadmin home directory. This document uses shell type bash as an example.

        Table 1 Configuration files that need to be modified for different shell types of operating systems

        Operating System

        Shell Type

        Configuration File

        Configuration Approach

        Linux

        sh/bash (default, recommended)

        • SUSE/Rocky: .profile
        • Red Hat: .bash_profile

        export name=value

        csh

        .cshrc

        setenv name value

        ksh

        .profile

        export name=value

        AIX/Solaris

        sh/ksh (default, recommended)

        .profile

        export name=value

        csh

        .cshrc

        setenv name value

        bash

        .profile

        export name=value

        HP-UX

        sh/POSIX Shell (default, recommended)

        .profile

        export name=value

        csh

        .cshrc

        setenv name value

        ksh

        .profile

        export name=value

        bash

        .profile

        export name=value

      13. Run the vi ~/. xxx_profile command to open the .profile file in the home directory of user rdadmin.For example, run the vi ~/.bash_profile command in the Red Hat operating system.

        Set xxx based on the site requirements.

      14. Press i to enter the editing mode and edit the .profile file.
      15. Add the following content to the .profile file. Table 2 describes the related parameters.
        ORA_CRS_HOME=/opt/oracle/product/10g/cluster 
        PATH=$PATH:/bin:/sbin:/usr/sbin  
        export ORA_CRS_HOME PATH 
        Table 2 System variables

        Name

        Value

        Description

        ORA_CRS_HOME

        /opt/oracle/product/10g/cluster

        Indicates the installation directory for the CRS software of an Oracle database. This environment variable needs to be configured only when the version of the RAC environment is earlier than Oracle 11g R2 and Clusterware has been installed.

        PATH

        PATH=$PATH:/bin:/sbin:/usr/sbin

        Indicates the command directory of the operating system on the host where the Oracle database resides.

      16. After you have modified the file, press Esc and enter :wq! to save the changes and close the file.

  1. If the host where the Oracle database resides runs Linux, check the disk mapping mode using udev.

    When udev is used to map disks, the restrictions on disk mapping modes are as follows:

    • Disks can only be mapped through disk partitioning.
    • When udev is used to map ASM disks, use udev disks to serve as the member disks of the ASM disk group.
    • The udev configuration rules at the production end must be in the 99-oracle-asmdevices.rules rule file (save path: /etc/udev/rules.d).

      Two mapping modes are available. The following uses SUSE Linux 10 (disks asm1 and asm2 involved) as an example to describe how to configure both mapping modes:

      • Renaming disks
        KERNEL=="sd*1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s /block/$parent", RESULT=="36200bc71001f375519f5d2c0000000f9", NAME="asm1", OWNER="oracle",  
        GROUP="dba", MODE="0660"
      • Creating disk links
        KERNEL=="sd*1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s /block/$parent", 
        RESULT=="36200bc71001f375519f5d2c0000000f9", SYMLINK+="asm1", OWNER="oracle", 
         GROUP="dba", MODE="0660"

    The value of the KERNEL parameter must contain wildcards (for example, KERNEL=="sd*1") and cannot be a fixed device partition name (for example: KERNEL="sda"). Otherwise, udev configuration rules cannot take effect.

  2. Check the authentication mode of the database.

    During the creation of the Oracle protected group, you can specify different authentication modes for different protected objects and RAC hosts. Currently, database authentication and operating system authentication are supported. Table 3 describes the configuration details.

    Table 3 Configuration requirements for database authentication modes

    Authentication Mode

    Requirements

    Database authentication

    In a cluster, authentication modes of all hosts must be the same.

    In a protected group, authentication modes of protected objects must be the same.

    During protected group creation, authentication mode specified on the eReplication must be the same as that used by the database.

    Operating system authentication

    In an Oracle RAC cluster deployed on ASM, the operating system authentication must be enabled so that the cluster at the DR end can be started normally upon DR.

    For single-instance Oracle databases deployed on ASM, the following requirements must be met:

    • For Unix-like operating systems, operating system authentication must be enabled if the password files of Oracle databases are configured to save in the ASM disk group. Alternatively, you can save the password files on the local file system. If neither method is adopted, the recovery plan corresponding to the Oracle protected group cannot be executed for testing, planning migration, and fault recovery.
    • For Windows, operating system authentication must be enabled.

Check Items at the Production End

  1. Check the running mode of databases at the production end.

    The eReplication Agent can ensure consistency between Oracle databases only when the databases are running in archive mode. Perform the following steps to check the running mode of a database.

    • To configure the running mode of an Oracle database in Windows, perform the following steps:
      1. Run the sqlplus command to log in to the Oracle database. In the example provided here, the user name is sys, the password is abc, and the instance name is db01.

        The following shows the command format and output:

        C:\Documents and Settings\Administrator>sqlplus /nolog 
         
        SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 3 26 18:09:00 2020 
         
        Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved. 
         
        SQL> conn sys/abc@db01 as sysdba 
        Connected.
      2. Run the archive log list command to check whether the database is in archive mode.

        The following shows the command format and output:

        SQL> archive log list; 
        Database log mode            No Archive Mode 
        Automatic archival           Enabled 
        Archive destination          G:\oracle10g\product\10.2.0\db_1\RDBMS 
        Oldest online log sequence   7 
        Current log sequence         9     
    • If Database log mode is Archive Mode, the database is in archive mode.
    • If Database log mode is No Archive Mode, follow instructions in related Oracle database documents to change the running mode to archive.
    • To configure the running mode of an Oracle database running a non-Windows operating system, perform the following steps:
      1. Run the sqlplus command to log in to the Oracle database. In the example provided here, the user name is sys, the password is oracle, and the instance name is verify.

        The following shows the command format and output:

        [oracle@rhcs218 ~]$ sqlplus /nolog 
         
        SQL*Plus: Release 11.2.0.3.0 - Production on Fri Jun 26 10:30:34 2020 
         
        Copyright (c) 1982, 2002, Oracle.  All rights reserved. 
         
        SQL> conn sys/oracle@verify as sysdba 
        Connected.
      2. Run the archive log list command to check whether the database is in archive mode.

        The following shows the command format and output:

        SQL> archive log list; 
        Database log mode             No Archive Mode 
        Automatic archival            Enabled 
        Archive destination           /oracle/archive 
        Oldest online log sequence    7793 
        Next log sequence to archive  7795   
        Current log sequence          7795 
    • If Database log mode is Archive Mode, the database is in archive mode.
    • If Database log mode is No Archive Mode, follow instructions in related Oracle database documents to change the running mode to archive.

  2. Check the database files at the production end.

    Check whether the data files, log files, and control files of a database are stored on LUNs. If those files are not stored on LUNs, DR cannot be performed for the database. You are advised to store temporary tablespaces on the LUN where data files, log files, or control files reside or store temporary them on a LUN different from the LUNs where other database files are stored.

Check Items at the Storage End

  1. Check whether information about initiators of production hosts (cluster) and test hosts (cluster) is displayed on the array.
  2. Check that the production LUN has been mapped to the production host (cluster). For a cluster consisting of hosts, ensure that the hosts included in the host group to which the primary and secondary LUNs are mapped are all the hosts only in the cluster.

Copyright © Huawei Technologies Co., Ltd.