fastest database refresh using oracle clonedb - · pdf filefastest database refresh using...

12
Fastest Database Refresh using Oracle CloneDB Sangam 2014 (7 th ,8 th ,9 th Nov) Suvendu

Upload: duongkien

Post on 05-Feb-2018

280 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Fastest Database Refresh using Oracle CloneDB - · PDF fileFastest Database Refresh using Oracle CloneDB ... OCP ,RAC ,Oracle Linux Certified. ... There are several methods for DB

Fastest Database Refresh

using Oracle CloneDB

Sangam 2014 (7th,8th ,9th Nov)

Suvendu

Page 2: Fastest Database Refresh using Oracle CloneDB - · PDF fileFastest Database Refresh using Oracle CloneDB ... OCP ,RAC ,Oracle Linux Certified. ... There are several methods for DB

Who am I ?

•  Lead Database consultant @ Fiberlink-MaaS360 (An IBM Company)

•  10 years of real-time industry experience (4.5 years with Oracle corp. metalink support).

•  OCM , OCP ,RAC ,Oracle Linux Certified.

•  Technical Blog (www.dbagalaxy.com).

Page 3: Fastest Database Refresh using Oracle CloneDB - · PDF fileFastest Database Refresh using Oracle CloneDB ... OCP ,RAC ,Oracle Linux Certified. ... There are several methods for DB

Available Refresh options..

�  A refresh can be full database refresh or schema/partial refresh.

�  There are several methods for DB refresh /cloning databases .

�  Manually copy files and recreate the database.

�  EXPDP/IMPDP

�  RMAN DUPLICATE - active database.

�  RMAN DUPLICATE - backup.

�  3rd Party solutions (e.g Snapshots).

�  All require copying or restoring files to new location requiring:

�  Additional disk space

�  Time to perform the copy/import.

Page 4: Fastest Database Refresh using Oracle CloneDB - · PDF fileFastest Database Refresh using Oracle CloneDB ... OCP ,RAC ,Oracle Linux Certified. ... There are several methods for DB

Current DB Refresh Challenges….

§  EXPDP/IMPDP process is time consuming. Not an efficient for big size databases.

§  EXPDP/IMPDP feature has lots of bugs which causes lots of data mismatch/environment mismatch issues. With every run we find new issues/fixes. That impacts environment delivery dates.

§  Increase in DB environment refresh requests.

§  Store usage: We need to further invest in enterprise storage expansion, licensing.

Page 5: Fastest Database Refresh using Oracle CloneDB - · PDF fileFastest Database Refresh using Oracle CloneDB ... OCP ,RAC ,Oracle Linux Certified. ... There are several methods for DB

What is a Clone? An exact copy of the original.

Page 6: Fastest Database Refresh using Oracle CloneDB - · PDF fileFastest Database Refresh using Oracle CloneDB ... OCP ,RAC ,Oracle Linux Certified. ... There are several methods for DB

What is Clonedb? §  In 11.1 Oracle introduced Direct NFS(DNFS) Client .

§  11.2.0.2 patch set introduced Clonedb functionality, built on top of DNFS.

§  Clonedb uses Write-On-Demand (WOD) technology for clones.

§  This is best suited for full database refresh/clone.

Page 7: Fastest Database Refresh using Oracle CloneDB - · PDF fileFastest Database Refresh using Oracle CloneDB ... OCP ,RAC ,Oracle Linux Certified. ... There are several methods for DB

Write on demand(W.O.D)

§  Clones use read-only image copies of datafiles as source(Backup).

§  Only modified blocks are written to NFS location.

Backup file

Copies

Read-only 300GB

Clone DB 1 NFS w.o.d Files 50G

Clone DB 2 NFS w.o.d

Files 10g

Clone DB 3 NFS w.o.d

Files 1G

Page 8: Fastest Database Refresh using Oracle CloneDB - · PDF fileFastest Database Refresh using Oracle CloneDB ... OCP ,RAC ,Oracle Linux Certified. ... There are several methods for DB

Advantages….

§  No extra licensing cost.

§  One-time server setup, then repeated cloning is simple, super-quick (Complete refresh within less than < 10 min)

§  Error free method ,exact replica DB of the source DB.

§  Dev doesn’t need to spent time on post refresh issues.Saves two days worth of productive hour of GTS/DEV.

§  Clonedb saves storage space ,with existing infrastructure we can accommodate 40% more environments.

Page 9: Fastest Database Refresh using Oracle CloneDB - · PDF fileFastest Database Refresh using Oracle CloneDB ... OCP ,RAC ,Oracle Linux Certified. ... There are several methods for DB

Demo

Page 10: Fastest Database Refresh using Oracle CloneDB - · PDF fileFastest Database Refresh using Oracle CloneDB ... OCP ,RAC ,Oracle Linux Certified. ... There are several methods for DB

Known Issues….

§  The script tries to drop default TEMP tablespace .We need to add temporary tablespace.

§  If the source backup is an online backup (not consistent),it may need media recovery using the archived redo logs.You may get an error during database open.You can use the following commands to recover.

§  ORA-01511: error in renaming log/data files ORA-01141: error renaming data file x – new file ‘xxxxxxx’ not found ORA-01110: data file x:xxxxxx ORA-17515: Creation of clonedb failed using snapshot file xxxxxxxxx ORA-06512: at “SYS.X$DBMS_DNFS”, line 10

clonedb=true is missing in the clonedb pfile. This will cause the above errors .If the clonedb parameter is not updated.

§  ORA-01511: error in renaming log/data files ORA-17513: dNFS package call failed ORA-06512: at “SYS.X$DBMS_DNFS”, line 10

The log or datafile may be saved in a Local disk.Check if the target- clone datafile locations is not on NFS location.

Page 11: Fastest Database Refresh using Oracle CloneDB - · PDF fileFastest Database Refresh using Oracle CloneDB ... OCP ,RAC ,Oracle Linux Certified. ... There are several methods for DB

Limitations….

§  Need NFS/DNFS setup.

§  Over time if more changed blocks will be written to NFS location (W-O-D), so space savings will reduce.

§  Best suited in One Source –Many Target clone environment.

§  Best suited for short-lived clones used for functional, not performance testing.

§  Fairly new technology with little documentation.

Page 12: Fastest Database Refresh using Oracle CloneDB - · PDF fileFastest Database Refresh using Oracle CloneDB ... OCP ,RAC ,Oracle Linux Certified. ... There are several methods for DB

Q & A

Thank You !

Thanks to Kevin and Tim who shared this technology to the community. http://kevinclosson.wordpress.com/2010/12/23/oracle-database-11g-direct-nfs-clonedb-feature-part-i/ http://www.oracle-base.com/articles/11g/Clonedb_11gR2.php MOS: Clone your dNFS Production Database for Testing [ID 1210656.1] http://docs.oracle.com/cd/E16655_01/server.121/e17636/create.htm#ADMIN14024