27 PDBaaS Fleet Operations

This chapter describes the EMCLI commands that can be used to perform PDBaaS fleet operations. It contains the following sections:

Preparing and Subscribing to the Software Image (SSA Admin)

To prepare and subscribe to the software image, follow these steps:
  • 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

PDBaaS Pool Operations Performed by SSA Admin (Option 1)

The PDBaaS pool operations that can be performed by SSA Admin are:

  • Deploy the Oracle Home from the subscribed image on the targets

    Note:

    Ensure you have set the root credentials for the database pool. Set the privileged delegation for the particular host mentioned in the database pool throughout the zone.

    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.yourcompany.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.yourcompany.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.

PBaaS Pool Operations Performed by SSA Admin (Option 2)

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.yourcompany.com" –target_list=”crm.yourcompany.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.yourcompany.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.

Update CDB (SSA Admin and SSA User Operations)

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.mycompany.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
    

PDBaaS Pool Cleanup Operations - SSA Admin

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.yourcompany.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.yourcompany.com_FIN”

    This step rolls back the given PDBs in the target_list to their parent CDB.

As part of PDBaaS Fleet Maintenance operations, the new Oracle Home(s) (OH) and new Container Database(s) (CDBs) are deployed.

The individual PDB instances, which are patched, are relocated to these newly deployed CDBs. After all the PDBs in a CDB are patched, the old CDB needs to be deleted for reclaiming the resources. This removal of old CDBs and old OHs post completion of a patching cycle can be achieved using an automated operation, the PDBaaS Fleet Maintenance 'CLEANUP' operation.

The pool cleanup operations are:

  • CLEANUP with –reportOnly flag

    The -reportOnly option provides a report of eligible CDB(s) and Oracle Home(s) to be removed as part of next CLEANUP operation.

    emcli db_cloud_maintenance -performOperation -purpose="CLEANUP" -pool_name="poolname" -pool_type="pdbaas_pool" -name="Cleanup CDBs and Homes" -description="Only show a CLEANUP report" -reportOnly=true

    Table 27-1 Categories of Report Formats

    Category Description

    Container Database(s) (CDBs) eligible for cleanup

    Lists the CDBs that are deleted by next ‘CLEANUP’ operation

    Oracle Home(s) (OHs) eligible for cleanup

    Lists the OHs that are deinstalled by next ‘CLEANUP’ operation

    CDB(s) not eligible for cleanup

    Lists the CDBs that are not deleted by next ‘CLEANUP’ operation due to presence of one or more PDBS

    Reverse-engineering Knowledge Module JDE Enterprise One DB2 UDB

    Integration Knowledge Module JDE Enterprise One Control Append (UBE)

    Ineligible Home(s) for cleanup

    Lists the OHs that are not deinstalled by next ‘CLEANUP’ operation due to presence on one or more associated DB/CDBs

  • CLEANUP

    The CLEANUP operation when initiated performs actual deletion/deinstall of eligible CDB/OH targets as shown in the CLEANUP report.

    emcli db_cloud_maintenance -performOperation -purpose="CLEANUP" -pool_name="Pluggable Database Pool" -pool_type="pdbaas_pool" -name="Cleanup CDBs and Homes" -description="Show CLEANUP report and submit CLEANUP operation"

    Note:

    Before initiating the CLEANUP operation, ensure to generate and review the CLEANUP report using –reportOnly=true to show only the report.
  • CLEANUP with -target_list

    The target_list option is used for deletion of a specific CDB target which is eligible for ‘CLEANUP’ operation. In this case, target_type is oracle_database or rac_database.

    emcli db_cloud_maintenance -performOperation -purpose="CLEANUP" -pool_name="poolname" -pool_type="pdbaas_pool" -target_list="cdbtemp" -target_type='oracle_database' -name="Cleanup CDBs and Homes" -description="CLEANUP for CDB target" -reportOnly=true

    The –reportOnly flag is used to check if target CDB is eligible for CLEANUP or not.