[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

How do I troubleshoot this CLR error in SQL Server (64-bit) spatial

I have the following query:

    Insert into PropertyTractsTemp
        Select 
    		P.field1 as field1 , 
    		P.field2 as field2, 
    		P.field3 as field3, 
    		P.field4 as field4, 
    		G.GEOID, 
    		P.field5 as field5
    	from PROPERTY_PARAMETERS P
    	join BH_EDW.dbo.REF_GEOID_GEOG G WITH(INDEX([geog_sidx]))on G.geom.STIntersects(P.GeoLocation) =1
    	where P.GEOID is null

Open in new window


This may have 1,000 to 100Mil records to match up.
Either way, the query stops and I receive this error:

    Msg 10316, Level 16, State 1, Line 3
    The app domain with specified version id (4) was unloaded due to memory pressure and could not be found.
    The statement has been terminated.

Open in new window


I'm told it's a CLR error, and it has something to do with the spatial index but no explanation on how to troubleshoot it.

Any wisdom would be greatly appreciated.
0
Evan Cutler
Asked:
Evan Cutler
2 Solutions
 
ste5anSenior DeveloperCommented:
1) How much memory has your server (hardware) and what are your SQL Server min memory and max memory settings?

2) What SQL Server version and bitness do you use?
0
 
Evan CutlerVolunteer Chief Information OfficerAuthor Commented:
My server has 64 Gb of ram.
It is server 2012 64-bit.

Thank you.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
My server has 64 Gb of ram.
How much is configured for SQL Server?
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Evan CutlerVolunteer Chief Information OfficerAuthor Commented:
64Gb is set on SQL Server.
0
 
Nakul VachhrajaniTechnical Architect, Capgemini IndiaCommented:
That may be one of the problem. Per best practices recommended by Microsoft, if RAM > 8GB is available on the server, a minimum of 4GB must be kept reserved for the OS. So, in this case SQL Server max memory should be 60GB (at a maximum, assuming there are no other applications or services running on the server).
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
So you're not leaving nothing for the operating system.
My recommendation is that you leave a minimum of 4GB to Windows (set MSSQL max memory to 60GB). If you can double it then even better.
0
 
Evan CutlerVolunteer Chief Information OfficerAuthor Commented:
ok.  trying.  please be patient.  I'm running this query on 80+ Million records.  The error doesn't appear until somewhere around 40-60M with a 1.1M / hr speed.  I'll do ask you ask, and let you know.

Thank you.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Evan, weekend passed. What is the point of situation today?
0
 
Evan CutlerVolunteer Chief Information OfficerAuthor Commented:
The solution worked.

I appreciate your advice.
This was exactly the problem I had.
Thanks much.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now