com.esri.arcgis.datasourcesGDB
Interface IDataServerManagerAdmin

All Superinterfaces:
Serializable
All Known Implementing Classes:
DataServerManager

public interface IDataServerManagerAdmin
extends Serializable

Provides access to administration functions of a Data Server.

Description

The IDataServerManagerAdmin interface allows you to administer a Database Server.

Remarks

You must first be connected to perform administration operations and be an administrator on the Database Server.

When To Use

Use this inteface to perform operations such as creating and deleting Geodatabases, adding or deleting logins, backing up Geodatabases, etc.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


Method Summary
 void analyze(String gdbName)
          Updates the statistics for a Geodatabase.
 void attachGeodatabase(String dbName, String dataFileName, String logFileName)
          Attachs an existing database to a server.
 boolean backupGeodatabase(String gdbName, String backupFileName, String backupName, String description)
          Performs a full backup on the specified Geodatabase.
 void createGeodatabase(String gdbName, String gdbFileName, int gdbFileSize, String logFileName, int logFileSize)
          Creates a new Geodatabase.
 void createLogin(String loginName, boolean isAdministrator)
          Creates a new login.
 IWorkspaceName createWorkspaceName(String gdbName, String versionPropName, Object versionSpecifier)
          Creates a Workspace Name object to the Geodatabase.
 void deleteGeodatabase(String gdbName)
          Deletes a Geodatabase.
 void deleteLogin(String loginName)
          Deletes a login.
 void detachGeodatabase(String dbName)
          Detachs a database from a server.
 int getConnectedUsers(String dbName)
          Gets active users.
 void getDBProperties(String dbName, String[] status, int[] dbSize, String[] owner, Object[] createDate, Object[] dbBackup)
          Returns various properties on a Database.
 void getFileProperties(String dbName, String[] dataName, String[] dataPhysicalName, int[] dataFileSize, String[] logName, String[] logPhysicalName, int[] logFileSize)
          Return various properties on a database file.
 String getGeodatabaseName(String dataFileName)
          Returns the Database name from the database file.
 IEnumBSTR getGeodatabaseNames()
          Returns a list of Geodatabse names.
 void getLogins(IEnumBSTR[] loginNames, IEnumBSTR[] dbNames, IEnumBSTR[] loginTypes, IEnumBSTR[] languages)
          Returns a list logins and associated information.
 void getServerAdministrators(IEnumBSTR[] userNames)
          Gets a list of server administrators.
 void getUsersByPermissionType(String dbName, int permission, IEnumBSTR[] userNames)
          Get Users in by the Permission type.
 boolean isConnectedUserAdministrator()
          Indicates whether the connected user is an administrator or not.
 void isSimpleRecoveryModel(String gdbName, boolean[] isSimpleRecoveryModel)
          Returns whether the Geodatabase is in simple recovery model or not.
 void modifyGeodatabaseSecurity(String dbName, String loginName, int permission)
          Modify a login's database security.
 void modifyLoginSecurity(String loginName, boolean isAdministrator)
          Modify a login's server security.
 void rebuildIndices(String gdbName)
          Rebuilds the indices on all tables in a Geodatabase.
 void restoreGeodatabase(String gdbName, String backupFileName, String dbFilePath)
          Restores a backup for the specified Geodatabase.
 void setGeodatabaseToSimpleRecoveryModel(String gdbName)
          Sets a Geodatabase to simple recovery model.
 void shrinkGeodatabase(String gdbName)
          Shrinks the size of a Geodatabase and frees up unused space.
 void upgradeGeoDatabase(String gdbName)
          Upgrades a Geodatabase.
 void upgradeSDESchema(String gdbName)
          Upgrades the SDE schema.
 

Method Detail

createGeodatabase

void createGeodatabase(String gdbName,
                       String gdbFileName,
                       int gdbFileSize,
                       String logFileName,
                       int logFileSize)
                       throws IOException,
                              AutomationException
Creates a new Geodatabase.

Remarks

The CreateGeodatabase method creates a geodatabase with the supplied name, corresponding to the specified .mdf file.

The gdbName and gdbFileName arguments must have the same name, geodatabases with different names from the .mdf file are not currently supported. The gdbFileName argument should contain the complete folder path to the location in which the .mdf file will be created. It should also correspond with the name of the geodatabase to be created and should have the ".mdf" suffix specified.

gdbFileSize is in megabytes and is an optional parameter. If you specify 0, the size of the database created will be set to the data server's defaults (which is generally around 7 MBs).

logFileName and logFileSize are also optional parameters. If you specify an empty string for the logFileName or 0 for the logFileSize, they will be set to the data server's defaults. If an empty string is supplied for logFileName, a file will be created in the same directory as that specified for the gdbFileName, but will conform to the following: gdbFileName & "_log.LDF". If the logFileName argument is supplied, a valid size (greater than 0), must be supplied for the logFileSize. The logFileName may have a different name and be created within a different location than the .mdf file, however, this is generally not recommeded.

