Friday, June 30, 2023

Oracle Base Database patching to 19.17 using DBCLI

 




OCI - (Oracle Cloud Infrastructure)

Intro

Cloud platforms are booming and many organizations are planning on a cloud journey to get a competitive advantage.  The cloud market is vast, with a diverse selection of services. It's not easy to select a suitable cloud platform for an organization.  There are certain criteria you need to consider when selecting a platform. 

    • Certifications & Standards
    • Technologies & Service Roadmap
    • Data Security, Data Governance, and Business policies
    • Service Dependencies & Partnerships
    • Contracts, Commercials & SLAs
    • Reliability & Performance
    • Migration Support, Vendor Lock-in & Exit Planning
    • Business health & Company profile
    • Cost of the cloud services and License.
    All these factors play a huge role when selecting a cloud platform suited for your system workloads. If your IT infrastructure consists of many Oracle databases,  I would say there is no better place than OCI (Oracle Cloud Infrastructure) to host your workload.  Oracle has been there for the market for a long time and gives immense selection when hosting Oracle workloads. 

    Autonomous selection  :
    • Autonomous Database
    • Autonomous data warehouse
    • Autonomous JSON Database
    • Autonomous Transaction Processing
    Exadata services : 
    • Exadata at Oracle Cloud.
    • Exadata Cloud@Customer
    DB service  selection :
    • Oracle Base Database Service
    VM selection.
    • Bare Metal

    The best part about OCI is they came up with new orchestration tools to standardize and ease the administration work. I have listed down all the orchestration tools and administration work we can perform using the tool.

    • OCI CLI - Oracle Cloud Command Line Interface:
    OCI is a small-footprint tool that makes calls to Oracle Cloud Infrastructure REST APIs using HTTPS requests. It is built with the SDK for Python.
    • dbcli - Database Cli :
    dbcli is a command line tool available on virtual machines and bare metal DB systems (not on Exadata DB systems)
    • cliadm - CLI admin command
    Updates your dbcli tool to get the new commands that support new features added to the cloud services:
    • dbaascli
    dbaasapi is deprecated and replaced by dbaascli. 

    This tool is the command line tool for life-cycle and administration operations for Exadata databases. It must be run on the local Exadata compute node. Many dbaascli commands can be run by the Oracle user. However, some commands require root administrator privileges.

    Summary of the dbaascli tool task ; 
    1. Scale up/down OCPUs in disconnected mode (ExaCC only)
    2. Download and list available software images
    3. Managing pluggable databases (PDBs) – use SQL alternatively
    4. Rotating the TDE master encryption key – use SQL alternatively
    5. Starting and stopping the Oracle Net listener – use lsnrctl alternatively
    6. Managing databases created via dbaasapi (dbaascli) on a subset of the nodes (not recommended)
    • bkup_api
    bkup_api was replaced by dbaascli.

    • exacli
    exacli is the command line for getting storage cell metrics and diagnostics information on Exadata DB systems. 


    In this article, I will illustrate how you can patch the VM machine database system.

    Before running any command you should upgrade the cliadm with the latest patch version.  Upgrading this help you to support the latest features added to cloud services.

    Note: you do not need to worry about staging the patches, oracle will stage the patches in all the environments.

    Upgrade cliadm

    Once you execute the update-dbcli  status can be checked by running dbcli list-jobs command.

    
    
    [root@dbsdpl21 ~]# cliadm update-dbcli
    
    Job details
    ----------------------------------------------------------------
                         ID:  79c1ed97-3b3f-4d35-94e6-b5cba5565ecd
                Description:  DcsCli patching
                     Status:  Created
                    Created:  April 14, 2023 2:54:32 PM UTC
                    Message:  Dcs cli will be updated
    
    Task Name                                                                Start Time                          End Time                            Status
    ------------------------------------------------------------------------ ----------------------------------- ----------------------------------- ----------
    
    

    Validate cliadm upgrade status

    
    
    [root@dbsdpl21 ~]# dbcli list-jobs
    79c1ed97-3b3f-4d35-94e6-b5cba5565ecd     DcsCli patching    Friday, April 14, 2023, 14:54:32 UTC Success
    
    

    Describe the component

    Execute dbcli describe-component command and check what is the latest patch available to apply.

    
    
    [root@dbsdpl21 ~]# dbcli describe-component
    System Version
    ---------------
    21.2.3.0.0
    
    Component                                Installed Version    Available Version
    ---------------------------------------- -------------------- --------------------
    GI                                        19.11.0.0.0           19.18.0.0
    DB                                        19.11.0.0.0           19.18.0.0
    
    

    Describe latest patches

    
    
    [root@dbsdpl21 ~]# dbcli describe-latestpatch
    
    componentType   availableVersion
    --------------- --------------------
    gi              12.2.0.1.230117
    gi              12.1.0.2.230117
    gi              18.16.0.0.0
    gi              19.18.0.0.0
    gi              21.9.0.0.0
    db              11.2.0.4.230117
    db              12.2.0.1.230117
    db              12.1.0.2.230117
    db              18.16.0.0.0
    db              19.18.0.0.0
    db              21.9.0.0.0
    [root@dbsdpl21 ~]#
    
    

    Upgrade database

    Upgrade commands need the database home-id, this can be obtained by running the dbcli list-DB homes. Make sure to clean up the database home folder and gain space before the upgrade.

    Note: I would recommend staying one patch level down (N-1), so you can apply the 19.17.0.0 patch for the database.

    
    
    [root@dbsdpl21 ~]# dbcli list-dbhomes
    
    ID                                       Name                 DB Version                               Home Location                                 Status
    ---------------------------------------- -------------------- ---------------------------------------- --------------------------------------------- ----------
    42935588-54f1-4f08-98cb-5f95d95cb881     OraDB19000_home1     19.11.0.0.0                              /u01/app/oracle/product/19.0.0.0/dbhome_1     Configured
    
    [root@dbsdpl21 ~]#
    
    
    
    
    [root@dbsdpl21 ~]# dbcli update-dbhome -i 42935588-54f1-4f08-98cb-5f95d95cb881 -v 19.17.0.0.0
    {
      "jobId" : "31904f6a-f9b9-498b-8e5f-8ecfab1d6114",
      "status" : "Created",
      "message" : null,
      "errorCode" : "",
      "reports" : [ ],
      "createTimestamp" : "April 14, 2023 15:01:46 PM UTC",
      "resourceList" : [ ],
      "description" : "Database inplace image patching with dbhomeId : 42935588-54f1-4f08-98cb-5f95d95cb881",
      "updatedTime" : "April 14, 2023 15:01:52 PM UTC",
      "percentageProgress" : "0%",
      "cause" : null,
      "action" : null
    }
    [root@dbsdpl21 ~]
    
    

    Upgrade: Status Check

    The upgrade consists of 4 steps.


    • Precheck DBHome patching tasks
    • DBHome patching

    
    
    [root@dbsdpl21 log]# dbcli describe-job -i 31904f6a-f9b9-498b-8e5f-8ecfab1d6114
    
    Job details
    ----------------------------------------------------------------
                         ID:  31904f6a-f9b9-498b-8e5f-8ecfab1d6114
                Description:  Database inplace image patching with dbhomeId : 42935588-54f1-4f08-98cb-5f95d95cb881
                     Status:  Running
                    Created:  April 14, 2023 3:01:46 PM UTC
                   Progress:  99%
                    Message:
                 Error Code:
    
    Task Name                                                                Start Time                          End Time                            Status
    ------------------------------------------------------------------------ ----------------------------------- ----------------------------------- ----------
    Precheck DBHome patching tasks                                           April 14, 2023 3:02:43 PM UTC       April 14, 2023 3:09:53 PM UTC       Success
    DBHome patching                                                          April 14, 2023 3:09:53 PM UTC       April 14, 2023 3:53:46 PM UTC       Success
    Post DBHome patching tasks                                               April 14, 2023 3:53:46 PM UTC       April 14, 2023 3:53:46 PM UTC       Running
    
    [root@dbsdpl21 log]#
    
    

    DB Upgrade: Validate

    Upgrade is

    
    
    [root@dbsdpl21 log]# dbcli describe-job -i 31904f6a-f9b9-498b-8e5f-8ecfab1d6114
    
    Job details
    ----------------------------------------------------------------
                         ID:  31904f6a-f9b9-498b-8e5f-8ecfab1d6114
                Description:  Database inplace image patching with dbhomeId : 42935588-54f1-4f08-98cb-5f95d95cb881
                     Status:  Success
                    Created:  April 14, 2023 3:01:46 PM UTC
                   Progress:  100%
                    Message:
                 Error Code:
    
    Task Name                                                                Start Time                          End Time                            Status
    ------------------------------------------------------------------------ ----------------------------------- ----------------------------------- ----------
    Precheck DBHome patching tasks                                           April 14, 2023 3:02:43 PM UTC       April 14, 2023 3:09:53 PM UTC       Success
    DBHome patching                                                          April 14, 2023 3:09:53 PM UTC       April 14, 2023 3:53:46 PM UTC       Success
    Post DBHome patching tasks                                               April 14, 2023 3:53:46 PM UTC       April 14, 2023 4:19:32 PM UTC       Success
    Install object store swift module                                        April 14, 2023 4:18:54 PM UTC       April 14, 2023 4:19:06 PM UTC       Success
    
    [root@dbsdpl21 log]#
    
    

    Conclusion

    In summary, OCI is getting more mature day by day.  These new orchestration tools ease the life of oracle dba that spending on administration tasks like patching. 

    If you want to learn about server patching refer to my article on Oracle Cloud Infrastructure (OCI) - Part 2: OCI -VM Server and DB Patching.
     

    No comments:

    Post a Comment

    Unified Auditing Housekeeping

      Intro  Data is the new currency. It is one of the most valuable organizational assets, however, if that data is not well...