Creating a Database

To manually create a database to store the session data, use the hadbm create command. The syntax is as follows.

hadbm create [--package=package name] [--packagepath=path][--installpath=path] [--historypath=path] [--devicepath=path] [--datadevices=devices-per-node] [--portbase=base-no] [--spares=sparecount] [--set=attr-name-value-list] [--agent=maurl] [--no-cleanup] [--no-clear] --devicesize=size --dbpassword=password | --dbpasswordfile=file --adminpassword=password | --adminpasswordfile=file | --no-adminauthentication --hosts=host list [dbname]

For example:

hadbm create --spares 2 --devicesize 1024 --dbpassword secret123 --hosts n0,n1,n2,n3,n4,n5

If you have difficulty creating a database, check the following:

Database creation errors are written to the following files:

The hadbm create command options are listed in the following table.

Table 0-6  hadbm create Options 

Long Form

Short Form

Default

Description

 

 

 

 

--packagepath

 

 

Supports package registration through the create command.

--set

 

 

variable for heterogeneous path settings. This option allows for specifying different file paths for each node.

--no-clear

None

 

The database will not be started after create.

--no-cleanup

None

 

This will leave device, history, and config file if database fails to create.

--installpath

-n

parent of the directory where hadbm resides: install_dir/SUNWhadb/4/

Specifies the HADB system installation path. This path must already exist and be writable. Use this option if the HADB server installation resides in a location different from the management-client machine from which the hadbm create command is run.

--historypath

-t

/var/tmp

Specifies the path to the history files. This path must already exist and be writable. For details about history files, see "Clearing and Archiving History Files".

When database creation fails, the history files are removed from the HADB machines, and valuable debugging information is lost. However, if you create a writable directory with the same path as the --historypath on the machine from which you execute the hadbm create command, and this machine is different from the HADB machines, the history files are saved there.

--devicepath

-d

/var/opt/SUNWhadb

Specifies the path to the devices. There are three devices: the DataDevice, the NiLogDevice (node internal log device), and the RelalgDevice (relational algebra query device). This path must already exist and be writable. To set this path differently for each node or each device, see "Setting Heterogeneous Device Paths".

--configpath

-c

/etc/opt/SUNWhadb

Specifies the path to the configuration files used internally by the HADB. This path must already exist and be writable.

--datadevices

-a

1

Specifies the number of data devices on each node, between 1 and 8 inclusive. Data devices are numbered starting at 0.

--portbase

-b

15200

Specifies the port base number used for node 0. Successive nodes are automatically assigned port base numbers in steps of 20 from this number. Each node uses its port base number and the next five consecutively numbered ports.

If you want to run several databases on the same machine, you should have a plan for allocating port numbers and allocate them explicitly.

--spares

-s

0

Specifies the number of spare nodes. This number must be even and must be less than the number of nodes specified in the --hosts option. Spare nodes are optional, but having two or more ensures high availability.

--set

-S

none

Specifies a comma-separated list of database configuration attributes in name=value format. For explanations of valid database configuration attributes, see “Viewing and Modifying Configuration Attributes” on page 62.

For example, to specify the use of rsh instead of ssh (the default), use the following option:

--set ManagementProtocol=rsh

To use --set to set the --devicepath differently for each node or each device, see "Setting Heterogeneous Device Paths".

--inetd

-I

not specified

If specified, the database is configured to run with the inetd daemon, and is not automatically started after it is created. .

--inetdsetupdir

-u

current directory

Specifies the directory in which to store the inetd setup files. The directory must exist and be writable.

--devicesize

-z

none

Specifies the size of each device in MB. The device size should be as large as possible. The recommended size is four times the expected size of the user data, based on the number of users and the size of each user record.

The maximum size is the maximum operating system file size or 256 GB, whichever is smaller. The minimum size is as follows:

(4 x LogbufferSize + 16MB) / --datadevices

You can increase the device size later as described in "Adding Storage Space to Existing Nodes".

For more information on setting the LogbufferSize, see “Viewing and Modifying Configuration Attributes” on page 62.

--dbpassword

-p

none

Creates a password for the HADB system user. Must be at least 8 characters. You can use --dbpasswordfile instead. For details, see "Using the hadbm Command".

--dbpasswordfile

-P

none

Specifies a file that stores the password to be created for the HADB system user. For details, see "Using the hadbm Command".

--adminpassword

-w

none

The administrator password to manage the domain. If you use the adminpassword option with hadbm createdomain or hadbm create, then you must enter this password each time you use any hadbm command.

--adminpasswordfile

-W

None

Use the adminpasswordfile option to provide the password as a path to a file that contains the password

--no-adminauthentication

-U

None

The --no-adminauthentication option allows the administrator to use all hadbm commands without providing the administrator’s password.

--hosts

-H

none

Specifies a comma-separated list of host names or IP addresses for the nodes in the database. Using IP addresses is recommended because there is no dependence on DNS lookups. Host names must be absolute. You cannot use localhost or 127.0.0.1 as a host name.

One node is created for each comma-separated item in the list. The number of nodes must be even. Using duplicate host names creates multiple nodes on the same machine with different port numbers. Make sure that nodes on the same machine are not mirror nodes.

Nodes are numbered starting at 0 in the order listed in this option. The first mirrored pair are nodes 0 and 1, the second 2 and 3, and so on. Odd numbered nodes are in one DRU, even numbered nodes in the other. If --spares is used, spare nodes are those with the highest numbers.

For information about configuring double network interfaces, see "Configuring Double Networks".

dbname

none

hadb

Specifies the database name, which must be unique. To make sure the database name is unique, use the hadbm list command to list existing database names.

Use the default database name unless you need to create multiple databases. For example, to create multiple clusters with independent databases on the same set of HADB machines, use a separate database name for each cluster.


Legal Notices