Sun Java System Application Server Enterprise Edition 8.1 2005Q2 High Availability Administration Guide

- Previous: Using the HADB Management Agent
- Next: Configuring HADB

# Using the hadbm Management Command

Use the `hadbm` command-line utility to manage an HADB domain, its database instances, and nodes. The `hadbm` utility (also called the management client) sends management requests to the specified management agent, acting as a management server, which has access to the database configuration from the repository.

This section describes the hadbm command-line utility, with the following topics:

- Command Syntax

- Security Options

- General Options

- Environment Variables

## Command Syntax

The `hadbm` utility is located in the HADB_install_dir `/bin` directory. The general syntax of the `hadbm` command is:

    hadbm subcommand
    [-short-option [option-value]]
    [--long-option [option-value]]
    [operands]

The subcommand identifies the operation or task to perform. Subcommands are case-sensitive. Most commands have one operand (usually `dbname),` but some have none, and some have two.

Options modify how `hadbm` performs a subcommand. Options are case-sensitive. Each option has a long form and a short form. Precede the short form with a single dash (`-`); precede the long forms with two dashes (`--`). Most options require argument values, except for boolean options, which must be present to switch a feature on. Options are not required for successful execution of the command.

If a subcommand requires a database name, and you do not specify one, `hadbm` will use the default database, `hadb`.

##### Example 3–1 Example of hadbm command

The following illustrates the `status` subcommand:

    hadbm status --nodes

## Security Options

For security reasons, all `hadbm` commands require an administrator password. Use the `--adminpassword` option to set the password when you create a database or domain. From then on, you must specify that password when you perform operations on the database or domain.

For enhanced security, use the `--adminpasswordfile` option to specify a file containing the password, instead of entering it on the command line. Define the password in the password file with the following line:

`HADBM_ADMINPASSWORD=`password

Replace password with the password. Any other content in the file is ignored.

If you specify both the `--adminpassword` and `--adminpasswordfile` options, the `--adminpassword` takes precedence. If a password is required, but is not specified in the command, `hadbm` prompts you for a password.

Note –

You can change the administrator password, if required, using the command `setadminpassword`. For more information about the command, see the man page for the command `setadminpassword`.

In addition to the administrator password, HADB also requires a database password to perform operations that modify the database schema. You must use both passwords when using the following commands: `hadbm create`, `hadbm addnodes`, and `hadbm refragment`.

Specify the database password on the command line with the `--dbpassword` option. Similar to the administrator password, you can also put the password in a file and use the `--dbpasswordfile` option, specifying the file location. Set the password in the password file with the following line:

    HADBM_DBPASSWORD=password

For testing or evaluation, you can turn off password authentication with the `--no-adminauthentication` option when you create a database or domain. For more information, see Creating a Database and Creating a Management Domain

The following table summarizes the `hadbm` security command line options.

Table 3–4 `hadbm` Security Options

Option (Short Form) | Description
--- | ---
--adminpassword=password -w | Specifies administrator password for the database or domain. If you use this option when you create a database or domain, then you must provide the password each time you use hadbm to operate on the database or domain. Use either this option or --adminpasswordfile, but not both.
--adminpasswordfile=filepath -W | Specifies file that contains the administrator password for the database or domain. If you use this option when you create a database or domain, then you must provide the password each time you use hadbm to operate on the database or domain. Use either this option or --adminpassword, but not both.
--no-adminauthentication -U | Use this option when you create a database or domain to specify that no administrator password is required. For security reasons, do not use this option in a production deployment.
--dbpassword= password -p | Specifies the database password. If you use this option when you create the database, then you must provide the password each time you use an `hadbm` command to operate on the database. Creates a password for the HADB system user. Must be at least 8 characters. Use either this option or --dbpasswordfile, but not both.
--dbpasswordfile= filepath -P | Specifies a file that contains the password for the HADB system user. Use either this option or --dbpassword, but not both.

## General Options

General command options can be used with any `hadbm` subcommand. All are boolean options that are false by default. The following table describes the `hadbm` general command options.

Table 3–5 `hadbm` General Options

Option(Short Form) | Description
--- | ---
--quiet -q | Execute the subcommand silently without any descriptive messages.
--help -? | Display a brief description of this command and all the supported subcommands. No subcommand is required.
--version -V | Display the version details of the `hadbm` command. No subcommand is required.
--yes -y | Execute the subcommand in non-interactive mode.
--force -f | Execute the command non-interactively and does not throw an error if the command’s post condition is already achieved.
--echo -e | Display the subcommand with all the options and their user-defined values or the default values, then executes the subcommand.
--agent=URL -m | URL to the management agents. URL is: hostlist:port, where hostlist is a comma separated list of hostnames or IP-addresses, and port is the port number on which the management agent is operating. Default is localhost:1862. NOTE: This option is not valid with `hadbm addnodes`.

## Environment Variables

For convenience, you can set an environment variable instead of specifying a command option. The following table describes environment variables that correspond to `hadbm` command options.

Table 3–6 HADB Options and Environment Variables

Long Form | Short Form | Default | Environment Variable
--- | --- | --- | ---
--adminpassword | -w | none | $HADBM_ADMINPASSWORD
--agent | --m | localhost:1862 | $HADBM_AGENT
--datadevices | -a | `1` | $HADBM_DATADEVICES
dbname | none | `hadb` | $HADBM_DB
--dbpassword | -p | none | $HADBM_DBPASSWORD
--dbpasswordfile | -P | none | $HADBM_DBPASSWORDFILE
--devicepath | -d | Solaris and Linux: `/var/opt/SUNWhadb` Windows: `C:\Sun\AppServer\SUNWhadb\vers`, where vers is the HADB version number. | $HADBM_DEVICEPATH
--devicesize | -z | none | $HADBM_DEVICESIZE
--echo | -e | False | $HADBM_ECHO
--fast | -F | False | $HADBM_FAST
--force | -f | False | $HADBM_FORCE
--help | -? | False | $HADBM_HELP
--historypath | -t | Solaris and Linux: `/var/opt/SUNWhadb` Windows: REPLACEDIR, replaced by the actual URL at runtime. | $HADBM_HISTORYPATH
--hosts | -H | none | $HADBM_HOSTS
--interactive | -i | True | $HADBM_INTERACTIVE
--no-refragment | -r | False | $HADBM_NOREFRAGMENT
--portbase | -b | 15200 | $HADBM_PORTBASE
--quiet | -q | False | $HADBM_QUIET
--repair | -R | True | $HADBM_REPAIR
--rolling | -g | True | $HADBM_ROLLING
--saveto | -o | none | $HADBM_SAVETO
--set | -S | none | $HADBM_SET
--spares | -s | 0 | $HADBM_SPARES
--startlevel | -l | normal | $HADBM_STARTLEVEL
--version | -V | False | $HADBM_VERSION
--yes | -y | False | $HADBM_YES

- Previous: Using the HADB Management Agent
- Next: Configuring HADB

- © 2010, Oracle Corporation and/or its affiliates