samdb - Oracle HSM sideband database commands
samdb check family_set [-f] [-s] [-q]
samdb create family_set [-s schema_file]
samdb dump family_set [-a] [-s] [-f file name]
samdb drop family_set
samdb load family_set [-i] [-f file name]
samdb query family_set [-t type] [-c] [-s] [-i inum] [-f file] [-v vsn]
The samdb
commands are used to configure and query an Oracle HSM MySQL
database. This database retains metadata information for each file in the file
system. Use of the Oracle HSM MySQL database implies the Oracle HSM server has
access to a MySQL server. The Oracle HSM server need not host the MySQL server if
as network access to the database host system is available. The samdb.conf
(4)
configuration file contains the access parameters for the database.
Use of the Oracle HSM MySQL database is optional and is specified by the mount
option sam_db
. If set, the fsalogd daemon
is started at mount time.
The file system sends events to the fsalogd who writes the events to a
log file. A second daemon, sam-dbupd
, reads the events from the fsalogd
log files and updates the Oracle HSM database.
The database is initially populated by the samdb load
command. Input
to the samdb load
command is the load file created by samfsdump.
Example 1:
Generate load file from an existing dumpfile.
# samfsrestore -S -Z ∕tmp∕samfs1∕dbload -f ∕path∕to∕dump∕samfs1.dump
Example 2:
Generate load file while performing a samfsrestore.
# samfsrestore -Z ∕tmp∕samfs1dbload -f ∕path∕to∕dump∕samfs1.dump
Example 3:
Pipelining samfsdump to load database.
# samfsdump -S -Z - ∕samfs1 | samdb load samfs1
Once the Oracle HSM MySQL database is populated, the performance of
samfsdump
(1m) can be improved by using the database for path
name creation. This is either done with a file created by samdb dump
or pipelined together.
Example:
Pipelining samdb dump to samfsdump
# samdb dump samfs1 | samfsdump -Y -f ∕path∕samfs1.dump -
A series of commands are provided to configure and query the Oracle HSM MySQL database. The specific options to the individual commands are listed below.
family set
Specifies the family set name of the file system. This family set name must
be configured in the samdb.conf
file.
help
Displays a command syntax summary.
Here is a list of the samdb commands and an explanation of the options.
samdb check
family_set [-f
] [-s
] [-q
]Checks the database against specified file system for consistency. This scans the inodes of the filesystem making sure the entries in the database are correct.
-f
Perform a fast consistency check. This skips checking the directory namespace in the database, using only information found in the inode.
-s
Perform a scan without repairing database errors.
-q
Quiet output, only display the number of problems found.
samdb create
family_set [-s schema_file
]Creates the database for the specified filesystem. The Oracle HSM sideband database
must be created using the samdb create
command and not the MYSQL create
command.
-s schema_file
Specifies the schema file to use. The default file is ∕opt∕SUNWsamfs∕etc∕samdb.schema. The schema file contains a series of CREATE TABLE commands.
samdb dump
family_set [-a
] [-s
] [-f file name
]Generates a list of files for samfsdump.
-a
Use absolute pathnames in file list. This will allow samfsdump to be ran outside of the root of the filesystem. The default is relative pathnames.
-s
Sort dump file by parent directory ids. This option groups files together in the dump file based on their parent directories. Subsequent samfsdump performance will not be improved when using this option.
-f file name
Specifies file to send output to. If a file is not supplied, output goes to standard out.
samdb drop
family_setDrops the database for the specified file system. A confirmation prompt will appear.
samdb load
family_set [-f file name
]Loads a database from a samfsdump file. After loading a database a samdb check should be performed for that filesystem.
-i
Use an inode scan instead of a load file to load the database. This can be used if no recent samfsdump file is available to generate the load file with.
-f filename
The filename of the load file, default is standard input. This file can
be generated by samfsdump
(1m)∕samfsrestore
(1m) -Z option.
samdb query
family_set [-t type] [
-c
] [-s
] [-i inum
] [-f file
] [-v vsn
]Queries a database for files or vsns based on provided file or vsn information. Multiple -ifv terms can be provided. Like terms are OR'd together, and unlike terms are AND'd.
-t {vsn,file}
The query type to produce, either vsn or file. If vsn is chosen a list of vsns matching the -ifv terms will be output. If file is chosen a list of files matching the -ifv terms will be output. If both query types are chosen, e.g. -t vsn -t file, then a list of files broken down by vsn will be output. The default is file.
-c
Produce a count instead outputing a result list. Depending on the query type, the output will be the number of either vsns or files that match the -ifv terms.
-s
Sort the results. Results are sorted alphabetically ascending.
-i inum
Match the provided inode number. This is provided to query the database for which files or vsns have the given inode number.
-f filename
Match the provided filename. This queries the database for files that match the given filename. The % wildcard character can be used within a filename to match multiple files. Paths must either being with a wildcard, or be absolute relative to the mount point.
For example ∕dir1∕file1 or %dir1∕file1 are valid. The first would match the dir1 directory in the mount point. The second would match any directory ending in dir1.
-v vsn
Match the provided vsn. Depending on the query type this will output a list of files on the vsn, or restrict the results to the provided vsn.