DELPHIX CONVERT VIRTUAL DATABASE TO PHYSICAL ONE (V2P)




This post will discuss one of the greatest and unique capabilities of Delphix Engine wich is Virtual to Physical (V2P) functionality.

Some of major use cases that can benefit from V2P :

  • Benchmarking the new application code released on VDB into UAT before deploying to production
  • Accelerate the cloud adoption by easing data movement (terabytes even more) between on prems. DCs or to cloud.
  • Production database recovery.
And so ...

Let's start by creating our physical target tree directories to host database files.

cd /u02/oradata
[delphix@linuxtarget ~]$ cd /u02/oradata/
mkdir ctl data temp undo
[oracle@linuxtarget oradata]$ tree /u02/oradata/
/u02/oradata/
   ctl
   data
   redo
   temp
   undo


Identify all the source database files directories to remap

[oracle@linuxtarget ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri Mar 24 10:03:26 2017

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning option

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/mnt/provision/devdb/datafile/u01/app/oracle/oradata/orcl/system01.dbf
/mnt/provision/devdb/datafile/u01/app/oracle/oradata/orcl/sysaux01.dbf
/mnt/provision/devdb/datafile/u01/app/oracle/oradata/orcl/undotbs01.dbf
/mnt/provision/devdb/datafile/u01/app/oracle/oradata/orcl/users01.dbf
/mnt/provision/devdb/datafile/u01/app/oracle/oradata/orcl/APEX_2276431178881901.dbf

SQL>

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/mnt/provision/devdb/datafile/u01/app/oracle/oradata/orcl/control01.ctl

SQL>

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/mnt/provision/devdb/datafile/DEVDB/onlinelog/o1_mf_3_df7b5wtx_.log
/mnt/provision/devdb/datafile/DEVDB/onlinelog/o1_mf_2_df7b5w9q_.log
/mnt/provision/devdb/datafile/DEVDB/onlinelog/o1_mf_1_df7b5vn1_.log

SQL>

It's time to do fun things, connect to delphix admin console select the vdb subject to be convert and click on the "V2P" button image







Complete the screen parameter with the required values as per the following.




Adjust the directories values as needed (i'm configuring only specific directory for the temporary file)



Now, have to remap my database file as following

/mnt/provision/devdb/datafile/u01/app/oracle/oradata/orcl/system01.dbf 

=> the red part is the source file mapping 

That we will be replacing using 


/u02/oradata/data/system01.dbf


Notice, that you can use a one time replacement mapping if you have all files under the same directory. This is not my case as all of my files aren't at the same directory level specifically undo and ctl





Once done validate the summary screen




Let's check our new converted database.





Unfortunatly, the redolog mapping is not possible directly in V2P process. But, you can workaround that with moving the redologs at the end of the process to the needed directory using database classical process.
[oracle@linuxtarget oradata]$ tree /u02/oradata/
[oracle@linuxtarget oradata]$ tree /u02/oradata/
/u02/oradata/
  1_11_939365500.dbf
  1_12_939365500.dbf
  1_13_939365500.dbf
  1_1_939471323.dbf
  1_2_939471323.dbf
  ctl
     control01.ctl
  data
     APEX_2276431178881901.dbf
     sysaux01.dbf
     system01.dbf
     users01.dbf
  DEVDB
     onlinelog
         o1_mf_1_df7b5vn1_.log
         o1_mf_2_df7b5w9q_.log
         o1_mf_3_df7b5wtx_.log
  init.ora
  init.ora.createControlfile
  init.ora.recovery
  init.ora.rename
  PDEVDB
     onlinelog
         o1_mf_4_dfbkjlv6_.log
         o1_mf_5_dfbkjlyn_.log
  redo
  script
     pdevdb
         archive-log-current.sh
         change-archivelog-mode.sh
         check-vdb-status.sh
         doCreateControlFile.sh
         doCreateLogFiles.sh
         doCreateSPFile.sh
         doCreateTempfiles.sh
         doDisableFlashback.sh
         doEnableInstances.sh
         doGenerateNewDbid.sh
         doIncompleteRecovery.sh
         doOpenDatabase.sh
         doRecoveryWithBackupCF.sh
         doRecoveryWithCreatedCF.sh
         doRenameDatafiles.sh
         doRenameReadOnlyDataFiles.sh
         doShutdownOracleInstance.sh
         functions.sh
         initpdevdb.ora
         mount-vdb-instance.sh
         old_datafiles.txt
         open-database-read-only.sh
         open-vdb.sh
         recover-vdb.sh
         register-listeners.sh
         restart_vdb_19702.log
         restart-vdb.sh
         rmanRenameCmd
         setup-oraenv.sh
         shutdown-abort-vdb.sh
         shutdown-delete-vdb.sh
         shutdown-vdb.sh
         sqlplusRenameCmd.sql
         start-no-resetlogs-vdb.sh
  source_init.ora
  spfile.ora
  temp
     temp1.dbf
  undo
       undotbs01.dbf

11 directories, 57 files
[oracle@linuxtarget oradata]$

[oracle@linuxtarget oradata]$ ps -ef | grep pdevdb
delphix  19746     1  0 12:15 ?        00:00:00 ora_pmon_pdevdb
delphix  19748     1  0 12:15 ?        00:00:00 ora_vktm_pdevdb
delphix  19752     1  0 12:15 ?        00:00:00 ora_gen0_pdevdb
delphix  19754     1  0 12:15 ?        00:00:00 ora_diag_pdevdb
delphix  19756     1  0 12:15 ?        00:00:00 ora_dbrm_pdevdb
delphix  19758     1  0 12:15 ?        00:00:00 ora_psp0_pdevdb
delphix  19760     1  0 12:15 ?        00:00:00 ora_dia0_pdevdb
delphix  19762     1  0 12:15 ?        00:00:00 ora_mman_pdevdb
delphix  19764     1  0 12:15 ?        00:00:00 ora_dbw0_pdevdb
delphix  19766     1  0 12:15 ?        00:00:00 ora_lgwr_pdevdb
delphix  19768     1  0 12:15 ?        00:00:00 ora_ckpt_pdevdb
delphix  19770     1  0 12:15 ?        00:00:00 ora_smon_pdevdb
delphix  19772     1  0 12:15 ?        00:00:00 ora_reco_pdevdb
delphix  19774     1  0 12:15 ?        00:00:00 ora_mmon_pdevdb
delphix  19776     1  0 12:15 ?        00:00:00 ora_mmnl_pdevdb
delphix  19831     1  0 12:15 ?        00:00:00 ora_p000_pdevdb
delphix  19833     1  0 12:15 ?        00:00:00 ora_p001_pdevdb
delphix  19835     1  0 12:15 ?        00:00:00 ora_arc0_pdevdb
delphix  19837     1  0 12:15 ?        00:00:00 ora_arc1_pdevdb
delphix  19839     1  0 12:15 ?        00:00:00 ora_arc2_pdevdb
delphix  19841     1  0 12:15 ?        00:00:00 ora_arc3_pdevdb
delphix  19843     1  0 12:15 ?        00:00:00 ora_qmnc_pdevdb
delphix  19872     1  0 12:15 ?        00:00:00 ora_cjq0_pdevdb
delphix  19888     1  0 12:15 ?        00:00:00 ora_q000_pdevdb
delphix  19890     1  0 12:15 ?        00:00:00 ora_q001_pdevdb
oracle   19899  8629  0 12:16 pts/0    00:00:00 grep pdevdb
[oracle@linuxtarget oradata]$


[oracle@linuxtarget oradata]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri Mar 24 12:17:10 2017

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning option
SQL> select status from v$instance;

STATUS
------------
OPEN

SQL>


SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u02/oradata/data/system01.dbf
/u02/oradata/data/sysaux01.dbf
/u02/oradata/undo/undotbs01.dbf
/u02/oradata/data/users01.dbf
/u02/oradata/data/APEX_2276431178881901.dbf

SQL> select name from v$tempfile;

NAME
--------------------------------------------------------------------------------
/u02/oradata/temp/temp1.dbf

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/u02/oradata/ctl/control01.ctl

SQL> select member from v$logfile
  2  ;

MEMBER
--------------------------------------------------------------------------------
/u02/oradata/DEVDB/onlinelog/o1_mf_3_df7b5wtx_.log
/u02/oradata/DEVDB/onlinelog/o1_mf_2_df7b5w9q_.log
/u02/oradata/DEVDB/onlinelog/o1_mf_1_df7b5vn1_.log
/u02/oradata/PDEVDB/onlinelog/o1_mf_4_dfbn4qgb_.log
/u02/oradata/PDEVDB/onlinelog/o1_mf_5_dfbn4qhv_.log

SQL>

No comments:

Post a Comment