0% found this document useful (0 votes)
351 views13 pages

Database CLI (DBCLI) OCI: Database Command Line Utility - L200

The document discusses the Database CLI (dbcli) which is a command line interface available on Oracle Cloud Infrastructure bare metal and virtual machine DB systems. It describes how dbcli can be used to perform database operations like creating and deleting databases, database homes, backups, and more. The document provides the syntax and examples of various dbcli commands.

Uploaded by

Rafael Gaona
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
351 views13 pages

Database CLI (DBCLI) OCI: Database Command Line Utility - L200

The document discusses the Database CLI (dbcli) which is a command line interface available on Oracle Cloud Infrastructure bare metal and virtual machine DB systems. It describes how dbcli can be used to perform database operations like creating and deleting databases, database homes, backups, and more. The document provides the syntax and examples of various dbcli commands.

Uploaded by

Rafael Gaona
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Database CLI(DBCLI) OCI

Database Command Line Utility– L200


Bal Sharma
Oracle Cloud Infrastructure
October 2019
Safe harbor statement

The following is intended to outline our general product direction. It is intended for information
purposes only, and may not be incorporated into any contract. It is not a commitment to deliver
any material, code, or functionality, and should not be relied upon in making purchasing
decisions.

The development, release, timing, and pricing of any features or functionality described for
Oracle’s products may change and remains at the sole discretion of Oracle Corporation.

2 © 2019 Oracle
Objectives

After completing this lesson, you should be able to:

• Understand What is DBCLI


• Applicability of DBCLI for OCI Data Management
• Various options supported through DBCLI
• Summary
Database CLI
The database CLI (dbcli) is a command line interface available on bare metal and virtual machine
DB systems. After you connect to the DB system, you can use the database CLI to perform tasks such as
creating Oracle database homes and databases.

Note: The database CLI is not for use on Exadata DB systems.


The database CLI commands must be run as the root user.
• dbcli is in the /opt/oracle/dcs/bin/ directory. This directory is included in the path for the root user's
environment.
• 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.
• The database CLI commands and most parameters are case sensitive and should be typed correctly. A
few parameters are not case sensitive, you should look at parameter descriptions.

4
Database CLI Syntax & Update Commands
The database CLI commands syntax:
dbcli command [parameters]
Where ,command is a verb-object combination such as create-database.
parameters include additional options for the command. Most parameter names are preceded with
two dashes, for example, --help. Abbreviated parameter names are preceded with one dash, for
example, -h.
User-specified parameter values are shown within angle brackets, for example, <db_home_id>. Omit
the angle brackets when specifying these values.
The help parameter is available with every command.
CLI Update Command
cliadm update-dbcli
Note: The cliadm update-dbcli command is not available on 2-node RAC DB systems.

5
Database CLI Syntax & Update Commands
Synatx
cliadm update-dbcli [-h] [-j]
where:
H stands for help and –j stands for JSON output, both are optional parameters.
Update the CLI to ensure you have the latest patching commands (older DB systems might not include
them).
SSH to the DB System as opc user.
ssh -i <private_key_path> opc@<db_system_ip_address>
sudo to the root user. Use sudo su - with a hyphen to invoke the root user's profile, which will set the
PATH to the dbcli directory (/opt/oracle/dcs/bin).
[opc@dbsys ~]$ sudo su -
Update the CLI by using the cliadm update-dbcli command.
[root@dbsys ~]# cliadm update-dbcli

6
Database CLI Database Commands
Note: Use the dbcli create-database command to create a new database.
You can create a database with a new or existing Oracle Database home,
dbcli clone-database however each database home can have only one database.
dbcli create-database It takes a few minutes to create the database. After you run the dbcli
dbcli delete-database create-database command, you can use the dbcli list-jobs command to
check the status of the database creation job.
dbcli describe-database
The dbcli create-database command is available on bare metal
dbcli list-databases DB systems only.
dbcli modify-database
You must create and activate a master encryption key for any PDBs that
dbcli recover-database you create. After creating or plugging in a new PDB on a 1- or 2-node
dbcli register-database
RAC DB System, use the dbcli update-tdekey command to create and
activate a master encryption key for the PDB. Otherwise, you might
dbcli update-database encounter the error ORA-28374: typed master key not found in wallet
when attempting to create tablespaces in the PDB. In a multitenant
environment, each PDB has its own master encryption key which is
stored in a single keystore used by all containers.

https://docs.cloud.oracle.com/iaas/Content/Database/References/dbacli.htm#DatabaseCommands
7
Database CLI Commands Continued..

Dbhome Commands : The Dbstorage Commands Backup Commands


following commands are The following commands are available The following commands are
available to manage to manage database storage: available to back up databases:
database homes:
•dbcli list-dbstorages •dbcli create-backup
dbcli create-dbhome •dbcli describe-dbstorage •dbcli getstatus-backup
dbcli describe-dbhome •dbcli create-dbstorage •dbcli schedule-backup
dbcli delete-dbhome •dbcli delete-dbstorage
dbcli list-dbhomes
dbcli update-dbhome

https://docs.cloud.oracle.com/iaas/Content/Database/References/dbacli.htm#DbhomeCommands

8
Database CLI Commands Continued..
Objectstoreswift Commands

You can back up a database to an existing bucket in the Oracle Cloud Infrastructure Object Storage
service by using the dbcli create-backup command,
• 1. Create an object store on the DB system, by using the dbcli create-objectstoreswift command.

• Create a backup configuration that refers to the object store ID and the bucket name by using the dbcli
create-backupconfig command.

• Associate the backup configuration with the database by using the dbcli update-database command.

• The following commands are available to manage object stores.


•dbcli create-objectstoreswift
•dbcli describe-objectstoreswift
•dbcli list-objectstoreswifts

9
Database CLI– Demo

10 © 2019 Oracle
Database CLI– How to Use database operation using
DBCLI 4. List Databases storage configured
using dbcli command
1. Create database with "dbcli create-database" command
dbcli create-database --dbname dbtest --dbhomeid 8601c041-5bf5-4810-b736-
0ab24509a0c9 --adminpassword

5. Delete Databases using “dbcli


delete-database” command

2. Check status with "dbcli list-dbhomes" command

3. List Databases using dbcli command

6. dbcli create-dbhome -v 12.1.0.2


11
Database CLI– Summary
You should now be able to
Describe the features supported using Database CLI
Understand the applicability of database CLI based on use case.
Oracle Cloud always free tier:
oracle.com/cloud/free/

OCI training and certification:


oracle.com/cloud/iaas/training
oracle.com/cloud/iaas/training/certification
education.oracle.com/oracle-certification-path

OCI hands-on labs:


ocitraining.qloudable.com/provider/oracle

Oracle learning library videos on YouTube:


youtube.com/user/OracleLearning

You might also like