The dbscan tool analyzes and extracts information from a Directory Server database file. See Section 4.4, “Database Files” for more information on database files.
Database files use the .db2, .db3, and .db4 extensions in their filename, depending on the version of Directory Server.
dbscan
-f filename
[
options
]
| Option | Parameter | Description |
|---|---|---|
-f
|
filename | Specifies the name of the database file, the contents of which are to be analyzed and extracted. This option is required. |
-R
|
Dump the database as raw data. | |
-t
|
size | Specifies the entry truncate size (in bytes). |
The options listed in Table 6.22, “Entry File Options” are meaningful only when the database file is id2entry.db4.
| Option | Parameter | Description |
|---|---|---|
-K
|
entry_id | Specifies the entry to ID to look up. |
The index file options, listed in Table 6.23, “Index File Options ”, are meaningful only when the database file is the secondary index file.
| Option | Parameter | Description |
|---|---|---|
-k
|
key | Specifies the key to look up in the secondary index file. |
-l
|
size |
Sets the maximum length of the dumped ID list. The valid range is from 40 to 1048576 bytes. The default value is 4096.
|
-G
|
n | Sets only to display those index entries with ID lists exceeding the specified length. |
-n
|
Sets only to display the length of the ID list. | |
-r
|
Sets to display the contents of the ID list. | |
-s
|
Gives the summary of index counts. |
The following are command-line examples of different situations using dbscan to examine the Directory Server databases.
dbscan -f /var/lib/dirsrv/slapd-instance_name/db/userRoot/id2entry.db4
dbscan -f /var/lib/dirsrv/slapd-instance_name/db/userRoot/cn.db4
dbscan -r -f /var/lib/dirsrv/slapd-instance_name/db/userRoot/mail.db4
dbscan -r -G 20 -f /var/lib/dirsrv/slapd-instance_name/db/userRoot/sn.db4
dbscan -s -f /var/lib/dirsrv/slapd-instance_name/db/userRoot/objectclass.db4
dbscan -r -f /var/lib/dirsrv/slapd-instance_name/db/userRoot/vlv#bymccoupeopledcpeopledccom.db4
dbscan -f /var/lib/dirsrv/slapd-instance_name/changelogdb/c1a2fc02-1d11b2-8018afa7-fdce000_424c8a000f00.db4
dbscan -R -f /var/lib/dirsrv/slapd-instance_name/db/userRoot/uid.db4
In this example, the common name key is =hr managers, and the equals sign (=) means the key is an equality index.
dbscan -k "=hr managers" -r -f /var/lib/dirsrv/slapd-instance_name/db/userRoot/cn.db4 =hr%20managers 7
dbscan -K 7 -f id2entry.db4 id 7 dn: cn=HR Managers,ou=groups,dc=example,dc=com objectClass: top objectClass: groupOfUniqueNames cn: HR Manager ou: groups description: People who can manage HR entries creatorsName: cn=directory manager modifiersName: cn=directory manager createTimestamp: 20050408230424Z modifyTimestamp: 20050408230424Z nsUniqueId: 8b465f73-1dd211b2-807fd340-d7f40000 parentid: 3 entryid: 7 entrydn: cn=hr managers,ou=groups,dc=example,dc=com