10.1 ExaCLI Command Reference

ExaCLI is a command-line administration tool that runs on database and cell nodes and enables you to manage nodes remotely.

Overview

You can use ExaCLI to manage cell and database node configuration and objects in the remote node's environment. ExaCLI is installed when a cell or database node is imaged. ExaCLI supports the same command syntax as DBMCLI and CellCLI. The main difference is that ExaCLI manages cell and database nodes from a remote host whereas DBMCLI runs directly on a database node, and CellCLI runs directly on a cell node.

There are two main reasons to use ExaCLI:

  • Many companies, especially government organizations, require root access or the SSH service on the cell and database nodes to be disabled as part of the compliance requirements.

  • Service providers that host Exadata machines provide access to a virtual machine running on the cell and database node. Customers are not allowed to SSH into the cell or database node to manage the node using CellCLI or DBMCLI.

For such cases, the only way to manage the cell or database node is by using ExaCLI running on a remote node.

Prerequisites

  • Users created on the cell or database node that have been granted the necessary privileges. See Creating Users for Use with ExaCLI for more information.

  • Java version 1.8 or later

    You can determine the version of Java by running the java -version command. In addition, the JAVA_HOME environment variable must be set to point to the installation directory of the proper version of Java.

File Path

/usr/local/sbin/exacli

Syntax

You run ExaCLI from the operating system command line.

exacli -c [username@]remotehost[:port] [-l username] [ --xml | --json ]
 [--cookie-jar [filename]] [-e {command | 'command[; command]' | @batchfile}]

Options

Option Description

-c [username@]remotehost or

--connect [username@]remotehost[:port]

Specifies the remote node to which you want to connect. ExaCLI prompts for the user name if not specified.

ExaCLI can connect to both cells and compute nodes. The default port for compute node MS is 7879.

You can specify the remote host using an IPv6 address. The IPv6 addresses must be enclosed in square brackets and single quotes as shown in Example 10-2.

-l username or

--login-name username

Specifies the user name to log into the remote node.

--xml

Displays output in XML format.

--json

Displays output in JSON format.

--cookie-jar [filename]

Specifies the filename of the cookie jar to use. If filename is not specified, the cookie is stored in a default cookie jar located at HOME/.exacli/cookiejar, where HOME is the home directory of the OS user running the ExaCLI command.

The presence of a valid cookie allows the ExaCLI user to run commands without requiring to login in subsequent ExaCLI sessions.

-e command or

-e 'command[; command]' or

-e @batchFile

Specifies either the ExaCLI commands to run or a batch file. ExaCLI exits after running the commands.

If specifying multiple commands to run, enclose the commands in single quotes to prevent the shell from interpreting the semi-colon.

Omit this option to start an interactive ExaCLI session.

--cert-proxy proxy[:port]

Specifies the proxy server to use when downloading certificates. If port is omitted, port 80 is used by default.

-n or

--no-prompt

Suppresses prompting for user input.

Usage Notes

  • Notes for the --cookie-jar option:

    • The user name and password are sent to the remote node for authentication. On successful authentication, the remote node issues a cookie (the login credentials) that is stored in the specified filename on the database node. If filename is not specified, the cookie is stored in a default cookie jar located at HOME/.exacli/cookiejar, where HOME is the home directory of the operating system user running the ExaCLI command.

    • Permissions for the cookie jar file are set to rw- --- --- (600).

    • The operating system user running the ExaCLI command is the owner of the cookie-jar file.

    • A cookie jar can contain multiple cookies from multiple users on multiple nodes in parallel sessions.

    • If the cookie is not found or is no longer valid, ExaCLI prompts for the password. The new cookie is stored in the cookie jar identified by filename, or the default cookie jar if filename is not specified.

    • Even without the --cookie-jar option, ExaCLI still checks for cookies from the default cookie jar. However, if the cookie does not exist or is no longer valid, the new cookie will not be stored in the default cookie jar if the --cookie-jar option is not specified.

  • Notes for the -e option:

    • ExaCLI exits after running the commands.

    • If specifying multiple commands to run, be sure to enclose the commands in single quotes to prevent the shell from interpreting the semi-colon.

    • The batch file is a text file that contains one or more ExaCLI commands to run.

  • Notes for the -n (--no-prompt) option:

    • If ExaCLI needs additional information from the user, for example, if ExaCLI needs to prompt the user for a password (possibly because there were no valid cookies in the cookie-jar) or to prompt the user to confirm the remote node’s identity, then ExaCLI prints an error message and exits.

