Adding datafiles to the 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 version 6.0.26 and later, 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 adding 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: Version 6.0.40 and earlier do not suppport adding more than one datafile per dbvisit run. so if multiple datafiles are to be added then it should be done as follows:
1. Add datafile
2. Run Dbvisit Standby on the primary
3. Add second datafile
4. Run Dbvisit Standby on the primary again
5. Repeat process for each additional datafile to be added

 

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 also 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 sqlplus output, Dbvisit will attempt to create a new standby datafile as an OMF file, but only if 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).

 

In any case Dbvisit can only add maximum MAX_DATAFILES_TO_ADD (default 10) per session.