RestAPI for Oracle DBaaS Cookbook

Hello Friends,

Great news that I wanted to share with you all!!! I am delighted to announce the launch of my first Oracle technical book named “RestAPI for Oracle DBaaS Cookbook”. 

This book authored by myself (Hariprasath Rajaram, Cloud OCP on DBAAS),  Skant Gupta (Oracle Certified Master) and Stuti Kaushal (Oracle Certified Associate)  describe the hands-on guide imparting practical working knowledge and guidance of RestAPI concepts.

The Target Audience

The primary target audience are Oracle DBAs and Oracle Cloud DBA’s (DBaas). This book has been diligently planned for all levels of DBA experts. Coming right from the real-world practicing DBA’s, this book is written as a hands-on guide imparting practical working knowledge and guidance of RestAPI concepts.

What this book covers

Chapter 1, Introduction to RestAPI covers the Fundamentals of RestAPI, verbs, methods and status codes.

Chapter 2, Access Rules discusses the method of creating a rule, viewing a rule, enabling a rule, disabling a rule and deleting an access rule using RestAPI in Oracle Database Cloud Service.

Chapter 3, Backup and Recovery discusses method to start a backup operation, viewing all backup operations, starting a recovery operation and viewing all recovery operations.

Chapter 4, Patches illustrates the details about various operations being performed on Oracle Database Cloud patches using RestAPI

Chapter 5, Service Instances gives an overview on the usage of Oracle Database Cloud Service instances using various RestAPI methods

Chapter 6, Snapshots discusses the procedure of creating, viewing and deleting a snapshot in database using RestAPI

Chapter 7, SSH Keys describes usage of Oracle Database Cloud service RestAPI to create and manage database endpoints to view and manage Secure Shell (SSH) public keys of a Database

This book is available on Paperback, Kindle Edition and PDF version.

RestAPI for Oracle DBaaS Cookbook-Paperback

  
BUY ON AMAZON   https://www.amazon.com/dp/1731311249/

Co-Author’s

Special thanks for Skant Gupta for initiated the writing of this book and helped me to complete it on time successfully along with Stuti Kaushal.

Skant Gupta
Stuti Kaushal
RestAPI for Oracle DBaaS Cookbook-Kindle Edition
BUY ON AMAZON   https://www.amazon.in/dp/B07L2C5GKH/

Family Members

Special thanks to my wife and son who have patience during this time and helped me to complete this book. Without your support, i would not have completed this!!!

Doyensys Team

Thanks Somu Chockalingam, president of Doyensys Inc, for his encouragement and motivation to complete this book successfully. Thanks to all Doyensys DBA team who has supported me during this journey. Special Thanks To Marimuthu Pandu

Aioug Chennai Chapter Team

Thanks for overall support and guidance from AIOUG team, especially Hariharaputhran and Harish for their support.

Hariharaputhran Vaithinathan
Harish Panduranga Rao
Justin Michael Raj
Veeratteshwaran Sridhar

 

Sincerely,
Hariprasath Rajaram
Oracle DBA Senior Consultant,
Doyensys Inc.Chennai,
India
Catch Me On:- Hariprasath Rajaram

Telegram:https://t.me/joinchat/I_f4DkeGfZsxfzXxHD6gTg
LinkedIn:https://www.linkedin.com/in/hari-prasath-aa65bb19/
Facebook:https://www.facebook.com/HariPrasathdba
FB Group:https://www.facebook.com/groups/894402327369506/
FB Page: https://www.facebook.com/dbahariprasath/?
Twitter: https://twitter.com/hariprasathdba

Oracle 18c-Rman Duplication of a PDB To Another CDB

Oracle 18c-Rman Duplication of a PDB To Another CDB

Description:-

  • In this article we are going to see Oracle 18c-Rman Duplication of a PDB To Another CDB
  • It is Available from Oracle 18c

Restrictions on Duplicating PDBS

  • Only active database duplication is supported.
  • Only the following clauses of the DUPLICATE command are supported: NORESUME, DB_FILE_NAME_CONVERT, SECTION SIZE, and USING COMPRESSED BACKUPSET.
  • The following clauses of the DUPLICATE command are not supported: SPFILE, NO STANDBY, FARSYNC STANDBY, and LOG_FILE_NAME_CONVERT.
  • Duplicating a PDB to a CDB that is a standby database is not supported.
    Only one PDB can be duplicated at a time.
  • Partial PDB duplication is not supported, only complete PDB duplication is supported. For example, you cannot include or exclude specific tablespaces while duplicating a PDB.
  • Duplicating a non-CDB as a PDB in an existing CDB is not supported.
  • Duplicating PDBs that contain TDE-encrypted tablespaces is not supported.

Environment Details

Let’s start the Demo:-

Step1:-Prerequisites for active database duplication

Check PDB status on Source side (TESTDB)

SQL> show pdbs

CON_ID         CON_NAME             OPEN MODE          RESTRICTED
---------- --------------------    ----------          ----------
2              PDB$SEED            READ ONLY                 NO
3              PDB2                READ WRITE                NO
4              PDB1                READ WRITE                NO
5              PDB2_COPY           READ WRITE                NO
6              PDB3                READ WRITE                NO

Check PDB status on Target side (DEVDB)

SQL> show pdbs

CON_ID        CON_NAME     OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2            PDB$SEED     READ ONLY      NO
3            DEVPDB2      READ WRITE     NO
4            DEVPDB1      READ WRITE     NO

Creating table for Testing After the clone we will verify the table

