In this article we shall discuss creating an Oracle Database 18c cloud service instance from a backup. An Oracle Database 18c instance may be created on Oracle Database Cloud Service, as discussed in Using Toad for Oracle with Oracle Database 18c – Part I. A new Oracle Database 18c Cloud Service instance may also be created with database instantiation from cloud-based backup of an Oracle Database Cloud Service database or an on-premises Oracle database. The requirement is that the backup is in the cloud. Instantiating from backup is the process of creating a new Oracle Database Cloud Service instance and replacing its database with a cloud backup of another Oracle Database. The database from which the cloud backup is made is called the “source database”.
This article has the following sections.
Creating an Oracle Database Cloud Service instance
Enabling Access Rules
Accessing EM Console
Obtaining Connection Parameters
Connecting to Instance
Listing Storage Container
Creating an Oracle Database Cloud Service instance
We shall be using a cloud backup of an existing Oracle Database Cloud Service instance to instantiate the database in a new Oracle Database Cloud Service instance. Creating an Oracle Database 18c instance is discussed in Using Toad for Oracle with Oracle Database 18c – Part I. The existing Oracle Database Cloud Service instance is shown in Figure 1. To create the new instance click on Create Instance as also shown in Figure 1.
Figure 1. Create Instance
Specify a unique Instance Name (ORCL18c-2) as shown in Figure 2. The Service Level must be set to Oracle Database Cloud Service, which installs and configures Oracle Database software on Oracle Cloud Virtual Machine using configuration options provided in the wizard. The user does not need to install and configure the database. The Oracle Database Cloud Service – Virtual Image option must not be used, as it only provides an empty virtual image with Oracle Database software tarball on it and database has to be created and configured with user-supplied configuration or with Database Configuration Instance (DBCA).
In Software Release use the same database version as for the source database; Oracle Database 18c. For Software Edition choose at least an edition that supports the options of the source database. We have chosen the same software edition (Enterprise Edition – High Performance) as for the source database. Database Type must be selected as Single Instance. Click on Next as shown in Figure 2.
Figure 2. Instance Basic Information
Next, specify the Instance Details (Figure 3) for the new instance whose database is to be instantiated from a backup. Specify any DB Name that meets the requirements “… up to 8 characters; must begin with a letter and can contain only letters and numbers.” If the DB Name is to be the same as the source DB name it must match case. We have used the same DB Name of ORCL.
Specify PDB Name and Administration Password, for which no additional requirements exist. Set Usable Database Storage (GB) to a value that is at least the Usable Database Storage of the source database. If source database storage is larger than the maximum Usable Database Storage value that may be selected, select the maximum Usable Database Storage value, and after the service instance has been created scale up the data and local backup storage.
In Advanced Settings do not choose the option Include Demos PDB, as the database will be replaced.
In Backup and Recovery Configuration select any of the following three options for Backup Destination:
– Both Cloud Storage and Local Storage
– Cloud Storage Only
The database instance being created from a backup itself does not require creation of a backup. Choose the default URL for Cloud Storage Container and specify Username and Password to the Oracle Cloud service account to create/access the storage container. Select the option Create Cloud Storage Container and specify Estimated Monthly Storage (GB). In the Initialize Data From Backup section set Create Instance from Existing Backup to Yes as shown in Figure 3.
Figure 3. Setting Create Instance from Existing Backup to Yes
A Create Database from Existing Backup popup gets displayed, indicating that you should “Make sure the Usable Database Storage size you provided is large enough to hold the database from the backup.” as shown in Figure 4. Click on OK.
Figure 4. Create Database from Existing Backup Confirmation
As we are using cloud-based backup of a Oracle Database Cloud Service instance in the same Identity Domain, do not select the option On-Premises Backup? The “On-Premises Backup” option does not imply that the backup is on premises; it just implies that the source database is on-premises or in a different Identity Domain. If the option On-Premises Backup is selected the name of an existing Oracle Storage Cloud Service Container must be specified. Select Source Instance Name from the drop-down as ORCL18c-1 as shown in Figure 5. The Backup Tag field is optional and is left blank, as we don’t know the backup tag.
Figure 5. Initialize Data From Backup Settings
Click on Next as shown in Figure 6.
Figure 6. Instance Details>Next
A message indicates that a Cloud Storage Container has been created, as shown in Figure 7. In the Confirmation screen click on Create.
Figure 7. Confirmation > Create
A new Oracle Database Cloud Service instance starts to get created, as shown in Figure 8.
Figure 8. Creating Instance
After the new instance has been created the progress icon (hourglass) gets removed and a Created On timestamp gets added, as shown in Figure 9.
Figure 9. Instance Created
Connecting with the Database Created from a Backup
First, Enable Access Rules as shown in Figure 10.
Figure 10. Enabling Access Rules
Next, obtain the connection parameters; for which, click on the instance link as shown in Figure 11.
Figure 11. Selecting instance
Obtain the connection parameters from the instance details page as shown in Figure 12. The Connection String provides the Service name as the substring after the “/”. The port is also included in the Connection String. The Public IP in the Resources section is the HOST IP.
Figure 12. Obtaining Connection Parameters
To connect to the instance with SQL*Plus run the following command on the Windows OS command line.
sqlplus sys/ORCLfirstname.lastname@example.org:1521/PDB1.a432275.oraclecloud.internal as sysdba
SQL*Plus connects to Oracle Database 18c on Oracle Database Cloud and the SQL> command prompt gets displayed, as shown in Figure 13.
Figure 13. Connecting to Oracle Database 18c with SQL*Plus
The database connected to is a CDB (container database) as indicated by output from following command.SQL> select cdb from v$database;
Oracle Database Cloud Service provides the service name and public IP to the PDB (pluggable database) within the CDB but not the root CDB container itself. Find the container ID, PDB ID and PDB name.
select con_id, dbid, name from v$pdbs;
ThePDB1 container gets listed.
SQL> select con_id, dbid, name from v$pdbs;
In this article we created a Oracle Database Cloud Service instance with database initialized from a cloud backup of another Oracle Database Cloud Service instance. The Oracle Database 18c instantiated from a backup may be used with Toad for Oracle just as an Oracle Database 18c created in the first instance as discussed in Using Toad for Oracle with Oracle Database 18c – II.