Leveraging Exascale Snapshots and Clones with Oracle Database #JoelKallmanDay

Leveraging Exascale Snapshots and Clones with Oracle Database #JoelKallmanDay

Exascale brings cutting-edge, space-efficient snapshot and cloning functionalities that seamlessly integrate with Oracle Database. This integration removes the need for a test master database when creating snapshots and clones on Exadata. The following sections explore common use cases for utilizing Oracle Database alongside Exascale's snapshot and cloning capabilities.


1. Thin Cloning a Pluggable Database with Exascale Storage

This section explores an efficient method of creating thin clones of Oracle Pluggable Databases (PDBs) that leverage the power of Exascale storage.

1. Creating a Thin Clone

The CREATE PLUGGABLE DATABASE command with the SNAPSHOT COPY option allows you to create a writable clone of an existing PDB. For example, to clone a PDB named pdb1 into a new PDB named pdb2c:


SQL> CREATE PLUGGABLE DATABASE pdb2c FROM pdb1 SNAPSHOT COPY;
        

When Oracle Database utilizes Exascale storage, this command leverages Exascale's native cloning capabilities for thin provisioning. The cloned PDB data files are stored within the same Exascale vault as the source PDB. Exascale's redirect-on-write mechanism ensures:

  • Instantaneous Cloning: The cloning process is swift regardless of the data file size.
  • Space Efficiency: Cloned files initially consume minimal space, and physical storage is allocated only when new data is written.

2. Viewing Cloned Files

The cloned data files are treated as regular files within the Oracle Database and appear in views like 'DBA_DATA_FILES'. For Exascale-specific details, consult the 'V$EXA_FILE' view.

The ESCLI command 'lssnapshots' provides a detailed view of the association between cloned data files and their source files within Exascale storage.

Preventing Standby Replication

Suppose a thin clone is created on an Oracle Data Guard primary database. In that case, the corresponding standby PDB data files will contain a complete (non-thinly provisioned) copy of the data, even with Exascale storage. To prevent this, include STANDBYS=NONE within the CREATE PLUGGABLE DATABASE command:


SQL> CREATE PLUGGABLE DATABASE pdb2c FROM pdb1 SNAPSHOT COPY STANDBYS=NONE;
        

2. Thin Cloning of a Pluggable Database in a Different Container Database

This section explores the technique of creating a writable snapshot copy (clone) of a Pluggable Database (PDB) located in a different Container Database (CDB). The process involves the CREATE PLUGGABLE DATABASE command in conjunction with a database link.

1. Creating a Thin Clone:

To create a clone of a PDB named sample_pdb residing in a CDB called remote_cdb, you can use the following command:


SQL> CREATE PLUGGABLE DATABASE cloned_pdb FROM sample_pdb@remote_cdb_link SNAPSHOT COPY;
        

Here, cloned_pdb is the name of the cloned PDB, and remote_cdb_link is the database link referencing the source PDB's CDB.

2. Thin Cloning with Exascale:

When both CDBs leverage the same Exascale vault, the cloning process takes advantage of Exascale's native functionality to create a thinly provisioned clone. This means the cloned PDB data files reside in the same Exascale vault as the source data files, employing redirect-on-write techniques for space efficiency.

3. Advantages of Thin Cloning:

  • Instantaneous and Space-Saving: The cloning operation is instant, irrespective of the data size. Space is allocated only when new data is written, making it highly space-efficient.
  • Oracle Database Integration: The cloned files function like regular data files within Oracle Database, visible in standard dictionary views such as 'DBA_DATA_FILES'.
  • Exascale Visibility: You can explore Exascale-specific details using the 'V$EXA_FILE' view. The 'lssnapshots' command in ESCLI reveals the association between cloned and source data files.

4. Cloning from a Standby Database:

You can clone a PDB on an Oracle Data Guard standby database, creating efficient test and development environments separate from the primary. This requires temporarily stopping the redo apply on the standby database during the cloning operation.


Steps:

  1. Stop the redo apply on the standby database:

DGMGRL> edit database STANDBY set state='apply-off';
        

  1. Create the PDB clone:

