RPLib is short for Reconcile and Post Library. This is a useful collection of Esri tools and Python functions for enterprise geodatabase administration. Esri provides many useful tools for geodatabase administration tasks, but when building a model and exporting it to a Python script, by default, it will typically lack things like iterators, error trapping, email notification when something does not work as expected, and the ability to control the level of logging details. RPLib is an attempt to compliment Esri’s tools by providing enhanced error trapping, more useful error handling and messages, emailing capabilities, more control of logging, and the ability to build if then logic into your scripts so if a process does not work as expected you can kick off another set of events. Much of the documentation for each function/tool was taken directly from Esri’s help pages in an effort to be consistent with terminology. Many in the GIS community wear multiple hats within their organization and some wear all the hats for their organization. The purpose of building RPLib was to make it easier for those within the community to automate administrative tasks that might have otherwise been done manually, until now. Hopefully this collection of functions will be useful to your organization and if there are other functions or processes that would be useful to the community please share and we will try to add it to a future release, thank you!
- 04/03/2014 - Added executesql function
- 04/11/2014 - Enhanced rebuild_indexes_analyze function to be more efficient when gathering database objects. Thanks to Patricia Moehring for finding this!
- 04/14/2014 - Reworked executesql function to have more descriptive error messages. Reworked email function to keep proper formatting of text.
- 04/14/2014 - Added emaillog function which can be run at end of script to email contents of current log file. Should be run at the end of a script. Thanks to Patricia Moehring for suggesting this!
- 05/02/2014 - Fixed issue with controlservices not looping through folders properly, Thanks to Anthony Pagan and Eric Moody for finding this!
- 05/02/2014 - Fixed issue with truncateappend requiring a datefield when it should be optional, Thanks to Anthony Pagan and Eric Moody for finding this!
- 05/02/2014 - Fixed issue with email function, error was being thrown when starttls was envoked, added some error trapping and user was then able to send emails, Thanks to Jeff Trimmer for finding this!
Click here for detailed instructions on Installation, List of Functions and Variables, and Implementation Examples.
- clearworkspacecache - Clears any ArcSDE workspaces from the ArcSDE workspace cache.
- pauseconnections - Allows an administrator to disable the ability of nonadministrative users to make connections to an enterprise geodatabase.
- resumeconnections - Allows an administrator to enable the ability of nonadministrative users to make connections to an enterprise geodatabase.
- killconnections - Allows an administrator to disconnect all users who are currently connected to an Enterprise geodatabase.
- compressgdb - Compresses an enterprise geodatabase by removing states not referenced by a version and redundant rows.
- createversions - Creates a new version(s) in the specified geodatabase.
- rebuild_indexes_analyze - Updates indexes of datasets and system tables stored in an enterprise geodatabase. Rebuilds existing attribute or spatial indexes. Updates database statistics of base tables, delta tables, and archive tables, along with the statistics on those tables indexes.
- reconcilepost - Reconciles a version or multiple versions against a target version.
- truncateappend - Truncates and appends data from one object to another.
- syncreplicas - Synchronizes updates between two replica geodatabases in a direction specified by the user.
- controlservices - Manage individual ArcGIS Server services at the folder level or through the Windows Services Console by stopping or starting the main ArcGIS Server service.
- deletefilesolderthan - Manages the cleanup of logfiles generated by RPLib.
- executesql - Execute one or multiple SQL statements against an enterprise geodatabase.
- emaillog - Reads the contents of the current iteration of a log file and sends it in the body of the email.