Wednesday, May 10, 2023

DBCLI commands for DBCS and Bare Metals in OCI

What is DBCLI in Oracle?

It is a command line interface available on bare metal and virtual machine DB systems.

The database CLI commands must be run as the root user

dbcli is in the /opt/oracle/dcs/bin/ directory.

Oracle Database maintains logs of the dbcli command output in the dcscli.log and dcs-agent.log files in the /opt/oracle/dcs/log/ directory.


How to Check CLI and update it (How to update dbcli)

[root@host opc]# rpm -qa |grep dcs
dcs-cli-19.4.1.0.0_develop_191119.0113-1.x86_64
dcs-admin-19.4.1.0.0_develop_191119.0113-1.x86_64
dcs-agent-20.1.2.0.0_200408.0952-25.x86_64

[root@host opc]# /opt/oracle/dcs/bin/dbcli --help |grep -i create-pdb
[root@host opc]#

[root@host opc]# /opt/oracle/dcs/bin/cliadm update-dbcli
Job details
ID: d1363c42-1da5-47b0-8738-de3aa16c233a
Description: DcsCli patching
Status: Created
Created: April 28, 2020 10:42:56 AM UTC
Message: Dcs cli will be updated

How to run Dbhome Commands with dbcli

The following commands are available to manage database homes:

dbcli create-dbhome
dbcli describe-dbhome
dbcli delete-dbhome
dbcli list-dbhomes
dbcli update-dbhome

Let’s explain each of these in detail


How to Describe Oracle Home

dbcli describe-dbhome -i [-h] [-j]

Here -i is the DB home id, -h is the help option, -j is the JSON option

[root]# dbcli describe-dbhome -i 52850389-228d-4397-bbe6-102fda65922b
DB Home details
ID: 112850389-228d-4397-bbe6-102fda65933b                
Name: OraDB12102_home1             
Version: 12.1.0.2       
Home Location: /u01/app/oracle/product/12.1.0.2/dbhome_1             Created: June 29, 2020 4:36:31 AM UTC

How to list Db homes

dbcli list-dbhomes [-h] [-j]

Here -h is the help option, -j is the JSON option

[root]# dbcli list-dbhomes
ID Name DB Version Home Location
------------------------------------ ----------------- ---------- ------------------------------------------
b727bf80-c99e-4846-ac1f-28a81a725df6 OraDB12102_home1 12.1.0.2 /u01/app/orauser/product/12.1.0.2/dbhome_1 January 19, 2017 10:03:31 AM PST January 19, 2017

How to create a new Oracle Home

dbcli create-dbhome --version 12.1.0.2.180417
Job details
ID: f9c48b8d-c00a-433d-8846-969290af4e81
Description: Database Home OraDB12201_home2 creation with version :12.1.0.2.180417
Status: Created
Created: Sep 20, 2020 8:16:53 PM UTC
Message: Create Database Home

To verify the status of Database Software Installation. You can describe the job using

dbcli describe-job -i

dbcli describe-job -i f9c48b8d-c00a-433d-8846-969290af4e81
Job details
ID: f9c48b8d-c00a-433d-8846-969290af4e81
Description: Database Home OraDB12201_home2 creation with version :12.2.0.1.180417
Status: Success
Created: Sep 20, 2020 8:16:53 PM UTC
Message: Create Database Home
DBCLI commands

After successful completion, you can execute dbcli list-dbhomes to verify the ORACLE HOME location

dbcli list-dbhomes

How to apply patch bundle to Oracle Home

dbcli update-dbhome -i -n [–local] [–precheck] [-h] [-j]

[root@dbsys ~]# dbcli update-dbhome -i e1877dac-a69a-40a1-b65a-d5e190e671e6
{
"jobId" : "493e703b-46ef-4a3f-909d-bbd123469bea",
"status" : "Created",
"message" : null,
"reports" : [ ],
"createTimestamp" : "January 19, 2019 10:03:21 AM PST",
"resourceList" : [ ],
"description" : "DB Home Patching: Home Id is e1877dac-a69a-40a1-b65a-d5e190e671e6",
"updatedTime" : "January 19, 2019 10:03:21 AM PST"
}

dbcli describe-job -i 493e703b-46ef-4a3f-909d-bbd123469bea

Job details
ID: 493e703b-46ef-4a3f-909d-bbd123469bea
Description: DB Home Patching: Home Id is e1877dac-a69a-40a1-b65a-d5e190e671e6
Status: Running
Created: January 19, 2017 10:03:21 AM PST
Message:

How to list jobs with dbcli

dbcli list-jobs

TDE Commands

The following commands are available to manage TDE-related items (backup reports, keys, and wallets):

dbcli list-tdebackupreports
dbcli update-tdekey
dbcli recover-tdewallet

Admin Commands

The following commands are to perform administrative actions on the DB system:

dbadmcli manage diagcollect
dbadmcli power
dbadmcli power disk status
dbadmcli show controller
dbadmcli show disk
dbadmcli show diskgroup
dbadmcli show env_hw (environment type and hardware version) (environment type and hardware version)
dbadmcli show fs (file system details) (file system details)
dbadmcli show storage
dbadmcli stordiag

Database Commands(The dbcli create-database command is available on bare metal DB systems only)

The following commands are available to manage databases:

dbcli clone-database
dbcli create-database
dbcli delete-database
dbcli describe-database
dbcli list-databases
dbcli modify-database
dbcli recover-database
dbcli register-database
dbcli update-database

we can check the parameter required using the below syntax always


dbcli <command > -h

AgentCommands

The following commands are available to manage agents:

dbcli ping-agent
dbcli list-agentConfigParameters
dbcli update-agentConfigParameters

Listing various administrative options for PDB in DBCLI

[root@host opc]# /opt/oracle/dcs/bin/dbcli -h|grep -i pdb
pdb:
clone-pdb
create-pdb
delete-pdb
describe-pdb
list-pdbs
update-pdb
clone-pdb
create-pdb
delete-pdb
describe-pdb
list-pdbs
update-pdb

How to check for Installed and Available Updates

we can display the installed update versions by using the Component Command

dbcli describe-component

we can display the latest update versions available in Object Storage by using the Latestpatch Command

dbcli describe-latestpatch

How to check for Available Operating System Updates for DB System Nodes

dbcli get-availableospatches
or
If you want output in JSON format
dbcli get-availableospatches -j

I hope you like this post on DBCLI commands


Patching-WebLogic-Server

 

Applying patches to WebLogic Server 12c is done using the OPatch utility. Make sure any processes running under this WebLogic installation are stopped before applying a patch.

Download the latest version of OPatch and the WebLogic updates from Oracle Support and put them into the "/u01/software" directory with the other software. For example.

  • OPatch : p6880880_132000_Generic.zip *** See Note Below
  • Updates : p22331568_122100_Generic.zip

 At the time of writing, the latest version of OPatch (OUI NextGen 13.2) is older than the version of OPatch that ships with WebLogic Server 12.2.1.

Assuming a newer version of OPatch were available you would unzip the OPatch utility and add it to your path.

cd /u01/software
unzip p6880880_132000_Generic.zip
export PATH=/u01/software/OPatch:$PATH

Since there isn't a newer version available at the time of writing, we will use the existing one.

export PATH=$MW_HOME/OPatch:$PATH

Unzip the patch and change to the resulting directory, then apply the patch.

unzip -d PATCH_TOP p22331568_122100_Generic.zip
cd PATCH_TOP/22331568
export ORACLE_HOME=$MW_HOME
opatch apply

Answer any prompts and take appropriate action when required.

When the patch is complete, check the WebLogic version using the following command. Depending on the scale of the patch, the version may not have changed.

. $WLS_HOME/server/bin/setWLSEnv.sh
java weblogic.version