[oracle@testdb ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 18.0.0.0.0 Production on Tue Jul 3 08:49:28 2018
Version 18.1.0.0.0
Copyright (c) 1982, 2017, Oracle. All rights reserved.
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.1.0.0.0

SQL> alter session set container=pdb2;
Session altered.

SQL> create table india (no number);
Table created.

SQL> insert into india values(1);
1 row created.

SQL> commit;
Commit complete.

Step2:-Create the directories that store the duplicate database files on the destination CDB (DEVDB)

[oracle@devdb ~]$ mkdir -p /u02/app/oracle/oradata/devdb/devpdb3/
[oracle@devdb ~]$ mkdir -p /u01/devpdb3
[oracle@devdb ~]$ sqlplus '/as sysdba'

SQL*Plus: Release 18.0.0.0.0 Production on Tue Jul 3 08:48:39 2018
Version 18.1.0.0.0
Copyright (c) 1982, 2017, Oracle. All rights reserved.
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.1.0.0.0

SQL> alter system set remote_recovery_file_dest='/u01/devpdb3';
System altered.

SQL> exit
Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.1.0.0.0

Step3:-Establish Oracle net connectivity between the source CDB and the destination CDB

[oracle@testdb ~]$ tnsping devdb
TNS Ping Utility for Linux: Version 18.0.0.0.0 - Production on 03-JUL-2018 08:58:54
Copyright (c) 1997, 2017, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/18.0.0/dbhome_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = devdb.compute-604179528.oraclecloud.internal)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = devdb.604179528.oraclecloud.internal)))
OK (0 msec)

[oracle@devdb ~]$ tnsping testdb
TNS Ping Utility for Linux: Version 18.0.0.0.0 - Production on 03-JUL-2018 08:59:47
Copyright (c) 1997, 2017, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/18.0.0/dbhome_1/network/admin/sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = testdb.compute-604179528.oraclecloud.internal)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = testdb.604179528.oraclecloud.internal)))
OK (0 msec)

Step4:-start the Rman Duplication of a PDB To Another CDB

[oracle@testdb ~]$ rman target sys/Chennai#123@testdb auxiliary sys/Chennai#123@devdb

Recovery Manager: Release 18.0.0.0.0 - Production on Tue Jul 3 08:50:40 2018
Version 18.1.0.0.0
Copyright (c) 1982, 2018, Oracle and/or its affiliates. All rights reserved.
connected to target database: TESTDB (DBID=2763264412)
connected to auxiliary database: DEVDB (DBID=885182715)

RMAN> DUPLICATE PLUGGABLE DATABASE PDB2 as DEVPDB3 TO DEVDB DB_FILE_NAME_CONVERT('/u02/app/oracle/oradata/testdb/PDB2/','/u02/app/oracle/oradata/devdb/devpdb3/') FROM ACTIVE DATABASE SECTION SIZE 400M;

Starting Duplicate PDB at 03-JUL-18
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=4 device type=DISK
current log archived
contents of Memory Script:
{
set newname for datafile 22 to
"/u02/app/oracle/oradata/devdb/devpdb3/system01.dbf";
set newname for datafile 23 to
"/u02/app/oracle/oradata/devdb/devpdb3/sysaux01.dbf";
set newname for datafile 24 to
"/u02/app/oracle/oradata/devdb/devpdb3/undotbs01.dbf";
restore
from nonsparse section size
400 m clone foreign pluggable database
"PDB2"
from service 'testdb' ;
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 03-JUL-18
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service testdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring section 1 of 1
channel ORA_AUX_DISK_1: restoring foreign file 22 to /u02/app/oracle/oradata/devdb/devpdb3/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:16
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service testdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring section 1 of 2
channel ORA_AUX_DISK_1: restoring foreign file 23 to /u02/app/oracle/oradata/devdb/devpdb3/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:16
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service testdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring section 2 of 2
channel ORA_AUX_DISK_1: restoring foreign file 23 to /u02/app/oracle/oradata/devdb/devpdb3/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service testdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring section 1 of 1
channel ORA_AUX_DISK_1: restoring foreign file 24 to /u02/app/oracle/oradata/devdb/devpdb3/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 03-JUL-18
current log archived
contents of Memory Script:
{
set archivelog destination to '/u01/devpdb3';
restore clone force from service 'testdb'
foreign archivelog from scn 4198374;
}
executing Memory Script
executing command: SET ARCHIVELOG DESTINATION
Starting restore at 03-JUL-18
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting archived log restore to user-specified destination
archived log destination=/u01/devpdb3
channel ORA_AUX_DISK_1: using network backup set from service testdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=15
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to user-specified destination
archived log destination=/u01/devpdb3
channel ORA_AUX_DISK_1: using network backup set from service testdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=16
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 03-JUL-18
Performing import of metadata...
Finished Duplicate PDB at 03-JUL-18

RMAN> exit

Step5:-Ensure that the destination CDB is open in read-write mode.

SQL> show pdbs

CON_ID            CON_NAME          OPEN MODE RESTRICTED
----------       -----------        ---------    ----------
2                   PDB$SEED       READ ONLY        NO
3                   DEVPDB2        READ WRITE       NO
4                   DEVPDB1        READ WRITE       NO
5                   DEVPDB3        READ WRITE       NO

Check the Table

SQL> alter session set container=DEVPDB3;

Session altered.

SQL> select * from india;

NO
----------
1

Successfully completed the  Rman Duplication of a PDB To Another CDB

Reference:-

https://docs.oracle.com/en/database/oracle/oracle-database/18/bradv/rman-duplicating-databases.html#GUID-9E630E2C-3D1B-4594-B738-4B5B43E50C58

Catch Me On:- Hariprasath Rajaram

LinkedIn:https://www.linkedin.com/in/hari-prasath-aa65bb19/
Facebook:https://www.facebook.com/HariPrasathdba
FB Group:https://www.facebook.com/groups/894402327369506/
FB Page: https://www.facebook.com/dbahariprasath/?
Twitter:  https://twitter.com/hariprasathdba