Oracle Configuration (Configuring the pfile File)

When the Oracle RAC cluster is used at the production end and a single machine is used at the DR end, after the DR database is created, you need to configure the pfile file.

Creating a Database by Copying Parameter Files

  1. Create the database on the DR end.

    If the DR end is in the single-instance environment where databases are installed on file systems, copy required database files and folders from the production end to the DR end, and modify the users or roles of the copy required database files. Files and folders need to be copied include all folders under the $ORACLE_BASE\admin\dbname directory, the $ORACLE_HOME\network\admin\ listener.ora file, the $ORACLE_HOME\network\admin\ tnsnames.ora file, and password and parameter files under the $ORACLE_HOME\dbs directory.

  2. Create the pfile file from spfile file in production end database.

    1. Run sqlplus / as sysdba command to connect the database instance in production end from OS authentication.
      oracle@suse140:/u01/app/oracle/product/11.2.0/db_1/dbs> export ORACLE_SID=lqraw1 
      oracle@suse140:/u01/app/oracle/product/11.2.0/db_1/dbs> sqlplus / as sysdba 
       
      SQL*Plus: Release 11.2.0.3.0 Production on Fri Jun 26 09:57:08 2020 
       
      Copyright (c) 1982, 2011, Oracle.  All rights reserved. 
       
       
      Connected to: 
      Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production 
      With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, 
      Data Mining and Real Application Testing options     
    2. Run show parameter spfile command to view the spfile file.
      SQL> show parameter spfile; 
       
      NAME                  TYPE  VALUE 
      ------------------------------------ ----------- ------------------------------ 
      spfile                   string   +LQRAWDATA/lqraw/spfilelqraw.o 
                               ra 
           
    3. Run create pfile='/home/oracle/initlqraw1.ora' from spfile command to create the pfile file from the spfile file.
       
      SQL> create pfile='/home/oracle/initlqraw1.ora' from spfile;  
       
      File created.

  3. Modify local pfile files and copy modified files to the root directory of the Oracle host on the DR end.

    Figure 1 pfile file before modification

    Figure 2 pfile files after modification

    Red contents need to be modified. For details about how to modify pfile files, consult the database administrator. Incorrect modification may impose adverse impact on the DR database.

  4. Map the LUNs of the DR storage array to the DR host and complete the storage configuration of the database. Or use the eReplication to complete the test and the storage configuration.
  5. Start the database in DR end.
  6. Create pfile file from spfile file in DR end database.

    1. Run sqlplus / as sysdba command to connect the database instance in DR end from OS authentication.
      oracle@suse140:/u01/app/oracle/product/11.2.0/db_1/dbs> export ORACLE_SID=lqraw 
      oracle@suse140:/u01/app/oracle/product/11.2.0/db_1/dbs> sqlplus / as sysdba 
       
      SQL*Plus: Release 11.2.0.3.0 Production on Fri Jun 26 09:57:08 2020 
       
      Copyright (c) 1982, 2011, Oracle.  All rights reserved. 
       
       
      Connected to: 
      Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production 
      With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, 
      Data Mining and Real Application Testing options 
           
    2. Run startup pfile='/home/oracle/ initlqraw1.ora' command to start database from local pfile file.
      SQL> startup pfile='/home/oracle/ initlqraw1.ora';  
      ORACLE instance started. 
       
      Total System Global Area 5144301568 bytes 
      Fixed Size                  2230424 bytes 
      Variable Size            1157629800 bytes 
      Database Buffers         3976200192 bytes 
      Redo Buffers                8241152 bytes 
      Database mounted. 
      Database opened.     
    3. Run create spfile from pfile='/home/oracle/initlqraw1.ora' command to create the local spfile file.
      SQL> create spfile from pfile='/home/oracle/initlqraw1.ora'; 
       
      File created. 
           
    4. Run shutdown immediate command to close the database.
      SQL> shutdown immediate 
      Database closed. 
      Database dismounted. 
      ORACLE instance shut down.
    5. Run startup command to start the database.
      SQL> startup 
      ORACLE instance started. 
       
      Total System Global Area 5144301568 bytes 
      Fixed Size                  2230424 bytes 
      Variable Size            1157629800 bytes 
      Database Buffers         3976200192 bytes 
      Redo Buffers                8241152 bytes 
      Database mounted. 
      Database opened.
    6. Run show parameter spfile command to check whether the spfile file exist in local path.
      SQL> show parameter spfile;                   
       
      NAME                                 TYPE        VALUE 
      ------------------------------------ ----------- ------------------------------ 
      spfile                               string      /u01/app/oracle/11.2.0/product 
                                                       /db/dbs/spfilelqraw.ora     

      For Oracle 12c databases, run the srvctl modify database -db database name -spfile local path to file spfile command to save file spfile to the local path, after the previous operations are complete.

