dbxml


dbxml [-ctVvx] [-h home] [-P password] [-s script] 

Description

The dbxml utility provides an interactive shell that you can use to manipulate containers, documents and indices, and to perform XQuery queries against those containers.

dbxml uses an optional Berkeley DB home (environment) directory, which defaults to the current directory. An attempt is made to join an existing environment; if that fails, a private environment is created in the specified location. dbxml has a concept of a default open container; that is, the container upon which container operations such as adding and deleting indices are performed. The default container is set by use of the createContainer and openContainer commands. An in-memory container can be created using the command, createContainer "". This is useful for using dbxml without file system side effects.

For a list of the commands available in the shell, use the help command. For help on a specific command, pass the command's name to the help command. For example:

dbxmlsh> help createContainer

The options are as follows:

-c
Create a new environment in the directory specified by the -h option. This option should only be used for debugging - since it does not allow you to specify important environment configuration options.
-h
Specify a home directory for the database environment; by default, the current working directory is used.
-P
Specify an environment password. Although Berkeley DB utilities overwrite password strings as soon as possible, be aware there may be a window of vulnerability on systems where unprivileged users can see command-line arguments or where utilities are not able to overwrite the memory containing the command-line arguments.
-s
Execute the dbxml commands contained in the script file upon shell startup. The commands must be specified one to a line in the script file. If any of the commands contained in the script file fail, the shell will not start.

For example, the following is the contents of a script that creates a container, loads several files into it, performs a query, and then prints the results:

createContainer myContainer.dbxml
putDocument a {<a><b name="doc1">doc1 n1</b><c>doc1 n2</c></a>}
putDocument a {<a><b name="doc2">doc2 n1</b><c>doc2 n2</c></a>}
putDocument a {<a><b name="doc3">doc3 n1</b><c>doc3 n2</c></a>}
query collection("myContainer.dbxml")/a/b
print
-t
Run in transaction mode. Transactions can be used, and they are required for writes.

Note that if you are running this utility against an existing environment, and that environment is transactional, this option will be automatically enabled.

-v
Provide verbose output. Specify this option a second time to increase the shell's verbosity.
-V
Write the library version number to the standard output, and exit.
-x
Run in secure mode. XQuery queries cannot access the local filesystem or perform network access.

If you are using dbxml to manipulate containers that are managed by an existing database environment, you must specify the path to that existing database environment. dbxml cannot be used to create environment files that can be shared with other applications. It will either create a private environment, or join an existing, shareable environment created by another application.

Environment Variables

DB_HOME
If the -h option is not specified and the environment variable DB_HOME is set, it is used as the path of the database home, as described in DB_ENV->open.

Copyright (c) 1996,2007 Oracle. All rights reserved.