start-database
start-database
Starts the Java DB
Synopsis
asadmin [asadmin-options] start-database [--help]
[--jvmoptions jvm-options] [--suspend={true|false}]
[--dbhost host] [--dbport port-no]
[--dbhome db-file-path]
[--dbname name] [sqlfilename sql-file-path]
[--dbuser] [--passwordfile password-file-path]
Description
The start-database subcommand starts the Java DB server that is
available for use with Eclipse GlassFish. Java DB is based upon Apache
Derby. Use this subcommand only for working with applications deployed
to the server.
When you start Java DB server by using the start-database subcommand,
the database server is started in Network Server mode. Clients
connecting to it must use the Java DB ClientDriver. For details on
connecting to the database, refer to the Apache Derby documentation.
When the database server starts, or a client connects to it successfully, the following files are created:
-
The
derby.logfile that contains the database server process log along with its standard output and standard error information -
The database files that contain your schema (for example, database tables)
These files are created at the location that is specified by the
--dbhome option. To create the database files at a particular
location, you must set the --dbhome option. If the --dbhome option
is not specified, the start-database subcommand determines where to
create these files as follows:
-
If the current working directory contains a file that is named
derby.log, thestart-databasesubcommand creates the files in the current working directory. -
Otherwise, the
start-databasesubcommand creates the files in the as-install/databasesdirectory.
The start-database subcommand starts the database process, even if it
cannot write to the log file.
This subcommand is supported in local mode only.
Options
- asadmin-options
-
Options for the
asadminutility. For information about these options, see theasadmin(1M) help page. --help-?-
Displays the help text for the subcommand.
--jvmoptions-
A space-separated list of command-line options that are passed to the Java application launcher when the database is started. By default, no options are passed.
The format of an option depends on whether the option has a name and a value or only a name:-
If the option has a name and a value, the format is option-name=value.
-
If the option has only a name, the format is option-name. For example,
-Xmx512m.
-
--suspend-s-
Specifies whether the domain is started with Java Platform Debugger Architecture (JPDA) debugging enabled and suspend the newly started VM before the main class loads. When a debugger connects, it can send a JDWP command to resume the suspended VM. With debugging enabled extra exceptions can be printed. Possible values are as follows:
true-
The instance is started with JPDA debugging enabled and a suspendPolicy of
SUSPEND_ALL. The port number for JPDA debugging is displayed. false-
The instance is started with JPDA debugging disabled (default).
--dbhost-
The host name or IP address of the Java DB server process. The default is the IP address 0.0.0.0, which denotes all network interfaces on the host where you run the
start-databasesubcommand. --dbport-
The port number where the Java DB server listens for client connections. This port must be available for the listen socket, otherwise the database server will not start. The default is 1527.
--dbhome-
The absolute path to the directory where the database files and the
derby.logfile are created. If the--dbhomeoption is not specified, thestart-databasesubcommand determines where to create these files as follows:-
If the current working directory contains a file that is named
derby.log, thestart-databasesubcommand creates the files in the current working directory. -
Otherwise, the
start-databasesubcommand creates the files in the as-install/databasesdirectory.
-
--dbname-
The name of the database that should be used to initialize when
sqlfilenameis specified. --sqlfilename-
Path to a file containing SQL statements to be executed after starting up the Java DB. Each statement should be separated by a ";". Statements may be put on new lines. The file encoding to be used is UTF-8. This file is only taken into consideration when
dbnameis specified. --dbuser-
The user name of the Java DB user that is to execute init SQL statements. This option is used only when
dbnameandsqlfilenameare specified. If this option is omitted the DB schema used for the init SQL statements is owned by the default user. Must be combined with the generalpasswordfileoption of which the file it points to must contain theAS_ADMIN_DBPASSWORDkey with as value the password associated with the user.To create the database files at a particular location, you must set the
--dbhomeoption.
Examples
Example 1 Starting Java DB
This example starts Java DB on the host host1 and port 5001.
asadmin> start-database --dbhost host1 --dbport 5001 --terse=true
Starting database in the background. Log redirected to
/opt/SUNWappserver/databases/derby.log.
Example 2 Starting Java DB With Options for the Java Application
Launcher
This example starts Java DB with the options for setting the minimum heap memory size to 128 megabytes and the maximum heap memory size to 512 megabytes.
asadmin> start-database --jvmoptions="-Xms128m -Xmx512m" --terse=true
Starting database in the background.
Log redirected to /export/glassfish8/glassfish/databases/derby.log.
Exit Status
The exit status applies to errors in executing the asadmin utility.
For information on database errors, see the derby.log file. This file
is located in the directory you specify by using the --dbhome option
when you run the start-database subcommand. If you did not specify
--dbhome, the value of DERBY_INSTALL defaults to as-install/javadb.
- 0
-
subcommand executed successfully
- 1
-
error in executing the subcommand
See Also
"Administering Database Connectivity" in Eclipse GlassFish Administration Guide
For more information about the Java application launcher, see the reference page for the operating system that you are using:
-
Oracle Solaris and Linux: java - the Java application launcher (
http://docs.oracle.com/javase/6/docs/technotes/tools/solaris/java.html) -
Windows: java - the Java application launcher (
http://docs.oracle.com/javase/6/docs/technotes/tools/windows/java.html)