Creating a Database in the Oracle Mode

  1. Create the database on the DR end.

    On non-Windows operating systems, create the database under dbca. On Windows operating system, create the database under Database Configuration Assistant.

    After the database is created, the spfile file is saved locally or on a LUN.

  2. Confirm where the spfile file is saved.

    On non-Windows operating systems, check whether spfile${ORACLE_SID}.ora and init${ORACLE_SID}.ora exist under $ORACLE_HOME/dbs. On Windows operating systems, check whether spfile${ORACLE_SID}.ora and init${ORACLE_SID}.ora exist under %ORACLE_HOME%/database.

    • When only spfile${ORACLE_SID}.ora exists: The database stores spfile files and these files are saved locally.
    • When only init${ORACLE_SID}.ora exists:
      • If init${ORACLE_SID}.ora contains SPFILE='+ASMDISKGROUP/xxx/spfile${ORACLE_SID}.ora', the database stores spfile files and these files are saved on LUNs.
      • If init${ORACLE_SID}.ora does not contain SPFILE='+ASMDISKGROUP/xxx/spfile${ORACLE_SID}.ora', the database stores spfile files and these files are saved locally.
    • When both spfile${ORACLE_SID}.ora and init${ORACLE_SID}.ora exist: The database stores spfile files and these files are saved locally.
    • When spfile${ORACLE_SID}.ora and init${ORACLE_SID}.ora do not exist: The database does not exist.

  3. Optional: If the spfile file is stored on a LUN, save the spfile file in the DR database locally.

    1. Start the database instance.
    2. Run cat initautoasm.ora command to view the spfile file information.
      bash-4.2$ cat initautoasm.ora  
      SPFILE='+PG_AUTOASM$_DATA/autoasm/spfileautoasm.ora'  
      bash-4.2$ export ORACLE_SID=autoasm     
    3. Run sqlplus / as sysdba command to database instance in DR end from OS authentication.
      bash-4.2$ sqlplus / as sysdba                          
       
      SQL*Plus: Release 11.2.0.3.0 Production on Thu Jun 16 09:32:39 2020 
       
      Copyright (c) 1982, 2011, Oracle.  All rights reserved. 
       
       
      Connected to: 
      Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production 
      With the Partitioning, Automatic Storage Management, OLAP, Data Mining 
      and Real Application Testing options 
           
    4. Run create pfile='/home/oracle/initautoasm.ora' from spfile command to create the pfile file from spfile file.
      SQL> create pfile='/home/oracle/initautoasm.ora' from spfile; 
       
      File created.     
    5. Run shutdown immediate command to close the database.
      SQL> shutdown immediate; 
      Database closed. 
      Database dismounted. 
      ORACLE instance shut down.     
    6. Run startup pfile='/home/oracle/initautoasm.ora' command to start database from local pfile.
      SQL> startup pfile='/home/oracle/initautoasm.ora';  
      ORACLE instance started. 
       
      Total System Global Area 5144301568 bytes 
      Fixed Size                  2230424 bytes 
      Variable Size            1157629800 bytes 
      Database Buffers         3976200192 bytes 
      Redo Buffers                8241152 bytes 
      Database mounted. 
      Database opened.     
    7. Run create spfile from pfile='/home/oracle/initautoasm.ora' command to create local spfile file.
      SQL> create spfile from pfile='/home/oracle/initautoasm.ora'; 
       
      File created.     
    8. Run shutdown immediate command to close the database.
    9. Run startup command to start the database.
      SQL> startupORACLE instance started. 
       
      Total System Global Area 5144301568 bytes 
      Fixed Size                  2230424 bytes 
      Variable Size            1157629800 bytes 
      Database Buffers         3976200192 bytes 
      Redo Buffers                8241152 bytes 
      Database mounted. 
      Database opened.     
    10. Run show parameter spfile command to check whether spfile exist in the local path.
      SQL> show parameter spfile;                  
       
      NAME                                 TYPE        VALUE 
      ------------------------------------ ----------- ------------------------------ 
      spfile                               string      /u01/app/oracle/11.2.0/product 
                                                       /db/dbs/spfileautoasm.ora     

      For Oracle 12c databases, run the srvctl modify database -db database name -spfile local path to file spfile command to save file spfile to the local path, after the previous operations are complete.


Copyright © Huawei Technologies Co., Ltd.