Examples

The following examples show how use ExaCLI after the users have been created and granted the necessary privileges. See Creating Users for Use with ExaCLI for examples of creating users and assigning privileges to them.

Example 10-1 Connecting to a User on a Cell using ExaCLI

Connect to cell node cellnode01 as the celladministrator user. ExaCLI prompts for a password if the default cookie jar does not contain a valid cookie for the celladministrator user. Because the --cookie-jar option is not specified, the cookie is not stored in the cookie jar.

$ exacli -l celladministrator -c cellnode01

The following command is equivalent.

$ exacli -c celladministrator@cellnode01

Example 10-2 Connecting to a Remote Host Using an IPv6 Address

You can specify the remote host using an IPv6 address. The IPv6 addresses must be enclosed in square brackets and single quotes.

$ exacli -c 'scott@[2001:db8:a0b:12f0::1]'

$ exacli -c '[2001:db8:a0b:12f0::1]' -l scott

Example 10-3 Creating a Cookie for ExaCLI Connections

The user celladministrator and password are sent to cellnode01 for authentication. On successful authentication, the cell node sends back a cookie which is stored in the default cookie jar. The specified commands are then run on the cell node. Note that

Tip:

Multiple commands must be enclosed in single quotes.
$ exacli -l celladministrator -c cellnode01 --cookie-jar -e 'list cell; list celldisk'
Password=************

Example 10-4 Creating a Cookie for ExaCLI Connections

The user celladministrator and password are sent to cellnode01 for authentication. On successful authentication, the cell node sends back a cookie which is stored in the default cookie jar. The specified commands are then run on the cell node.

Tip:

Multiple commands must be enclosed in single quotes.
$ exacli -l celladministrator -c cellnode01 --cookie-jar -e 'list cell; list celldisk'
Password=************

Example 10-5 Using a Cookie when Ruunning ExaCLI Commands

After creating a cookie, as shown in the previous example, ExaCLI does not prompt for password for subsequent ExaCLI sessions for the celladministrator user because it uses the cookie from the default cookie jar.

$ exacli -l celladministrator -c cellnode01 -e list griddisk detail

If you connect as a user other than celladministrator, and a cookie does not exist for that user, you are prompted for a password.

$ exacli -c user1@cellnode01 -e list griddisk detail
Password=************

Example 10-6 Viewing DBSERVER Details using ExaCLI

In this example, ExaCLI connects to the dbnode01 node as the dbnodeadministrator user and lists the DBSERVER object attributes in detail.

$ exacli -l dbnodeadministrator -c dbnode01 --cookie-jar -e list dbserver detail

The login and password are sent to the database node for authentication. On successful authentication, the database node returns a cookie with the login credentials which gets stored in the cookie jar on the machine running ExaCLI

Example 10-7 Viewing the ALERTHISTORY for a DBSERVER using ExaCLI

In this example, ExaCLI connects to the dbnode01 node as the dbnodeadministrator user and lists the ALERTHISTORY object. ExaCLI does not prompt for password if there is a valid cookie in the default cookie jar.

$ exacli -c dbnodeadministrator@dbnode01 -e list alerthistory

Example 10-8 Using a Command Batch File with ExaCLI

In this example, the file commandFile is stored in the local directory (from where the ExaCLI command is called) and contains the following information:

list dbserver detail
list alerthistory

ExaCLI connects as the dbnodeadministrator user to the dbnode01 database node, and, on successful authentication, runs the commands in commandFile.

$ exacli -l dbnodeadministrator -c dbnode01 -e @commandFile