Friday, November 29, 2024

Exacs database creation using dbaascli

 







Intro

OCI (Oracle Cloud Infrastructure) provides robust automation capabilities for routine maintenance tasks such as patching, creating database homes, and server OS updates. Oracle further simplifies these tasks by handling the staging process, reducing the administrative burden.

Additionally, Oracle has introduced several tools to streamline maintenance and management tasks, including:

  • dbaascli
  • exacli
  • dbcli
  • exadbcpatchmulti
  • dbaascli is a command-line utility for managing Oracle Database Cloud Services (DBaaS) instances. Mainly for Oracle Exadata cloud services. It provides several features to administer Oracle databases running on Oracle Cloud Infrastructure (OCI). This tool allows users to perform various administrative tasks like backup and recovery, patching, scaling, and checking the status of the database environment.

    Key Features of dbaascli:

    1. Backup and Restore:

      • Manage and schedule backups.
      • Perform on-demand backups.
      • Restore the database from backups.
    2. Patching:

      • Apply database patches.
      • Check for available patches.
      • Rollback patches if necessary.
    3. Database Management:

      • Start and stop databases.
      • Perform database health checks.
      • Manage Data Guard configurations (for high availability and disaster recovery).
    4. Storage Management:

      • Resize the database storage as required.
    5. Diagnostic Tools:

      • Collect diagnostic information to troubleshoot issues.
      • Generate diagnostic logs for support cases.
    As a DBA, it's essential to start utilizing these orchestration tools to streamline and simplify your tasks. These tools make database management more efficient by automating key processes. With dbaascli, for example, DBAs no longer need to manually download and copy binary files to servers—dbaascli will automatically download the latest binaries, making the entire process faster and smoother.

    In this article, I will demonstrate how to create a database using dbaascli.

    Note: Creating a non-CDB database is not supported via the console. The only way to create a non-CDB database is through the backend.

    Step 1: Identify the Database Home


    First, identify and note down the Database Home associated with the version you want to use for creating the database.

    For this example, since I want to create a database using the 19c home, I will record the path for the 19c Database Home.

    
    
    [root@exadevdb-node01 ~]# dbaascli dbhome info
    DBAAS CLI version 24.3.2.0.0
    Executing command dbhome info
    [INFO] [DBAAS-14011] - The usage of this command is deprecated.
       ACTION: It is recommended to use 'dbaascli dbHome getDetails or dbaascli system getDBHomes' for this operation.
    Enter a homename or just press enter if you want details of all homes
    
    1.HOME_NAME=OraHome1
      HOME_LOC=/u02/app/oracle/product/19.0.0.0/dbhome_1
      VERSION=19.24.0.0
      PATCH_LEVEL=19.24.0.0.0
      DBs installed=
       OH Backup=NOT Configured
    
    2.HOME_NAME=OraHome3
      HOME_LOC=/u02/app/oracle/product/11.2.0/dbhome_1
      VERSION=11.2.0.4
      PATCH_LEVEL=11.2.0.4.231017
      DBs installed=TEST
       Agent DB IDs=ec3f0396-d79d-450f-a9b3-aaae88b37c56
     OH Backup=NOT Configured
    
    [root@exadevdb-node01 ~]#
    
    
    

    To retrieve the DB home information, you can use the latest dbaascli command:

    
    dbaascli system getDBHomes
    
    This output will be a Jason output
    
    
    [root@exadevdb-node01 ~]# dbaascli system getDBHomes
    DBAAS CLI version 24.3.2.0.0
    Executing command system getDBHomes
    Job id: 1530c019-99c4-467d-9b2f-be3a2b5d3cd0
    Session log: /var/opt/oracle/log/system/getDBHomes/dbaastools_2024-09-30_03-45-24-PM_342051.log
    {
      "OraHome1" : {
        "homePath" : "/u02/app/oracle/product/19.0.0.0/dbhome_1",
        "homeName" : "OraHome1",
        "version" : "19.24.0.0.0",
        "createTime" : 1724441733874,
        "updateTime" : 1724683497105,
        "unifiedAuditEnabled" : false,
        "ohNodeLevelDetails" : {
          "exadevdb-node02" : {
            "nodeName" : "exadevdb-node02",
            "version" : "19.24.0.0.0",
            "patches" : [ "34697081", "36538667", "36414915", "36587798", "36582781" ]
          },
          "exadevdb-node01" : {
            "nodeName" : "exadevdb-node01",
            "version" : "19.24.0.0.0",
            "patches" : [ "34697081", "36538667", "36414915", "36587798", "36582781" ]
          }
        },
        "messages" : [ ]
      },
      "OraHome2" : {
        "homePath" : "/u02/app/oracle/product/19.0.0.0/dbhome_2",
        "homeName" : "OraHome2",
        "version" : "19.24.0.0.0",
        "createTime" : 1724680153103,
        "updateTime" : 1724692594136,
        "unifiedAuditEnabled" : false,
        "ohNodeLevelDetails" : {
          "exadevdb-node02" : {
            "nodeName" : "exadevdb-node02",
            "version" : "19.24.0.0.0",
            "patches" : [ "34697081", "36538667", "36414915", "36587798", "36582781" ]
          },
          "exadevdb-node01" : {
            "nodeName" : "exadevdb-node01",
            "version" : "19.24.0.0.0",
            "patches" : [ "34697081", "36538667", "36414915", "36587798", "36582781" ]
          }
        },
        "messages" : [ ]
      },
      "OraHome3" : {
        "homePath" : "/u02/app/oracle/product/11.2.0/dbhome_1",
        "homeName" : "OraHome3",
        "version" : "11.2.0.4.231017",
        "createTime" : 1724683333257,
        "updateTime" : 1727708629760,
        "unifiedAuditEnabled" : false,
        "ohNodeLevelDetails" : {
          "exadevdb-node02" : {
            "nodeName" : "exadevdb-node02",
            "version" : "11.2.0.4.231017",
            "patches" : [ "25139545", "33613829", "33991024", "35638387", "22291453", "30432076", "31335037", "32327201", "32558369", "34006614", "34533061", "34698179", "35099667", "35220732", "35239280", "35313335", "35685663", "32224895", "22366322", "31228670", "21289564", "35574089" ]
          },
          "exadevdb-node01" : {
            "nodeName" : "exadevdb-node01",
            "version" : "11.2.0.4.231017",
            "patches" : [ "25139545", "33613829", "33991024", "35638387", "22291453", "30432076", "31335037", "32327201", "32558369", "34006614", "34533061", "34698179", "35099667", "35220732", "35239280", "35313335", "35685663", "32224895", "22366322", "31228670", "21289564", "35574089" ]
          }
        },
        "messages" : [ ]
      },
      "OraHome4" : {
        "homePath" : "/u02/app/oracle/product/19.0.0.0/dbhome_3",
        "homeName" : "OraHome4",
        "version" : "19.24.0.0.0",
        "createTime" : 1724695480172,
        "updateTime" : 1727709224645,
        "unifiedAuditEnabled" : false,
        "ohNodeLevelDetails" : {
          "exadevdb-node02" : {
            "nodeName" : "exadevdb-node02",
            "version" : "19.24.0.0.0",
            "patches" : [ "34697081", "36538667", "36414915", "36587798", "36582781" ]
          },
          "exadevdb-node01" : {
            "nodeName" : "exadevdb-node01",
            "version" : "19.24.0.0.0",
            "patches" : [ "34697081", "36538667", "36414915", "36587798", "36582781" ]
          }
        },
        "messages" : [ ]
      }
    }
    
    dbaascli execution completed
    [root@exadevdb-node01 ~]#
    
    

    Create a database using dbaascli commands


    Here is a sample command to create the database. For detailed information, refer to the Oracle documentation at:  Using dbaascli for Exadata Database Service

    Since we are creating a non-container database, the createAsCDB parameter is set to false.

    
    
    /bin/dbaascli database create \
    --dbname SYNPOC \
    --dbUniqueName SYNPOC_EXA \
    --dbSID SYNPOC1 \
    --createAsCDB false \
    --dbCharset AL32UTF8 \
    --dbNCharset AL16UTF16 \
    --sgaSizeInMB 4096 \
    --pgaSizeInMB 1024 \
    --oracleHome /u02/app/oracle/product/19.0.0.0/dbhome_1 \
    --oracleHomeName OraHome1 \
    --tdeConfigMethod FILE \
    --executePrereqs no
    
    

    Sample log output

    
    
    [root@exadevdb-node01 ~]# /bin/dbaascli database create \
    > --dbname SYNPOC \
    > --dbUniqueName SYNPOC_EXA \
    > --dbSID SYNPOC \
    > --createAsCDB false \
    > --dbCharset AL32UTF8 \
    > --dbNCharset AL16UTF16 \
    > --sgaSizeInMB 4096 \
    > --pgaSizeInMB 1024 \
    > --oracleHome /u02/app/oracle/product/19.0.0.0/dbhome_1 \
    > --oracleHomeName OraHome1 \
    > --tdeConfigMethod FILE \
    > --executePrereqs no
    DBAAS CLI version 24.3.2.0.0
    Executing command database create --dbname SYNPOC --dbUniqueName SYNPOC_EXA --dbSID SYNPOC1 --createAsCDB false --dbCharset AL32UTF8 --dbNCharset AL16UTF16 --sgaSizeInMB 4096 --pgaSizeInMB 1024 --oracleHome /u02/app/oracle/product/19.0.0.0/dbhome_1 --oracleHomeName OraHome1 --tdeConfigMethod FILE --executePrereqs no
    Job id: 88f650c6-0467-4b3b-bcda-3f38eaa0ea6e
    Session log: /var/opt/oracle/log/SYNPOC/database/create/dbaastools_2024-09-30_03-51-46-PM_368426.log
    Enter SYS_PASSWORD:
    
    Enter SYS_PASSWORD (reconfirmation):
    
    Enter TDE_PASSWORD:
    
    Enter TDE_PASSWORD (reconfirmation):
    
    Loading PILOT...
    Enter SYS_PASSWORD
    ********************
    Enter SYS_PASSWORD (reconfirmation):
    **********************
    Enter TDE_PASSWORD
    ***********************
    Enter TDE_PASSWORD (reconfirmation):
    ********************
    Session ID of the current execution is: 1490
    Log file location: /var/opt/oracle/log/SYNPOC/database/create/pilot_2024-09-30_03-53-13-PM_374149
    -----------------
    Running Plugin_initialization job
    Completed Plugin_initialization job
    Acquiring read lock: _u02_app_oracle_product_19.0.0.0_dbhome_1
    -----------------
    Running Default_value_initialization job
    Completed Default_value_initialization job
    -----------------
    Running Validate_input_params job
    Completed Validate_input_params job
    -----------------
    Running Validate_cpu_availability job
    Completed Validate_cpu_availability job
    -----------------
    Running Validate_asm_availability job
    Completed Validate_asm_availability job
    -----------------
    Running Validate_disk_space_availability job
    Completed Validate_disk_space_availability job
    -----------------
    Running Validate_huge_pages_availability job
    Completed Validate_huge_pages_availability job
    -----------------
    Running Validate_hostname_domain job
    Completed Validate_hostname_domain job
    -----------------
    Running Validate_crs_state job
    Completed Validate_crs_state job
    -----------------
    Running Install_db_cloud_backup_module job
    Skipping. Job is detected as not applicable.
    -----------------
    Running Perform_dbca_prechecks job
    Completed Perform_dbca_prechecks job
    -----------------
    Running Validate_backup_report job
    Skipping. Job is detected as not applicable.
    Acquiring write lock: create_db_cloud
    -----------------
    Running Setup_acfs_volumes job
    Completed Setup_acfs_volumes job
    -----------------
    Running Setup_db_folders job
    Completed Setup_db_folders job
    -----------------
    
    Running DB_creation job
    Completed DB_creation job
    Releasing lock: create_db_cloud
    -----------------
    Running Generate_db_metadata job
    Completed Generate_db_metadata job
    -----------------
    Running Create_db_from_backup job
    Skipping. Job is detected as not applicable.
    Completed Create_db_from_backup job
    -----------------
    Running Load_db_details job
    Completed Load_db_details job
    -----------------
    Running Populate_creg job
    Completed Populate_creg job
    -----------------
    Running Register_ocids job
    Skipping. Job is detected as not applicable.
    -----------------
    Running Run_datapatch job
    Skipping. Job is detected as not applicable.
    -----------------
    Running Create_users_tablespace job
    Skipping. Job is detected as not applicable.
    -----------------
    Running Configure_pdb_service job
    Skipping. Job is detected as not applicable.
    -----------------
    Running Set_pdb_admin_user_profile job
    Skipping. Job is detected as not applicable.
    -----------------
    Running Lock_pdb_admin_user job
    Skipping. Job is detected as not applicable.
    -----------------
    Running Configure_flashback job
    Completed Configure_flashback job
    -----------------
    Running Update_cloud_service_recommended_config_parameters job
    Completed Update_cloud_service_recommended_config_parameters job
    -----------------
    Running Update_distributed_lock_timeout job
    Completed Update_distributed_lock_timeout job
    -----------------
    Running Configure_archiving job
    Completed Configure_archiving job
    -----------------
    Running Configure_huge_pages job
    Completed Configure_huge_pages job
    -----------------
    Running Set_credentials job
    Completed Set_credentials job
    -----------------
    Running Update_dba_directories job
    Completed Update_dba_directories job
    -----------------
    Running Set_cluster_interconnects job
    Completed Set_cluster_interconnects job
    -----------------
    Running Create_db_secure_profile job
    Completed Create_db_secure_profile job
    -----------------
    Running Set_utc_timezone job
    Completed Set_utc_timezone job
    -----------------
    Running Run_dst_post_installs job
    Completed Run_dst_post_installs job
    -----------------
    Running Enable_auditing job
    Completed Enable_auditing job
    -----------------
    Running Apply_security_measures job
    Completed Apply_security_measures job
    -----------------
    Running Set_listener_init_params job
    Completed Set_listener_init_params job
    -----------------
    Running Update_db_wallet job
    Completed Update_db_wallet job
    -----------------
    Running Add_oratab_entry job
    Completed Add_oratab_entry job
    -----------------
    Running Setup_dbaastools_schema job
    Skipping. Job is detected as not applicable.
    -----------------
    Running Purge_rmf_configuration job
    Completed Purge_rmf_configuration job
    -----------------
    Running Configure_sqlnet_ora job
    Completed Configure_sqlnet_ora job
    -----------------
    Running Configure_tnsnames_ora job
    Completed Configure_tnsnames_ora job
    -----------------
    Running Enable_fips job
    Completed Enable_fips job
    -----------------
    Running DTRS_DB_Configure_Job job
    Completed DTRS_DB_Configure_Job job
    -----------------
    Running Restart_database job
    Completed Restart_database job
    -----------------
    Running Create_db_login_environment_file job
    Completed Create_db_login_environment_file job
    -----------------
    Running Generate_dbsystem_details job
    Acquiring native write lock: global_dbsystem_details_generation
    Releasing native lock: global_dbsystem_details_generation
    Completed Generate_dbsystem_details job
    -----------------
    Running Cleanup job
    Completed Cleanup job
    Releasing lock: _u02_app_oracle_product_19.0.0.0_dbhome_1
    
    dbaascli execution completed
    [root@exadevdb-node01~]# 
    
    

    Conclusion

    To sum up, dbaascli is an effective command line tool that helps in performing various tasks involved in the lifecycle of a database in the context of the Oracle cloud. It makes the execution of tasks like the creation of databases, the administration of homes and even the fetching of information effortless. With dbaascli, the administrators have a way to automate most of the usual activities and cut down on errors and increase efficiency thereby making the management of databases smooth and effective.

    No comments:

    Post a Comment

    Exacs database creation using dbaascli

      Intro OCI (Oracle Cloud Infrastructure) provides robust automation capabilities for routine maintenance tasks such as patching, ...