Showing posts with label acfs exploration. Show all posts
Showing posts with label acfs exploration. Show all posts

Friday, January 24, 2025

Manual snap database creation

 In my last post Storage optimization using acfs I have explained how to create snap clone database using gDBclone utility. Honestly I am not against that tool which is an awesome innovation but that has some limitation for certain conditions.

 Lets say you don't want your test master database to be actively duplicated from prod or standby database.

You want to clone using some timestamp using backup based duplication without catalog connection.

Unfortunately gDBClone will fail throwing below error

RMAN-06136: Oracle error from auxiliary database: ORA-01152: file 2 was not restored from a sufficiently old backup

ORA-01110: data file 2: '/ccbdata/.ACFS/snaps/ccbmstr/CCBMSTR/datafile/o1_mf_cists_01_mrc8bpth_.dbf'

One more observation is after applying incremental level1 it does not restore and apply archivelog.

This is because of the following bug and when I worked with oracle support I git below update.

Bug 34210234 : RMAN DUPLICATE UNTIL TIMESTAMP USING BACKUP FAILS WITH ORA-01152
<<--- still no fix found, only workaround can be implemented

This limitation has forced me to remove the dependency with the tool and do it manually.If you still have enough patience to continue please follow below manual steps.

1.      Create 3 volumes like below

asmcmd volcreate -G data -s 9120G DATA

asmcmd volcreate -G reco -s 500G RECO

asmcmd volcreate -G data -s 200G REDO

 

2.      Create file system out of that volume

 

asmcmd  volinfo -G DATA DATA

Diskgroup Name: DATA

 

         Volume Name: DATA

         Volume Device: /dev/asm/DATA-132

         State: ENABLED

         Size (MB): 5242880

         Resize Unit (MB): 64

         Redundancy: MIRROR

         Stripe Columns: 8

         Stripe Width (K): 1024

         Usage:

         Mountpath:

/sbin/mkfs -t acfs /dev/asm/DATA-132

mkfs.acfs: version                   = 19.0.0.0.0

mkfs.acfs: on-disk version           = 46.0

mkfs.acfs: volume                    = /dev/asm/DATA-132

mkfs.acfs: volume size               = 5497558138880  (   5.00 TB )

mkfs.acfs: Format complete.

 

asmcmd  volinfo -G RECO RECO

Diskgroup Name: RECO

 

         Volume Name: RECO

         Volume Device: /dev/asm/RECO-262

         State: ENABLED

         Size (MB): 512000

         Resize Unit (MB): 64

         Redundancy: MIRROR

         Stripe Columns: 8

         Stripe Width (K): 1024

         Usage:

         Mountpath:

/sbin/mkfs -t acfs /dev/asm/RECO-262

mkfs.acfs: version                   = 19.0.0.0.0

mkfs.acfs: on-disk version           = 46.0

mkfs.acfs: volume                    = /dev/asm/RECO-262

mkfs.acfs: volume size               = 536870912000  ( 500.00 GB )

mkfs.acfs: Format complete.

               asmcmd  volinfo -G DATA REDO

               Diskgroup Name: DATA

               Volume Name: REDO

               Volume Device: /dev/asm/REDO-132

               State: ENABLED

               Size (MB): 204800

               Resize Unit (MB): 64

               Redundancy: MIRROR

               Stripe Columns: 8

                Width (K): 1024

               Usage:

               Mountpath:   

/sbin/mkfs -t acfs /dev/asm/REDO-132

               mkfs.acfs: version                   = 19.0.0.0.0

mkfs.acfs: on-disk version           = 46.0

mkfs.acfs: volume                    = /dev/asm/REDO-132

mkfs.acfs: volume size               = 214748364800  ( 200.00 GB )

mkfs.acfs: Format complete.

 

3.      Create below mount point from root user

mkdir /DATA;chown oracle:dba /DATA;ls -ldr /DATA

drwxr-xr-x 2 oracle dba 4096 Jan  7 14:13 /DATA

mkdir /RECO;chown oracle:dba /RECO;ls -ldr /RECO

drwxr-xr-x 2 oracle dba 4096 Jan  7 14:15 /RECO

mkdir /REDO;chown oracle:dba /REDO;ls -ldr /REDO

4.      Mount the acfs file syetm using below command

grep grid /u01/app/oraInventory/ContentsXML/inventory.xml

<HOME NAME="OraGrid19000" LOC="/u01/app/19.0.0.0/grid" TYPE="O" IDX="1" CRS="true"/>

 

/u01/app/19.0.0.0/grid/bin/srvctl add filesystem -device /dev/asm/DATA-132 -path /DATA -user oracle -mountowner oracle -mountgroup dba -mountperm 755

 

/u01/app/19.0.0.0/grid/bin/srvctl add filesystem -device /dev/asm/RECO-262 -path /RECO -user oracle -mountowner oracle -mountgroup dba -mountperm 755

 

