Back in 2013 I wrote a couple pieces on how to set up the SDE Intercept trace through the environment variables directly and with a batch file. *There are no major changes here with the exception of the quantity of traces generated at ArcGIS 10.3 and later. *You should now only see 1 trace per ArcGIS/SDE session.
Aside from that, I wanted to streamline the instructions for the manual environment variable set up, combine the batch file instructions and show how to capture a single event all in one post. *Here you go…
Environment Variable Setup:
1. Be sure to shut down ArcMap or ArcCatalog if you have it open to allow the application to read in your new environment variables.
2.*In the Start menu (or File Explorer in Win. 8), right click Computer and choose Properties.
3. *In the System properties window, choose Advanced system settings.
4. *In the System Properties dialog choose Advanced>Environment Variables.
5. *Create two new System Variables for the trace flags and the log’s output location. *The output path can be anywhere and the file can be named anything. *I chose the Temp folder on my C: drive and named the file “client_intercept”.
Variable name: SDEINTERCEPTVariable value: crwTfVariable name: SDEINTERCEPTLOCVariable value: C:\Temp\client_intercept6. *Restart ArcGIS and make a connection to an SDE geodatabase.
You should see the file created in the SDEINTERCEPTLOC defined with numeric file extensions. *Be sure to delete the variables when you are done as each SDE geodatabase connection will create a new log. *This can fill up disk space quickly.
Batch File:
The other option is setting up a batch file with the same environment variables and a path to an MXD or the path to the ArcMap/Catalog executable. *This option is handy when you don’t want to set up the permanent environment variables and you don’t want to capture all the steps before the problem you want to trace. *The other benefit is the trace will only log for the duration of that ArcGIS/SDE session.
For instance, if I need to trace a single edit operation on an SDE feature class, I may not need to see the touching of the feature class in the catalog tree, the adding of the feature class to ArcMapand/or panning and zooming to a desired area. *While I can’t avoid the connection and starting of the edit session, I can save a map with the feature class in the desired area and use the following to launch ArcMap and start logging:
Just the Facts:
While the batch file option or launching an MXD with the environment variables set manually will allow you to avoid logging extraneous actions like panning or adding data, you will still end up logging actions your issue doesn’t depend on. *What if you wanted to only capture a single action like panning a map to trace redraw times? *This is possible with certain text editors (not Notepad.exe). *I have found VS Code*and Notepad++ to be successful with the following:
That’s it. *You now have an SDE trace file that captured only the panning of the map. *No connection, no adding data, no cleanup operations. *Let me know what you think or if you have any questions.
أكثر...
Aside from that, I wanted to streamline the instructions for the manual environment variable set up, combine the batch file instructions and show how to capture a single event all in one post. *Here you go…
Environment Variable Setup:
1. Be sure to shut down ArcMap or ArcCatalog if you have it open to allow the application to read in your new environment variables.
2.*In the Start menu (or File Explorer in Win. 8), right click Computer and choose Properties.
3. *In the System properties window, choose Advanced system settings.
4. *In the System Properties dialog choose Advanced>Environment Variables.
5. *Create two new System Variables for the trace flags and the log’s output location. *The output path can be anywhere and the file can be named anything. *I chose the Temp folder on my C: drive and named the file “client_intercept”.
Variable name: SDEINTERCEPTVariable value: crwTfVariable name: SDEINTERCEPTLOCVariable value: C:\Temp\client_intercept6. *Restart ArcGIS and make a connection to an SDE geodatabase.
You should see the file created in the SDEINTERCEPTLOC defined with numeric file extensions. *Be sure to delete the variables when you are done as each SDE geodatabase connection will create a new log. *This can fill up disk space quickly.
Batch File:
The other option is setting up a batch file with the same environment variables and a path to an MXD or the path to the ArcMap/Catalog executable. *This option is handy when you don’t want to set up the permanent environment variables and you don’t want to capture all the steps before the problem you want to trace. *The other benefit is the trace will only log for the duration of that ArcGIS/SDE session.
For instance, if I need to trace a single edit operation on an SDE feature class, I may not need to see the touching of the feature class in the catalog tree, the adding of the feature class to ArcMapand/or panning and zooming to a desired area. *While I can’t avoid the connection and starting of the edit session, I can save a map with the feature class in the desired area and use the following to launch ArcMap and start logging:
- *Open your favorite text editor and add the following:set SDEINTERCEPTLOC=D:\Temp\client_Interceptset SDEINTERCEPT=cwrTf@echo offstart "" "D:\Path\To\My\Map.mxd"
- Save the file as a .bat file.
- Run the batch file.
Just the Facts:
While the batch file option or launching an MXD with the environment variables set manually will allow you to avoid logging extraneous actions like panning or adding data, you will still end up logging actions your issue doesn’t depend on. *What if you wanted to only capture a single action like panning a map to trace redraw times? *This is possible with certain text editors (not Notepad.exe). *I have found VS Code*and Notepad++ to be successful with the following:
- *Set the environment variables manually or launch ArcMap through the batch file.
- *With the map open, navigate to the desired geographic area if necessary.
- Open the trace associated with the current session in a text editor that won’t see the trace as locked. *See links above.
- With the map ready to be panned, select and delete all the text in the trace file. *
- Save the trace file.
- Pan the map to expose the performance issue.
- Copy the trace file to another location to prevent logging the shutdown and cleanup entries.
That’s it. *You now have an SDE trace file that captured only the panning of the map. *No connection, no adding data, no cleanup operations. *Let me know what you think or if you have any questions.
أكثر...