This chapter describes the EMCLI commands that can be used to perform PDBaaS fleet operations. It contains the following sections:
Create a Software Image of the Oracle Home with patches/patchsets
emcli db_software_maintenance -createSoftwareImage -input_file="data:"/scratch/input_rac"
where the contents of input_rac
are:
IMAGE_NAME=DbGoldImage
IMAGE_DESCRIPTION=Gold Image for 12c db
REF_TARGET_NAME=ORACLE_HOME
IMAGE_SWLIB_LOC=Oracle Home Provisioning Profiles/12.1.0.2.0/linux_x64
REF_HOST_CREDENTIALS=ZONE_CREDS:TESTSUPERADMIN
WORKING_DIRECTORY=/tmp
STORAGE_TYPE_FOR_SWLIB=OmsShared
STORAGE_NAME_FOR_SWLIB=swlib
VERSION_NAME=Version1
Retrieve the Created Image
To get the id of the newly created image, run the following command:
emcli db_software_maintenance –getImages
Subscribe the PDBaaS Pool to the Newly Created Image
emcli db_cloud_maintenance -subscribeTarget -pool_name=PDB_POOL -pool_type=pdbaas_pool -image_id=438AA95015F34E25E053FB7BB10A9E3B
This command subscribes the PDBaaS pool, the CDB members and the PDBs associated with the CDBs. This is a db_cloud_maintenance operation and not a db_software_maintenance operation.
Verify the PDBaaS Target and Its Subscriptions
To verify the PDBaaS target and its subscriptions, run the following command:
emcli db_software_maintenance -getSubscriptionsForContainer -target_name="RAC Pool" -target_type=pdbaas_pool -image_id=FE55AD7AB28974EFE04313B2F00AD4A0
The PDBaaS pool operations that can be performed by SSA Admin are:
Deploy the Oracle Home from the subscribed image on the targets
emcli db_cloud_maintenance -performOperation -purpose="DEPLOY_DB_SOFTWARE/DEPLOY_RAC_SOFTWARE" -pool_name="PDB_POOL" -pool_type="pdbaas_pool" -name="Deploy Patch OH for Pool" -target_type=oracle_home -description="Deploys the Patched Oracle home on target nodes" -input_file="data:/scratch/data_backup/deployoh.properties"
The contents of the deployoh.properties
are:
NEW_ORACLE_HOME_LIST=/u01/app/oracle/product/patchedHome2
WORK_DIR_LOC=/tmp
DISPATCHER_LOC=/tmp
The following parameters can be added if the prerequisite checks need to be skipped during the Deploy operation:
SKIP_PREREQUISITE_CHECKS=true
SKIP_CVU_CHECK=true
This step retrieves the list of Oracle Homes associated with the CDB members of the pool and creates a new Oracle Home for each, using the software image provided and creates a Oracle Home Lineage.
Migrate the Listeners
Run the following command to migrate the listeners:
emcli db_cloud_maintenance -performOperation -purpose="MIGRATE_LISTENER" -pool_name="PDB_POOL" -pool_type="pdbaas_pool" -name="Migrate Listeners" -description="Migrate the listeners to the new Oracle Home, if any"
Create / Deploy CDB
To create or deploy the CDB, run the following command:
emcli db_cloud_maintenance -performOperation -purpose="DEPLOY_CDB" -pool_name="PDB_POOL" -pool_type="pdbaas_pool" -name="Deploy CDB" -target_type=rac_database -description="Deploy a new CDB on the new OH for every CDB on the Pool using the prefix " -db_prefix="racdb"
This step creates a new CDB for every CDB member of the pool by using the member CDBs structure only template. The new CDBs that are created will use the db_prefix for their names.
emcli db_cloud_maintenance -performOperation -purpose="DEPLOY_CDB" -pool_name="PDB_POOL" -pool_type="pdbaas_pool" -name="Deploy CDB for a given target" -target_type=rac_database -description=" Deploy a new CDB on the new OH for the selected CDB target " -db_name="slspc" -target_list="sales.us.oracle.com"
This step creates a new CDB for the selected CDB member of the pool specified in the target_list option, using its structure only template. The new CDBs that are created will use the db_prefix for their db name.
The CDBs created using this command will be marked as Passive and will be part of the pool’s member list. There will also be a lineage created between the CDBs.
Activate CDB
emcli db_cloud_maintenance -performOperation -purpose="ACTIVATE_CDB" -pool_name="PDB_POOL" -pool_type="pdbaas_pool" -name="Activate the CDBs" -target_type=oracle_database/rac_database -description="Activates the newly created CDBs"
This step marks all the new CDBs in the pool that were created in the above step as Active and the existing CDBs as Inactive. Any further SSA requests will be forwarded to the newly activated CDBs.
emcli db_cloud_maintenance -performOperation -purpose="ACTIVATE_CDB" -pool_name="PDB_POOL" -pool_type="pdbaas_pool" -name="Activate the CDBs" -target_type=oracle_database/rac_database -description="Activates the newly created CDBs" -target_list=”sales.us.oracle.com”
This step the given CDBs in the target_list as Active and is predecessor CDBs as Inactive. Any further SSA requests will be forwarded to the newly activated CDB.
The following operations can be performed by the SSA Admin:
Attach an existing CDB to the pool
emcli db_cloud_maintenance -performOperation -purpose="ATTACH_CDB" -pool_name="PDB_POOL" -pool_type="pdbaas_pool" -name="Attach an existing CDB" -target_type=oracle_database/rac_database -description="Attach an existing CDB as the successor" -destinationCDB="subjects.us.oracle.com" –target_list=”crm.us.oracle.com”
This step will attach the destination CDB as the successor of the member CDB specified in the target_list. This will bypass the Deploy OH, Migrate Listener, Deploy CDB steps and will create the necessary lineage for Oracle home and CDB. The destination CDB should be in the same zone associated with the pool and on the same cluster. The newly attached CDB will be marked as Passive once it has been attached.
Activate the CDB
emcli db_cloud_maintenance -performOperation -purpose="ACTIVATE_CDB" -pool_name="PDB_POOL" -pool_type="pdbaas_pool" -name="Activate the CDBs" -target_type=oracle_database/rac_database -description="Activates the newly created CDBs"
This step marks all the new CDBs in the pool that were created in the above step as Active and the existing CDBs as Inactive. Any further SSA requests will be forwarded to the newly activated CDBs.
emcli db_cloud_maintenance -performOperation -purpose="ACTIVATE_CDB" -pool_name="PDB_POOL" -pool_type="pdbaas_pool" -name="Activate the CDBs" -target_type=oracle_database/rac_database -description="Activates the newly created CDBs" -target_list=”sales.us.oracle.com”
This step marks the specified CDBs in the target_list as Active and is predecessor CDBs as Inactive. Any further SSA requests will be forwarded to the newly activated CDB.
This section lists the Update CDB operations:
Update PDB — SSA Admin
emcli db_cloud_maintenance -performOperation -purpose="UPDATE_PDB" -pool_name="PDB_POOL" -pool_type="pdbaas_pool" -name="Update PDB to new CDB" -target_type=oracle_pdb -description="Relocates the PDB from its inactive CDB to newly active CDB" -target_list="crm.us.oracle.com_SDB1"
The SSA Admin can update a PDB from its predecessor to the newly activated CDB.
Update PDB – SSA User – UI
The SSA User will see an Update Database button on the PDB home page once the new CDB has been activated and is available for update. The SSA User can schedule an update of the PDB with no additional inputs.
Update PDB – SSA User — RESTful API
The SSA can submit a Update PDB request using the RESTful API request.
https://<host>:<port>/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/<requestid> Content-Type: application/oracle.com.cloud.common.PluggableDbPlatformInstance+json Accept: application/oracle.com.cloud.common.PluggableDbPlatformInstance+json Body: { "operation" : "UPDATE_DATABASE", "update_schedule" : "" } Method: POST
The following pool cleanup operations can be performed by the SSA Admin:
Deactivate the CDB
If there are any issues with the newly activated CDB, the SSA Admin can deactivate them and use the old CDB as their member active CDB for new requests until the time the issue is sorted with the new CDB or they are removed from the pool (given that they do not service any PDB’s)
emcli db_cloud_maintenance -performOperation -purpose="DEACTIVATE_CDB" -pool_name="PDB_POOL" -pool_type="pdbaas_pool" -name="Deactivate the CDBs" -target_type=oracle_database/rac_database -description="Deactivates the newly created CDBs"
This step marks all the new CDBs in the pool that were created in the above step as Passive and their predecessor CDBs as Active. Any further SSA requests will be forwarded to the newly activated CDBs.
emcli db_cloud_maintenance -performOperation -purpose="DEACTIVATE_CDB" -pool_name="PDB_POOL" -pool_type="pdbaas_pool" -name="Deativate the CDBs" -target_type=oracle_database/rac_database -description="Deactivates the newly created CDBs" -target_list=”sales.us.oracle.com”
This step the given CDBs in the target_list as Passive and is predecessor CDBs as Active. Any further SSA requests will be forwarded to the newly activated CDB.
Rollback the PDB
In case the PDB update has any issues with the CDB to which it was updated, the admin (and admin only) can do a rollback of the PDB to the CDB that was the predecessor of the currently active CDB.
emcli db_cloud_maintenance -performOperation -purpose=" ROLLBACK_PDB" -pool_name="PDB_POOL" -pool_type="pdbaas_pool" -name="Activate the CDBs" -target_type= oracle_pdb -description="Rolls back the PDB to its parent CDB"
This step rolls back the PDBs associated with the pool to their respective parent CDBs.
emcli db_cloud_maintenance -performOperation -purpose=" ROLLBACK_PDB" -pool_name="PDB_POOL" -pool_type="pdbaas_pool" -name="Activate the CDBs" -target_type= oracle_pdb -description="Rolls back the PDB to its parent CDB" -target_list=”sales.us.oracle.com_FIN”
This step rolls back the given PDBs in the target_list to their parent CDB.