Sergey
Sergey

Reputation: 167

How to clone PDB for Snapshot Carousel in 18c

Friends!

I have an Oracle Database 18c with Data Guard configuration:

DGMGRL> show configuration;

Configuration - CDB_DG

  Protection Mode: MaxPerformance
  Members:
  cdb1p - Primary database
  cdb2p - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 55 seconds ago)

SQL> select banner from v$version;

BANNER
---------------------------------------------------------------------------
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production

SQL> SELECT PROPERTY_NAME, PROPERTY_VALUE FROM DATABASE_PROPERTIES WHERE  PROPERTY_NAME = 'LOCAL_UNDO_ENABLED';

PROPERTY_NAME             PROPERTY_V
------------------------- ----------
LOCAL_UNDO_ENABLED        TRUE

It's a CDB with one PDB. My OS is RedHat 7.

When I try to create Snapshot DB from my PDB I have these errors:

SQL> alter pluggable database snapshot PDBSNAP;
alter pluggable database snapshot PDBSNAP
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-65169: error encountered while attempting to copy file +ASM_CDB_DATA/CDB1P/7533D1D42D885BD1E053465A130A97EE/DATAFILE/undotbs1.271.986139369
ORA-17517: Database cloning using storage snapshot failed on file 8:+ASM_CDB_DATA/CDB1P/7533D1D42D885BD1E053465A130A97EE/DATAFILE/undotbs1.271.986139369

I read about parameter CLONEDB (= TRUE) and about permissions for asmadmin:x:1308:grid,oracle in /etc/group file..

Unfortunately, it doesn't help me.. Friends, maybe somebody has resolved this problem?

Maybe, it's all about snapshot clone restrictions, but I'm not sure:

Supported platforms
– Sun ZFS Storage Appliance (ZFSSA)
– Oracle ASM Cluster File System (ACFS)
– NetApp ™

Upvotes: 0

Views: 1374

Answers (2)

Joseph Santaniello
Joseph Santaniello

Reputation: 199

The answer given by user11051512 worked for me as well. I will try to clarify, as it was a little difficult to understand as written:

Snapshots only work on certain filesystems, such as ACFS, not directly in ASM. So to use snapshot functionality in an ASM-based setup, you need to create an ACFS filesystem where the database files will live. The ACFS filessystem uses ASM as it's backing store.

  1. Create a volume in asm (with asmcmd): volcreate -G data -s 50G volume1
  2. Make a mount point: mkdir /acfs
  3. Make a an acfs filesystem on the asm device: mkfs.acfs /dev/asm/volume-whatver
  4. Mount the device: mount.acfs /dev/asm/volume-whatver /acfs
  5. Make a director and give it to your oracle/database user: mkdir /acfs/data && chown.. etc
  6. In your CDB (you need to have created it with "-useOMF false": alter system set db_create_file_dest='/acfs/data';
  7. Create a pluggable db: create pluggable database master admin user master identified by master;
  8. Look at datafiles: select name from v$datafile;
  9. alter the new pdb to read write so it gets registered. Then close it again, and open read only.
  10. NOW finally we can do a snapshot copy:
SQL> create pluggable database test1 from master snapshot copy;

Pluggable database created.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 MASTER                         READ ONLY  NO
         4 TEST1                          MOUNTED
SQL>

Upvotes: 1

user11051512
user11051512

Reputation:

ERROR at line 1: ORA-00604: error occurred at recursive SQL level 1 ORA-65169: error encountered while attempting to copy file +DATA/ORCL_IAD1T9/87BD77B686294076E0530200000A3FB4/DATAFILE/undotbs1.282.1006941 741 ORA-17517: Database cloning using storage snapshot failed on file 8:+DATA/ORCL_IAD1T9/87BD77B686294076E0530200000A3FB4/DATAFILE/undotbs1.282.10069 41741


for the above issue i got the solution.

i solution which helped my is pdb snapshot clone can be created only if the pdb on ACFS or DNFS and other storage. but i should not be on ASM storage. it will work only if ACFS is there on top of ASM storage.

once you create the ACFS change the db_create_file_dest to new ACFS mount point then file alter pluggable database snapshot command of taking the snapshot.

for more info please follow the below public urls

https://docs.oracle.com/en/database/oracle/oracle-database/18/multi/cloning-a-pdb.html#GUID-E4EAE488-5371-4B8A-A839-2ADFA7507705

https://www.cyberciti.biz/faq/creating-soft-link-or-symbolic-link/

Thanks.

Upvotes: 1

Related Questions