Previous Next JavaScript must be enabled to correctly display this content

## ODACLI Commands

Understand FAQs on ODACLI commands.

What is the difference between `odacli` and `odaadmcli` commands?

ODACLI commands are used to perform most of the lifecycle management operations for the appliance, network, databases, data guard, application VMs and DB systems. ODAADMCLI is used to perform hardware management and monitoring operations.

What is the difference between `oakcli` and `odacli` commands?

OAKCLI commands are deprecated from Oracle Database Appliance release 19.10 on bare metal deployments. OAKCLI commands can be used on Oracle VM (Xen) deployments for lifecycle management of virtual resources. You can use ODACLI to perform the corresponding oakcli functionality on bare metal systems. ODACLI is also enhanced in each Oracle Database Appliance release and enables management of KVM and DB systems on Oracle Database Appliance.

Can I run odacli or odaadmcli commands as a non-root user?

No, only `root` user or `root sudoers` can run ODACLI and ODAADMCLI commands.

When I run odacli commands, why is the error `DCS-10033:Service DCS_AGENT is down.` displayed?

ODACLI commands communicates with the DCS agent to perform most operations on the appliance. Ensure that the system service `initdcsagent` is running properly. The ODACLI commands also communicate with the DCS admin to perform some patching operations. Ensure that the system service `initdcsadmin` is running properly if you face any issue communicating with that service.

    # systemctl status initdcsagent
    * initdcsagent.service - Oracle dcs-agent startup
       Loaded: loaded (/etc/systemd/system/initdcsagent.service; enabled; vendor preset: disabled)
       Active: active (running) since (...)
     Main PID: 1512 (sh)
        Tasks: 45
       Memory: 352.9M
    (...)

How can I get more information about `odacli` commands?

The Oracle Database Appliance Deployment and User's Guide for your hardware model contains detailed information about each ODACLI command. You can use the command line to view the help for each command.

To list all the actions and object categories use: `odacli -h`

To list all the operations against an object category, use: `odacli object -h`

    # odacli database -h
    Command usage:
            database:
                    clone-database
                    create-database
                    delete-database
                    describe-database
                    irestore-database
                    list-databases
                    modify-database
                    move-database
                    recover-database
                    register-database
                    upgrade-database

To list all the operations against an action, use: `odacli action -h`

    # odacli create -h
    Command usage:
            create:
                    create-appliance
                    create-auto-logclean-policy
                    create-backup
                    create-backupconfig
                    create-cpupool
                    create-database
                    create-dbhome
                    create-dbstorage
                    create-dbsystem
                    create-jobdata-retention-policy
                    create-logcleanjob
                    create-network
                    create-objectstoreswift
                    create-prepatchreport
                    create-purge-jobdata-job
                    create-vdisk
                    create-vm
                    create-vmstorage
                    create-vnetwork

To get the help of a specific command, use: `odacli command -h`

    # odacli create-database -h
    create-database
        Creates a new database

    Syntax
        create-database -n db_name [-nn associated_network_names]
        [-bi backup_config_id] [-bn backup_config_name] [-bp] [-c]
        [-cs character_set] [-cp cpu_pool] [-u database_unique_name]
        [-de db_editon] [-f] [-rd db_redundancy] [-cl db_class] [-co]
        [-dn db_domain_name] [-dh db_home_id] [-l db_language]
        [-s db_shape] [-r db_storage] [-dt db_territory]
        [-y {RAC|RACOne|SI}] [-no-sh] [-sh] [-t] [-fc] [-io]
        [-lb level_zero_backup_day] [-ns national_character_set] [-no-c]
        [-no-f] [-no-co] [-no-fc] [-d pdb_adminuser_name] [-p pdb_name]
        [-th db_target_node_name] [-g db_target_node_number]
        [-v db_version] [-j] [-h]

    Parameters
        Options                    Description
        -------------------------  -------------------------------------------------
        --dbname,-n (*)            Database name

        --associated-networks,-nn  Associated network names (in format
                                   networkname1,networkname2,...)

    (...)

Can I change the default port to communicate with DCS agent?

Yes, by default the DCS agent service uses port 7070 but you can edit the file `/opt/oracle/dcs/dcscli/dcscli.conf` to change the property `"AgentPort=port"`. Note: by default the DCS admin service uses port 7060, you can edit the same file to edit the property `"AdminPort=port"` to change that port.

Where are the logs for odacli command?

The logs are in the `/opt/oracle/dcs/dcscli/log` directory. Most of the operations log entries are available in the `dcscli.log`. VM and DB system operations log entries are available in `dcscli_kvm.log`.

How I can process the output of odacli command more easily?

Each ODACLI command has the `-j` option which provides a JSON formatted output that may be processed by any other process. For complex integration, use the Oracle Database Appliance Java SDK.

Where I could check the cause and action for each DCS error message I get after running an odacli command?

You can use the tool `dcserr` to see the cause and action for any DCS error message displayed when you run an ODACLI command:

    # dcserr
    10037, System_Not_Provisioned,"System is not yet Provisioned."
    // *Cause: System was not yet Provisioned.
    // *Action: Contact Oracle Support Services.
    /

Parent topic: Oracle Database Appliance Frequently Asked Questions