Britt,
Have you looked into blocking connections to your database then disconnecting all users? You would need SDE or DBO level rights on your geodatabase.
Your script would connect using SDE or DBO and that connection would remain active. However, you would ensure no additional locks by blocking connections and disconnecting all users:
import arcpy
import time
from arcpy import env
database_conn = r'Database Connections\Enterprise.sde'
env.workspace = database_conn
try:
print 'Blocking connections in %s' % database_conn
arcpy.AcceptConnections(env.workspace, False)
except (arcpy.ExecuteError, arcpy.ExecuteWarning) as e:
print e
print 'Blocked all connections'
time.sleep(60)
try:
print 'Disconnecting all users from %s...' % database_conn
arcpy.DisconnectUser(env.workspace, "ALL")
except (arcpy.ExecuteError, arcpy.ExecuteWarning) as e:
print e
print 'Disconnected all users'
try:
print 'Accepting Connections from %s...' % database_conn
arcpy.AcceptConnections(env.workspace, True)
except (arcpy.ExecuteError, arcpy.ExecuteWarning) as e:
print e
Regards,
Alex