sdelog

The sdelog command administers log file tables. This command is primarily useful if you are utilizing shared log files, and is present mostly for backward compatibility since shared log files are not the default setting for any ArcSDE geodatabase. 

Usage syntax

sdelog -o alter -L <logfile> -k <PERSISTENT,TEMPORARY> [-O <Owner>]
[-i {<service> | <port#> | <direct connection>}] [-s <server_name>]
[-D <database_name>] -u <DB_user_name> [-p <DB_user_password>] [-N] [-q]
 

sdelog -o clean [-O <Owner>] [-i {<service> | <port#> | <direct connection>}]
[-s <server_name>] [-D <database_name>] -u <DB_user_name>
[-p <DB_user_password>] [-N] [-A] [-q]
 

sdelog -o delete -L <logfile> [-O <Owner>] [-s <server_name>]
[-i {<service> | <port#> | <direct connection>}] [-D <database_name>]
-u <DB_user_name> [-p <DB_user_password>] [-N] [-q]
 

sdelog -o display -L <logfile> [-O <Owner>] [-s <server_name>]
[-i {<service> | <port#> | <direct connection>}] [-D <database_name>]
-u <DB_user_name> [-p <DB_user_password>] [-q]
 

sdelog -o grant -U <user> [-O <Owner>] [-s <server_name>]
[-i {<service> | <port#> | <direct connection>}] [-D <database_name>]
-u <DB_user_name> [-p <DB_user_password>] [-q]
 

sdelog -o list [{-O <Owner> | -l <table,column> | -T <table>}]
[-i {<service> | <port#> | <direct connection>}] [-s <server_name>]
[-D <database_name>] -u <DB_user_name> [-p <DB_user_password>] [-q]
 

sdelog -o revoke -U <user> [-O <Owner>] [-s <server_name>]
[-i {<service> | <port#> | <direct connection>}] [-D <database_name>]
-u <DB_user_name> [-p <DB_user_password>] [-q]
 

sdelog -o truncate -L <logfile> [-O <Owner>] [-s <server_name>]
[-i {<service> | <port#> | <direct connection>}] [-D <database_name>]
-u <DB_user_name> [-p <DB_user_password>] [-N] [-q]
 

sdelog -h
 

sdelog -?
 

Operations

Operation Description
alter Modifies log file's persistence
clean Deletes all temporary log files
delete Deletes a single log file
display Prints the contents of a log file
grant Grants access to the owner's log file for a user
list Lists a user's log files
revoke Revokes access from the owner's log files for a user
truncate Deletes the contents of a log file

 

Options

Options Description
-A Deletes all log files: temporary, persistent, and pre-8.0 format
-D Database name (not supported on Oracle)
-h or -? Use either of these options to see the usage and options for the command. Note: If using a C shell, use -h or "-\?".
-i ArcSDE service name, port number, or direct connection information (default: esri_sde or 5151)
-k Log file persistence keyword, either TEMPORARY or PERSISTENT (Doesn't affect session or stand-alone log files.)
-l Layer table and spatial column name
-L Log file name (not containing user)
-N No verification is performed; operation begins immediately after being invoked.
-o Operation
-O Owner of the log file
-p DBMS user password
-q Quietall titles and warnings are suppressed.
-s ArcSDE server host name (default: localhost)
-T Table name
-u DBMS user name
-U The user to whom log file access will be granted or revoked or whose log files will be cleaned

 

Discussion

ArcSDE shared log files are stored in the DBMS tables SDE_LOGFILES and SDE_LOGFILE_DATA. Prior to ArcSDE 8, they were stored on disk as files. Some of the usage syntax still reflects that old style of use. During the migration to ArcSDE 8, the files on disk became DBMS table records. A log file is represented as a single row in the SDE_LOGFILES table. The records of the log file are stored in the SDE_LOGFILE_DATA table and are referenced by the foreign key LOGFILE_ID, which is also the primary key of the SDE_LOGFILES table.

Beginning with ArcSDE 9.0, two additional types of log files were introduced—session and stand-alone log files. This command (sdelog) is primarily used to administer shared log files.

 

Examples

Alter how long a log file persists

The alter operation modifies a log file's persistence from either temporary to persistent or vice versa. This example shows log file log0630, which is owned by user bernard, being changed from temporary to persistent.

sdelog -o alter -L log0630 -k PERSISTENT -O bernard -u av

Clean up temporary log files

Both the delete and clean operations of sdelog will remove log files. The clean operation, by default, removes a user's temporary log files. Essentially, all rows are truncated from the SDE_LOGFILES and SDE_LOGFILE_DATA tables for the user specified by the -U flag.

sdelog -o clean -u slojoe

Specify the -N option if you don't want to be prompted for verification.

sdelog -o clean -u slojoe -N

Specify the -A option to delete all of a user's logs: temporary, persistent, and the style preceding SDE 3.x.

sdelog -o clean -u slojoe -N -A

Delete a log file

The delete operation of the sdelog administration command removes a single log file. You can enter the -N option to suppress the verification prompt. In this case, the single record in the SDE_LOGFILES table containing the LOGFILE_NAME column value of logBCAa06599 is deleted. From the SDE_LOGFILE_DATA table, all records with a LOGFILE_ID foreign key that matches the SDE_LOGFILES table's primary key LOGFILE_ID value are deleted as well.

sdelog -o delete -L logBCAa06599 -u av -N

Print the contents of a log file

The log file utility display operation provides a list of shape IDs contained in the log file. When inputting the log file name, do not include the user name at the beginning. In this case, the log file name including the user name would have been RJP.XX00000131_0.

sdelog -o display -L XX00000131_0 -u RJP

Logfile               Administration Utility
-----------------------------------------------------
2
9
12
19
95
97
182
514
620
961
1026
1111
2002

Grant access to another user

The grant operation allows another user to have access to a specific user's log file. The log file's owner must grant this access. Here, rocketjay is being given access to cc's log files.

sdelog -o grant -U rocketjay -O cc -u cc

List log files

You can list the log tables with the log file utility list operation.

sdelog -o list -u RJP
Enter Database User password:

Logfile          Administration Utility
-----------------------------------------------

Logfile Name  :  RJP.XX00000131_0
Logfile Id    :  1
Logfile Type  :  TABLE
Table Id      :  41
Persistence   :  TEMPORARY
-------------------------------------------------------------

Revoke access to a log file

The revoke operation removes access from the owner's log files for a specified user.

sdelog -o revoke -U doc -O cc -u av

Truncate

The truncate operation deletes the contents of a log file but does not delete the log file itself. Here, log file log_perm4's contents are being deleted.

sdelog -o truncate -L log_perm4 -u sde

 

Home

Copyright © Environmental Systems Research Institute, Inc. 2004 - 2010.