SQL> CREATE PLUGGABLE DATABASE cloned_pdb FROM sample_pdb@standby_link SNAPSHOT COPY;
        

  1. Resume redo apply on the standby database:

DGMGRL> edit database STANDBY set state='apply-on';
        

Note: If a thin clone is created on a primary database, the corresponding standby PDB data files contain a complete (not thinly provisioned) copy of the data. To prevent this, use the STANDBYS=NONE option within the CREATE PLUGGABLE DATABASE command.

This method offers a streamlined approach to creating efficient and space-saving copies of PDBs, enabling flexible development, testing, and data management scenarios.

3. Using a Carousel of Thinly Provisioned Pluggable Database Snapshots

Within Oracle Database, you can create a library of pluggable database (PDB) snapshots, known as a PDB snapshot carousel. A PDB snapshot is a point-in-time copy of a PDB. The source PDB can be open read-only or read/write while the snapshot is created. A PDB snapshot carousel is useful for maintaining a library of recent PDB copies for point-in-time recovery and cloning.

For example, the following command creates a snapshot carousel based on my_pdb where a new snapshot is taken every 2 hours:

SQL> ALTER PLUGGABLE DATABASE my_pdb SNAPSHOT MODE EVERY 2 hours;
        

When Oracle Database uses Exascale storage, the PDB snapshot operation automatically uses native Exascale functionality to snapshot the underlying Oracle Database files. A PDB snapshot carousel based on Exascale storage can contain up to 4096 PDB snapshots. Once the carousel reaches its limit, each new snapshot automatically replaces the oldest snapshot.

The snapshots reside in the same Exascale vault as the underlying source data files, and Exascale uses redirect-on-write techniques to create and maintain the thinly provisioned snapshot data files. As a result, the snapshot operation is instantaneous, regardless of the size of the underlying data files. Also, each snapshot consumes no additional space. Space is only consumed when new data is written to the source PDB or a writable clone based on a snapshot.

Within the Oracle Database, the snapshot data files appear in the standard Oracle Database dictionary views, such as 'DBA_PDB_SNAPSHOTFILE'.

Within Exascale, you can use the 'ESCLI lssnapshots' command to view the association between the snapshots and their underlying source files.

Note:

If you create a thinly provisioned PDB snapshot on an Oracle Data Guard primary database, the snapshot metadata propagates to the standby. However, the snapshot is not accessible at the standby site, even after an Oracle Data Guard role transition (switchover or failover).

To utilize a snapshot from the PDB snapshot carousel as a writable PDB, you must create a clone (snapshot copy) based on the snapshot. For example:

SQL> CREATE PLUGGABLE DATABASE my_pdb_clone FROM my_pdb USING SNAPSHOT my_pdb_snapshotN SNAPSHOT COPY;
        

In the example, if my_pdb_snapshotN identifies a thinly provisioned PDB snapshot on Exascale storage, the new PDB (my_pdb_clone) is also thinly provisioned.

Creating a clone (snapshot copy) based on the PDB snapshot requires access to archived redo log files from the snapshot's time to ensure consistency across the PDB data files.

4. Efficiently Cloning a Container Database with gDBClone and Exascale

Oracle Database provides a comprehensive approach to cloning both pluggable databases (PDBs) and container databases (CDBs), leveraging the capabilities of Exascale storage for enhanced efficiency. While PDB cloning can be achieved through SQL commands, CDB cloning requires a dedicated utility due to the complexity involved in replicating the entire database environment.


The gDBClone utility simplifies this process, offering a flexible and reliable solution for CDB cloning. It leverages Exascale snapshots and clones for space efficiency and speed, enabling you to create CDB copies quickly, regardless of their size.

Here's how you can use gDBClone to create a CDB clone within an Exascale environment:

1. Preparation:

  • Ensure the source CDB is running in ARCHIVELOG mode.
  • Make sure your target CDB has a unique name and configuration settings.

2. Using the gDBClone Utility:

# /opt/gDBClone/gDBClone.bin { clone | snap } -sdbname source_db_name -tdbname target_db_name             
     [ -tdbhome target_db_home ]
     [[[ -sga_max_size size_mb ] [ -sga_target size_mb ]] | -pfile file-name ]
     [ -sdbport source_listener_port ]
     [ -racmod { 0 | 1 | 2 }]
     [ -syspwf sys_password_file ]
     [ -walletpwf wallet_password_file ]
        

