We are Running a .sql script which was created by tablediff.exe using SQLCMD
The script execution fails with the ' 701: There is insufficient system memory to run this query. ' Exception.
The following was the SQL Server Configuration
* Operating System: Windows Server 2003
* Database : SQL Server 2005 Standard Edition SP2
* Main Memory: 4GB
* Virtual Memory: 6GB
* Processors: 2 nos (Intel XEON 1.6 GHz)
Since, we are replicating a Database from a staging database, we are using the tablediff.exe.
The Script file which was created by the tablediff will be at the maximum size of 30MB.
The following are the SQL Server Settings which we are using now,
* Min Server Memory: 0
* Max Server Memory: 2147483647
* Min Memory Per Query: 2048
* AWE Enabled: No
Any ideas on where is the issue ?
13 8004 iburyak 1,017
Recognized Expert Top Contributor
This error usually is not about a size.
It is usually when server is trying to do something in infinite loop.
If you have a script that you run try commenting out parts of this script and find out which part is not working.
Good Luck.
The sync script was created by the TableDiff utility. If the record count in that script is below 20,000, then no problems there. But it fails on huge counts like 60,000. I don't think that there will be a way for infinite loop run.
iburyak 1,017
Recognized Expert Top Contributor
http://support.microsoft.com/kb/912439
Hi,
This is the first fix i had tried and my production server's SP are up to date (Currently SP2).
I was confused that why it had thrown this exception after the fix was installed ? Any Suggestions ?
iburyak 1,017
Recognized Expert Top Contributor
Without seeing your script it is hard to guess what you are doing and where the problem is.
As I said it looks like something is taking too much memory and not releasing it on time.
Yes Exactly,
I found this cause some 2 weeks back itself. But there is no way i have to execute that script with 7 lakhs insert and updates using SQLCMD.
The sp which i used is below, - USE [ODS]
-
GO
-
/****** Object: StoredProcedure [dbo].[sp_TableDiff4] Script Date: 11/12/2007 05:58:32 ******/
-
SET ANSI_NULLS ON
-
GO
-
SET QUOTED_IDENTIFIER ON
-
GO
-
ALTER PROCEDURE [dbo].[sp_TableDiff4]
-
-- Add the parameters for the stored procedure here
-
(@sourceTable varchar(100),
-
@targetTable varchar(100),
-
@filepath varchar(100))
-
AS
-
BEGIN
-
DECLARE @sTableDiff nvarchar(1000)
-
DECLARE @sPath nvarchar(100)
-
DECLARE @sTableName nvarchar(40)
-
DECLARE @a nvarchar(50)
-
DECLARE @sSQLCMD nvarchar(100)
-
SET @sTableDiff= ' "C:\Program Files\Microsoft SQL Server\90\COM\tablediff" -sourceserver GRSRV4 -sourceuser username -sourcepassword pwd -sourcedatabase ODS-STG -sourcetable ' + @sourceTable + ' -destinationserver GRSRV4 -destinationuser username -destinationpassword password -destinationdatabase ODS -destinationtable ' + @targetTable + ' -f '+@filepath
-
PRINT @sTableDiff
-
EXEC XP_CMDSHELL @sTableDiff
-
SET @sTableName = @sourceTable
-
PRINT @sTableName
-
SET @sPath = 'd:\' + @sTableName
-
SET @sPath = @filepath
-
SET @sSQLCMD = 'sqlcmd -s GRSRV4 \SQL -U username -P pwd -d ODS -i ' + @sPath
-
PRINT @sSQLCMD
-
EXEC XP_CMDSHELL @sSQLCMD
-
SET @a = 'del ' + @sPath
-
PRINT @a
-
EXEC XP_CMDSHELL @a
-
END
-
In the above code, the sql cmd acquires memory to execute the 7L+ records.
Is there any other ways to release the acquired memory manually in our code i.e in the above sp ?
iburyak 1,017
Recognized Expert Top Contributor
You know what, I had similar problem a long time ago.
I had a DLL and because I had to call it multiple times it made memory overflow. I had to reboot my Server to proceed.
What happened was DLL stayed in server memory and with each call it loaded a new instance of the same DLL. I put this DLL under COM object and it started controlling environment, if I called the same DLL again it provided the same already loaded into memory instance instead of loading a new one. I never had this problem since. I think you should put both executables (tablediff and sqlcmd) under COM control which could solve your problem.
Hope it helps.
Good Luck
I called it through a stored procedure and a T-SQL script. I Was not using any languages like c# to make a dll and use it. Now app is in production and its hard to make those changes.
Any other ways to release the memory ?
iburyak 1,017
Recognized Expert Top Contributor
I don’t think you understood what I was talking about.
Go to your server, click Start – Run – type mmc, press enter.
Go to File – Add/Remove Snap-in
Press Add button and choose Component Service.
Press Add, Close, OK.
Expend everything to vew COM+ Applications
.
This is what I was talking about. You should put programs you are calling from your procedure under control of this object which will control memory usage and protect memory overflow.
Good Luck.
Thanks a lot, Let me try this....
I don’t think you understood what I was talking about.
Go to your server, click Start – Run – type mmc, press enter.
Go to File – Add/Remove Snap-in
Press Add button and choose Component Service.
Press Add, Close, OK.
Expend everything to vew COM+ Applications
.
This is what I was talking about. You should put programs you are calling from your procedure under control of this object which will control memory usage and protect memory overflow.
Good Luck.
Here i have a problem.
When i try to install, it requests for .MSI or .PAK file. But mine are all T-SQL and Stored Procedure.
The problem where i got is the SQLCMD.EXE (This is the one which was responsible for executing the scripts).
How can i add this in COM+ ?
I don’t think you understood what I was talking about.
Go to your server, click Start – Run – type mmc, press enter.
Go to File – Add/Remove Snap-in
Press Add button and choose Component Service.
Press Add, Close, OK.
Expend everything to vew COM+ Applications
.
This is what I was talking about. You should put programs you are calling from your procedure under control of this object which will control memory usage and protect memory overflow.
Good Luck.
iburyak 1,017
Recognized Expert Top Contributor
First program should be in this path according to your script. C:\Program Files\Microsoft SQL Server\90\COM\tablediff.exe
Second program you should search for using Windows Search utility or better you should go to Registry and search for this keyword and it should show you where it is registered from.
sqlcmd.exe
Good Luck.
Irina.
Hey,
I Was unable to add that executable (sqlcmd.exe) into the COM+ service since it doesn't accept exe files. It only accepts .msi and .pak files (i.e To install pre-build applications it ask for .msi and .pak files but mine was executable).
Any workarounds ?
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: AlessanBar |
last post by:
Hello Friends !!
I have a strange problem, and I need to know what would be the source of
this. I have a laptop computer with the following configuration:
Pentium III
Brand : Toshiba
Speed :...
|
by: hishamfangs |
last post by:
Hi guys!
I'm facing a problem and I can't quite figure it out!
I have created a table on SQL Server 2000 to store call records. We get
about 250,000 calls a day, and the most frequently used...
|
by: Justin Lazanowski |
last post by:
Cross posting this question on the recommendation of an
I have a .NET application that I am developing in C# I am loading
information in from a dataset, and then pushing the dataset to a grid,...
|
by: sathyashrayan |
last post by:
Following are the selected thread from the date:30-jan-2005 to
31-jan-2005. I did not use any name because of the subject is important.
You can get the original thread by typing the subject...
|
by: mike |
last post by:
Help;
Im New with a company and the sql server is
maxing out the cpu's
We have 3 web servers load balanced....
large volume of data
the current Properties
Computer:
4 amd 2.88 processors
4...
| |
by: =?Utf-8?B?RWxpb3Ro?= |
last post by:
I try to install Windows Services but it show this error during the
installation process, "Insufficient System resources exist to complete the
requested service."
I created this Services in VB...
|
by: Coldfire |
last post by:
Since i cannot show the differences in a two-column like table. I am first putting
MS SQL Server 2005 and then MySQL 5.x.
MS SQL Server 2005
Brief Overview
- SQL Server is a full-fledged...
|
by: mauler05 |
last post by:
I have scheduled a SSIS package to run repeatedly by creating a scheduled SQL job that runs every minute . After every hour the packgae fails with the following error
Description:...
|
by: marshmallowww |
last post by:
I have an Access 2000 mde application which uses ADO and pass through
queries to communicate with SQL Server 7, 2000 or 2005.
Some of my customers, especially those with SQL Server 2005, have had...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |