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](https://techgoeasy.com/wp-content/uploads/2021/03/dbcli-create-home.png?ezimgfmt=rs:702x157/rscb2/ng:webp/ngcb2)
After successful completion, you can execute dbcli list-dbhomes to verify the ORACLE HOME location
dbcli list-dbhomes
![](https://techgoeasy.com/wp-content/uploads/2021/03/dbcli-list-dbhome.png?ezimgfmt=rs:702x47/rscb2/ng:webp/ngcb2)
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:
![](https://techgoeasy.com/wp-content/uploads/2021/03/dbcli-update-dbhome.png?ezimgfmt=rs:702x107/rscb2/ng:webp/ngcb2)
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
No comments:
Post a Comment