Previous Table of Contents Index Next
Perforce 2009.2: Command Reference



p4 admin
Synopsis
Perform administrative operations on the server.
Syntax
p4 [g-opts] admin checkpoint [ -z ] [ prefix ]
p4 [g-opts] admin dbstat [ -h ] [ -s ] [ -a | dbtable... ]
p4 [g-opts] admin journal [ -z ] [ prefix ]
p4 [g-opts] admin lockstat
p4 [g-opts] admin logstat
p4 [g-opts] admin stop
p4 [g-opts] admin updatespecdepot [ -a | -s type ]
Description
The p4 admin command allows Perforce superusers to perform administrative tasks even when working from a different machine than the one running the Perforce Server.
To stop the server, use p4 admin stop. This locks the database to ensure that it is in a consistent state upon server restart, and then shuts down the Perforce background process. (For Windows users, this works whether you are running Perforce as a server or a service.)
To take a checkpoint, use p4 admin checkpoint [prefix]. This is equivalent to logging in to the server machine and taking a checkpoint with p4d -jc [prefix]. A checkpoint is taken and the journal is copied to a numbered file. If a prefix is specified, the files are named prefix.ckp.n or prefix.jnl.n-1 respectively, where n is a sequence number. You can store checkpoints and journals in the directory of your choice by specifying the directory as part of the prefix. (Rotated journals are stored in the P4ROOT directory, regardless of the directory in which the current journal is stored.) If no prefix is specified, the default filenames checkpoint.n and journal.n-1 are used.
The p4 admin journal command is equivalent to p4d -jj. For details, see the System Administrator's Guide. The files are created in the server root specified when the Perforce server was started.
The p4 admin lockstat command reports any database tables that are currently locked for a read or write operation.
The p4 admin dbstat command displays statistics on the internal state of the Perforce Server's database. The dbtable correspond to the db.* files in your server's root directory. This command is typically used in conjunction with Perforce technical support for purposes of estimating disk seeks due to sequential database scans. To obtain size information, use p4 admin dbstat -s.
The p4 admin logstat command reports the sizes of the journal, error log (if it exists), and audit log (if it exists).
The p4 admin updatespecdepot command causes the Perforce Server to archive stored forms (specifically, client, depot, branch, label, typemap, group, user, and job forms) into the spec depot. If the -a flag is used, all of the form specification types are archived. If the -s flag option is used, then only those of the specified type are archived. Only those forms that have not yet been archived are created.
Options
For p4 admin checkpoint and p4 admin journal, save the checkpoint and saved journal file in compressed (gzip) format, appending the .gz suffix to the files.
For p4 admin dbstat, display a histogram showing distances between leaf pages.
For p4 admin dbstat, display statistics for all tables.
For p4 admin updatespecdepot, update the spec depot with all current forms.
For p4 admin dbstat, display statistics for only the specified tables (for instance, db.have, db.user, and so on.)
-s type
For p4 admin updatespecdepot, update the spec depot with forms of the specified type, where type is one of client, depot, branch, label, typemap, group, user, or job.
Usage Notes
Can File Arguments Use
Revision Specifier?
Because p4 admin stop shuts down the Perforce server, you may see an error message indicating that the connection between the client and server was closed unexpectedly. You can ignore this message.
Because p4 admin dbstat locks out write access to the database while it scans the tables, use this command with care. You will most often use this command when working with Perforce technical support.
For more about administering Perforce, see the Perforce System Administrator's Guide.
Examples
Create a checkpoint named checkpoint.n, and start a new journal named journal, copying the old journal file to journal.n-1, where n is a sequence number.
Create a checkpoint named name.ckp.n, and start a new journal named journal, copying the old journal file to name.jnl.n-1, where n is a sequence number.


Previous Table of Contents Index Next

Perforce 2009.2: Command Reference
Copyright 1999-2009 Perforce Software.