Query on RDS DB Snapshot

0

Hi, We have Oracle multitenant architecture on RDS and have DB snapshots taken from time to time. How can I know , what all PDB's are present in a DB snapshot? Also, is it possible to restore a single PDB from the DB snapshot?

asked 3 months ago177 views
2 Answers
0
Accepted Answer

Hi,

To find the PDB (tenant databases) in a snapshot, you can use the CLI command describe-db-snapshot-tenant-databases. This command only applies to RDS for Oracle DB instances in the multi-tenant configuration.You can use this command to inspect the tenant databases within a snapshot before restoring it.

https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBSnapshotTenantDatabases.html

On your second question on whether it is possible to restore a single PDB from the DB snapshot, you can't directly interact with the tenant databases in a CDB snapshot that uses the multi-tenant architecture configuration. If you restore the DB snapshot, you restore all its tenant databases. You can find more details on these in the below link as well.

https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Oracle.Concepts.single-tenant.snapshots.html#br-cdb.db-snapshots

Hope it helps and if it does, I would appreciate if answer can be accepted so that community can benefit for clarity when searching for similar enquirers in Repost, thank you.

AWS
answered 3 months ago
profile picture
EXPERT
reviewed 3 months ago
0

Hi, To identify the PDBs within a DB snapshot and restore a single PDB, you can utilize the following methods:

  1. Using the Oracle Database Console:

List PDBs in a Snapshot: Log in to the Oracle Database Console. Navigate to the "Database" tab. Select the desired DB snapshot. Click on the "Open" button. The list of PDBs contained within the snapshot will be displayed. Restore a Single PDB: Right-click on the desired PDB. Select the "Restore" option. Follow the on-screen instructions to complete the restore process. 2. Using SQL Plus:

List PDBs in a Snapshot: Connect to the DB snapshot using SQL Plus: SQL SQLPLUS / AS SYSDBA

Execute the following query: SQL SELECT PDB_NAME FROM V$PDB;

Restore a Single PDB: Use the ALTER DATABASE OPEN RESETLOGS RENAME PDB <old_pdb_name> TO <new_pdb_name> command to create a new PDB with the same structure as the original PDB in the snapshot. Use the ALTER PLUGGABLE DATABASE <new_pdb_name> PLUGIN FROM <snapshot_name> command to plug in the PDB from the snapshot into the newly created PDB. 3. Using Oracle RMAN:

List PDBs in a Snapshot: Connect to RMAN: SQL RMAN TARGET / AS SYSDBA

Execute the following command: SQL LIST BACKUP OF DATABASE;

Look for the snapshot in the output and identify the PDBs using the PDB_NAME column. Restore a Single PDB: Use the RESTORE DATABASE FROM BACKUP SET <backup_set_name> PDB_NAME <pdb_name> command to restore the specific PDB from the snapshot. Note:

Ensure that you have the necessary permissions to perform these operations. It's recommended to create a backup of the target database before restoring a PDB to avoid data loss in case of issues.

answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions