|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDataServerManagerAdmin
Provides access to administration functions of a Data Server.
The IDataServerManagerAdmin interface allows you to administer a Database Server.
You must first be connected to perform administration operations and be an administrator on the Database Server.
Use this inteface to perform operations such as creating and deleting Geodatabases, adding or deleting logins, backing up Geodatabases, etc.
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 |
---|
void createGeodatabase(String gdbName, String gdbFileName, int gdbFileSize, String logFileName, int logFileSize) throws IOException, AutomationException
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.
gdbName
- The gdbName (in)gdbFileName
- The gdbFileName (in)gdbFileSize
- The gdbFileSize (in)logFileName
- The logFileName (in)logFileSize
- The logFileSize (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void deleteGeodatabase(String gdbName) throws IOException, AutomationException
Deletes a Geodatabase.
You must be a server administrator to perform this operation.
gdbName
- The gdbName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void createLogin(String loginName, boolean isAdministrator) throws IOException, AutomationException
The method creates a login on the server. Login names are Microsoft Windows logins.
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.
loginName
- The loginName (in)isAdministrator
- The isAdministrator (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void modifyLoginSecurity(String loginName, boolean isAdministrator) throws IOException, AutomationException
This method allows you to make an existing login an administrator or not.
You must be an server adminstrator to execute this method.
loginName
- The loginName (in)isAdministrator
- The isAdministrator (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void modifyGeodatabaseSecurity(String dbName, String loginName, int permission) throws IOException, AutomationException
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.
dbName
- The dbName (in)loginName
- The loginName (in)permission
- A com.esri.arcgis.datasourcesGDB.esriGeodatabasePermissionsType constant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void deleteLogin(String loginName) throws IOException, AutomationException
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.
You must be a server administrator to perform this operation.
loginName
- The loginName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IEnumBSTR getGeodatabaseNames() throws IOException, AutomationException
This method returns a list of Geodatabases on the Database Server.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void getLogins(IEnumBSTR[] loginNames, IEnumBSTR[] dbNames, IEnumBSTR[] loginTypes, IEnumBSTR[] languages) throws IOException, AutomationException
This method returns a list of logins and their associated Geodatabase, login types, and default languages.
The login types are: NTUser, NTGroup and Standard. They represent a Windows login, Windows group and a built-in database user, respectively.
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)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void detachGeodatabase(String dbName) throws IOException, AutomationException
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.
You must be a server administrator to perform this operation.
dbName
- The dbName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void attachGeodatabase(String dbName, String dataFileName, String logFileName) throws IOException, AutomationException
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.
dbName
- The dbName (in)dataFileName
- The dataFileName (in)logFileName
- The logFileName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void upgradeGeoDatabase(String gdbName) throws IOException, AutomationException
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.
gdbName
- The gdbName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void upgradeSDESchema(String gdbName) throws IOException, AutomationException
The IDataServerManagerAdmin.UpgradeGeoDatabase should be used in place of this method.
gdbName
- The gdbName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.String getGeodatabaseName(String dataFileName) throws IOException, AutomationException
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.
dataFileName
- The dataFileName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean backupGeodatabase(String gdbName, String backupFileName, String backupName, String description) throws IOException, AutomationException
This method backs up a Geodatabase.
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.
gdbName
- The gdbName (in)backupFileName
- The backupFileName (in)backupName
- The backupName (in)description
- The description (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void restoreGeodatabase(String gdbName, String backupFileName, String dbFilePath) throws IOException, AutomationException
This method restores a Geodatabase from a previous backup.
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.
gdbName
- The gdbName (in)backupFileName
- The backupFileName (in)dbFilePath
- The dbFilePath (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void isSimpleRecoveryModel(String gdbName, boolean[] isSimpleRecoveryModel) throws IOException, AutomationException
This method returns whether the Geodatabase is in simple recovery model or not.
gdbName
- The gdbName (in)isSimpleRecoveryModel
- The isSimpleRecoveryModel (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setGeodatabaseToSimpleRecoveryModel(String gdbName) throws IOException, AutomationException
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.
gdbName
- The gdbName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isConnectedUserAdministrator() throws IOException, AutomationException
This method returns whether the connected user is an administrator or not.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IWorkspaceName createWorkspaceName(String gdbName, String versionPropName, Object versionSpecifier) throws IOException, AutomationException
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.
gdbName
- The gdbName (in)versionPropName
- The versionPropName (in)versionSpecifier
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void getDBProperties(String dbName, String[] status, int[] dbSize, String[] owner, Object[] createDate, Object[] dbBackup) throws IOException, AutomationException
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.
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.
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)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void getFileProperties(String dbName, String[] dataName, String[] dataPhysicalName, int[] dataFileSize, String[] logName, String[] logPhysicalName, int[] logFileSize) throws IOException, AutomationException
This method returns information about the data files associated with this Geodatabase.
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.
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)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void analyze(String gdbName) throws IOException, AutomationException
This method performs an analyze operation on the specified Geodatabase which updates all index statistics.
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.
gdbName
- The gdbName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void rebuildIndices(String gdbName) throws IOException, AutomationException
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.
Perform this periodically as a regular maintenance operation.
gdbName
- The gdbName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void shrinkGeodatabase(String gdbName) throws IOException, AutomationException
This method frees up unused space in the Geodatabase data file (.mdf).
Perform this periodically as a regular maintenance operation. You must be a server administrator to execute this method.
gdbName
- The gdbName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.int getConnectedUsers(String dbName) throws IOException, AutomationException
This method returns the number of connected users in a particular Geodatabase.
dbName
- The dbName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void getServerAdministrators(IEnumBSTR[] userNames) throws IOException, AutomationException
This method returns a list of users with server administrator permissions on the database server.
userNames
- A reference to a com.esri.arcgis.system.IEnumBSTR (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void getUsersByPermissionType(String dbName, int permission, IEnumBSTR[] userNames) throws IOException, AutomationException
Gets a list of user belonging to a particular permission type (esriGeodatabasePermissionsType).
This method returns a list of users based on permission type.
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)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |