Create Standby Database using Transportable Media option - CLI

This section will show you an example on how to Create Standby database using Transportable Media option using Dbvisit Command Line Interface:

In this example the setup is as follow

  • Dbvisit Standby version used: 7.0.17
  • Operating System - Oracle Linux 5.10
  • Oracle Database version 11.2.0.4
  • Oracle Grid Infrastructure 11.2.0.4
  • Database Name: testdb
  • Primary Server: dbvlin803
  • Standby Server: dbvlin804
  • Dbvisit Standby ARCHDEST: /u01/app/oracle/dbvisit_archive
  • Transportable Media Location: /standby_nfs/backup

Important

  • Creating a standby database is performed on the primary server.
  • You must have a DDC file already created before you proceed with CSD.
  • Dbvisit Standby is making use of a directory referred to as the ARCHDEST. This location is specific to Dbvisit Standby and is not - and should not, be seen as the same as the Oracle Database Archive destinations.

Note: ASM 10.2. and above is supported, but Dbvisit Standby does not support Graceful Switchover when ASM versions less than 11.1 is used. ASM 11.2 with latest patches applied is recommended.

 

The setup is created using the Dbvisit Standby CLI "dbvisit_setup".

 

On Primary Server:

oracle@dbvlin803[/usr/dbvisit/standby]: ./dbvisit_setup

=========================================================
     Dbvisit Standby Database Technology (7.0.17.12419)
           http://www.dbvisit.com
=========================================================
=>dbvisit_setup only needs to be run on the primary server.
Is this the primary server? <Yes/No> [Yes]:
=========================================================
     Dbvisit Standby Database Technology (7.0.17.12419)
           http://www.dbvisit.com
     Dbvisit Database setup
       Default values will be shown in []
  Options:
       1) New Dbvisit Database setup (combines options 2,3,4)
       1a) New Dbvisit RAC Instance setup (combines options 2,3,4)
       2) New Dbvisit Database configuration (DDC) file setup
       3) New Dbvisit Archive Management Module (AMM) setup
       4) New Dbvisit Database repository (DDR) setup
       5) Manage Dbvisit Database repository (DDR)
       6) Update Dbvisit Database configuration (DDC) file
       7) Create Standby Database (and template)
       8) Synchronize Standby Database
       9) Uninstall Dbvisit Database repository (DDR)
       E) Exit
=========================================================


Please enter choice : 7
------------------------------------------------------------------------------
=>Creating Standby Database.
Primary database will NOT be shutdown.
 
Choose database:
The following Oracle database(s) have a Dbvisit Database configuration (DDC)
file on this server:
     DDC
     ===
1)   DEV
2)   ORCL12C
3)   testdb
4)   Return to menu


Please enter choice : 3
Is this correct? <Yes/No> [Yes]: Yes


Database testdb is up.


>>> Checking Dbvisit Standby for configurational differences between dbvlin803 and
    dbvlin804...
    No configurational differences found between dbvlin803 and dbvlin804.


>>> Checking Oracle installation on dbvlin804 in
    /u01/app/oracle/product/11.2.0/db_1/bin/oracle...


>>> Checking primary datafiles on dbvlin803...


>>> Validating Dbvisit configuration file on dbvlin804...


>>> Checking if a database is up and running on dbvlin804...
    Checks completed OK.


>>> Total database size for testdb is 2.00GB


What would you like to do:
   1 - Create standby database (and optionally save settings in template)
   2 - Create standby database using existing template (previously saved)
   3 - Help
   4 - Terminate processing
   Please enter your choice [1]: 1


-------------------------------------------------------------------------------
Do you want to create an ASM standby database (with all or some database files
in ASM storage)? [No]:


Standby database will be ASM: N


Is this correct? <Yes/No> [Yes]:
-------------------------------------------------------------------------------
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? [No]: No
Database files will be copied to standby server using temporary location on
dbvlin803.


Is this correct? <Yes/No> [Yes]: Yes
-------------------------------------------------------------------------------
Use network compression to compress the database files during transfer? [No]: No
Database files will be compressed during transfer: N


Is this correct? <Yes/No> [Yes]: Yes
-------------------------------------------------------------------------------
Dbvisit Standby provides functionality to create missing filesystem directories
on the standby server automatically.


Do you want Dbvisit Standby to create missing filesystem directories on the
standby server automatically? [Yes]: Yes


Dbvisit Standby will create missing filesystem directories automatically: Y


Is this correct? <Yes/No> [Yes]: Yes
-------------------------------------------------------------------------------


The following oracle database parameters will be set in the standby database pfile or spfile:
-------------------------------------------------------------------------------
audit_file_dest                         /u01/app/oracle/admin/testdb/adump
compatible                              11.2.0.4.0
control_files                           /u01/app/oracle/oradata/testdb/control01.ctl, /u01/app/oracle/fast_recovery_area/testdb/control02.ctl
db_block_size                           8192
db_name                                 testdb
db_recovery_file_dest                   /u01/app/oracle/fast_recovery_area
db_recovery_file_dest_size              4385144832
diagnostic_dest                         /u01/app/oracle
dispatchers                             (PROTOCOL=TCP) (SERVICE=testdbXDB)
memory_max_target                       683671552
memory_target                           683671552
open_cursors                            300
processes                               150
remote_login_passwordfile               EXCLUSIVE
spfile                                  OS default
standby_file_management                 MANUAL
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
-------------------------------------------------------------------------------
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.
[No]: Yes


Transportable media will be used: Y


Is this correct? <Yes/No> [Yes]: Yes
-------------------------------------------------------------------------------
A transportable media location must be specified on dbvlin803 where the
database will be backed up to first.
This location must be big enough to hold RMAN backup of the whole database
(2.00GB).


Specify the location on this server: [/usr/tmp]: /standby_nfs/backup/


Directory for transportable media location will be: /standby_nfs/backup/


Is this correct? <Yes/No> [Yes]: Yes
-------------------------------------------------------------------------------
Please specify the transportable media location on dbvlin804. This is where the
backup of the database will be found after plugging the transportable media
into the remote server.


Specify location on remote server: [/standby_nfs/backup/]:


Directory for transportable media will be: /standby_nfs/backup/


Is this correct? <Yes/No> [Yes]: Yes
  • Make Sure that you provide "Transportable media will be used: Y" , since we will be using Transportable Media.
  • Also provide the media locations for both Source and Target Server.
Primary database contains non-OMF datafiles and/or tempfiles.


Creation of non-OMF standby datafiles and/or tempfiles requires valid
filesystem locations on the standby server.


Review and confirm standby locations to create standby non-OMF datafiles and
tempfiles.

-------------------------------------------------------------------------------
Primary                               ===> Standby
-------------------------------------------------------------------------------
/u01/app/oracle/oradata/testdb        ===> /u01/app/oracle/oradata/testdb
-------------------------------------------------------------------------------
What would you like to do:
   1 - Confirm standby location(s) are correct and continue
   2 - Provide different standby location(s)
   Please enter your choice [1]: 1


Primary database contains non-OMF redo logs.
Creation of non-OMF redo logs Dbvisit Standby requires valid filesystem
locations on the standby server.


Review and confirm standby locations to create standby non-OMF redo logs.

-------------------------------------------------------------------------------
Primary                                             ===> Standby
-------------------------------------------------------------------------------
/u01/app/oracle/fast_recovery_area/TESTDB/onlinelog ===> /u01/app/oracle/fast_recovery_area/TESTDB/onlinelog
-------------------------------------------------------------------------------
What would you like to do:
   1 - Confirm standby location(s) are correct and continue
   2 - Provide different standby location(s)
   Please enter your choice [1]:
Standby locations validated.

-------------------------------------------------------------------------------
=>Create standby database template for testdb using provided answers? <Yes/No>
[Yes]: Yes


An existing template found.


=>Do you want to view the existing template? <Yes/No> [Yes]: No
What would you like to do:
   1 - Keep existing template and continue with creating a standby database
       using provided answers
   2 - Save provided answers as a new template (Note: existing template
       will be replaced by the new one)
   Please enter your choice [1]: 1


>>> Dbvisit 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 Dbvisit 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.


>>> 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.
    Backing up datafile 6... - done.
|
>>> Creating standby control file... - done.
Backup of primary database completed.
Requested stop point has been reached. Database has been backed up to
/standby_nfs/backup/.


 
Please complete the folllowing steps:
1 - Unplug Transportable Media (/standby_nfs/backup/) from this server
(dbvlin803).
2 - Manually move Transportable Media to standby server (dbvlin804).
3 - Plug in Transportable Media to standby server (dbvlin804).
4 - Ensure Transportable Media can be found in /standby_nfs/backup/ (on
dbvlin804).
5 - Restart the process on this server (dbvlin803).
To resume the creation of the standby database choose Restart under the Create
Standby Database option.


Dbvisit Standby will provide the option to re-start this process from the stop
point.


Please press <Enter> to continue...

Now Unplug the Transportable Media from Source Server and plug to Target Server. Once this is done, Please restart the CSD process on Primary.

oracle@dbvlin803[/usr/dbvisit/standby]: ./dbvisit_setup

=========================================================
     Dbvisit Standby Database Technology (7.0.17.12419)
           http://www.dbvisit.com
=========================================================
=>dbvisit_setup only needs to be run on the primary server.
Is this the primary server? <Yes/No> [Yes]:
=========================================================
     Dbvisit Standby Database Technology (7.0.17.12419)
           http://www.dbvisit.com
     Dbvisit Database setup
       Default values will be shown in []
  Options:
       1) New Dbvisit Database setup (combines options 2,3,4)
       1a) New Dbvisit RAC Instance setup (combines options 2,3,4)
       2) New Dbvisit Database configuration (DDC) file setup
       3) New Dbvisit Archive Management Module (AMM) setup
       4) New Dbvisit Database repository (DDR) setup
       5) Manage Dbvisit Database repository (DDR)
       6) Update Dbvisit Database configuration (DDC) file
       7) Create Standby Database (and template)
       8) Synchronize Standby Database
       9) Uninstall Dbvisit Database repository (DDR)
       E) Exit
=========================================================
Please enter choice : 7


------------------------------------------------------------------------------
=>Creating Standby Database.
Primary database will NOT be shutdown.


Choose database:
The following Oracle database(s) have a Dbvisit Database configuration (DDC)
file on this server:
     DDC
     ===
1)   DEV
2)   ORCL12C
3)   testdb
4)   Return to menu
Please enter choice : 3


Is this correct? <Yes/No> [Yes]: Yes
Database testdb is up.


>>> Checking Dbvisit Standby for configurational differences between dbvlin803 and
    dbvlin804...
    No configurational differences found between dbvlin803 and dbvlin804.


>>> Checking Oracle installation on dbvlin804 in
    /u01/app/oracle/product/11.2.0/db_1/bin/oracle...


>>> Checking primary datafiles on dbvlin803...


>>> Validating Dbvisit configuration file on dbvlin804...


>>> Checking if a database is up and running on dbvlin804...
    Checks completed OK.


>>> Total database size for testdb is 2.00GB


What would you like to do:
   1 - Create standby database (and optionally save settings in template)
   2 - Restart the uncompleted creation of standby database
   3 - Create standby database using existing template (previously saved)
   4 - Help
   5 - Terminate processing
   Please enter your choice [2]: 2


What would you like to do:
   1 - Restart the uncompleted creation of standby database
   2 - View status of the uncompleted creation of standby database
   3 - Return to the previous menu
   Please enter your choice [1]: 1


>>> Restoring standby control files... - done.


>>> Starting standby database testdb on dbvlin804 mount... - done.


>>> Restoring datafiles on dbvlin804...
    Restoring datafile 1 - done.
    Restoring datafile 2 - done.
    Restoring datafile 3 - done.
    Restoring datafile 4 - done.
    Restoring datafile 5 - done.
    Restoring datafile 6 - done.
