sdeversion

The sdeversion command allows the ArcSDE administrator to manage versions. 

Usage syntax

sdeversion -o alter -V <version_name> [-d <description>]
[-A {public | protected | private}] [-N] [-q]
[-s <server_name>] [-D <database_name>]
[-i {<service> | <port#> | <direct connection>}]
-u <DB_user_name> [-p <DB_user_password>]
 

sdeversion -o create -V <version_name> -P <parent_version> [-U]
[-A {public | protected | private}] [-d <description>]
[-i {<service> | <port#> | <direct connection>}] [-s <server_name>]
[-D <database_name>] -u <DB_user_name> [-p <DB_user_password>] [-q]
 

sdeversion -o compress [-N] -u <ArcSDE_Admin_user_name> [-p <ArcSDE_Admin_user_password>] [-q]
[-i {<service> | <port#> | <direct connection>}] [-s <server_name>] [-D <database_name>]
 

sdeversion -o delete -V <version_name> [-N]
[-s <server_name>] [-D <database_name>] [-q]
[-i {<service> | <port#> | <direct connection>}]
-u <DB_user_name> [-p <DB_user_password>]
 

sdeversion -o describe [-V <version_name>] [-w <"where_clause">]
-u <DB_user_name> [-p <DB_user_password>] [-q]
[-s <server_name>] [-D <database_name>]
[-i {<service> | <port#> | <direct connection>}]
 

sdeversion -o rename -V <old_version_name> -n <new_version_name> [-N]
-u <DB_user_name> [-p <DB_user_password>] [-q] [-s <server_name>]
[-i {<service> | <port#> | <direct connection>}] [-D <database_name>]
 

sdeversion -h

sdeversion -?
 

Operations

Operation Description
alter Allows you to alter the definition of a version
compress Compresses the database's state tree
create Creates a new version
delete Deletes an existing version
describe Shows version descriptions and lists the current definition of an existing version
rename Renames an existing version

 

Options

Options Description
-A
 
Access: public, protected, or private
-d Version description
-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)
-n New version name
-N No verification is performed; the operation begins immediately after being invoked
-o Operation
-p DBMS user password

For the compress operation, this is the DBMS user password of the ArcSDE administrator

-P Parent version name
-q Quietall titles and warnings are suppressed.
-s ArcSDE server host name (default: localhost)
-U Generate unique version name by adding a suffix if necessary.
-u DBMS user name

For the compress operation, this is the DBMS user of the ArcSDE administrator

-V Version name

Version names are case sensitive. For example, SDE.DEFAULT and SDE.default are different versions.

-w SQL WHERE clause

 

Discussion

The sdeversion command manages versions of an ArcSDE geodatabase. For more information on versioning, see the ArcGIS Desktop or ArcGIS Server Help, which can be accessed from the ESRI Resource Center. (http://resources.arcgis.com)

Examples

Alter a version's definition

The alter operation allows you to alter the definition of a version. For example, you may want to make the new version available to some coworkers but with read-only access permissions. Only the version owner can alter a version. In the following example, version MY_VERSION, the access level is being changed to protected.

sdeversion -o alter -V MY_VERSION -A protected -u sde -p sde

Compress the database's state tree

Versioned databases need to be compressed to maintain performance. To do this, you can use the compress operation. You must be the ArcSDE administrator to perform a compress operation. Note that if you are using geodatabases stored in a user's schema with an Oracle database, the ArcSDE administrator is the schema owner. Also note that if you are using SQL Server 2005, your ArcSDE administrator may be dbo.

sdeversion -o compress -N -u sde -p jackaninny

The database's state tree is compressed by removing all states that are no longer referenced by a version. Branches not referenced by a version are removed, and nonbranching sequences between versions are trimmed.

Create a new version

In the following example, a new private version is createdJIMS_VERSIONbased on version SDE.DEFAULT. Since this will be a private version, only the person who creates it will have access to it.

sdeversion -o create -V JIMS_VERSION -P SDE.DEFAULT -A private -d "Overpass Design- Phase II" -u sde -p sde

The -d option allows you to add some descriptive text when creating the new version. This provides useful documentation as to the reasons for creating the new version.

Delete a version

The delete operation allows you to delete an existing version. Only the version owner can delete a version. Here, the ArcSDE administrator has decided to delete the version he just created above.

sdeversion -o delete -V JIMS_VERSION -u jim -p sde

Get the description and definition of a version

The describe operation shows a description and lists the current definition of an existing version. This example shows the description and definition of an SDE.DEFAULT version.

sdeversion -o describe -V SDE.DEFAULT -u sde -p sde129

ArcSDE 9.2 Build 625 Mon Oct 2 22:33:27 PDT 2005
Version Administration Utility
-----------------------------------------------------
Instance default version.
-----------------------------------------------------
Version Name: SDE.DEFAULT
Version ID: 1
Parent Version Name:
Parent Version ID: 0
State ID: 3422
Access: Public
Creation Time: 09/01/99 11:16:28

If you execute sdeversion without specifying the -V option, you receive a list of all the versions for that instance. For example, in the following sdeversion -o describe statement, all the versions for the database associated with ArcSDE service 6000 are listed.

sdeversion -o describe -i 6000 -u sde

Version  Administration Utility
-------------------------------------------------
Enter DBMS User Password:
2 versions found:

Instance default version
-------------------------------------------------
Version Name:         sde.Default
Version ID:           1
Parent Version Name:    
Parent Version ID:    0
State ID:             0
Access:               Public
Creation Time:        05/15/2006  16:32:24

-------------------------------------------------
Version Name:         gdb.AugustEdits
Version ID:           15
Parent Version Name:  sde.DEFAULT
Parent Version ID:    1
State ID:             0
Access:               Public
Creation Time:        08/01/2007  08:05:16

When you use replication, system versions are created that assist with the synchronization process. When you execute sdeversion -o describe, if these versions exist in your database, they are included in the returned list of versions. Do not attempt to alter, rename, or compress these versions. Making any changes to these versions will result in your not being able to synchronize replicas.

Rename a version

Use the rename operation to change the name of an existing version. Only the version owner can rename a version.

sdeversion -o rename -V MY_VERSION -n PATS_VERSION -u sde -p sde

 

Home

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