DOC
|
To maintain optimal performance for a traditionally versioned geodatabase, it's a best practice to compress your geodatabase on a regular basis. To achieve a full compress to state 0, it's necessary to remove all locks from the geodatabase. Locks can be created from users accessing the geodatabase in desktop applications, such as ArcGIS Pro, and from ArcGIS Server services that are referencing data from the geodatabase. This script will stop ArcGIS Server services that are currently running, disconnect all users from the geodatabase, block further connections to the geodatabase, reconcile/post all versions, and compress the geodatabase. After the geodatabase is compressed, the script will rebuild indexes and recalculate stats on versioned feature classes, and then finally restart the previous running services. Additionally, the script will output a CSV file showing the before and after counts of the A & D tables, also known as the Delta tables. This will allow you to easily see if the versioned feature classes have been compressed. Also, the script will report the before and after state id of the geodatabase. Some optional parameters within the script include sending e-mail notifications. If the script executes successfully, an e-mail will be sent attaching the CSV file of the delta table counts, and a message of the before and after state id. If an error occurs, an e-mail will be sent including a log file reporting the error and the line within the script that caused the error. A quick note, all geodatabase replicas should be synced before this script is executed Video of workflow:
... View more
51 seconds ago
|
0
|
0
|
4
|
POST
|
Hi @Sven_Harpering, You can use the report property: https://developers.arcgis.com/python/guide/administering-your-gis/#:~:text=Pandas%20DataFrame%20table-,pro_license.report,-Entitlement
... View more
2 hours ago
|
0
|
0
|
11
|
DOC
|
@SallyBickel @Chase_RSO what IDE are you using to execute the script? Try running the IDE as an Administrator (i.e. right-click on IDE > Run As Administrator). Do you still receive the same error?
... View more
Wednesday
|
0
|
0
|
50
|
POST
|
@RaenaBallantyne_DeMaris that may be the case. You can add a try/except to bypass this error. Ex: # Iterate through fruit list
for fruit in fruitList:
with arcpy.da.SearchCursor(farmLocations, ["LocCode"], f"Fruits LIKE '%{fruit}%'") as cursor:
for row in cursor:
# Create CSV file for each fruit
csvOutput = fr'{csvDirectory}\{fruit}.csv'
output_file = open(csvOutput, 'w')
header = 'LocCode, ProjName\n'
output_file.write(header)
try:
for project in projectsDict[row[0]]:
output = f'{row[0]}, {project}\n'
output_file.write(output)
except KeyError:
pass
del cursor
... View more
Tuesday
|
1
|
0
|
67
|
POST
|
@BlakeTerhune I believe the documentation states that it's not required when using it within a with statement, but I've found there can still be locks when I do not explicitly remove the cursor using del cursor.
... View more
Tuesday
|
0
|
0
|
93
|
POST
|
Hi @RaenaBallantyne_DeMaris , Try the following: import arcpy
# Variables
farmLocations = r"c:\projects\GeoNET\GeoNET.gdb\FarmLocations"
projects = r"c:\projects\GeoNET\GeoNET.gdb\Project"
csvDirectory = r"c:\projects\GeoNET"
# List of frutis
fruitList = ['Apples', 'Walnuts', 'Hazelnuts', 'Cherries', 'Apricots', 'Pecans', 'Pears', 'Peaches', 'Plums']
# Create Projects Dictionary
projectsDict = {}
with arcpy.da.SearchCursor(projects, ["LocCode", "ProjName"]) as cursor:
for row in cursor:
projectsDict.setdefault(row[0], [])
projectsDict[row[0]].append(row[1])
del cursor
# Iterate through fruit list
for fruit in fruitList:
with arcpy.da.SearchCursor(farmLocations, ["LocCode"], f"Fruits LIKE '%{fruit}%'") as cursor:
for row in cursor:
# Create CSV file for each fruit
csvOutput = fr'{csvDirectory}\{fruit}.csv'
output_file = open(csvOutput, 'w')
header = 'LocCode, ProjName\n'
output_file.write(header)
for project in projectsDict[row[0]]:
output = f'{row[0]}, {project}\n'
output_file.write(output)
del cursor
output_file.close()
... View more
Tuesday
|
2
|
1
|
109
|
POST
|
I would verify the feature classes' A&D tables are cleared after the compress. If there is a lock on the feature class, the compress will skip over the feature class. If your database is SQL Server you can find the correct A&D table with the following: query the sde.sde_table_registry table to get the registration_id. Ex: select registration_id from dbo.SDE_table_registry where table_name = 'Airports' This will return the registration_id: This will indicate which A&D tables to query. Ex:
... View more
a week ago
|
1
|
1
|
153
|
POST
|
Hi @EdX1, Is your feature class registered as versioned? If it is, has your geodatabase been compressed recently? The compress will clear the A&D (delta) tables, which will improve performance of the feature class. You will want to make sure there are no locks on the feature class when performing the compress. For example, make sure all services are stopped, and all users are disconnected.
... View more
a week ago
|
3
|
9
|
215
|
DOC
|
@ErikNelson1 can you test the below code on another machine that has ArcGIS Pro installed: from arcgis.gis import GIS
gis = GIS(url="https://gis.organization.com/portal", username="username", password="password", verify_cert=False)
... View more
2 weeks ago
|
0
|
0
|
234
|
DOC
|
@Chase_RSO try deleting the scratch folder at C:\Users\<useraccount>\appdata\local\temp. Recreate this directory, and then add Full Control to your account to the scratch folder by right-clicking on the folder > Properties > Security.
... View more
2 weeks ago
|
0
|
0
|
263
|
DOC
|
@ErikNelson1 , 1. Are you able to sign into Portal with the credentials you are providing in the script? 2. Do you have any reverse proxies in place? 3. Is there another built-in admin account you can try?
... View more
2 weeks ago
|
0
|
0
|
293
|
POST
|
Hi @AudraPayne1, is this occurring for all hosted feature services, or just this particular one?
... View more
2 weeks ago
|
0
|
1
|
123
|
DOC
|
@ErikNelson1 do you have a security question set for the built-in account you are using?
... View more
2 weeks ago
|
0
|
0
|
357
|
Title | Kudos | Posted |
---|---|---|
1 | Tuesday | |
2 | Tuesday | |
1 | a week ago | |
3 | a week ago | |
2 | 3 weeks ago |
Online Status |
Online
|
Date Last Visited |
41 seconds ago
|