Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

How to bake a Customer Story with With Windows, NVM-e, Data Guard, ACFS Snapshots & Perl

70 vues

Publié le

Having a database snapshot solution for fast database cloning is a must. Doing it on a low budget is not so easy. For a customer in Lausanne we implemented a fast, space efficient solution using only features included in Oracle Database 12c Enterprise Edition.
In this session, I will explain the customer challenge, the solution that we proposed, and the technical steps used for the implementation. Microsoft Windows, Oracle Restart, ACFS, Oracle Data Guard… with such strange ingredients, baking has been fun!

Publié dans : Technologie
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

How to bake a Customer Story with With Windows, NVM-e, Data Guard, ACFS Snapshots & Perl

  1. 1. How to Bake a Customer Story With Windows, NVM-e, Data Guard, ACFS Snapshots & Perl Ludovico Caldara @ludodba ukoug_tech17
  2. 2. About Ludovico Caldara DB Cloning : Customer Story2 12/2/2017 ■ 18 Years DBA (Not Only Oracle) ▪ I do it everywhere (even Windows) ■ RAC ATTACK Ninja & co-writer ■ President, SOUG & ITOUG Board ■ OCP (11g, 12c, MySQL) & OCE ■ Italian living in Switzerland ■ http://www.ludovicocaldara.net ■ @ludodba ludodba ■ ludovicocaldara
  3. 3. Our company. DB Cloning : Customer Story3 12/2/2017 Trivadis is a market leader in IT consulting, system integration, solution engineering and the provision of IT services focusing on and technologies in Switzerland, Germany, Austria and Denmark. We offer our services in the following strategic business fields: Trivadis Services takes over the interacting operation of your IT systems. O P E R A T I O N
  4. 4. COPENHAGEN MUNICH LAUSANNE BERN ZURICH BRUGG GENEVA HAMBURG DÜSSELDORF FRANKFURT STUTTGART FREIBURG BASEL VIENNA With over 600 specialists and IT experts in your region. DB Cloning : Customer Story4 12/2/2017 14 Trivadis branches and more than 600 employees 200 Service Level Agreements Over 4,000 training participants Research and development budget: CHF 5.0 million Financially self-supporting and sustainably profitable Experience from more than 1,900 projects per year at over 800 customers
  5. 5. DB Cloning : Customer Story5 12/2/2017 Customer requirements
  6. 6. Customer "Original Requirements" DB Cloning : Customer Story6 12/2/2017 Protect production database(s) in case of disaster Refresh test databases on demand Database size at that time: 50GB
  7. 7. Previous solution DB Cloning : Customer Story7 12/2/2017 DB_NAME PRIMARY SERVER B @ SITE B DB_NAME STANDBY DATA GUARD DB_NAME CLONE SERVER A @ SITE A RMAN DUPLICATE Storage Area Network Storage Area Network
  8. 8. Previous solution DB Cloning : Customer Story8 12/2/2017 DB_NAME PRIMARY SERVER B @ SITE B DB_NAME STANDBY DATA GUARD DB_NAME CLONE SERVER A @ SITE A RMAN DUPLICATE Storage Area Network Storage Area Network 25 minutes cloning process
  9. 9. Requirements 4 years later... DB Cloning : Customer Story9 12/2/2017 Protect production database(s) in case of disaster Refresh test databases on demand Database size now: 300GB
  10. 10. Requirements 4 years later... DB Cloning : Customer Story10 12/2/2017 Protect production database(s) in case of disaster Refresh test databases on demand Database size now: 300GB 2 hours cloning process!
  11. 11. Customer needs a new solution! DB Cloning : Customer Story11 12/2/2017 New hardware, not related to cloning performance – Eventually not tied to Storage Area Network – (Eventually NVM-e) A magic for faster clones – Not willing to spend for additional technologies (Delphix, Actifio...)
  12. 12. DB Cloning : Customer Story12 12/2/2017 The new solution
  13. 13. Ingredients DB Cloning : Customer Story13 12/2/2017 Oracle Data Guard
  14. 14. Ingredients DB Cloning : Customer Story14 12/2/2017 Oracle Data Guard NVM-e
  15. 15. Ingredients DB Cloning : Customer Story15 12/2/2017 Oracle Data Guard NVM-e ACFS Snapshots
  16. 16. Ingredients DB Cloning : Customer Story16 12/2/2017 Oracle Data Guard NVM-e ACFS Snapshots Bash Scripts
  17. 17. Ingredients DB Cloning : Customer Story17 12/2/2017 Oracle Data Guard NVM-e ACFS Snapshots Bash Scripts Linux
  18. 18. Ingredients DB Cloning : Customer Story18 12/2/2017 Oracle Data Guard NVM-e ACFS Snapshots Bash Scripts Linux
  19. 19. Ingredients DB Cloning : Customer Story19 12/2/2017 Oracle Data Guard NVM-e ACFS Snapshots Bash Scripts Linux Windows
  20. 20. Ingredients DB Cloning : Customer Story20 12/2/2017 Oracle Data Guard NVM-e ACFS Snapshots Bash Scripts Linux Windows + Perl
  21. 21. Target Architecture Overview DB Cloning : Customer Story21 12/2/2017 NEW SERVER A @ SITE A NVM-e NEW SERVER B @ SITE B NVM-e
  22. 22. Target Architecture Overview DB Cloning : Customer Story22 12/2/2017 NEW SERVER A @ SITE A NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA NEW SERVER B @ SITE B NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA
  23. 23. Target Architecture Overview DB Cloning : Customer Story23 12/2/2017 NEW SERVER A @ SITE A NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA NEW SERVER B @ SITE B NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA ACFS E:acfsDATA ACFS E:acfsFRA ACFS E:acfsREDO
  24. 24. Target Architecture Overview DB Cloning : Customer Story24 12/2/2017 NEW SERVER A @ SITE A NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA NEW SERVER B @ SITE B NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA SNAPSHOT DB_NAME ACFS E:acfsDATA ACFS E:acfsFRA ACFS E:acfsREDO
  25. 25. Target Architecture Overview DB Cloning : Customer Story25 12/2/2017 NEW SERVER A @ SITE A NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA DB_NAME PRIMARY NEW SERVER B @ SITE B NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA ACFS E:acfsDATA ACFS E:acfsFRA ACFS E:acfsREDO DB_NAME STANDBY SNAPSHOT DB_NAME DATA GUARD
  26. 26. Target Architecture Overview DB Cloning : Customer Story26 12/2/2017 NEW SERVER A @ SITE A NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA DB_NAME PRIMARY NEW SERVER B @ SITE B NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA ACFS E:acfsDATA ACFS E:acfsFRA ACFS E:acfsREDO DB_NAME STANDBY SNAPSHOT DB_NAME DATA GUARD SNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPY
  27. 27. Target Architecture Overview DB Cloning : Customer Story27 12/2/2017 NEW SERVER A @ SITE A NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA DB_NAME PRIMARY NEW SERVER B @ SITE B NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA ACFS E:acfsDATA ACFS E:acfsFRA ACFS E:acfsREDO DB_NAME STANDBY SNAPSHOT DB_NAME DATA GUARD SNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPY
  28. 28. Target Architecture Overview DB Cloning : Customer Story28 12/2/2017 NEW SERVER A @ SITE A NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA DB_NAME PRIMARY NEW SERVER B @ SITE B NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA ACFS E:acfsDATA ACFS E:acfsFRA ACFS E:acfsREDO DB_NAME STANDBY SNAPSHOT DB_NAME DATA GUARD DATABASE CLONE SNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPY
  29. 29. Target Architecture Overview DB Cloning : Customer Story29 12/2/2017 NEW SERVER A @ SITE A NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA DB_NAME PRIMARY NEW SERVER B @ SITE B NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA ACFS E:acfsDATA ACFS E:acfsFRA ACFS E:acfsREDO DB_NAME STANDBY SNAPSHOT DB_NAME DATA GUARD DATABASE CLONE DB_NAME CLONE SNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPY
  30. 30. Target Architecture Overview DB Cloning : Customer Story30 12/2/2017 NEW SERVER A @ SITE A NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA DB_NAME PRIMARY NEW SERVER B @ SITE B NVM-e GRID INFRASTRUCTURE 12cR1 E:oracleproduct12.1.0.2grid DG +DATA ACFS E:acfsDATA ACFS E:acfsFRA ACFS E:acfsREDO DB_NAME STANDBY SNAPSHOT DB_NAME DATA GUARD DATABASE CLONE DB_NAME CLONE SNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPY SNAPSHOTS ON DATA NO SNAPSHOTS ON FRA/REDO
  31. 31. DB Cloning : Customer Story31 12/2/2017 Thoughts about ACFS
  32. 32. Snapshot on Snapshot: Why? DB Cloning : Customer Story46 12/2/2017 Multiple databases!
  33. 33. Snapshot on Snapshot: Why? DB Cloning : Customer Story47 12/2/2017 Multiple databases! I want to clone RED database
  34. 34. Snapshot on Snapshot: Why? DB Cloning : Customer Story48 12/2/2017 Multiple databases! I want to clone RED database But I get copy on write for ALL of them!
  35. 35. Snapshot on Snapshot: Why? DB Cloning : Customer Story49 12/2/2017 Multiple databases! I want to clone RED database But I get copy on write for ALL of them!
  36. 36. Snapshot on Snapshot: Why? DB Cloning : Customer Story50 12/2/2017 Multiple databases! I want to clone RED database But I get copy on write for ALL of them! Snapshot space usage will grow much faster
  37. 37. Snapshots on snapshots are better! DB Cloning : Customer Story51 12/2/2017
  38. 38. Snapshots on snapshots are better! DB Cloning : Customer Story52 12/2/2017
  39. 39. DB Cloning : Customer Story53 12/2/2017 Not Supported
  40. 40. ACFS and Oracle Restart DB Cloning : Customer Story54 12/2/2017 From the documentation: Oracle Restart does not support root-based Oracle ACFS resources for this release: Loading Oracle ACFS drivers Mounting Oracle ACFS file systems listed in the Oracle ACFS mount registry Mounting resource-based Oracle ACFS database home file systems And: Oracle ACFS does not support data files or redo logs in an Oracle Restart configuration.
  41. 41. Assume the risk… DB Cloning : Customer Story55 12/2/2017 Primary: Oracle Restart with DB on ASM Only Standby and Test: Oracle Restart with DB on ACFS
  42. 42. DB Cloning : Customer Story56 12/2/2017 GI + ACFS Implementation
  43. 43. GI Installation and Patching… out of scope? DB Cloning : Customer Story57 12/2/2017 Meet system requirements (e.g. Windows object access auditing disabled) Partition Disks and stamp the partitions with asmtool.exe Install Oracle Grid Infrastructure Apply the latest bundle patch At that time: BP 12.1.0.2.171017. Now: BP 12.1.0.2.171130
  44. 44. Patching "sometimes" leaves the old drivers DB Cloning : Customer Story58 12/2/2017 Solution? – crsctl stop has; acfsload stop – acfsinstall /i /a ; acfsinstall /i /o ; acfsinstall /i /l Directory of C:WindowsSystem32drivers 12/20/2016 05:15 AM 3,461,008 oracleacfs.sys 12/20/2016 05:02 AM 841,104 oracleadvm.sys 12/20/2016 04:53 AM 478,608 oracleoks.sys Directory of C:WindowsSystem32drivers 06/21/2017 11:42 AM 3,461,008 oracleacfs.sys 06/21/2017 11:29 AM 841,104 oracleadvm.sys 06/21/2017 11:19 AM 478,608 oracleoks.sys – acfsload start -s ; crsctl start has
  45. 45. ACFS filesystems with Oracle Restart... DB Cloning : Customer Story59 12/2/2017 ACFS Drivers need to be loaded at boot set ORACLE_BASE=E:oracle set ORACLE_HOME=E:oracleproduct12.1.0.2grid set PATH=... %ORACLE_HOME%binacfsload start -s
  46. 46. ACFS filesystems with Oracle Restart... DB Cloning : Customer Story60 12/2/2017 The ACFS filesystem resource does not exist on Oracle Restart configurations Must use action script / custom type / resource!
  47. 47. ACFS filesystems with Oracle Restart... DB Cloning : Customer Story61 12/2/2017 The ACFS filesystem resource does not exist on Oracle Restart configurations Must use action script / custom type / resource! crsctl add type acfs_fs.type -basetype local_resource -attr "ATTRIBUTE=ACTION_SCRIPT,TYPE=string,DEFAULT_VALUE=E:oracleTrivadisscri ptsstop_startacfs_actionscript.bat,ATTRIBUTE=AUTO_START,TYPE=string,DEFA ULT_VALUE=always,ATTRIBUTE=START_TIMEOUT,TYPE=int,DEFAULT_VALUE=100,ATTRIB UTE=STOP_TIMEOUT,TYPE=int,DEFAULT_VALUE=100,ATTRIBUTE=CHECK_INTERVAL,TYPE= int,DEFAULT_VALUE=10,ATTRIBUTE=START_DEPENDENCIES,TYPE=string,DEFAULT_VALU E=hard(ora.DATA.dg)pullup(ora.DATA.DG),ATTRIBUTE=STOP_DEPENDENCIES,TYPE=st ring,DEFAULT_VALUE=hard(ora.DATA.dg),ATTRIBUTE=ACL,TYPE=string,DEFAULT_VAL UE='owner:nt authoritysystem:rwx,pgrp:ORA_ASMDBA:rwx',ATTRIBUTE=TYPE_ACL,TYPE=string,D EFAULT_VALUE='owner:nt authoritysystem:rwx,pgrp:ORA_ASMDBA:rwx,other::r-- '"
  48. 48. ACFS filesystems with Oracle Restart... DB Cloning : Customer Story62 12/2/2017 The ACFS filesystem resource does not exist on Oracle Restart configurations Must use action script / custom type / resource! crsctl add resource FRA.acfs -type acfs_fs.type -attr "ACL='owner:nt authoritysystem:rwx,pgrp:ORA_ASMDBA:rwx,other::r--'" crsctl add resource DATA.acfs -type acfs_fs.type -attr "ACL='owner:nt authoritysystem:rwx,pgrp:ORA_ASMDBA:rwx,other::r--'" crsctl add resource REDO.acfs -type acfs_fs.type -attr "ACL='owner:nt authoritysystem:rwx,pgrp:ORA_ASMDBA:rwx,other::r--'"
  49. 49. DB Cloning : Customer Story63 12/2/2017 Database Implementation
  50. 50. Naming Convention is crucial! DB Cloning : Customer Story64 12/2/2017 EXAMPLES SITE1 SITE2 ORACLE_SID/DB_NAME LUDO LUDO DB_UNIQUE_NAME LUDO_SITE1 LUDO_SITE2 CRS_RESOURCE ora.ludo_site1.db ora.ludo_site2.db DG Configuration LUDO LUDO DG Member ludo_site1 ludo_site2 DGConnectIdentifier ludo_site1 ludo_site2 Static Listener Entry (GLOBAL_DBNAME) LUDO_SITE1_DGMGRL LUDO_SITE2_DGMGRL Base Snapshot Name LUDO LUDO Snapshot Copies (when applies) - LUDO.18H.<weekday> E.g. LUDO.18H.Thu
  51. 51. Configuration of new standby databases DB Cloning : Customer Story65 12/2/2017 Create the directories for controlfiles and redo log Create the main snapshot – acfsutil snap create LUDO E:acfsdata Add the Database (in this case, as standby) – srvctl add database -d LUDO_SITE2 -o E:oracleproduct12.1.0.2db_BP171017 -p %ORACLE_HOME%databasespfileLUDO.ora -r PHYSICAL_STANDBY -s mount -n LUDO -i LUDO -a "DATA" Add the dependencies with the filesystem – crsctl modify resource ora.ludo_site2.db -attr "START_DEPENDENCIES='hard(FRA.acfs,DATA.acfs,REDO.acfs)pullup(F RA.acfs,DATA.acfs,REDO.acfs)',STOP_DEPENDENCIES='hard(FRA.acfs, DATA.acfs,REDO.acfs)'" -unsupported
  52. 52. Data Guard implementation... DB Cloning : Customer Story66 12/2/2017 Duplicate for standby Create broker configuration Add standby database ... usual steps! Oracle Managed Files because the primary is on ASM
  53. 53. Configuration of new clone databases DB Cloning : Customer Story67 12/2/2017 Create the service with ORADIM.exe Add the resource with srvctl add database – -db is the unique name, for the copies it MUST be the same as the db_name! Add the dependency with the filesystem (same as a new master database)
  54. 54. DB Cloning : Customer Story68 12/2/2017 Snapshots
  55. 55. ACFS Filesystem Layout: Source and its snapshot DB Cloning : Customer Story69 12/2/2017 E:acfsdata.ACFSsnaps<DB_NAME><DB_UNIQUE_NAME>DATAFILE... DB_CREATE_FILE_DEST Example of datafile: E:acfsdata.ACFSsnapsLUDOLUDO_SITE2DATAFILE01_MF_SYSTEM_DNNMQRVC_.DBF (Oracle Managed Files) SOURCE DATABASE LAYOUT E:acfsdata.ACFSsnaps<SNAP_NAME><DB_UNIQUE_NAME>DATAFILE... DB_CREATE_FILE_DEST Example: E:acfsdata.ACFSsnapsLUDO.18H.THULUDO_SITE2DATAFILE... SAME AS SOURCE SNAPSHOT COPY LAYOUT
  56. 56. ACFS Filesystem Layout: Clones DB Cloning : Customer Story70 12/2/2017 Source Snapshot E:acfsdata.ACFSsnaps<SNAP_NAME><SRC_DB_UNIQUE_NAME> DATABASE CLONE LAYOUT E:acfsdata.ACFSsnaps<CLONE_DB_NAME><SRC_DB_UNIQUE_NAME> ONLY THE SNAPSHOT NAME CHANGES Example of datafile: E:acfsdata.ACFSsnapsTESTVICOLUDO_SITE2DATAFILE01_MF_SYSTEM_DNNMQRVC_.DBF Clone DB_NAME Source DB_UNIQUE_NAME
  57. 57. Detail of the cloning process DB Cloning : Customer Story71 12/2/2017 LUDO_SITE2 SNAPSHOT LUDO Let's give it a name: – Primary: LUDO_SITE1 – Standby: LUDO_SITE2 MRP0
  58. 58. Detail of the cloning process DB Cloning : Customer Story72 12/2/2017 LUDO_SITE2 SNAPSHOT LUDO Stop Apply
  59. 59. Detail of the cloning process DB Cloning : Customer Story73 12/2/2017 LUDO_SITE2 SNAPSHOT LUDO LUDO.SUN Stop Apply Create a Snapshot
  60. 60. Detail of the cloning process DB Cloning : Customer Story74 12/2/2017 LUDO_SITE2 SNAPSHOT LUDO LUDO.SUN Stop Apply Create a Snapshot Copy pfile and Controlfile to trace
  61. 61. Detail of the cloning process DB Cloning : Customer Story75 12/2/2017 LUDO_SITE2 SNAPSHOT LUDO LUDO.SUN Stop Apply Create a Snapshot Copy pfile and Controlfile to trace Start Apply MRP0
  62. 62. Detail of the cloning process DB Cloning : Customer Story76 12/2/2017 LUDO_SITE2 SNAPSHOT LUDO LUDO.SUN Stop Apply Create a Snapshot Copy pfile and Controlfile to trace Start Apply MRP0 snap_database.pl
  63. 63. Running the script DB Cloning : Customer Story77 12/2/2017 snap_all_database.bat – Will overwrite the snapshot named <DB_NAME>.18H.<Weekday> for all the dbs tvd_perl snap_database.pl -b SOURCE [-n SNAPNAME] [-s SUFFIX] – Where SOURCE is the source DB (e.g. LUDO) – SNAPNAME is the name of the new snapshot (defaults to <SOURCE>.18H) – SUFFIX can be set to «weekday» to automatically add the week of the day to the name of the snapshot – E.g. tvd_perl snap_database.pl -b LUDO -n PREUPG will create a snapshot PREUPG from the standby database LUDO
  64. 64. Detail of the cloning process DB Cloning : Customer Story78 12/2/2017 LUDO_SITE2 SNAPSHOT LUDO LUDO.SUN Stop Apply Create a Snapshot Copy pfile and Controlfile to trace Start Apply MRP0
  65. 65. Detail of the cloning process DB Cloning : Customer Story79 12/2/2017 LUDO_SITE2 SNAPSHOT LUDO LUDO.SUN Stop Apply Create a Snapshot Copy pfile and Controlfile to trace Start Apply MRP0 LUDO.MON
  66. 66. Detail of the cloning process DB Cloning : Customer Story80 12/2/2017 LUDO_SITE2 SNAPSHOT LUDO LUDO.SUN Stop Apply Create a Snapshot Copy pfile and Controlfile to trace Start Apply MRP0 LUDO.MON LUDO.TUE
  67. 67. Detail of the cloning process DB Cloning : Customer Story81 12/2/2017 LUDO_SITE2 SNAPSHOT LUDO LUDO.SUN Stop Apply Create a Snapshot Copy pfile and Controlfile to trace Start Apply MRP0 LUDO.MON LUDO.TUE LUDO.WED LUDO.THU LUDO.FRI LUDO.SAT
  68. 68. Detail of the cloning process DB Cloning : Customer Story82 12/2/2017 LUDO_SITE2 SNAPSHOT LUDO LUDO.MON LUDO.TUE LUDO.WED LUDO.THU LUDO.FRI LUDO.SAT MRP0 LUDO.SUN
  69. 69. Detail of the cloning process DB Cloning : Customer Story83 12/2/2017 LUDO_SITE2 SNAPSHOT LUDO LUDO.MON LUDO.TUE LUDO.WED LUDO.THU LUDO.FRI LUDO.SAT MRP0 LUDO.SUN Delete previous clone
  70. 70. Detail of the cloning process DB Cloning : Customer Story84 12/2/2017 LUDO_SITE2 SNAPSHOT LUDO DATABASE CLONE LUDO.MON LUDO.TUE LUDO.WED LUDO.THU LUDO.FRI LUDO.SAT MRP0 LUDO.SUN Delete previous clone Create a Snapshot
  71. 71. Detail of the cloning process DB Cloning : Customer Story85 12/2/2017 LUDO_SITE2 SNAPSHOT LUDO LUDO.MON LUDO.TUE LUDO.WED LUDO.THU LUDO.FRI LUDO.SAT MRP0 LUDO.SUN Delete previous clone Create a Snapshot Replace snapshot name in pfile and ctlfile DATABASE CLONE
  72. 72. Detail of the cloning process DB Cloning : Customer Story86 12/2/2017 LUDO_SITE2 SNAPSHOT LUDO LUDO.MON LUDO.TUE LUDO.WED LUDO.THU LUDO.FRI LUDO.SAT MRP0 LUDO.SUN Delete previous clone Create a Snapshot Replace snapshot name in pfile and ctlfile Open resetlogs DATABASE CLONE CLONE
  73. 73. Detail of the cloning process DB Cloning : Customer Story87 12/2/2017 LUDO_SITE2 SNAPSHOT LUDO LUDO.MON LUDO.TUE LUDO.WED LUDO.THU LUDO.FRI LUDO.SAT MRP0 LUDO.SUN Delete previous clone Create a Snapshot Replace snapshot name in pfile and ctlfile Open resetlogs DATABASE CLONE CLONE clone_from_snap.pl
  74. 74. Cloning the databases: running the procedure DB Cloning : Customer Story88 12/2/2017 tvd_perl clone_from_snap.pl –b SOURCEDB –s SNAPNAME –d DESTDB – Where SOURCEDB is the original DB_NAME of the source DB (e.g. LUDO) – SNAPNAME is the name of the snapshot used for the clone (e.g. LUDO.18h.Thu) – DESTDB is the name of the destination database. A new snapshot will be created with this name (or overwritten if it already exists) – E.g.: tvd_perl clone_from_snap.pl –b LUDO –s LUDO.18H.Thu –d testclone Will clone LUDO to testclone using LUDO.18H.Thu snapshot
  75. 75. DB Cloning : Customer Story89 12/2/2017 Checking the ACFS
  76. 76. Checking the ACFS DB Cloning : Customer Story90 12/2/2017 Two custom aliases inside TVD-basenv $ acfsinfo – Gives information (including size and free space) about the ACFS filesystems $ snaps – Gives information about the snapshots in E:acfsdata – It includes parent name and creation time – The snapshot size does not apply (Oracle copy-on-first-write works differently from other techhnologies) Another script is integrated with customer's PRTG environment
  77. 77. Checking the ACFS DB Cloning : Customer Story91 12/2/2017 SQL> SELECT fs_name, type, parent, snap_name, to_char(create_time,'YYYY-MM-DD HH24:MI:SS') as CREATE_TIME FROM v$asm_acfssnapshots ORDER BY create_time; FS_NAME TYPE PARENT SNAP_NAME CREATE_TIME ------------ ---- -------------- -------------- -------------------- E:acfsDATA RW NULL LUDO 2017-06-21 12:48:22 E:acfsDATA RW LUDO CLONE002 2017-07-06 15:50:49 E:acfsDATA RW LUDO LUDO.18H.SAT 2017-07-08 18:00:56 E:acfsDATA RW LUDO LUDO.18H.SUN 2017-07-09 18:00:57 E:acfsDATA RW LUDO LUDO.18H.MON 2017-07-10 18:00:47 E:acfsDATA RW LUDO LUDO.18H.TUE 2017-07-11 18:00:28 E:acfsDATA RW LUDO LUDO.18H.WED 2017-07-12 18:00:32 E:acfsDATA RW LUDO.18H.WED CLONE001 2017-07-14 10:20:31 E:acfsDATA RW LUDO.18H.WED CLONE003 2017-07-14 10:58:52 E:acfsDATA RW LUDO LUDO.18H.FRI 2017-07-14 11:04:09 E:acfsDATA RW LUDO PREUPG 2017-07-13 11:42:28 E:acfsDATA RW PREUPG CLONE004 2017-07-13 11:47:24
  78. 78. Checking the ACFS DB Cloning : Customer Story92 12/2/2017 ludo@winsrv:E:oraclelocaldbaetc [OraDb11g_home1] acfsinfo FS_NAME STATE CORRUPT TOTAL_SIZE TOTAL_FREE SNAP_USAGE PCT_USAGE -------------- ------------- ------- ---------- ---------- ---------- ---------- E:acfsREDO AVAILABLE FALSE 51200 32200.07 0 37.11 E:acfsDATA AVAILABLE FALSE 1331200 517929.54 825515.75 61.09 E:acfsFRA AVAILABLE FALSE 122880 36200.09 0 70.54 SELECT fs_name, state, corrupt , ROUND(total_size,2) as total_size , ROUND(total_free,2) as total_free , ROUND(total_snap_space_usage,2) as snap_usage , ROUND((100-(total_free/total_size)*100),2) as PCT_USAGE FROM v$asm_filesystem;
  79. 79. DB Cloning : Customer Story93 12/2/2017 ACFS and Windows. What can go wrong?
  80. 80. The Check inside the action script DB Cloning : Customer Story94 12/2/2017 Check was executing `acfsutil info fs` During shapshot operations there are ACFS metadata locks The action script was failing Oracle Restart decided to restart the FS (indluding all the databases!) Now a lockfile mechanism and higher script timeouts prevent the problem if ( -f $lockFile ) { &DoMsg ("ACFS operation in progress. Will not check."); }
  81. 81. Standby reinstate: erase all? DB Cloning : Customer Story95 12/2/2017 ALL the snapshots depend on the first one containing the standby Reinstate of the standby will increase massively the disk space If not enough, all the clones will be destroyed and taken again
  82. 82. Need to switchover DB Cloning : Customer Story96 12/2/2017 The standby is on a snapshot that has snapshots In case of switchover the performance will decrease significantly The customer is ready to accept degraded performance in such case
  83. 83. DB Cloning : Customer Story97 12/2/2017
  84. 84. Three months long service request DB Cloning : Customer Story98 12/2/2017 ************************************************************************** * * * Bugcheck Analysis * * * ************************************************************************** Use !analyze -v to get detailed debugging information. BugCheck 3B, {c0000005, fffff8012845e144, ffffd0006da60b10, 0} *** WARNING: Unable to verify timestamp for oracleacfs.sys *** ERROR: Module load completed but symbols could not be loaded for oracleacfs.sys Probably caused by : oracleacfs.sys ( oracleacfs+3d144 ) Followup: MachineOwne
  85. 85. Three months long service request DB Cloning : Customer Story99 12/2/2017 Hi Ludovico, We got a development teame. They are going to include patch on 12.1.0.2.171130. Targeting fix for Bundle Patch via this CI bug: BUG 26994229 - CI BACKPORT OF BUG 19439577 FOR INCLUSION IN WINDOWS DB BP 12.1.0.2.171130 I would request you to monitor the next PSU release and apply on your environment.
  86. 86. DB Cloning : Customer Story100 12/2/2017 Customer satisfied?
  87. 87. Customer satisfied? DB Cloning : Customer Story101 12/2/2017 GOOD Clone process reduced to 3 minutes Space consumption: -80% Performance increase due to NVMe BAD Stability problems (almost fixed) Big operational change Clones cannot live forever (wow, that sounds just like Blade Runner) because of space usage
  88. 88. 12/2/2017 DB Cloning : Customer Story102 Technology on its own won't help you. You need to know how to use it properly.
  89. 89. Thank you! @trivadis #opencompany Ludovico Caldara @ludodba ukoug_tech17

×