|
>>> Renaming standby redo logs and tempfiles on dbvlin804... - done.


>>> Performing checkpoint and archiving logs... - done.


>>> Finishing standby database creation... - done.


Standby database created.
To complete creating standby database please run Dbvisit on the primary server first,
then on the standby server, to ensure the standby database is in sync with the primary
database.


Please press <Enter> to continue...
=========================================================
     Standby Database creation on dbvlin804 completed.


Next steps:
1) Exit out of dbvisit_setup.
2) Run Dbvisit on this server with command:
        dbvisit database_name
3) Run Dbvisit on standby server with command:
       dbvisit database_name


Once Dbvisit has been tested, schedule Dbvisit on primary and standby servers
using cron or other scheduling tool.

The Standby Database has been created successfully, you can now send logs to the standby from the primary server:

 

Run Dbvisit on Primary to send the logs:

oracle@dbvlin803[/usr/dbvisit/standby]: ./dbvisit testdb
=============================================================
Dbvisit Standby Database Technology (7.0.17.12561) (pid 2100)
dbvisit started on dbvlin803: Thu Jul 10 12:47:40 2014 ()
=============================================================


>>> Obtaining information from standby database (RUN_INSPECT=Y)...


>>> Sending heartbeat message... - done.


>>> Checking Dbvisit Standby for configurational differences between dbvlin803 and
    dbvlin804...
    No configurational differences found between dbvlin803 and dbvlin804.


>>> Log file(s) for testdb will be transferred from dbvlin803 to dbvlin804...
  
  > Transferring 'o1_mf_1_116_9vswqj7j_.arc.gz' to server dbvlin804:7890
    Progress: 0%...20%...40%...60%...80%...100% [10185 KB/s] - done.
    1 archive log transfer to dbvlin804 for testdb completed.
    Last sequence was 116.


>>> Dbvisit Archive Management Module (AMM)
    Config: number of archives to keep      = 0
    Config: number of days to keep archives = 7
    Config: archive backup count            = 0
    Config: diskspace full threshold        = 80%
    Current disk percent full (/u01/app/oracle/fast_recovery_area) = 83%
    *** SITUATION IS CRITICAL! ***
    Threshold of 80% on /u01/app/oracle/fast_recovery_area is less than the currently
    available disk space of 83%.


Disk space is sparse (83% full) and it is not allowed to remove oldest archives from
-> /u01/app/oracle/fast_recovery_area


This is due to DELETE_ARCHSOURCE = N being set in DDC file.
    Number of archive logs deleted = 0


=============================================================
dbvisit ended on dbvlin803: Thu Jul 10 12:48:16 2014
=============================================================

 

Run Dbvisit now on the standby to apply the logs:

oracle@dbvlin804[/usr/dbvisit/standby]: ./dbvisit testdb
=============================================================
Dbvisit Standby Database Technology (7.0.17.12561) (pid 18504)
dbvisit started on dbvlin804: Thu Jul 10 12:54:11 2014 ()
=============================================================


>>> Sending heartbeat message... - done.


>>> Log file(s) for testdb from dbvlin803 will be applied to dbvlin804


	201407101254 - Log seq 116 thread 1 applied to standby database testdb.
    
	No Mail sent as SEND_MAIL_FLAG_DR = N


>>> Dbvisit Archive Management Module (AMM)
    Config: number of archives to keep      = 0
    Config: number of days to keep archives = 7
    Config: diskspace full threshold        = 80%
Processing /u01/app/oracle/dbvisit_archive...
    Archive log dir: /u01/app/oracle/dbvisit_archive
    Total number of archive files   : 2
    Number of archive logs deleted = 0
    Current Disk percent full       : 92%


Disk space is sparse (92% full) and it is not allowed to remove oldest archives from
-> /u01/app/oracle/dbvisit_archive


This is due to DELETE_ARCHDEST = N being set in DDC file.
    No Mail sent as SEND_MAIL_FLAG_DR = N

=============================================================
dbvisit ended on dbvlin804: Thu Jul 10 12:56:42 2014
=============================================================