Key Options:

  • clone: Creates a full copy of the CDB, which is ideal for migrating databases into Exascale.
  • snap: Creates a space-efficient thin clone within the same Exascale vault, leveraging redirect-on-write techniques.
  • -sdbname: Specifies the source CDB's db_unique_name.
  • -tdbname: Specifies the target CDB's db_unique_name.
  • -tdbhome: Optionally specifies the ORACLE_HOME location for the target CDB.
  • -sga_max_size: Specifies the maximum SGA size for the target CDB.
  • -sga_target: Specifies the nominal SGA size for the target CDB.
  • -pfile: Specifies a file containing parameter settings for the target CDB.
  • -sdbport: Specifies the source CDB listener port.
  • -racmod: Specifies the target CDB configuration (single-instance, One Node, or RAC).
  • -syspwf: Specifies a file containing the encrypted SYS password.
  • -walletpwf: Specifies a file containing the encrypted wallet password for TDE-enabled databases.


Example:

To create a thin clone named THIN from the SOURCE CDB (an Oracle RAC database) within the same Exascale vault:

# /opt/gDBClone/gDBClone.bin snap -sdbname SOURCE -tdbname THIN -racmod 2        

Additional gDBClone Functions:

  • listdbs -tree: Lists databases created with gDBClone and display their relationships.
  • deldb -tdbname THIN: Quickly removes a database.

For a complete list of options and detailed documentation, please see the gDBClone reference at MOS Doc 2099214.1.

Benefits of using gDBClone and Exascale for CDB cloning:

  • Ease of use: The utility requires minimal input.
  • Reliability: Automated procedure minimizes errors.
  • Flexibility: Supports various database configurations and encryption types.
  • Efficiency: Exascale snapshots and clones ensure fast and space-efficient operations.

By leveraging the capabilities of gDBClone and Exascale, you can streamline the creation of CDB clones, simplify database management, and enable efficient resource utilization.


Summary

Oracle Exadata Exascale is a game-changer in cloud data architecture, offering the power of Exadata with the flexibility of the cloud. Integrating Oracle Database with Exascale storage provides a powerful and efficient solution for managing and cloning databases. By leveraging Exascale's native snapshot and cloning capabilities, users can create thin clones of pluggable databases (PDBs) and container databases (CDBs) that are both space-efficient and instantaneous, regardless of the data size. Key benefits of this integration include:

  • Instantaneous Cloning: Cloning operations are swift, regardless of the data file size.
  • Space Efficiency: Cloned files initially consume minimal space, with physical storage allocated only when new data is written.
  • Oracle Database Integration: Cloned files function like regular data files within Oracle Database and are visible in standard dictionary views such as 'DBA_DATA_FILES'.
  • Exascale Visibility: Exascale-specific details can be explored using the 'V$EXA_FILE' view and the 'ESCLI lssnapshots' command.

Using a PDB snapshot carousel further enhances these capabilities by allowing for the maintenance of a library of recent PDB copies for point-in-time recovery and cloning. Additionally, the gDBClone utility simplifies the process of cloning CDBs, offering a flexible and reliable solution that leverages Exascale snapshots and clones for space efficiency and speed. The combination of Oracle Database and Exascale storage provides a comprehensive and efficient solution for database cloning and management, enabling organizations to optimize their database environments and improve resource utilization.

References:

  1. https://docs.oracle.com/en/engineered-systems/exadata-database-machine/exscl/toc.htm
  2. https://www.oracle.com/engineered-systems/exadata/?source=:so:yt:or:awr:ocorp:::1448381467&SC=:so:yt:or:awr:ocorp:::1448381467&pcode=
  3. Oracle MOS Doc 2099214.1
  4. Images are extracted from the presentation "Exadata Exascale: The World’s Only Intelligent Data Architecture for Oracle Cloud."

要查看或添加评论,请登录

Arsalan Dehghanisariyarghan的更多文章

社区洞察

其他会员也浏览了