12. ‘The ‘maintain’ Utility : ‘maintain’ Command Reference

‘maintain’ Command Reference
chpasswd
maintain chpasswd <user> <new-password>
Changes the password stored in the AccuRev repository for an existing principal-name (named AccuRev user). To remove a user’s password, use two consecutive double-quote characters as the <new-password> parameter:
maintain chpasswd derek ""
chslice
maintain chslice <slice-number> <new-location>
Changes the location of an existing slice in the repository. Use the show slices command to get a listing of slice numbers and their current locations.
Note: this command does not physically move the slice. See the chslice command in the AccuRev CLI User’s Guide for more information.
chuser
maintain chuser <user-ID> <new-username>
Changes the principal-name (AccuRev username) of an existing user. You specify the user by the unique numeric user-ID, which is immutable. This command is similar to the accurev chuser command.
concheck
maintain concheck [ site | diag ] <db-admin>
Tests AccuRev’s ability to connect to the database.
When site is specified, the command verifies the existence of the AccuRev database as well.
When diag is specified, the command performs a series of diagnostics (server initialization, database connection, query execution, and database creation) and displays timing information for each one.
Also see Specifying a Database Admin Username and Password.
dbcheck
maintain dbcheck [<depot-name>]
Performs certain checks on the whole AccuRev database or a specified depot-name:
Note: Stop the AccuRev Server before running this command.
dbupgrade
maintain dbupgrade [ --auto_commit ] <db-admin>
Upgrades the AccuRev database when the schema changes between AccuRev versions (between 5.x and 6.x, for example). This process may take several minutes or several hours, depending upon the size of the database being upgraded. You should always perform a full backup before running dbupgrade. See Backup/Restore of the AccuRev Repository for more information.
The dbupgrade wizard will prompt you through the options and values that you need to provide, including database admin name and password. If you are upgrading from AccuRev 4.x, the wizard gives you the option to perform a “dry run” upgrade -- one that does not write to the database -- to allow you to verify the UTF-8 changes that are required for the current AccuRev database before actually committing them. If you already have a UTF-8 database (AccuRev 5.2 and later) you will not be given the option for a dry-run because no UTF-8 conversion is required.
During the upgrade, dbupgrade checks and corrects (if necessary) the integrity of information in AccuRev depots. These integrity checks focus primarily on the trans (transactions), trans_entry (transaction-entries), ver (version), vvr (virtual-version), and anc (ancestry) tables.
The --auto_commit option. If you have a large number of depots (several hundred or more), consider using the --auto_commit option. The --auto_commit option instructs dbupgrade to commit each depot immediately after it is checked, rather than waiting until every depot has been inspected before committing all changes. This requires fewer database resources and can help speed the dbupgrade process.
If a failure occurs when using this option, some depots will have been upgraded to the new database version, while others will have not. If you can resolve the problem, you can run dbupgrade with the
--auto_commit option again; dbupgrade will skip the depots that have already been upgraded and resume the upgrade process with the remainder. If you are unable to resolve the problem that lead to the failure, you can return to your pre-upgrade state by reinstalling your previous AccuRev release and then restoring from the backup you created prior to running dbupgrade.
See “Using the ‘maintain dbupgrade’ Command” in the current AccuRev Installation and Release Notes for the most up-to-date information about using dbupgrade. Also see Specifying a Database Admin Username and Password.
discard
maintain discard [-i] [-v] {-s <stream> | -l <stream list file>} <snapshot or stream>
The discard command permanently deletes a snapshot or stream, provided it is unreferenced. This means it cannot have cross-links, children or references. An attempt to discard such will fail. Once deleted, the stream or snapshot may not be restored.
Supported options include:
-s <stream>: Specify stream to be discarded.
-l <stream list>: Specify a file containing a list of streams to be discarded.
-v: display additional information.
-i: display only what is being discarded without actually deleting anything.
Note: Use of either -s or -l is required.
mkdbuser
maintain mkdbuser <db-admin>
Makes a database user using the DB_USER and DB_PASS values from the acserver.cnf file in the AccuRev bin directory. The AccuRev Server uses this username to communicate with the database.
mksite
maintain mksite <db-admin>
This command creates an empty database for use with AccuRev 5.0 and higher.
Also see Specifying a Database Admin Username and Password.
restore
maintain restore <backup-file-spec> <db-admin>
Provides a facility for restoring AccuRev metadata from backup (see Backup/Restore of the AccuRev Repository).
The <backup-file-spec> can be either a file name (if the backup was saved to $BACKUP_LOC) or the full path and name of the backup file.
Also see Specifying a Database Admin Username and Password.
rmdepot
maintain rmdepot <depot-name>
Removes a depot from the AccuRev repository. All streams, snapshots, and workspace streams are also removed from the repository. (Workspace trees are not removed.) For details, see Removing a Depot from the AccuRev Repository.
rmsite
maintain rmsite <db-admin>
Removes the PostgreSQL database used by AccuRev 5.0 and higher.
Also see Specifying a Database Admin Username and Password.
setcnf
maintain setcnf <parameter> [<value>]
Writes the <parameter> and <value> specified to the acserver.cnf file in the AccuRev bin directory in the form PARAMETER=value. If the <parameter> is DB_PASS, this command encrypts the plain-text password given as well.
server_properties
maintain server_properties [ update <db-admin> ]
Displays the following server properties from both the acserver.cnf file and the AccuRev database: SITE_SLICE_LOC, MASTER_SERVER, and PORT. In addition, the values from each location are compared and the command displays whether or not they match.
When the update option is specified, the values that do not match are written from the acserver.cnf file into the database.
Important! Whenever you edit the values for SITE_SLICE_LOC, MASTER_SERVER, or PORT in the acserver.cnf file, you must also run the maintain server_properties update command before the new values will take effect.
show slices
maintain show slices [ all ]
For each AccuRev depot, displays the slice number (Slice#) and the full pathname to the directory within the repository that stores the data for that depot (Location). Use the all parameter to include deactivated (removed) slices in the listing. Use the chslice command to change the location of a slice.
su
maintain su [ { -a | -r } <accountname> ]
Add or remove a superuser account for working with element-level security (“EACL”s). If run with no arguments, maintain su displays a list of any superusers. See Element-Level Security (EACLs) for details.
vercheck
maintain vercheck [{ -c | -q } [ -e <eid> ] <depot-name>
Checks the storage containers in the specified depot’s data directory tree to verify that a storage container file (.sto) exists for each file version recorded in the depot database. It also reports CRC mismatches, which occur when the calculated checksum (CRC) of a .sto file does not match the checksum recorded in the corresponding version record.
You can use these vercheck options to correct CRC mismatches:
-q: computes the checksum of the .sto file and replaces the CRC value in the version record with the newly computed value.
-c: changes the .sto file by removing all its CR characters -- that is, all bytes with the value 0x0D -- and then performs the changes associated with -q.
By default, these options correct all versions of all files with CRC mismatches. You can restrict CRC mismatch processing to versions of a particular element with the -e option, leaving other versions as-is.
verinfo
maintain verinfo [ -fx ][ -n <count> ] <depot-name>
Displays the version information of unarchived elements in a depot, sorted by size.
The elements displayed can be altered by these options:
-fx: Display the results in XML format.
-n <count>: Display the first <count> elements.
Note:The size is the sum of all unarchived versions of the element kept and does not represent the size of the individual file. In addition, elements on Windows machines have the CR (Carriage Return) stripped from LR(Line Return)/CR and may actually be smaller than the actual file.

Micro Focus