Create Standby Database (CSD)
 Introduction
Dbvisit Standby can assist in creating the standby database. Â Dbvisit Standby supports the creation of standby databases even if ASM or OMF are used. Â If you are still using RAW devices, Dbvisit Standby version 8 can also support this.
Dbvisit Standby version 8 also supports the creation of an Oracle RAC enabled standby database. Â There are a number of prerequisites before this can be performed. For example, the standby environment must already have the Clusterware (GI) installed and ASM storage configured, as well as have the Oracle Database software installed, this option will be discussed in more detail in this section.
Before getting into the more advanced configurations it is important to first make sure you understand the basics and then move onto the more advanced configurations. Â
Dbvisit Standby version 8 will guide you through the creation of the standby process, and by answering a few short questions you will be ready to start the process.
Creating a standby database can be done in three ways:
- Creating the standby database manually  (this option will not be discussed in this guide - for more detail please see the Oracle Documentation)
- Creating the standby database using the Dbvisit Standby Core - Command Line Interface
- Creating the standby database using the Central Console - GUI
Please note that this guide will refer to the Create Standby Database process as the CSD process.
If using ASM based databases, we do not recommend the use of ASM aliases but to rather use Oracle Managed File naming.
If you do create a standby database where ASM is used and the primary database is making use of ASM aliases, the standby database will only end up with OMF datafiles and ASM aliases will not be created. Â
ASM Aliases can be created post CSD either using a post-processing script or by manually creating them.
For more detail see:Â Pre/Post Processing#Pre/PostProcessing-ASMAliases
As a prerequisite, you have to make sure that the Primary database uses SPFILE and not PFILE before running the Create Standby Database process.
If you are using ODA machines, It is required that you create the dbstorages before creating the standby databases using Dbvisit. Please refer the blog for further details.
http://blog.dbvisit.com/configuring-dbvisit-standby-on-an-oda/
On this page:
2. Â Creating The Standby Database - Command Line
Creating the Standby Database is an easy process if you are familiar with your Database environment and have followed all the pre-requisites when installing the Dbvisit Standby software.
Please ensure you have adequate available space on the standby server to copy the RMAN backup and restore backup copy that this process does.
This section will focus on using the command line interface using the dbvctl command: Â ./dbvctl --csd
To quickly obtain the usage (syntax) of the CSD command run: "./dbvctl -h --csd"
[oracle@dbv101 /usr/dbvisit/standby]$ ./dbvctl -h --csd Create a new standby database dbvctl -d ddc --csd [--mode CLI|BATCH|GUI] [--restart] [--noprompt] [-j json_file] [--dump_template] --mode CLI default --restart Restart previous run in BATCH mode if incompleted --json Json file in GUI mode --noprompt No confirmation prompts --dump_template Json file to write an existing template to
When running the CSD process from the command line, you are not required to use the options listed in brackets [] example:Â
[--mode CLI|BATCH|GUI] [--restart] [--noprompt] [-j json_file] [--dump_template]
These are optional parameters.
2.1. Â Creating Single Instance Standby (non-RAC)
In the following example we will create a standby database based on the following information:
- Primary Server Details:
- Server Name: dbv101
- DB_NAME: DEV
- DB_UNIQUE_NAME: DEV
- The database is in archivelog mode
- Database archive log destination is set to the default recovery area (FRA) - /u01/app/oracle/fast_recovery_area
- There is a local backup folder /u01/backup which has sufficient space to hold a full compressed backup of the primary DEV database (RMAN Backup)
- The database data files are located in /u01/app/oracle/oradata/DEV
- NON-OMF is usedÂ
- One controlfiles are located in /u01/app/oracle/oradata/DEV and the second one in the FRA - /u01/app/oracle/fast_recovery_area/DEV
- Standby Server Details:
- Server Name: dbv102
- The DB_NAME and DB_UNIQUE_NAME will be the same as the primary
- The same folder structure as the primary will be usedÂ
- The Oracle Database software is already installed on the standby server and match the same version and edition of the primary
- The standby server also have a /u01/backup folder with sufficient space for a full RMAN database backup
In this example, the ideal configuration is used. This means that the primary and standby database servers are an exact match with regards to storage and the directory structure.
In this case, it will not be required to set any additional parameters such as the db_file_name_convert or log_file_name_convert parameters.
We can now start the process by running the following command from the primary server: Â ./dbvctl -d DEV --csd
During the CSD process, you will be asked to specify the Oracle Home user and password - on Unix based systems just accept an empty (null) value and continue.
Example:
Oracle Home User login might be required to create the Oracle Windows service Leave empty if Oracle Home User is Windows built-in account =>Specify Oracle Home User: []: Is this correct? <Yes/No> [Yes]: Yes =>Specify Oracle Home User password: []: Is this correct? <Yes/No> [Yes]: Yes
The example output below shows the detail steps followed:
[oracle@dbv101 /usr/dbvisit/standby]$ ./dbvctl -d DEV --csd >>> Running pre-checks please wait... done What would you like to do: 1 - Create standby database (and optionally save settings in template) 2 - Help 3 - Terminate processing Please enter your choice [1]: 1 ------------------------------------------------------------------------------- Answer Yes to transfer the datafiles directly to the standby server (not recommended for large database or slow networks) Note tablespaces will be placed in backup mode for direct copy. Answer No (recommended) to create an RMAN backup of primary datafiles in a temporary location and transfer the backup to the standby server =>Do you want to copy database files directly to the standby server? [N]: N Your input: N Is this correct? <Yes/No> [Yes]: Yes ------------------------------------------------------------------------------- =>Do you want to use TRANSPORTABLE MEDIA to transfer the database backup to the standby server? Transportable media is an external device such as a USB drive that is first plugged into the primary server and then manually transferred to the standby site and plugged into the standby server to continue the process. It can be used for large databases or slow networks. Specifying No means the network will be used to transfer the database backup. [N]: N Your input: N Is this correct? <Yes/No> [Yes]: Yes ------------------------------------------------------------------------------- A temporary location must be specified on dbv101 where the database will be backed up to first. This location must be big enough to hold RMAN backup of the whole database (1.42GB). =>Specify the location on this server: [/usr/tmp]: /u01/backup Your input: /u01/backup Is this correct? <Yes/No> [Yes]: Yes ------------------------------------------------------------------------------- A temporary location must be specified on dbv102 where the database backup will be copied to before moving to specified locations. =>Specify location on remote server: [/u01/backup]: /u01/backup Your input: /u01/backup Is this correct? <Yes/No> [Yes]: Yes ------------------------------------------------------------------------------- Oracle Home User login might be required to create the Oracle Windows service Leave empty if Oracle Home User is Windows built-in account =>Specify Oracle Home User: []: Is this correct? <Yes/No> [Yes]: Yes =>Specify Oracle Home User password: []: Is this correct? <Yes/No> [Yes]: Yes The following oracle database parameters will be set in the standby database pfile or spfile: ------------------------------------------------------------------------------- SID NAME VALUE * audit_file_dest /u01/app/oracle/admin/DEV/adump * compatible 11.2.0.4.0 * control_files /u01/app/oracle/oradata/DEV/control01.ctl,/u01/app/oracle/fast_recovery_area/DEV/control02.ctl * db_block_size 8192 * db_domain * db_name DEV * db_recovery_file_dest /u01/app/oracle/fast_recovery_area * db_recovery_file_dest_size 4385144832 * db_unique_name DEV * diagnostic_dest /u01/app/oracle * dispatchers (PROTOCOL=TCP) (SERVICE=DEVXDB) * java_jit_enabled false * open_cursors 300 * pga_aggregate_target 222298112 * processes 150 * remote_login_passwordfile EXCLUSIVE * sga_target 667942912 * spfile OS default * undo_tablespace UNDOTBS1 ------------------------------------------------------------------------------- What would you like to do: 1 - Proceed with creating the standby database 2 - Edit oracle database parameters for the standby database pfile/spfile 3 - Terminate processing Please enter your choice [1]: 1 Validating oracle database parameters... please wait =>SUCCEEDED ------------------------------------------------------------------------------- =>Create standby database template for DEV using provided answers? [Y]: Y Your input: 1 Is this correct? <Yes/No> [Yes]: Yes ------------------------------------------------------------------------------- =>Continue with creating a standby database? (If No processing will terminate, the saved template will be available for future use) [Y]: Y Your input: 1 Is this correct? <Yes/No> [Yes]: Yes >>> dbvctl will now run a pre-flight check for standby database creation. An attempt will be made to create a standby (s)pfile using oracle standby database parameters, followed by trying to start the standby instance. If this step fails, then please double-check the following items before re-running dbvctl again: 1) Review the standby database parameters you have supplied and provide valid values unless a template is used. 2) Recreate the template to provide valid values for standby database parameters if a template is used. >>> Running pre-flight check for standby creation, please wait... done >>> Total database size for DEV is 1.42GB >>> Backing up primary database... Backing up datafile 1... done Backing up datafile 2... done Backing up datafile 3... done Backing up datafile 4... done >>> Creating standby control file... done >>> Transferring backup from dbv101 to dbv102... Transferring /u01/backup/dbv_DEV_csd_dbf_1_01rf6t8f_1_1.rman... done Transferring /u01/backup/dbv_DEV_csd_dbf_1_02rf6t98_1_1.rman... done Transferring /u01/backup/dbv_DEV_csd_dbf_2_03rf6t9n_1_1.rman... done Transferring /u01/backup/dbv_DEV_csd_dbf_3_04rf6ta7_1_1.rman... done Transferring /u01/backup/dbv_DEV_csd_dbf_4_05rf6taf_1_1.rman... done >>> Restoring standby control files... done >>> Starting standby database DEV on dbv102 mount... done >>> Restoring datafiles on dbv102... Restoring datafile 1... done Restoring datafile 2... done Restoring datafile 3... done Restoring datafile 4... done >>> Renaming standby redo logs and tempfiles on dbv102... done >>> Performing checkpoint and archiving logs... done >>> Finishing standby database creation... done >>> Standby database created. To complete creating standby database please run dbvctl on the primary server first, then on the standby server, to ensure the standby database is in sync with the primary database. PID:252 TRACE:/usr/dbvisit/standby/trace/252_dbvctl_csd_DEV_201609071012.trc [oracle@dbv101 /usr/dbvisit/standby]$
Once the above process is complete, you should be able to send and apply logs which are shown below.
Note that sending or applying logs will fail if you have not applied a valid license, example:
[oracle@dbv101 /usr/dbvisit/standby]$ ./dbvctl -d DEV ============================================================= Dbvisit Standby Database Technology (8.0.01.17364) (pid 509) dbvctl started on dbv101: Wed Sep 7 10:23:07 2016 ============================================================= Dbvisit Standby terminated... Error Code: 7003 No license key found for Dbvisit Standby version: . Please contact Dbvisit Standby (www.dbvisit.com) to obtain a current license. Run the Dbvisit Standby license command (dbvctl -l) to update the license. Tracefile from server: dbv101 /usr/dbvisit/standby/trace/509_dbvctl_DEV_201609071023.trc [oracle@dbv101 /usr/dbvisit/standby]$
If you get the above error message you need to first apply your license key before you can continue.
2.1.1. Â Sending LogsÂ
Sending archive logs to the standby database can be done by running the following command: Â ./dbvctl -d <DDC>
Example:
[oracle@dbv101 /usr/dbvisit/standby]$ ./dbvctl -d DEV ============================================================= Dbvisit Standby Database Technology (8.0.01.17364) (pid 522) dbvctl started on dbv101: Wed Sep 7 10:25:17 2016 ============================================================= >>> Obtaining information from standby database (RUN_INSPECT=Y)... done >>> Note FORCE_LOGGING is disabled in the primary database. >>> Sending heartbeat message... skipped Performing a log switch... >>> Transferring Log file(s) from DEV on dbv101 to dbv102 for thread 1: o1_mf_1_10_cwztg2dv_.arc.gz ============================================================= dbvctl ended on dbv101: Wed Sep 7 10:26:18 2016 ============================================================= [oracle@dbv101 /usr/dbvisit/standby]$
2.1.2. Â Applying Logs
Applying archive logs on the standby database run the following command: Â ./dbvctl -d <DDC>
Example:
[oracle@dbv102 /usr/dbvisit/standby]$ ./dbvctl -d DEV ============================================================= Dbvisit Standby Database Technology (8.0.01.17364) (pid 902) dbvctl started on dbv102: Wed Sep 7 10:26:21 2016 ============================================================= >>> Sending heartbeat message... skipped >>> Applying Log file(s) from dbv101 to DEV on dbv102: 1_10_920690658.arc ============================================================= dbvctl ended on dbv102: Wed Sep 7 10:26:58 2016 ============================================================= [oracle@dbv102 /usr/dbvisit/standby]$
2.1.3. Â Running the log gap report
To ensure the primary and standby databases are up to date, you can run the Log Gap Report using the following command from the primary database server:./dbvctl -d <DDC> -iÂ
Example:
[oracle@dbv101 /usr/dbvisit/standby]$ ./dbvctl -d DEV -i ============================================================= Dbvisit Standby Database Technology (8.0.01.17364) (pid 555) dbvctl started on dbv101: Wed Sep 7 10:30:17 2016 ============================================================= Dbvisit Standby log gap report for DEV thread 1 at 201609071030: ------------------------------------------------------------- Destination database on dbv102 is at sequence: 10. Source database on dbv101 is at log sequence: 11. Source database on dbv101 is at archived log sequence: 10. Dbvisit Standby last transfer log sequence: 10. Dbvisit Standby last transfer at: 2016-09-07 10:26:11. Archive log gap for DEV: 0. Transfer log gap for DEV: 0. Standby database time lag (DAYS-HH:MI:SS): +0:00:33. ============================================================= dbvctl ended on dbv101: Wed Sep 7 10:30:22 2016 ============================================================= [oracle@dbv101 /usr/dbvisit/standby]$
2.2. Â Creating a filesystem based Standby Database for ASM storage based primary
In this example, we will show you how to create the standby database when the primary database is a single instance database using ASM based storage and the standby database server will be using Filesystem based storage.
Please note that we do recommend a Primary and Standby storage match, meaning if a primary is using ASM, ideally the standby database server should as well and should have the same disk group layout. This is to ensure the primary and standby database servers match as much as possible.
- On the primary Oracle Managed Files (OMF) is used and the diskgroup in use is +DATA.Â
- On the standby database server, the database files will make use of /u01/app/oracle/oradata and /u01/app/oracle/fast_recovery_area as the datafile location and recovery area.
You will notice in this example we have to modify the "db_create_file_dest" and the "db_recovery_file_dest" to point the filesystem locations.
2.2.1. Â ExampleÂ
oracle@dbvlin103[/usr/dbvisit8/standby]: ./dbvctl -d CDB1DR --csd --noprompt >>> Running pre-checks please wait... done What would you like to do: 1 - Create standby database (and optionally save settings in template) 2 - Help 3 - Terminate processing Please enter your choice [1]: 1 ------------------------------------------------------------------------------- =>Do you want to use TRANSPORTABLE MEDIA to transfer the database backup to the standby server? Transportable media is an external device such as a USB drive that is first plugged into the primary server and then manually transferred to the standby site and plugged into the standby server to continue the process. It can be used for large databases or slow networks. Specifying No means the network will be used to transfer the database backup. [N]: ------------------------------------------------------------------------------- A temporary location must be specified on dbvlin103 where the database will be backed up to first. This location must be big enough to hold RMAN backup of the whole database (4.26GB). =>Specify the location on this server: [/usr/tmp]: ------------------------------------------------------------------------------- A temporary location must be specified on dbvlin104 where the database backup will be copied to before moving to specified locations. =>Specify location on remote server: [/usr/tmp]: You choose to create a non ASM standby database. Please change all Oracle database parameters values pointing to ASM locations to point to valid filesystem locations on the standby server. The following oracle database parameters will be set in the standby database pfile or spfile: ------------------------------------------------------------------------------- SID NAME VALUE * audit_file_dest /u01/app/oracle/admin/CDB1/adump * compatible 12.1.0.2.0 * db_block_size 8192 * db_create_file_dest +DATA * db_domain * db_file_name_convert * db_name CDB1 * db_recovery_file_dest +DATA * db_recovery_file_dest_size 21474836480 * db_unique_name CDB1DR * diagnostic_dest /u01/app/oracle * dispatchers (PROTOCOL=TCP) (SERVICE=CDB1XDB) * enable_pluggable_database true * log_archive_format %t_%s_%r.dbf * log_file_name_convert * nls_territory NEW ZEALAND * open_cursors 300 * pga_aggregate_target 157286400 * processes 300 * remote_login_passwordfile EXCLUSIVE * sga_max_size 734003200 * sga_target 734003200 * spfile OS default * undo_tablespace UNDOTBS1 ------------------------------------------------------------------------------- What would you like to do: 1 - Proceed with creating the standby database 2 - Edit oracle database parameters for the standby database pfile/spfile 3 - Terminate processing Please enter your choice [1]: 2 WARNING: Do NOT use single or double quotes to enclose parameter values! Separate multiple values with a comma. If a comma is part of a value, escape it with a backslash. If a comma is part of a value, escape it with a backslash. =>Enter full parameter name: []: db_create_file_dest 1 - Remove from the standby parameter file (parameter will be set to defaultvalue) 2 - New value in the standby parameter file =>Please enter your choice: []: 2 =>Enter new value (leave blank to set to null) []: /u01/app/oracle/oradata Validating ... please wait The following oracle database parameters will be set in the standby database pfile or spfile: ------------------------------------------------------------------------------- SID NAME VALUE * audit_file_dest /u01/app/oracle/admin/CDB1/adump * compatible 12.1.0.2.0 * db_block_size 8192 * db_create_file_dest /u01/app/oracle/oradata * db_domain * db_file_name_convert * db_name CDB1 * db_recovery_file_dest +DATA * db_recovery_file_dest_size 21474836480 * db_unique_name CDB1DR * diagnostic_dest /u01/app/oracle * dispatchers (PROTOCOL=TCP) (SERVICE=CDB1XDB) * enable_pluggable_database true * log_archive_format %t_%s_%r.dbf * log_file_name_convert * nls_territory NEW ZEALAND * open_cursors 300 * pga_aggregate_target 157286400 * processes 300 * remote_login_passwordfile EXCLUSIVE * sga_max_size 734003200 * sga_target 734003200 * spfile OS default * undo_tablespace UNDOTBS1 ------------------------------------------------------------------------------- What would you like to do: 1 - Proceed with creating the standby database 2 - Edit oracle database parameters for the standby database pfile/spfile 3 - Terminate processing Please enter your choice [1]: 2 WARNING: Do NOT use single or double quotes to enclose parameter values! Separate multiple values with a comma. If a comma is part of a value, escape it with a backslash. If a comma is part of a value, escape it with a backslash. =>Enter full parameter name: []: db_recovery_file_dest 1 - Remove from the standby parameter file (parameter will be set to default value) 2 - New value in the standby parameter file =>Please enter your choice: []: 2 =>Enter new value (leave blank to set to null) []: /u01/app/oracle/fast_recovery_area Validating ... please wait The following oracle database parameters will be set in the standby database pfile or spfile: ------------------------------------------------------------------------------- SID NAME VALUE * audit_file_dest /u01/app/oracle/admin/CDB1/adump * compatible 12.1.0.2.0 * db_block_size 8192 * db_create_file_dest /u01/app/oracle/oradata * db_domain * db_file_name_convert * db_name CDB1 * db_recovery_file_dest /u01/app/oracle/fast_recovery_area * db_recovery_file_dest_size 21474836480 * db_unique_name CDB1DR * diagnostic_dest /u01/app/oracle * dispatchers (PROTOCOL=TCP) (SERVICE=CDB1XDB) * enable_pluggable_database true * log_archive_format %t_%s_%r.dbf * log_file_name_convert * nls_territory NEW ZEALAND * open_cursors 300 * pga_aggregate_target 157286400 * processes 300 * remote_login_passwordfile EXCLUSIVE * sga_max_size 734003200 * sga_target 734003200 * spfile OS default * undo_tablespace UNDOTBS1 ------------------------------------------------------------------------------- What would you like to do: 1 - Proceed with creating the standby database 2 - Edit oracle database parameters for the standby database pfile/spfile 3 - Terminate processing Please enter your choice [1]: 1 Validating oracle database parameters... please wait =>SUCCEEDED ------------------------------------------------------------------------------- =>Create standby database template for CDB1DR using provided answers? [Y]: Y ------------------------------------------------------------------------------- =>Continue with creating a standby database? (If No processing will terminate, the saved template will be available for future use) [Y]: >>> dbvctl will now run a pre-flight check for standby database creation. An attempt will be made to create a standby (s)pfile using oracle standby database parameters, followed by trying to start the standby instance. If this step fails, then please double-check the following items before re-running dbvctl again: 1) Review the standby database parameters you have supplied and provide valid values unless a template is used. 2) Recreate the template to provide valid values for standby database parameters if a template is used. >>> Running pre-flight check for standby creation, please wait... done >>> Total database size for CDB1 is 4.26GB >>> Backing up primary database... Backing up datafile 1... done Backing up datafile 3... done Backing up datafile 4... done Backing up datafile 5... done Backing up datafile 6... done Backing up datafile 7... done Backing up datafile 8... done Backing up datafile 9... done Backing up datafile 10... done >>> Creating standby control file... done >>> Transferring backup from dbvlin103 to dbvlin104... Transferring /usr/tmp/dbv_CDB1DR_csd_dbf_10_3vrkjmnq_1_1.rman... done Transferring /usr/tmp/dbv_CDB1DR_csd_dbf_1_3frkjmai_1_1.rman... done Transferring /usr/tmp/dbv_CDB1DR_csd_dbf_3_3hrkjmcp_1_1.rman... done Transferring /usr/tmp/dbv_CDB1DR_csd_dbf_4_3jrkjmel_1_1.rman... done Transferring /usr/tmp/dbv_CDB1DR_csd_dbf_5_3lrkjmfm_1_1.rman... done Transferring /usr/tmp/dbv_CDB1DR_csd_dbf_6_3nrkjmgu_1_1.rman... done Transferring /usr/tmp/dbv_CDB1DR_csd_dbf_7_3prkjmiq_1_1.rman... done Transferring /usr/tmp/dbv_CDB1DR_csd_dbf_8_3rrkjmkm_1_1.rman... done Transferring /usr/tmp/dbv_CDB1DR_csd_dbf_9_3trkjmlu_1_1.rman... done >>> Restoring standby control files... done >>> Starting standby database CDB1DR on dbvlin104 mount... done >>> Restoring datafiles on dbvlin104... Restoring datafile 1... done Restoring datafile 3... done Restoring datafile 4... done Restoring datafile 5... done Restoring datafile 6... done Restoring datafile 7... done Restoring datafile 8... done Restoring datafile 9... done Restoring datafile 10... done >>> Renaming standby redo logs and tempfiles on dbvlin104... done >>> Performing checkpoint and archiving logs... done >>> Finishing standby database creation... done >>> Standby database created. To complete creating standby database please run dbvctl on the primary server first, then on the standby server, to ensure the standby database is in sync with the primary database. PID:1124 TRACE:1124_dbvctl_csd_CDB1DR_201611102252.trc oracle@dbvlin103[/usr/dbvisit8/standby]:
We recommend that following a successful standby database creation you first run Dbvisit Standby manually once to ship and apply logs before you schedule it or run the Daemon process.
2.2.2. Â Sending Logs
oracle@dbvlin103[/usr/dbvisit8/standby]: ./dbvctl -d CDB1DR ============================================================= Dbvisit Standby Database Technology (8.0.02.18139) (pid 6550) dbvctl started on dbvlin103: Thu Nov 10 23:19:56 2016 ============================================================= >>> Obtaining information from standby database (RUN_INSPECT=Y)... done >>> Note FORCE_LOGGING is disabled in the primary database. >>> Sending heartbeat message... skipped Performing a log switch... >>> Transferring Log file(s) from CDB1 on dbvlin103 to dbvlin104 for thread 1: thread 1 sequence 17128 (thread_1_seq_17128.14278.927587587) ============================================================= dbvctl ended on dbvlin103: Thu Nov 10 23:20:11 2016 =============================================================
2.2.3. Â Applying Logs
oracle@dbvlin104[/usr/dbvisit8/standby]: ./dbvctl -d CDB1DR ============================================================= Dbvisit Standby Database Technology (8.0.02.18139) (pid 2083) dbvctl started on dbvlin104: Thu Nov 10 23:20:17 2016 ============================================================= >>> Sending heartbeat message... skipped >>> Applying Log file(s) from dbvlin103 to CDB1DR on dbvlin104: thread 1 sequence 17128 (1_17128_914110063.arc) ============================================================= dbvctl ended on dbvlin104: Thu Nov 10 23:20:21 2016 =============================================================
2.3. Â Creating a Single Instance Standby for an Oracle RAC Primary
In this example, we are going to create a single instance standby database using filesystem based storage for a RAC enabled primary database.
Key points to note with regards to this configuration:
- The standby database is using Filesystem Based storage:
- database files will be located in /u01/app/oracle/oradata and /u01/app/oracle/fast_recovery_area.
- Oracle Managed Files (OMF) is used
- The standby database will be created without using transportable media, meaning backups will be created locally in a temporary area (which must have sufficient disk space to hold a full compressed database backup)
- The creation process can take time. Â To estimate the time, keep in mind we need to create a full compressed database backup, copy the files to the standby database server and then perform a full restore
- In the example below, we modify the SPFILE parameters as the standby database is using filesystem based storage, not ASM.Â
2.3.1. Â Example
oracle@kiwi81[/acfs/dbvisit/standby]: ./dbvctl -d DEV --csd --noprompt >>> Running pre-checks please wait... done What would you like to do: 1 - Create standby database (and optionally save settings in template) 2 - Help 3 - Terminate processing Please enter your choice [1]: 1 ------------------------------------------------------------------------------- =>Do you want to use TRANSPORTABLE MEDIA to transfer the database backup to the standby server? Transportable media is an external device such as a USB drive that is first plugged into the primary server and then manually transferred to the standby site and plugged into the standby server to continue the process. It can be used for large databases or slow networks. Specifying No means the network will be used to transfer the database backup. [N]: ------------------------------------------------------------------------------- A temporary location must be specified on kiwi812-vip where the database will be backed up to first. This location must be big enough to hold RMAN backup of the whole database (1.47GB). =>Specify the location on this server: [/usr/tmp]: ------------------------------------------------------------------------------- A temporary location must be specified on kiwi91 where the database backup will be copied to before moving to specified locations. =>Specify location on remote server: [/usr/tmp]: You choose to create a non ASM standby database. Please change all Oracle database parameters values pointing to ASM locations to point to valid filesystem locations on the standby server. The following oracle database parameters will be set in the standby database pfile or spfile: ------------------------------------------------------------------------------- SID NAME VALUE * audit_file_dest /u01/app/oracle/admin/DEV/adump * compatible 11.2.0.4.0 * db_block_size 8192 * db_create_file_dest +DATA * db_create_online_log_dest_1 +DATA * db_create_online_log_dest_2 +FRA * db_domain * db_file_name_convert * db_name DEV * db_recovery_file_dest +FRA * db_recovery_file_dest_size 4621074432 * db_unique_name DEV * diagnostic_dest /u01/app/oracle * dispatchers (PROTOCOL=TCP) (SERVICE=DEVXDB) * log_archive_format %t_%s_%r.dbf * log_file_name_convert * nls_territory NEW ZEALAND * open_cursors 300 * pga_aggregate_target 104857600 * processes 150 * remote_login_passwordfile exclusive * sga_target 891289600 * spfile OS default * undo_tablespace UNDOTBS1 ------------------------------------------------------------------------------- What would you like to do: 1 - Proceed with creating the standby database 2 - Edit oracle database parameters for the standby database pfile/spfile 3 - Terminate processing Please enter your choice [1]: 2 WARNING: Do NOT use single or double quotes to enclose parameter values! Separate multiple values with a comma. If a comma is part of a value, escape it with a backslash. If a comma is part of a value, escape it with a backslash. =>Enter full parameter name: []: db_create_file_dest 1 - Remove from the standby parameter file (parameter will be set to defaultvalue) 2 - New value in the standby parameter file =>Please enter your choice: []: 2 =>Enter new value (leave blank to set to null) []: /u01/app/oracle/oradata Validating ... please wait The following oracle database parameters will be set in the standby database pfile or spfile: ------------------------------------------------------------------------------- SID NAME VALUE * audit_file_dest /u01/app/oracle/admin/DEV/adump * compatible 11.2.0.4.0 * db_block_size 8192 * db_create_file_dest /u01/app/oracle/oradata * db_create_online_log_dest_1 +DATA * db_create_online_log_dest_2 +FRA * db_domain * db_file_name_convert * db_name DEV * db_recovery_file_dest +FRA * db_recovery_file_dest_size 4621074432 * db_unique_name DEV * diagnostic_dest /u01/app/oracle * dispatchers (PROTOCOL=TCP) (SERVICE=DEVXDB) * log_archive_format %t_%s_%r.dbf * log_file_name_convert * nls_territory NEW ZEALAND * open_cursors 300 * pga_aggregate_target 104857600 * processes 150 * remote_login_passwordfile exclusive * sga_target 891289600 * spfile OS default * undo_tablespace UNDOTBS1 ------------------------------------------------------------------------------- What would you like to do: 1 - Proceed with creating the standby database 2 - Edit oracle database parameters for the standby database pfile/spfile 3 - Terminate processing Please enter your choice [1]: 2 WARNING: Do NOT use single or double quotes to enclose parameter values! Separate multiple values with a comma. If a comma is part of a value, escape it with a backslash. If a comma is part of a value, escape it with a backslash. =>Enter full parameter name: []: db_create_online_log_dest_1 1 - Remove from the standby parameter file (parameter will be set to defaultvalue) 2 - New value in the standby parameter file =>Please enter your choice: []: 2 =>Enter new value (leave blank to set to null) []: /u01/app/oracle/oradata Validating ... please wait The following oracle database parameters will be set in the standby database pfile or spfile: ------------------------------------------------------------------------------- SID NAME VALUE * audit_file_dest /u01/app/oracle/admin/DEV/adump * compatible 11.2.0.4.0 * db_block_size 8192 * db_create_file_dest /u01/app/oracle/oradata * db_create_online_log_dest_1 /u01/app/oracle/oradata * db_create_online_log_dest_2 +FRA * db_domain * db_file_name_convert * db_name DEV * db_recovery_file_dest +FRA * db_recovery_file_dest_size 4621074432 * db_unique_name DEV * diagnostic_dest /u01/app/oracle * dispatchers (PROTOCOL=TCP) (SERVICE=DEVXDB) * log_archive_format %t_%s_%r.dbf * log_file_name_convert * nls_territory NEW ZEALAND * open_cursors 300 * pga_aggregate_target 104857600 * processes 150 * remote_login_passwordfile exclusive * sga_target 891289600 * spfile OS default * undo_tablespace UNDOTBS1 ------------------------------------------------------------------------------- What would you like to do: 1 - Proceed with creating the standby database 2 - Edit oracle database parameters for the standby database pfile/spfile 3 - Terminate processing Please enter your choice [1]: 2 WARNING: Do NOT use single or double quotes to enclose parameter values! Separate multiple values with a comma. If a comma is part of a value, escape it with a backslash. If a comma is part of a value, escape it with a backslash. =>Enter full parameter name: []: db_create_online_log_dest_2 1 - Remove from the standby parameter file (parameter will be set to default value) 2 - New value in the standby parameter file =>Please enter your choice: []: 2 =>Enter new value (leave blank to set to null) []: /u01/app/oracle/fast_recovery_area Validating ... please wait The following oracle database parameters will be set in the standby database pfile or spfile: ------------------------------------------------------------------------------- SID NAME VALUE * audit_file_dest /u01/app/oracle/admin/DEV/adump * compatible 11.2.0.4.0 * db_block_size 8192 * db_create_file_dest /u01/app/oracle/oradata * db_create_online_log_dest_1 /u01/app/oracle/oradata * db_create_online_log_dest_2 /u01/app/oracle/fast_recovery_area * db_domain * db_file_name_convert * db_name DEV * db_recovery_file_dest +FRA * db_recovery_file_dest_size 4621074432 * db_unique_name DEV * diagnostic_dest /u01/app/oracle * dispatchers (PROTOCOL=TCP) (SERVICE=DEVXDB) * log_archive_format %t_%s_%r.dbf * log_file_name_convert * nls_territory NEW ZEALAND * open_cursors 300 * pga_aggregate_target 104857600 * processes 150 * remote_login_passwordfile exclusive * sga_target 891289600 * spfile OS default * undo_tablespace UNDOTBS1 ------------------------------------------------------------------------------- What would you like to do: 1 - Proceed with creating the standby database 2 - Edit oracle database parameters for the standby database pfile/spfile 3 - Terminate processing Please enter your choice [1]: 2 WARNING: Do NOT use single or double quotes to enclose parameter values! Separate multiple values with a comma. If a comma is part of a value, escape it with a backslash. If a comma is part of a value, escape it with a backslash. =>Enter full parameter name: []: db_recovery_file_dest 1 - Remove from the standby parameter file (parameter will be set to default value) 2 - New value in the standby parameter file =>Please enter your choice: []: 2 =>Enter new value (leave blank to set to null) []: /u01/app/oracle/fast_recovery_area Validating ... please wait The following oracle database parameters will be set in the standby database pfile or spfile: ------------------------------------------------------------------------------- SID NAME VALUE * audit_file_dest /u01/app/oracle/admin/DEV/adump * compatible 11.2.0.4.0 * db_block_size 8192 * db_create_file_dest /u01/app/oracle/oradata * db_create_online_log_dest_1 /u01/app/oracle/oradata * db_create_online_log_dest_2 /u01/app/oracle/fast_recovery_area * db_domain * db_file_name_convert * db_name DEV * db_recovery_file_dest /u01/app/oracle/fast_recovery_area * db_recovery_file_dest_size 4621074432 * db_unique_name DEV * diagnostic_dest /u01/app/oracle * dispatchers (PROTOCOL=TCP) (SERVICE=DEVXDB) * log_archive_format %t_%s_%r.dbf * log_file_name_convert * nls_territory NEW ZEALAND * open_cursors 300 * pga_aggregate_target 104857600 * processes 150 * remote_login_passwordfile exclusive * sga_target 891289600 * spfile OS default * undo_tablespace UNDOTBS1 ------------------------------------------------------------------------------- What would you like to do: 1 - Proceed with creating the standby database 2 - Edit oracle database parameters for the standby database pfile/spfile 3 - Terminate processing Please enter your choice [1]: 1 Validating oracle database parameters... please wait =>SUCCEEDED ------------------------------------------------------------------------------- =>Create standby database template for DEV using provided answers? [Y]: ------------------------------------------------------------------------------- =>Continue with creating a standby database? (If No processing will terminate, the saved template will be available for future use) [Y]: >>> dbvctl will now run a pre-flight check for standby database creation. An attempt will be made to create a standby (s)pfile using oracle standby database parameters, followed by trying to start the standby instance. If this step fails, then please double-check the following items before re-running dbvctl again: 1) Review the standby database parameters you have supplied and provide valid values unless a template is used. 2) Recreate the template to provide valid values for standby database parameters if a template is used. >>> Running pre-flight check for standby creation, please wait... done >>> Total database size for DEV1 is 1.47GB >>> Backing up primary database... Backing up datafile 1... done Backing up datafile 2... done Backing up datafile 3... done Backing up datafile 4... done Backing up datafile 5... done >>> Creating standby control file... done >>> Transferring backup from kiwi812-vip to kiwi91... Transferring /usr/tmp/dbv_DEV_csd_dbf_1_0krk8v9g_1_1.rman... done Transferring /usr/tmp/dbv_DEV_csd_dbf_1_0lrk8va9_1_1.rman... done Transferring /usr/tmp/dbv_DEV_csd_dbf_2_0mrk8vac_1_1.rman... done Transferring /usr/tmp/dbv_DEV_csd_dbf_3_0nrk8vas_1_1.rman... done Transferring /usr/tmp/dbv_DEV_csd_dbf_4_0ork8vau_1_1.rman... done Transferring /usr/tmp/dbv_DEV_csd_dbf_5_0prk8vb0_1_1.rman... done >>> Restoring standby control files... done >>> Starting standby database DEV on kiwi91 mount... done >>> Restoring datafiles on kiwi91... Restoring datafile 1... done Restoring datafile 2... done Restoring datafile 3... done Restoring datafile 4... done Restoring datafile 5... done >>> Renaming standby redo logs and tempfiles on kiwi91... done >>> Performing checkpoint and archiving logs... done >>> Finishing standby database creation... done >>> Standby database created. Please execute the following commands to complete the database creation process: To complete creating standby database please run $cDbvisit on the primary server first, then on the standby server, to ensure the standby database is in sync with the primary database. PID:11129 TRACE:11129_dbvctl_csd_DEV_201611062112.trc
2.3.2. Â Review Directory Structure on Standby
Once the restore is complete we now have our standby database. Â If we review the directory structure on the standby server we will notice the following:
oracle@kiwi91[/u01/app/oracle/oradata]: ls DEV oracle@kiwi91[/u01/app/oracle/oradata]: tree . . └── DEV ├── controlfile │ └── o1_mf_d1xt5gh3_.ctl ├── datafile │ ├── o1_mf_sysaux_d1xt7bjf_.dbf │ ├── o1_mf_system_d1xt63td_.dbf │ ├── o1_mf_undotbs1_d1xt7wxg_.dbf │ ├── o1_mf_undotbs2_d1xt87pl_.dbf │ └── o1_mf_users_d1xt83j2_.dbf ├── onlinelog └── tempfile 5 directories, 6 files oracle@kiwi91[/u01/app/oracle/oradata]: cd ../fast_recovery_area/ oracle@kiwi91[/u01/app/oracle/fast_recovery_area]: tree . . └── DEV ├── controlfile │ └── o1_mf_d1xt5gnc_.ctl └── onlinelog 3 directories, 1 file
The next step is to ship and apply logs manually before we enable either a schedule (using the CRON scheduler) or by running Dbvisit Standby as a Daemon process (background process) using the "dbvctl -d <DDC> -D start|stop|status" option.
2.3.3. Â Sending Logs from primary RAC
oracle@kiwi81[/acfs/dbvisit/standby]: ./dbvctl -d DEV ============================================================= Dbvisit Standby Database Technology (8.0.01.18066) (pid 5920) dbvctl started on kiwi812-vip: Sun Nov 6 22:01:04 2016 ============================================================= >>> Obtaining information from standby database (RUN_INSPECT=Y)... done >>> Note FORCE_LOGGING is disabled in the primary database. Performing a log switch... >>> Transferring Log file(s) from DEV1 on kiwi812-vip to kiwi91 for thread 1: thread 1 sequence 46 (thread_1_seq_46.309.927235555) >>> Transferring Log file(s) from DEV1 on kiwi812-vip to kiwi91 for thread 2: thread 2 sequence 28 (thread_2_seq_28.308.927235555) ============================================================= dbvctl ended on kiwi812-vip: Sun Nov 6 22:01:09 2016 =============================================================
2.3.4. Â Applying logs on standby: kiwi91
oracle@kiwi91[/usr/dbvisit/standby]: ./dbvctl -d DEV ============================================================= Dbvisit Standby Database Technology (8.0.01.18066) (pid 12772) dbvctl started on kiwi91: Sun Nov 6 22:03:33 2016 ============================================================= >>> Sending heartbeat message... skipped >>> Applying Log file(s) from kiwi812-vip to DEV on kiwi91: thread 1 sequence 46 (1_46_927128791.arc) thread 2 sequence 28 (2_28_927128791.arc) ============================================================= dbvctl ended on kiwi91: Sun Nov 6 22:03:35 2016 =============================================================
We have now successfully created the standby database.
3. Â Creating the Standby Database - Central Console (GUI)
Create Standby Database is one of the most important functions of Dbvisit Standby. Launch it by clicking the Create Standby Database button from the main page.
3.1. Â Creating Single Instance Standby
Begin by selecting the Configuration/DDC to work with [1]. Next, you will need to select one of three possible process options:
- New Database [2]: This will allow you to set up a new Standby Database completely from scratch. You will need to review system parameters and add/edit values as necessary. This is the default CSD process mode.
- Use Template [3]: Using this option you can run a CSD process using values saved from a previous successful operation. This is a good way to repeat similar/identical CSD operations without having to manually change system parameters each time.
- Resume CSD [4]: Initially disabled, this option becomes available if a previous CSD operation did not fully complete for whatever reason. This could be because you are creating a Standby database using the Transportable Media option (more on this below), or because an error has occurred that you need to resolve before re-trying to restore your database logs.
After selecting this option, you will need to review the system parameters presented in the table below the option selectors [1].
Please refer to Section 7.4: Edit DDC of this guide for tips on how to use the parameter table. Parameters highlighted with a blue background cannot be altered [2].
Following the parameter table are several Options:
- Transportable media [1]: Set this to Yes if you want to use a physical medium to manually move your database backup files. You may wish to do this if your database is very large and it would be faster to use a physical drive to move the data.
NOTE: Choosing to use Transportable Media will effectively split the CSD process into two distinct parts: Backup and Restore. Once all necessary data is Backed up onto your Transportable Media, you will need to physically move it to the Destination Host and continue the process into the Restore stage. For details, please see section 3.2: Using Transportable Media below.
- Windows system login [2]: If you are using a Windows environment with Oracle 12c, you will need to enter the username and password of the Windows user that will run the Oracle service.
- Source and Target temp location [3]: Please ensure both of these locations have enough disk space to hold a full backup of your primary database.
- Action:
- Create Standby Database [4] will start the process without saving your parameter settings.
- Create Standby Database & Template [5] will start the process AND save your parameter settings in a template. Next time you run a CSD process, you can instantly reload values from this template to speed up your work.
- Create Template Only [6] will ONLY create the template with your saved parameters. The CSD process itself will NOT be initiated.
Once all the options above are set, please click Submit [7] to initiate the Create Standby Database process.
OPTION: Use Template [1]
This option works exactly the same as Option 1 above, except all the values in the parameter table are loaded from a Template created during a previous iteration of the CSD process. This can be a good way to save time by reusing previously set values for complex installations.
OPTION: Resume CSD [1]
This option, normally disabled, will only become available if a previously initiated CSD process has stopped before completion. Most often, this will be because you have chosen to use the Transportable Media option, and the system is waiting for you to move the database backup files to the correct location before proceeding. Once you have moved the files, selecting this option and clicking Submit [2] will resume the process from where it stopped. NOTE: You can also do this from within the Task Details pane of the relevant CSD task - more on this in section 10 below.
Another reason this option is available may be because an error has occurred after the primary database backup step. In this case, you may be able to modify Configuration/DDC parameters, or other system settings, to resolve the error and resume the CSD process without having to re-run the database backup step.
Once the CSD process is underway, you can track it as a separate Task in the Active Task List [1].
3.2. Â Using Transportable Media Option
If you are using the transportable media option, you need to make sure that the temporary backup location you selected on the CSD main screen has full permissions for the database user.
Once the CSD process is started, the high-level steps are:
- A local backup will be created in the location specified as the source temporary backup directory - this should be your external drive, i.e. your Transportable Media.
- Once the Backup is complete, the process will be stopped and a pause option will become available in the Active Task List.
- The external storage must now be transferred to the standby site (Destination Host) and mounted to the temporary backup location previously specified.
- Once this is done, clicking on the paused CSD task in the Active Task List and then the Resume Create Standby Database button will resume the CSD process.
The images below provide an example of how a paused (waiting for Transportable Media to be moved) CSD process looks:
4. Â Creating an Oracle 12c Multitenant Standby Database
There are a few important pre-requisites that you need to be aware of when using Oracle 12c Multitenant option:
- Before creating a standby database, ensure that the primary database already has the required PDB created.
- Dbvisit Standby is focussed on Oracle Standard Edition (SE, SE1 and SE2) and in the case of using 12c, you are allowed to use Oracle Standard Edition 2 (SE2) with one single pluggable database. Â Using more than one PDB does require an Enterprise Edition license and the Multitenant Option. Â
- Using Oracle Managed Files (OMF) is recommended, especially when using ASM.
Please note that when you are using the Oracle-supplied templates - example the General Purpose one, you might notice that the primary SEED database is not actually located under the SEED GUID. Â However, when you create the standby database using Dbvisit Standby, the SEED will be placed under the GUID (as long as OMF is used).
To explain what we mean by this, let's review an example using Oracle Database 12.2.
In this example we would like to highlight that if you created a primary database using the DBCA option and you used one of the standard templates provided by Oracle - example General Purpose as shown in figure below, and Oracle Managed Files (OMF) is used, the default directory for the SEED database would not match the GUID for the seed database.
The end result showing the directory locations for the primary database can be seen below:
SQL> select con_id, guid, name from v$pdbs order by 1; CON_ID GUID NAME ---------- -------------------------------- --------------- 2 4BC09721B301127AE053AB02000AED63 PDB$SEED 3 4BC0AAB740DC1B8EE053AB02000A550F DEVPDB1 4 4BC0AB691AA11BA3E053AB02000A93C4 DEVPDB2 SQL> ... ... ASMCMD> find DEV * +DATA/DEV/4700A987085B3DFAE05387E5E50A8C7B/ +DATA/DEV/4700A987085B3DFAE05387E5E50A8C7B/DATAFILE/ +DATA/DEV/4700A987085B3DFAE05387E5E50A8C7B/DATAFILE/SYSAUX.270.939821503 +DATA/DEV/4700A987085B3DFAE05387E5E50A8C7B/DATAFILE/SYSTEM.271.939821503 +DATA/DEV/4700A987085B3DFAE05387E5E50A8C7B/DATAFILE/UNDOTBS1.272.939821503 +DATA/DEV/4BC09721B301127AE053AB02000AED63/ +DATA/DEV/4BC09721B301127AE053AB02000AED63/TEMPFILE/ +DATA/DEV/4BC09721B301127AE053AB02000AED63/TEMPFILE/TEMP.273.939821531 +DATA/DEV/4BC0AAB740DC1B8EE053AB02000A550F/ +DATA/DEV/4BC0AAB740DC1B8EE053AB02000A550F/DATAFILE/ +DATA/DEV/4BC0AAB740DC1B8EE053AB02000A550F/DATAFILE/SYSAUX.277.939821859 +DATA/DEV/4BC0AAB740DC1B8EE053AB02000A550F/DATAFILE/SYSTEM.276.939821859 +DATA/DEV/4BC0AAB740DC1B8EE053AB02000A550F/DATAFILE/UNDOTBS1.275.939821859 +DATA/DEV/4BC0AAB740DC1B8EE053AB02000A550F/DATAFILE/USERS.279.939821869 +DATA/DEV/4BC0AAB740DC1B8EE053AB02000A550F/TEMPFILE/ +DATA/DEV/4BC0AAB740DC1B8EE053AB02000A550F/TEMPFILE/TEMP.278.939821863 +DATA/DEV/4BC0AB691AA11BA3E053AB02000A93C4/ +DATA/DEV/4BC0AB691AA11BA3E053AB02000A93C4/DATAFILE/ +DATA/DEV/4BC0AB691AA11BA3E053AB02000A93C4/DATAFILE/SYSAUX.282.939821871 +DATA/DEV/4BC0AB691AA11BA3E053AB02000A93C4/DATAFILE/SYSTEM.281.939821871 +DATA/DEV/4BC0AB691AA11BA3E053AB02000A93C4/DATAFILE/UNDOTBS1.280.939821871 +DATA/DEV/4BC0AB691AA11BA3E053AB02000A93C4/DATAFILE/USERS.284.939821881 +DATA/DEV/4BC0AB691AA11BA3E053AB02000A93C4/TEMPFILE/ +DATA/DEV/4BC0AB691AA11BA3E053AB02000A93C4/TEMPFILE/TEMP.283.939821875 +DATA/DEV/AUTOBACKUP/ +DATA/DEV/AUTOBACKUP/2017_03_28/ +DATA/DEV/AUTOBACKUP/2017_03_28/s_939822437.285.939822437 +DATA/DEV/CONTROLFILE/ +DATA/DEV/CONTROLFILE/Current.261.939821487 +DATA/DEV/CONTROLFILE/Current.262.939821487 +DATA/DEV/DATAFILE/ +DATA/DEV/DATAFILE/SYSAUX.258.939821419 +DATA/DEV/DATAFILE/SYSTEM.257.939821383 +DATA/DEV/DATAFILE/UNDOTBS1.259.939821443 +DATA/DEV/DATAFILE/USERS.260.939821445 +DATA/DEV/ONLINELOG/ +DATA/DEV/ONLINELOG/group_1.263.939821489 +DATA/DEV/ONLINELOG/group_1.266.939821491 +DATA/DEV/ONLINELOG/group_2.264.939821489 +DATA/DEV/ONLINELOG/group_2.267.939821491 +DATA/DEV/ONLINELOG/group_3.265.939821489 +DATA/DEV/ONLINELOG/group_3.268.939821491 +DATA/DEV/PARAMETERFILE/ +DATA/DEV/PARAMETERFILE/spfile.274.939821703 +DATA/DEV/TEMPFILE/ +DATA/DEV/TEMPFILE/TEMP.269.939821499
The standby database created in this example is making use of Filesystem Based storage - but importantly also using Oracle Managed Files.Â
When the standby database is created, the db_create_file_dest and db_recovery_file_dest was set.  Note setting the required db_create_online_log_dest_n is recommended but not required.
[oracle@kiwi703 /u01/app/oracle/oradata]$ tree . . └── DEV ├── 4BC09721B301127AE053AB02000AED63 │ └── datafile │ ├── o1_mf_sysaux_dfmhwrpg_.dbf │ ├── o1_mf_system_dfmhw6r1_.dbf │ └── o1_mf_undotbs1_dfmhxh38_.dbf ├── 4BC0AAB740DC1B8EE053AB02000A550F │ └── datafile │ ├── o1_mf_sysaux_dfmhy7gj_.dbf │ ├── o1_mf_system_dfmhxocz_.dbf │ ├── o1_mf_undotbs1_dfmhysjj_.dbf │ └── o1_mf_users_dfmhyy0r_.dbf ├── 4BC0AB691AA11BA3E053AB02000A93C4 │ └── datafile │ ├── o1_mf_sysaux_dfmhznkc_.dbf │ ├── o1_mf_system_dfmhz29y_.dbf │ ├── o1_mf_undotbs1_dfmj07hy_.dbf │ └── o1_mf_users_dfmj0d42_.dbf ├── controlfile │ └── o1_mf_dfmhsrmz_.ctl ├── datafile │ ├── o1_mf_sysaux_dfmhvhyz_.dbf │ ├── o1_mf_system_dfmht9ph_.dbf │ ├── o1_mf_undotbs1_dfmhw2hy_.dbf │ └── o1_mf_users_dfmhxbs3_.dbf ├── onlinelog └── tempfile 11 directories, 16 files
5. Adding Datafiles to Primary Database
Normally, Oracle does not propagate the adding of datafiles on the primary database to the standby database. This must be done manually on the standby database.
Dbvisit Standby will automatically add the datafile to the standby database. Dbvisit Standby will attempt to generate a new name for a standby datafile, in case the primary name cannot be used due to different storage type (ASM and non-ASM) or different database file structure between the primary and standby.
There are some restrictions to automatically adding the datafiles to the standby database.
Note 1:Â There must be sufficient space on the standby server for Dbvisit Standby to add the datafile. If there is not sufficient space, then Oracle will generate an error message which will be captured by Dbvisit Standby and an alert will be sent.
Note 2:Â This feature is independent of the Oracle parameter STANDBY_FILE_MANAGEMENT. Dbvisit Standby will detect if STANDBY_FILE_MANAGEMENT has added the datafile to the standby database, and if so, Dbvisit Standby will not add the datafile.
Note 3:Â STANDBY_FILE_MANAGEMENT can only be used in Enterprise Edition and should not be set in Standard Edition.
Every time Dbvisit Standby runs on the primary, it takes a snapshot of primary datafile ids and names and saves it in the repository.
It detects if new data files have been added to the primary since the last run. If so Dbvisit Standby creates a new text file "datafiles_ORACLE_SID_DEST.txt" and ships it to the standby server to the location specified by parameter LOGDIR_DR, before proceeding with transferring redo logs.
Every time Dbvisit Standby runs on the standby, it reads the file datafiles_ORACLE_SID_DEST.txt and uses the primary datafile names to work out the location and name of a new standby datafile should one has to be added to the standby database. Actions related to recreating of a new standby control file are logged to Dbvisit Standby output and trace file.
This approach has certain limitations and Dbvisit may fail to obtain the primary name for a new standby datafile, if a delay lag is set for the standby, or if the datafile(s) have been dropped and added to the primary in between two consequent Dbvisit runs and Oracle happened to reuse file ids.
To deal with this limitation Dbvisit first attempts to obtain the primary name for the new standby datafile from the datafiles_ORACLE_SID_DEST.txt file. If that fails, Dbvisit looks for Oracle error message ORA-01274 that contains the primary name of the new datafile. If the error message is not present in the sqlplus output, Dbvisit will attempt to create a new standby datafile as an OMF file, but only if the creation of OMF files is enabled on the standby. This functionality can be turned off by setting the global ADD_DATAFILE_FORCE_OMF to N (default Y).
Dbvisit Standby can by default only add a maximum of 10 data files per session. Â This is controlled by the MAX_DATAFILES_TO_ADD parameter that can be set in the Dbvisit Database Configuration File (DDC)
When Using ASM
If the Standby database is making use of ASM, using OMF (Oracle Managed Files) is recommended. Â
Important
If ASM is used on the standby database for database storage, datafiles on the standby database will be created as Oracle Managed Files (OMF).
If a new datafile was added to the primary database the same process will be followed as mentioned above where the "datafiles_ORACLE_SID_DEST.txt" file is used, but if the standby database is making use of ASM and OMF is enabled - db_create_file_dest is set to a specific disk group - the standby database datafiles will be added as OMF files. Â (Aliases will not be used).