You must be a server administrator to perform this operation.

After a geodatabase has been created, all server administrators, including the user who created the geodatabase will have access to it. Other users will need to be granted permission to the geodatabase.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
gdbName - The gdbName (in)
gdbFileName - The gdbFileName (in)
gdbFileSize - The gdbFileSize (in)
logFileName - The logFileName (in)
logFileSize - The logFileSize (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deleteGeodatabase

void deleteGeodatabase(String gdbName)
                       throws IOException,
                              AutomationException
Deletes a Geodatabase.

Description

Deletes a Geodatabase.

Remarks

You must be a server administrator to perform this operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
gdbName - The gdbName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createLogin

void createLogin(String loginName,
                 boolean isAdministrator)
                 throws IOException,
                        AutomationException
Creates a new login.

Description

The method creates a login on the server. Login names are Microsoft Windows logins.

Remarks

If the isAdministrator parameter is set to true, the new user is made an adminstrator and has full administration rights, such as creating or deleting Geodatabases, adding users, etc.

You must be a server administrator to perform this operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
loginName - The loginName (in)
isAdministrator - The isAdministrator (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

modifyLoginSecurity

void modifyLoginSecurity(String loginName,
                         boolean isAdministrator)
                         throws IOException,
                                AutomationException
Modify a login's server security.

Description

This method allows you to make an existing login an administrator or not.

Remarks

You must be an server adminstrator to execute this method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
loginName - The loginName (in)
isAdministrator - The isAdministrator (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

modifyGeodatabaseSecurity

void modifyGeodatabaseSecurity(String dbName,
                               String loginName,
                               int permission)
                               throws IOException,
                                      AutomationException
Modify a login's database security.

Description

This method modifies the permission type of a user at the Geodatabase level. Permissions include the read access to the data, read\write access including the ability to create data in the Geodatabase or read\write access with the ability to perform administrator tasks. You must be a server administrator or a user with Geodatabase administrator permissions to use this method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
dbName - The dbName (in)
loginName - The loginName (in)
permission - A com.esri.arcgis.datasourcesGDB.esriGeodatabasePermissionsType constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deleteLogin

void deleteLogin(String loginName)
                 throws IOException,
                        AutomationException
Deletes a login.

Description

This method deletes a login from a database server. In order to delete a user or login, the user cannot own any data within the Database Server.

Remarks

You must be a server administrator to perform this operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
loginName - The loginName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getGeodatabaseNames

IEnumBSTR getGeodatabaseNames()
                              throws IOException,
                                     AutomationException
Returns a list of Geodatabse names.

Description

This method returns a list of Geodatabases on the Database Server.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
A reference to a com.esri.arcgis.system.IEnumBSTR
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLogins

void getLogins(IEnumBSTR[] loginNames,
               IEnumBSTR[] dbNames,
               IEnumBSTR[] loginTypes,
               IEnumBSTR[] languages)
               throws IOException,
                      AutomationException
Returns a list logins and associated information.

Description

This method returns a list of logins and their associated Geodatabase, login types, and default languages.

Remarks

The login types are: NTUser, NTGroup and Standard. They represent a Windows login, Windows group and a built-in database user, respectively.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
loginNames - A reference to a com.esri.arcgis.system.IEnumBSTR (out: use single element array)
dbNames - A reference to a com.esri.arcgis.system.IEnumBSTR (out: use single element array)
loginTypes - A reference to a com.esri.arcgis.system.IEnumBSTR (out: use single element array)
languages - A reference to a com.esri.arcgis.system.IEnumBSTR (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

detachGeodatabase

void detachGeodatabase(String dbName)
                       throws IOException,
                              AutomationException
Detachs a database from a server.

Description

This method detaches a Geodatabase from a database server. Once detached, the Geodatabase can be re-attached to this or some other database server. A Geodatabase cannot be detached while users are connected to it.

Remarks

You must be a server administrator to perform this operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
dbName - The dbName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

attachGeodatabase

void attachGeodatabase(String dbName,
                       String dataFileName,
                       String logFileName)
                       throws IOException,
                              AutomationException
Attachs an existing database to a server.

Remarks

The AttachGeodatabase method allows a Geodatabase to be attached to a Database Server. The dataFileName parameter must contain the full path name to the mdf file to be attached, for example: "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\MyDatabase.mdf". The logFileName is an optional parameter, i.e., you can set it to 0. If not specified, the log file will be re-created. The Geodatabase must first have been detached from a database server, before it can be attached.

You must be a server administrator to perform this operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
dbName - The dbName (in)
dataFileName - The dataFileName (in)
logFileName - The logFileName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

upgradeGeoDatabase

void upgradeGeoDatabase(String gdbName)
                        throws IOException,
                               AutomationException
Upgrades a Geodatabase.

Description

This upgrades the ArcSDE and Geodatabase releases to the current release of the installed ArcGIS. Geodatabases must be upgraded in order to take advantage of new functionality when new releases of ArcGIS are available.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
gdbName - The gdbName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

upgradeSDESchema

void upgradeSDESchema(String gdbName)
                      throws IOException,
                             AutomationException
Upgrades the SDE schema.

Remarks

The IDataServerManagerAdmin.UpgradeGeoDatabase should be used in place of this method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
gdbName - The gdbName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getGeodatabaseName

String getGeodatabaseName(String dataFileName)
                          throws IOException,
                                 AutomationException
Returns the Database name from the database file.

Description

This method returns the name of the Geodatabase inside a database server data file (.mdf). For Database Servers, the Geodatabase name will also be equal to the name of the .mdf file.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
dataFileName - The dataFileName (in)
Returns:
The dbName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

backupGeodatabase

boolean backupGeodatabase(String gdbName,
                          String backupFileName,
                          String backupName,
                          String description)
                          throws IOException,
                                 AutomationException
Performs a full backup on the specified Geodatabase.

Description

This method backs up a Geodatabase.

Remarks

You must specify the Geodatabase to be backed up, the name of the backup file to be created and a name identifying the backup itself. The description parameter is optional and may be set to 0.

If the Geodatabase has been set to something other than simple recovery model, then this method will fail and the IsSimpleRecoveryModel parameter will be set to TRUE.

You must be a server administrator or have geodatabase admin permissions (esriPermAdmin) to perform this operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
gdbName - The gdbName (in)
backupFileName - The backupFileName (in)
backupName - The backupName (in)
description - The description (in)
Returns:
The isSimpleRecoveryModel
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

restoreGeodatabase

void restoreGeodatabase(String gdbName,
                        String backupFileName,
                        String dbFilePath)
                        throws IOException,
                               AutomationException
Restores a backup for the specified Geodatabase.

Description

This method restores a Geodatabase from a previous backup.

Remarks

If the dbFilePath parameter is set to 0, the database will be backed up to it's original location. Specifying the dbFilePath parameter allows you to change the physical location of the data file. In this case, the dbFilePath parameter should specify the full path of the new location, including the new file name.

You must be a server adminstrator to perform this operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
gdbName - The gdbName (in)
backupFileName - The backupFileName (in)
dbFilePath - The dbFilePath (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isSimpleRecoveryModel

void isSimpleRecoveryModel(String gdbName,
                           boolean[] isSimpleRecoveryModel)
                           throws IOException,
                                  AutomationException
Returns whether the Geodatabase is in simple recovery model or not.

Description

This method returns whether the Geodatabase is in simple recovery model or not.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
gdbName - The gdbName (in)
isSimpleRecoveryModel - The isSimpleRecoveryModel (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setGeodatabaseToSimpleRecoveryModel

void setGeodatabaseToSimpleRecoveryModel(String gdbName)
                                         throws IOException,
                                                AutomationException
Sets a Geodatabase to simple recovery model.

Description

This method sets the Geodatabase to simple recovery model, which is required for backup/restore tools to work. It is not necessary to use this method when calling the BackupGeodatabase or RestoreGeodatabase methods.

Executing this method is only necessary if the geodatabase recovery model option has been modified outside of ArcGIS. Geodatabase created within ArcGIS will always use the simple recovery method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
gdbName - The gdbName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isConnectedUserAdministrator

boolean isConnectedUserAdministrator()
                                     throws IOException,
                                            AutomationException
Indicates whether the connected user is an administrator or not.

Description

This method returns whether the connected user is an administrator or not.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The isAdministrator
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createWorkspaceName

IWorkspaceName createWorkspaceName(String gdbName,
                                   String versionPropName,
                                   Object versionSpecifier)
                                   throws IOException,
                                          AutomationException
Creates a Workspace Name object to the Geodatabase.

Remarks

CreateWorkspaceName takes as input a geodatabase name (gdbName), type of version (versionPropName) and version name (versionSpecifier) and returns a WorkspaceName object to the specified geodatabase and version.

There are 3 valid values for the versionPropName property:

You must initialize the Data Server Manager object before using this method. The Data Server Manager can be initialized through the use of IDataServerManager.InitFromFile or IDataServerManager.ServerName and then calling IDataServerManager.Connect.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
gdbName - The gdbName (in)
versionPropName - The versionPropName (in)
versionSpecifier - A Variant (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IWorkspaceName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDBProperties

void getDBProperties(String dbName,
                     String[] status,
                     int[] dbSize,
                     String[] owner,
                     Object[] createDate,
                     Object[] dbBackup)
                     throws IOException,
                            AutomationException
Returns various properties on a Database.

Description

This method returns properties on a Geodatabase. It can only be used on Geodatabases that are attached to a data server. If the dbName parameter does not correspond to a Geodatabase attached to the current data server, an error will be raised.

Remarks

The dbName input parameter specifies for which database the properites should be returned.

The Status value indicates the status of the Geodatabase; such as Online for an attached Geodatabase or Offline for a detached Geodatabase.

dbSize indicates the size in MB of the Geodatabase.

The Owner value corresponds to the owner who created the Geodatabase and will refer to the OS login, not the database login.

The createDate value is the creation date for the Geodatabase.

The DbBackup parameter is an optional parameter (you can specify 0 as an argument). The DbBackup parameter is the date in which the last backup was performed on this Geodatabase. If no backup has yet been performed on the Geodatabase, this value will be empty.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
dbName - The dbName (in)
status - The status (out: use single element array)
dbSize - The dbSize (out: use single element array)
owner - The owner (out: use single element array)
createDate - A Variant (out: use single element array)
dbBackup - A Variant (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFileProperties

void getFileProperties(String dbName,
                       String[] dataName,
                       String[] dataPhysicalName,
                       int[] dataFileSize,
                       String[] logName,
                       String[] logPhysicalName,
                       int[] logFileSize)
                       throws IOException,
                              AutomationException
Return various properties on a database file.

Description

This method returns information about the data files associated with this Geodatabase.

Remarks

The dbName input parameter specifies for which database the properites should be returned.

The dataName value returns the name of the database, which should match the Geodatabase name, since ArcGIS does not support different database and datafile names. It does not include the .mdf extension.

dataPhysicalName returns the file path for the mdf file storing the Geodatabase. It includes the .mdf extension.

The dataFileSize value returns the size of the file in MBs.

The logName value returns the name of the log file for the database. It does not include the .ldf extension.

logPhysicalName returns the file path for the ldf file storing the database log file. It includes the .ldf extension.

The logFileSize value returns the size of the file in MBs.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
dbName - The dbName (in)
dataName - The dataName (out: use single element array)
dataPhysicalName - The dataPhysicalName (out: use single element array)
dataFileSize - The dataFileSize (out: use single element array)
logName - The logName (out: use single element array)
logPhysicalName - The logPhysicalName (out: use single element array)
logFileSize - The logFileSize (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

analyze

void analyze(String gdbName)
             throws IOException,
                    AutomationException
Updates the statistics for a Geodatabase.

Description

This method performs an analyze operation on the specified Geodatabase which updates all index statistics.

Remarks

Perform this periodically as a regular maintenance operation. Over time index statistics can become stale, especially in a heavily edited Geodatabase. Updating statistics can improve query performance.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
gdbName - The gdbName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

rebuildIndices

void rebuildIndices(String gdbName)
                    throws IOException,
                           AutomationException
Rebuilds the indices on all tables in a Geodatabase.

Description

This method rebuilds all the indexes on all existing user tables within a Geodatabase. You must either be a server administrator or a geodatabase administrator to use this method.

Remarks

Perform this periodically as a regular maintenance operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
gdbName - The gdbName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

shrinkGeodatabase

void shrinkGeodatabase(String gdbName)
                       throws IOException,
                              AutomationException
Shrinks the size of a Geodatabase and frees up unused space.

Description

This method frees up unused space in the Geodatabase data file (.mdf).

Remarks

Perform this periodically as a regular maintenance operation. You must be a server administrator to execute this method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
gdbName - The gdbName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getConnectedUsers

int getConnectedUsers(String dbName)
                      throws IOException,
                             AutomationException
Gets active users.

Description

This method returns the number of connected users in a particular Geodatabase.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
dbName - The dbName (in)
Returns:
The nUsers
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getServerAdministrators

void getServerAdministrators(IEnumBSTR[] userNames)
                             throws IOException,
                                    AutomationException
Gets a list of server administrators.

Description

This method returns a list of users with server administrator permissions on the database server.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
userNames - A reference to a com.esri.arcgis.system.IEnumBSTR (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getUsersByPermissionType

void getUsersByPermissionType(String dbName,
                              int permission,
                              IEnumBSTR[] userNames)
                              throws IOException,
                                     AutomationException
Get Users in by the Permission type.

Description

Gets a list of user belonging to a particular permission type (esriGeodatabasePermissionsType).

Remarks

This method returns a list of users based on permission type.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
dbName - The dbName (in)
permission - A com.esri.arcgis.datasourcesGDB.esriGeodatabasePermissionsType constant (in)
userNames - A reference to a com.esri.arcgis.system.IEnumBSTR (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.