DB2 10.5 for Linux, UNIX, and Windows

LIST DATABASE DIRECTORY command

Lists the contents of the system database directory. If a path is specified, the contents of the local database directory are listed.

Scope

If this command is issued without the ON path parameter, the system database directory is returned. This information is the same at all database partitions.

If the ON path parameter is specified, the local database directory on that path is returned. This information is not the same at all database partitions.

Authorization

None

Required connection

None. Directory operations affect the local directory only.

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-LIST--+-DATABASE-+--DIRECTORY--+---------------+------------><
         '-DB-------'             '-ON--+-path--+-'   
                                        '-drive-'     

Command parameters

ON path | drive
Specifies the local database directory from which to list information. If not specified, the contents of the system database directory are listed. Note that the instance name is implied in the path. Please do not specify the instance name as part of the path.

Examples

The following shows sample output for a system database directory:
     System Database Directory 
         
     Number of entries in the directory = 2
         
     Database 1 entry:          
       Database alias                       = SAMPLE     
       Database name                        = SAMPLE     
       Local database directory             = /home/smith     
       Database release level               = 8.00     
       Comment                              =     
       Directory entry type                 = Indirect     
       Catalog database partition number    = 0      
       Alternate server hostname            = montero
       Alternate server port number         = 29384
   
     Database 2 entry:          
       Database alias                       = TC004000
       Database name                        = TC004000
       Node name                            = PRINODE
       Database release level               = a.00
       Comment                              =
       Directory entry type                 = LDAP
       Catalog database partition number    = -1
       Gateway node name                    = PRIGW
       Alternate server node name           = 
       Alternate server gateway node name   = ALTGW

The following shows sample output for a local database directory:

     Local Database Directory on /u/smith

     Number of entries in the directory = 1

     Database 1 entry:

       Database alias                      = SAMPLE
       Database name                       = SAMPLE
       Database directory                  = SQL00001
       Database release level              = 8.00
       Comment                             =
       Directory entry type                = Home
       Catalog database partition number   = 0    
       Database partition number           = 0
            
These fields are identified as follows:
Database alias
The value of the alias parameter when the database was created or cataloged. If an alias was not entered when the database was cataloged, the database manager uses the value of the database-name parameter when the database was cataloged.
Database name
The value of the database-name parameter when the database was cataloged. This name is usually the name under which the database was created.
Local database directory
The path on which the database resides. This field is filled in only if the system database directory has been scanned.
Database directory
The name of the directory where the database resides. This field is filled in only if the local database directory has been scanned.
Node name
The name of the remote node. This name corresponds to the value entered for the nodename parameter when the database and the node were cataloged.
Database release level
The release level of the database manager that can operate on the database.
Comment
Any comments associated with the database that were entered when it was cataloged.
Directory entry type
The location of the database:
  • A Remote entry describes a database that resides on another node.
  • An Indirect entry describes a database that is local. Databases that reside on the same node as the system database directory are thought to indirectly reference the home entry (to a local database directory), and are considered indirect entries.
  • A Home entry indicates that the database directory is on the same path as the local database directory.
  • An LDAP entry indicates that the database location information is stored on an LDAP server.

All entries in the system database directory are either remote or indirect. All entries in local database directories are identified in thesystem database directory as indirect entries.

Authentication
The authentication type cataloged at the client.
Principal name
Specifies a fully qualified Kerberos principal name.
Catalog database partition number
Specifies which node is the catalog database partition. This is the database partition on which the CREATE DATABASE command was issued.
Database partition number
Specifies the number that is assigned in db2nodes.cfg to the node where the command was issued.
Alternate server hostname
Specifies the host name or the IP address for the alternate server to be used when there is communication failure on the connection to the database. This field is displayed only for the system database directory.
Alternate server port number
Specifies the port number for the alternate server to be used when there is communication failure on the connection to the database. This field is displayed only for the system database directory.
Alternate server node name
If the directory entry type is LDAP, specifies the node name for the alternate server to be used when there is communication failure on the connection to the database.
Alternate server gateway node name
If the directory entry type is LDAP, specifies the gateway node name for the alternate gateway to be used when there is communication failure on the connection to the database.

Usage notes

Regardless of the DB2LDAPCACHE miscellaneous variable setting, if using the LIST DATABASE DIRECTORY or the LIST NODE DIRECTORY commands, the list of local database and node entries are read from the LDAP server.

There can be a maximum of eight opened database directory scans per process. To overcome this restriction for a batch file that issues more than eight LIST DATABASE DIRECTORY commands within a single DB2® session, convert the batch file into a shell script. The "db2" prefix generates a new DB2 session for each command.