/u01/app/19.0.0.0/grid/bin/srvctl add filesystem -device /dev/asm/REDO-132 -path /REDO -user oracle -mountowner oracle -mountgroup dba -mountperm 755

5.      Start the acfs file system

/u01/app/19.0.0.0/grid/bin/srvctl start filesystem -d /dev/asm/DATA-132

/u01/app/19.0.0.0/grid/bin/srvctl start filesystem -d /dev/asm/RECO-262

/u01/app/19.0.0.0/grid/bin/srvctl start filesystem -d /dev/asm/REDO-132

 

 

 

6.      Check the acfs file system status

/u01/app/19.0.0.0/grid/bin/crsctl stat res ora.data.DATA.acfs ora.data.REDO.acfs ora.reco.RECO.acfs -t

--------------------------------------------------------------------------------

Name           Target  State        Server                   State details

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.data.DATA.acfs

               ONLINE  ONLINE       tuslsoda01a              mounted on /DATA,

                                                             STABLE

               ONLINE  ONLINE       tuslsoda01b              mounted on /DATA,

                                                             STABLE

ora.data.REDO.acfs

               ONLINE  ONLINE       tuslsoda01a              mounted on /REDO,

                                                             STABLE

               ONLINE  ONLINE       tuslsoda01b              mounted on /REDO,

                                                             STABLE

ora.reco.RECO.acfs

               ONLINE  ONLINE       tuslsoda01a              mounted on /RECO,

                                                             STABLE

               ONLINE  ONLINE       tuslsoda01b              mounted on /RECO,

                                                             STABLE

 

df -h 

/dev/asm/DATA-132                5.0T   11G  5.0T   1% /DATA

/dev/asm/RECO-262                500G  1.6G  499G   1% /RECO

/dev/asm/REDO-132                200G 1020M  200G   1% /REDO

 

7.      Identify DB home to use for clone

cat /u01/app/oraInventory/ContentsXML/inventory.xml

<?xml version="1.0" standalone="yes" ?>

<!-- Copyright (c) 1999, 2024, Oracle and/or its affiliates.

All rights reserved. -->

<!-- Do not modify the contents of this file by hand. -->

<INVENTORY>

<VERSION_INFO>

   <SAVED_WITH>12.2.0.7.0</SAVED_WITH>

   <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>

</VERSION_INFO>

<HOME_LIST>

<HOME NAME="OraGrid19000" LOC="/u01/app/19.0.0.0/grid" TYPE="O" IDX="1" CRS="true"/>

<HOME NAME="OraDB19000_home1" LOC="/u01/app/oracle/product/19.0.0.0/dbhome_1" TYPE="O" IDX="2"/>

</HOME_LIST>

<COMPOSITEHOME_LIST>

</COMPOSITEHOME_LIST>

</INVENTORY>

 

Make an entry in /etc/oratab for new clone database.Not needed for existing database being cloned

 

ccbdev:/u01/app/oracle/product/19.0.0.0/dbhome_1:N

 

 

8.      Create password file which can be used later

Set the oracle environment using oraenv/oset

orapwd file=$ORACLE_HOME/dbs/orapwCCBMSTR dbuniquename=ccbmstr

Enter password for SYS:

SYS password file created as /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/orapwCCBMSTR

9.      Prepare for clone from CC&B database

From grid user create snapshot like this and validate

/sbin/acfsutil snap create -w ccbmstr /DATA

acfsutil snap info ccbmstr /DATA'

snapshot name:               ccbmstr

snapshot location:           /DATA/.ACFS/snaps/ccbmstr

RO snapshot or RW snapshot:  RW

parent name:                 /DATA

snapshot creation time:      Tue Jan 14 13:15:46 2025

file entry table allocation: 8781824   (   8.38 MB )

storage added to snapshot:   5885567029248   (   5.35 TB )

Please use attached rman script to clone from source ASM to acfs file system.

 

10.  Execute rman clone

 

Create a rman command file like below attached file.Now execute below rman command in background

You must set your oracle home environment before running rman command

nohup rman target sys/*****@targetdb auxiliary / cmdfile=</path/rman_commands.txt>  log=rman_output.log &

 Please find below rman script

run {

allocate auxiliary channel aux1 device type disk;

allocate auxiliary channel aux2 device type disk;

allocate auxiliary channel aux3 device type disk;

allocate auxiliary channel aux4 device type disk;

allocate auxiliary channel aux5 device type disk;

allocate auxiliary channel aux6 device type disk;

allocate auxiliary channel aux7 device type disk;

allocate auxiliary channel aux8 device type disk;

SET NEWNAME FOR DATABASE TO NEW;

DUPLICATE TARGET DATABASE

TO 'ccbmstr'

  UNTIL TIME "TO_DATE('07-JAN-2025_03:00:00','DD-MON-YYYY_HH24:MI:SS')"

  SPFILE

    PARAMETER_VALUE_CONVERT='cist4','ccbmstr'

    SET CONTROL_FILES='/ccbredo/ccbmstr/CCBMSTR/controlfile/control01.ctl'

    SET DB_CREATE_FILE_DEST="/ccbdata/.ACFS/snaps/ccbmstr"

    SET DB_RECOVERY_FILE_DEST="/ccbreco/ccbmstr"

    SET DB_CREATE_ONLINE_LOG_DEST_1="/ccbredo/ccbmstr"

    SET FILESYSTEMIO_OPTIONS='setall'

    SET DB_RECOVERY_FILE_DEST_SIZE='10G'

    SET SERVICE_NAMES=""

    SET DB_CREATE_ONLINE_LOG_DEST_2=""

    SET DB_CREATE_ONLINE_LOG_DEST_3=""

    SET DB_CREATE_ONLINE_LOG_DEST_4=""

    SET DB_CREATE_ONLINE_LOG_DEST_5=""

    SET LOG_ARCHIVE_DEST=""

    SET LOG_ARCHIVE_DEST_1="LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES)"

    SET LOG_ARCHIVE_DEST_2=""

    SET LOG_ARCHIVE_DEST_3=""

    SET LOG_ARCHIVE_DEST_4=""

    SET LOG_ARCHIVE_DEST_5=""

    SET LOG_ARCHIVE_FORMAT='%r_%s_%t.arc'

    SET DB_NAME="ccbmstr"

    SET DB_UNIQUE_NAME="ccbmstr"

    SET INSTANCE_NAME="ccbmstr"

    SET CLUSTER_DATABASE='false'

    SET REMOTE_LISTENER="tuslsoda01:1521"

    SET DIAGNOSTIC_DEST="/u01/app/oracle"

    SET AUDIT_FILE_DEST="/u01/app/oracle/admin/ccbmstr/adump"

    SET DB_DOMAIN=''

    SET DB_FLASH_CACHE_FILE='/dev/null'

    SET DB_FLASH_CACHE_SIZE='0'

    SET LISTENER_NETWORKS=''

    SET LOCAL_LISTENER=''

  NOFILENAMECHECK;

}

11.   Post rman clone

If we have database in asm and we are moving to acfs then remove the database and add it back

       srvctl remove database -d ccbmstr

srvctl add database -d ccbmstr -oraclehome /u01/app/oracle/product/19.0.0.0/dbhome_1 -dbtype SINGLE -spfile /DATA/.ACFS/snaps/ccbmstr/CCBMSTR/parameterfile/spfileccbmstr.ora -pwfile /DATA/.ACFS/snaps/ccbmstr/CCBMSTR/password/orapwccbmstr  -acfspath /DATA,/RECO,/REDO -node tuslsoda01b -i ccbmstr

       Note:This step is not needed if we already have database in acfs and we are suing the same filesystem

       Verify all datafiles,controlfiles and online redo log files

 12.  Prepare for snap db creation

To get a consistent snap it is always recommended to shutdown the db and then take a snap.

Before shutting down the db generate pfile from spfile like below.

Login as sys using sqlplus and use

SQL>Create pfile from spfile;

Shutdown the db manually or using srvctl command like below

srvctl stop database -d ccbmstr

Now take a snap from grid user.You can see that a new snapshot ccbdev has been created whose parent is showing as ccbmstr

 

su -grid -c ‘/sbin/acfsutil snap create -w  -p ccbmstr ccbdev /DATA’

 

su - grid -c 'acfsutil snap info /DATA'

snapshot name:               ccbmstr

snapshot location:           /DATA/.ACFS/snaps/ccbmstr

RO snapshot or RW snapshot:  RW

parent name:                 /DATA

snapshot creation time:      Tue Jan 14 13:15:46 2025

file entry table allocation: 8781824   (   8.38 MB )

storage added to snapshot:   5885567025152   (   5.35 TB )

 snapshot name:               ccbdev

snapshot location:           /DATA/.ACFS/snaps/ccbdev

RO snapshot or RW snapshot:  RW

parent name:                 ccbmstr

snapshot creation time:      Tue Jan 14 15:30:09 2025

file entry table allocation: 8781824   (   8.38 MB )

storage added to snapshot:   2858209280   (   8.38 MB )

 

    number of snapshots:  2

    kilosnap state:       ENABLED

    snapshot space usage: 5890843222016  (   5.36 TB )

 

Note:If you go inside the directory /DATA/.ACFS/snaps/ccbdev you can see CCBMSTR directory.To avoid naming confusion lets rename so that ccbdev database files will have only under CCBDEV directory.Also need to create directories under /RECO and /REDO

mv /DATA/.ACFS/snaps/ccbdev/CCBMSTR /DATA/.ACFS/snaps/ccbdev/CCBDEV

mkdir -p /REDO/ccbdev

mkdir -p /RECO/ccbdev

 

13.  Clean up pfile and validate all the path

Remove all reference of source(cist4) from pfile like below

sed -i '/^cist4/d' initccbdev.ora

search and replace ccbmstr with ccbdev

sed -i 's/ccbmstr/ccbdev/g' initccbdev.ora

 

Check whether these path can be accessed

grep  "[/+]" initccbdev.ora

# Oracle init.ora parameter file generated by instance ccbdev on 01/15/2025 10:38:27

__oracle_base='/u01/app/oracle' # ORACLE_BASE set from environment

_diag_adr_trace_dest='/u01/app/oracle/diag/rdbms/ccbdev/ccbdev/trace'

audit_file_dest='/u01/app/oracle/admin/ccbdev/adump'

control_files='/REDO/ccbdev/CCBDEV/controlfile/control01.ctl' # Restore Controlfile

core_dump_dest='/u01/app/oracle/diag/rdbms/ccbdev/ccbdev/cdump'

db_create_file_dest='/DATA/.ACFS/snaps/ccbdev'

db_create_online_log_dest_1='/REDO/ccbdev'

db_flash_cache_file='/dev/null'

db_recovery_file_dest='/RECO/ccbdev'

diagnostic_dest='/u01/app/oracle'

14.   Mount source (ccbmstr) database and create controlfile script

sqlplus>startup mount

sqlplus> alter session set tracefile_identifier='ctrlbackup';

sqlplus>alter database backup controlfile to trace;

sqlplus> oradebug setmypid;

sqlplus> oradebug tracefile_name;

15.  Copy controlfile script  and modify

We can see there are 2 sections of controlfile creation one without resetlogs and another with resetlogs like this

--     Set #1. NORESETLOGS case

-- Set Database Guard and/or Supplemental Logging

--     Set #2. RESETLOGS case

-- Set Database Guard and/or Supplemental Logging

We need to consider resetlogs options.Remove all lines above Set2

Get the line number

grep -n "Set #2." ccbmstr_ora_93333_ctrlbackup.trc

347:--     Set #2. RESETLOGS case

sed -i.bak  '1,346d' ccbmstr_ora_93333_ctrlbackup.trc

change below statement from

CREATE CONTROLFILE REUSE DATABASE "CCBMSTR" RESETLOGS FORCE LOGGING ARCHIVELOG

To

CREATE CONTROLFILE SET DATABASE "CCBDEV" RESETLOGS FORCE LOGGING ARCHIVELOG

Now search and replace ccbmstr and CCBMSTR with ccbdev and CCBDEV respectively in vi editor or using sed

Remove all junk sitting at tail end and execute it.

 

16.   Bring up  new db using the pfile and execute above controlfile script

AtVerify all datafiles,controlfiles and resologfiles.

Bounce the database

Verify snapshot storage size now

su - grid -c 'acfsutil snap info /DATA'

snapshot name:               ccbmstr

snapshot location:           /DATA/.ACFS/snaps/ccbmstr

RO snapshot or RW snapshot:  RW

parent name:                 /DATA

snapshot creation time:      Tue Jan 14 13:15:46 2025

file entry table allocation: 8781824   (   8.38 MB )

storage added to snapshot:   5885567025152   (   5.35 TB ) Size of ccbmstr db files

snapshot name:               ccbdev

snapshot location:           /DATA/.ACFS/snaps/ccbdev

RO snapshot or RW snapshot:  RW

parent name:                 ccbmstr

snapshot creation time:      Tue Jan 14 15:30:09 2025

file entry table allocation: 8781824   (   8.38 MB )

storage added to snapshot:   2859307008   (   2.66 GB )  Size of snapdb ccbdev

     number of snapshots:  2

    kilosnap state:       ENABLED

    snapshot space usage: 5890851774464  (   5.36 TB )

Hope you have learnt something useful...

Thursday, January 9, 2025

Storage optimization using acfs

 Problem statement:Lets assume you have a production database of 50 TB in size in and you maintain it in ASM file system with normal redundancy.This implies your storage utilization is 100 TB.In addition you maintain full size several copies of non-production (like dev,test,uat,pre-prod etc) as required by project team. So at some point of time you will reach in a situation where your storage has exceeded warning threshold. How will you handle this situation?

Solution: This problem can be solved using oracle acfs filesystem.Please see below link for detailed documentation

https://www.oracle.com/a/tech/docs/acfs-snapshot-best-practices.pdf

  • Create database clone from production database using acfs file system.That will work as a master database.
  • Create a snapshot database out of it in same acfs file system for your non-prod environments.

Initially snapshot created from master database will have only some metadata information.If you make changes in master database only the changed block will be copied to the snapshot file system so that snapshot db has consistent data.Basically it uses copy on write mechanism for this storage snapshot.

Without giving big lectures lets walk in the ground of reality.Please find below technical steps which will guide you to prepare to adopt this approach.

Technical steps:

1.      Create 3 volumes like below

asmcmd volcreate -G data -s 5120G DATA

asmcmd volcreate -G reco -s 500G RECO

asmcmd volcreate -G data -s 200G REDO

 

2.      Create file system out of that volume

 

asmcmd  volinfo -G DATA DATA

Diskgroup Name: DATA

 

         Volume Name: DATA

         Volume Device: /dev/asm/data-132

         State: ENABLED

         Size (MB): 5242880

         Resize Unit (MB): 64

         Redundancy: MIRROR

         Stripe Columns: 8

         Stripe Width (K): 1024

         Usage:

         Mountpath:

/sbin/mkfs -t acfs /dev/asm/data-132

mkfs.acfs: version                   = 19.0.0.0.0

mkfs.acfs: on-disk version           = 46.0

mkfs.acfs: volume                    = /dev/asm/data-132

mkfs.acfs: volume size               = 5497558138880  (   5.00 TB )

mkfs.acfs: Format complete.

 

asmcmd  volinfo -G RECO RECO

Diskgroup Name: RECO

 

         Volume Name: RECO

         Volume Device: /dev/asm/reco-262

         State: ENABLED

         Size (MB): 512000

         Resize Unit (MB): 64

         Redundancy: MIRROR

         Stripe Columns: 8

         Stripe Width (K): 1024

         Usage:

         Mountpath:

/sbin/mkfs -t acfs /dev/asm/reco-262

mkfs.acfs: version                   = 19.0.0.0.0

mkfs.acfs: on-disk version           = 46.0

mkfs.acfs: volume                    = /dev/asm/reco-262

mkfs.acfs: volume size               = 536870912000  ( 500.00 GB )

mkfs.acfs: Format complete.

               asmcmd  volinfo -G DATA REDO

               Diskgroup Name: DATA

               Volume Name: REDO

               Volume Device: /dev/asm/redo-132

               State: ENABLED

               Size (MB): 204800

               Resize Unit (MB): 64

               Redundancy: MIRROR

               Stripe Columns: 8

                Width (K): 1024

               Usage:

               Mountpath:   

/sbin/mkfs -t acfs /dev/asm/redo-132

               mkfs.acfs: version                   = 19.0.0.0.0

mkfs.acfs: on-disk version           = 46.0

mkfs.acfs: volume                    = /dev/asm/redo-132

mkfs.acfs: volume size               = 214748364800  ( 200.00 GB )

mkfs.acfs: Format complete.

 

3.      Create below mount point from root user

mkdir /data;chown oracle:dba /data;ls -ldr /data

drwxr-xr-x 2 oracle dba 4096 Jan  7 14:13 /data

mkdir /reco;chown oracle:dba /reco;ls -ldr /reco

drwxr-xr-x 2 oracle dba 4096 Jan  7 14:15 /reco

mkdir /redo;chown oracle:dba /redo;ls -ldr /redo

4.      Mount the acfs file syetm using below command

grep grid /u01/app/oraInventory/ContentsXML/inventory.xml

<HOME NAME="OraGrid19000" LOC="/u01/app/19.0.0.0/grid" TYPE="O" IDX="1" CRS="true"/>

 

/u01/app/19.0.0.0/grid/bin/srvctl add filesystem -device /dev/asm/data-132 -path /data -user oracle -mountowner oracle -mountgroup dba -mountperm 755

 

/u01/app/19.0.0.0/grid/bin/srvctl add filesystem -device /dev/asm/reco-262 -path /reco -user oracle -mountowner oracle -mountgroup dba -mountperm 755

 

/u01/app/19.0.0.0/grid/bin/srvctl add filesystem -device /dev/asm/redo-132 -path /redo -user oracle -mountowner oracle -mountgroup dba -mountperm 755

5.      Start the acfs file system

/u01/app/19.0.0.0/grid/bin/srvctl start filesystem -d /dev/asm/data-132

/u01/app/19.0.0.0/grid/bin/srvctl start filesystem -d /dev/asm/reco-262

/u01/app/19.0.0.0/grid/bin/srvctl start filesystem -d /dev/asm/redo-132

 

 

 

6.      Check the acfs file system status

/u01/app/19.0.0.0/grid/bin/crsctl stat res ora.data.data.acfs ora.data.redo.acfs ora.reco.reco.acfs -t

--------------------------------------------------------------------------------

Name           Target  State        Server                   State details

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.data.data.acfs

               ONLINE  ONLINE       testoda01a              mounted on /data,

                                                             STABLE

               ONLINE  ONLINE       testsoda01b              mounted on /data,

                                                             STABLE

ora.data.redo.acfs

               ONLINE  ONLINE       testoda01a              mounted on /redo,

                                                             STABLE

               ONLINE  ONLINE       testoda01b              mounted on /redo,

                                                             STABLE

ora.reco.reco.acfs

               ONLINE  ONLINE       testoda01a              mounted on /reco,

                                                             STABLE

               ONLINE  ONLINE       testoda01b              mounted on /reco,

                                                             STABLE

 

df -h | grep

/dev/asm/data-132                5.0T   11G  5.0T   1% /data

/dev/asm/reco-262                500G  1.6G  499G   1% /reco

/dev/asm/redo-132                200G 1020M  200G   1% /redo

7.      Downloade gDBclone rpm using below link provided in gDBClone Powerful Database Clone/Snapshot Management Tool (Doc ID 2099214.1)

https://support.oracle.com/epmos/faces/ui/patch/PatchDetail.jspx?parent=DOCUMENT&sourceId=2099214.1&patchId=36589212

8.      Identify DB home to use for clone

/opt/gDBClone/gDBClone.bin listhomes

INFO: 2025-01-07 14:50:50: Please check the logfile '/opt/gDBClone/out/log/gDBClone_2758.log' for more details

 

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

 gDBClone - Version: 3.0.6-18

 Copyright (c) 2012-2024 Oracle and/or its affiliates.

 --------------------------------------------------------

 Author: Ruggero Citton <ruggero.citton@oracle.com>

 RAC Pack, Cloud Innovation and Solution Engineering Team

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

 

Oracle Home Name      Home Location

----------------      ------------

OraDB19000_home1      /u01/app/oracle/product/19.0.0.0/dbhome_1

9.      Create password file which can be used later

/opt/gDBClone/gDBClone.bin syspwf -syspwf /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/orapwMSTR

 

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

 gDBClone - Version: 3.0.6-18

 Copyright (c) 2012-2024 Oracle and/or its affiliates.

 --------------------------------------------------------

 Author: Ruggero Citton <ruggero.citton@oracle.com>

 RAC Pack, Cloud Innovation and Solution Engineering Team

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

Please enter the password to encrypt:

Please re-enter the password to encrypt:

 

SYS password file created as /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/orapwMSTR

10.  Use below command to clone from source database

/opt/gDBClone/gDBClone.bin clone -sdbname cist4.world -sbckloc /orabak5z/tusldoda01a/rman/CIST4  -tdbname mstr -tdbhome OraDB19000_home1 -dataacfs /data -redoacfs /redo -recoacfs /reco -racmod 0 -channels 8 -syspwf /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/orapwMSTR

INFO: 2025-01-07 15:13:06: Please check the logfile '/opt/gDBClone/out/log/gDBClone_75659.log' for more details

NOTE: Here I have used backup based duplication and that is why used parameter sbckloc

 

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

 gDBClone - Version: 3.0.6-18

 Copyright (c) 2012-2024 Oracle and/or its affiliates.

 --------------------------------------------------------

 Author: Ruggero Citton <ruggero.citton@oracle.com>

 RAC Pack, Cloud Innovation and Solution Engineering Team

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

 

 

MacroStep1 - Getting information and validating setup...

INFO: 2025-01-08 14:51:53: Validating environment

INFO: 2025-01-08 14:51:53: Checking superuser usage

INFO: 2025-01-08 14:51:53: Checking 'mstr' target database name

INFO: 2025-01-08 14:51:53: Checking target database home 'OraDB19000_home1' existence

INFO: 2025-01-08 14:51:53: Checking if Oracle Restart

INFO: 2025-01-08 14:51:53: Checking source backup location /orabak5z/tusldoda01a/rman/CIST4...

INFO: 2025-01-08 14:51:53: Getting ORACLE_BASE path from orabase

INFO: 2025-01-08 14:51:53: Checking target database 'mstr' existence

INFO: 2025-01-08 14:51:53: Checking target database 'mstr' registered instance

INFO: 2025-01-08 14:51:55: Checking ACFS snapshot 'mstr' existence under '/data'

INFO: 2025-01-08 14:51:56: Checking listener on 'tuslsoda01:1521'

INFO: 2025-01-08 14:51:56: Checking ACFS options

INFO: 2025-01-08 14:51:56: ...checking if dataacfs '/data' is an ACFS file system

INFO: 2025-01-08 14:51:56: ...checking if redoacfs '/redo' is an ACFS file system

INFO: 2025-01-08 14:51:56: ...checking if recoacfs '/reco' is an ACFS file system

SUCCESS: 2025-01-08 14:51:59: Environment validation complete

 

MacroStep2 - Setting up clone environment...

INFO: 2025-01-08 14:51:59: Creating local pfile

INFO: 2025-01-08 14:51:59: Creating local password file

INFO: 2025-01-08 14:51:59: Creating local Audit folder

INFO: 2025-01-08 14:51:59: Checking local auxiliary listener existence

INFO: 2025-01-08 14:51:59: Creating local auxiliary listener

INFO: 2025-01-08 14:51:59: Starting auxiliary listener

INFO: 2025-01-08 14:51:59: Sleeping 60 secs, please wait...

INFO: 2025-01-08 14:52:59: Setting up ACFS storage

INFO: 2025-01-08 14:52:59: Creating RMAN dynamic scripts

INFO: 2025-01-08 14:53:00: Cloning to target ACFS from backup location '/orabak5z/tusldoda01a/rman/CIST4'

INFO: 2025-01-08 14:53:00: ...creating RMAN duplicate script

INFO: 2025-01-08 14:53:00: ...creating RMAN spfile script

INFO: 2025-01-08 14:53:00: Creating RMAN script for spfile target to ACFS

INFO: 2025-01-08 14:53:00: Instantiating clone database

SUCCESS: 2025-01-08 14:53:00: Environment setup complete

 

MacroStep3 - Cloning database 'cist4.world'...

INFO: 2025-01-08 14:53:00: Database clone from backup in progress, please wait...

INFO: 2025-01-08 14:53:00:    (this can take a while depending on database size and/or network speed)

INFO: 2025-01-08 14:53:00:    (rman spool file '/opt/gDBClone/out/log/rman_clone_79140.log')

INFO: 2025-01-08 16:18:58: Create PFile from SPFile

INFO: 2025-01-08 16:20:15: Register 'mstr' database as cluster resource

INFO: 2025-01-08 16:20:16: Creating password file for 'mstr'

INFO: 2025-01-08 16:20:16: Register ACFS passwordfile '/data/.ACFS/snaps/mstr/MSTR/password/orapwmstr'

INFO: 2025-01-08 16:20:17: Updating SPFile

INFO: 2025-01-08 16:20:20: Updating local pfile

INFO: 2025-01-08 16:20:20: Modifying DB instance

INFO: 2025-01-08 16:20:21: Setup ACFS dependency

WARNING: 2025-01-08 16:20:24: Copy '/u01/app/oracle/product/19.0.0.0/dbhome_1/network/admin/tnsnames.ora' to remote node 'tuslsoda01a' failed

INFO: 2025-01-08 16:20:24: Starting database : mstr

SUCCESS: 2025-01-08 16:20:43: Clone database 'mstr' created successfully

 

INFO: 2025-01-08 16:20:43: Starting database 'mstr'

SUCCESS: 2025-01-08 16:20:44: Successfully created clone database 'mstr'

You have new mail in /var/spool/mail/root

11.   Check new database using tool

/opt/gDBClone/gDBClone.bin listdbs

INFO: 2025-01-08 16:25:16: Please check the logfile '/opt/gDBClone/out/log/gDBClone_75342.log' for more details

 

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

 gDBClone - Version: 3.0.6-18

 Copyright (c) 2012-2024 Oracle and/or its affiliates.

 --------------------------------------------------------

 Author: Ruggero Citton <ruggero.citton@oracle.com>

 RAC Pack, Cloud Innovation and Solution Engineering Team

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

 

Database Name    Database Type   Database Role      Master/Snapshot  Location/Parent

-------------    -------------   -------------      ---------------  ---------------

oemtest          SINGLE          PRIMARY            Master           /u02/app/oracle/oradata

mstr          SINGLE          PRIMARY            Master           /data/.ACFS/snaps/


 

12.  Create a snap db using the tool

/opt/gDBClone/gDBClone.bin snap -sdbname mstr -tdbname dev -tdbhome "OraDB19000_home1" -racmod 0 -syspwf /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/orapwMSTR

 

 

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

 gDBClone - Version: 3.0.6-18

 Copyright (c) 2012-2024 Oracle and/or its affiliates.

 --------------------------------------------------------

 Author: Ruggero Citton <ruggero.citton@oracle.com>

 RAC Pack, Cloud Innovation and Solution Engineering Team

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

 

 

MacroStep1 - Getting information and validating setup...

INFO: 2025-01-08 16:30:23: Checking whether the database 'mstr' is on Exascale

INFO: 2025-01-08 16:30:25: Checking whether the database 'mstr' is on ACFS snapshot

INFO: 2025-01-08 16:30:28: Validating environment...

INFO: 2025-01-08 16:30:28: Superuser usage check

INFO: 2025-01-08 16:30:28: Clusterware running check

INFO: 2025-01-08 16:30:28: Oracle Restart check

INFO: 2025-01-08 16:30:28: Minimum crs activeversion check

INFO: 2025-01-08 16:30:28: Checking source database 'mstr' existence

INFO: 2025-01-08 16:30:28: Checking source database 'mstr' if running

INFO: 2025-01-08 16:30:29: ...checking if target database home 'OraDB19000_home1' exists

INFO: 2025-01-08 16:30:29: Checking source database 'mstr' connectivity

INFO: 2025-01-08 16:30:34: Checking source database 'mstr' and target dbhome version

INFO: 2025-01-08 16:30:39: Checking target database 'dev' name

INFO: 2025-01-08 16:30:39: Checking target database 'dev' existence

INFO: 2025-01-08 16:30:39: Checking target database 'dev' registered instance

INFO: 2025-01-08 16:30:43: Checking target database 'dev' exists as ACFS snapshot in '/data'

INFO: 2025-01-08 16:30:43: Checking if source database 'mstr' is snapable...

INFO: 2025-01-08 16:30:44: ...checking whether the database 'mstr' is entirely on ACFS

INFO: 2025-01-08 16:30:46: ...checking whether the database 'mstr' is a primary/physical standby database.

INFO: 2025-01-08 16:30:47: ...checking whether the database 'mstr' is in rw/ro mode

INFO: 2025-01-08 16:30:50: ...checking whether the database 'mstr' is a multitenant

INFO: 2025-01-08 16:30:55: ...checking whether the database 'mstr' is running as backup mode

INFO: 2025-01-08 16:30:58: ...checking whether the database 'mstr' is running in archivelog mode

INFO: 2025-01-08 16:31:00: ...checking whether all database 'mstr' datafiles are available

INFO: 2025-01-08 16:31:03: ...checking if there are offline datafiles

SUCCESS: 2025-01-08 16:31:05: Environment validation complete

 

MacroStep2 - Getting database ACFS snapshot...

INFO: 2025-01-08 16:31:05: Cloning source database 'mstr' using ACFS snapshot

INFO: 2025-01-08 16:31:21: Entering into SNAP database creation phase 1

INFO: 2025-01-08 16:31:21: ...getting required information to get consistent database snapshot

WARNING: 2025-01-08 16:31:26: Do not perform any structural change to database 'mstr' till snapshot database 'dev' is created

INFO: 2025-01-08 16:31:33: ...getting the snapshot of Database 'mstr' at this time

INFO: 2025-01-08 16:31:33: ...successfully took the ACFS snapshot 'dev' of database 'mstr' on '/data'

INFO: 2025-01-08 16:31:37: ...setting up storage for SNAP Database 'dev'

INFO: 2025-01-08 16:31:50: Entering into SNAP database creation phase 2

INFO: 2025-01-08 16:31:50: ...creating controlfile for database 'dev'

INFO: 2025-01-08 16:32:23: ...recovering the database: dev, snapshot time : '2025-01-08:16:31:33', until 'change:39241811117184'

INFO: 2025-01-08 16:32:34: ...opening the database with resetlogs

INFO: 2025-01-08 16:32:49: ...setting the temporary tablespace for database 'dev'

INFO: 2025-01-08 16:35:06: ...creating spfile for 'dev'

INFO: 2025-01-08 16:35:08: ...Creating pfile for 'dev'

INFO: 2025-01-08 16:35:10: Creating password file for 'dev'

INFO: 2025-01-08 16:35:10: Entering into SNAP database creation phase 3

INFO: 2025-01-08 16:35:19: ...starting database 'dev'

INFO: 2025-01-08 16:35:40: ...successfully started the database

INFO: 2025-01-08 16:35:42: ...setting RMAN SNAPSHOT control file

INFO: 2025-01-08 16:35:47: ...disabling the external references in the database 'dev' inherited from 'mstr'

------------------------------------------------------------------------------

Run on the database 'dev' the SQL script:

 '/u01/app/oracle/product/19.0.0.0/dbhome_1/enable_external_refs_dev_CN5r.sql'

to enable these external references.

Also need to restart the database after running the SQL script.

------------------------------------------------------------------------------

INFO: 2025-01-08 16:37:12: Enabling block change tracking for database 'dev'

INFO: 2025-01-08 16:37:16: Setup ACFS dependency

SUCCESS: 2025-01-08 16:37:20: Snapshot database 'dev' created successfully

INFO: 2025-01-08 16:37:20: Starting database 'dev'

SUCCESS: 2025-01-08 16:37:21: Successfully started clone database 'dev'

Now emphasize in below output where master snap has size of 5.35 TB where as snapshot ccbdev is consuming only 514 GB

 acfsutil snap info /ccbdata

snapshot name:               ccbmstr

snapshot location:           /data/.ACFS/snaps/ccbmstr

RO snapshot or RW snapshot:  RW

parent name:                 /data

snapshot creation time:      Wed Jan  8 14:52:59 2025

file entry table allocation: 8781824   (   8.38 MB )

storage added to snapshot:   5885571432448   (   5.35 TB )

snapshot name:               ccbdev

snapshot location:           /data/.ACFS/snaps/ccbdev

RO snapshot or RW snapshot:  RW

parent name:                 ccbmstr

snapshot creation time:      Wed Jan  8 16:31:33 2025

file entry table allocation: 8781824   (   8.38 MB )

storage added to snapshot:   551938048000   ( 514.03 GB )

    number of snapshots:  2

    kilosnap state:       ENABLED

    snapshot space usage: 6440485769216  (   5.86 TB )

 df -h /data

Filesystem            Size  Used Avail Use% Mounted on

/dev/asm/data-132  9.0T  5.9T  3.1T  66% /data

Please mind that mstr DB size is around 5 TB so ideally if we clone another database out of it /data will run out of space but due to snapshot mechanism it consumes only 514 GB.

I hope this will work as a good strater if you have similar problem in your company.


Happy learning...



When SQL plan baseline is not used

 Thank you very much for your interest. Problem Statement: Lets assume you are reported about an application query running slow in one envir...