Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Wednesday, March 28, 2012

Poor performance import text file

Hi,

I'm very new at SSIS. I've got a package to import a 1,000,000 row tab delimited text file into my SQL2005 database. Using SSIS with a Text File source and OLE DB PROVIDER target it crawls. I do have it skipping error rows but that is the only logic I am using. No indexes on the table either. This is pretty basic and it takes SSIS 1.5 hours, DTS blows this away... Assuming this is not something outside of SSIS(like the network, or a user locking issue), what I am I doing wrong?

BTW -- I'm searching for some batch commit sizes, like in DTS, but I cannot find them.

Any ideas.

From the information that you've given, it's hard to know what the problem is, but here are a few things you can check.

Try to isolate the problem. Change the destination to a rowcount or trash destination from SQLIS.com, see if it improves the throughput.

Is the flatfile on the same machine as the executing package?

Are you minimally logged on the destination?

Is the destination DB on the same machine?

Have you tried the SQL Server Destination?

How many errors are you getting from the flat file?

Rows per batch is on the OLEDB Destination Adapter. Did you try changing that?

K

Monday, March 26, 2012

Poll For a File

Hi All,

I am using ActiveX code in a DTS package (Package1) to search a directory for a file.
When the file is there I want to start a DTS package (Package2) to load
in this file.

I will schedule Package1 to run at 10pm, however since the external file is being generated externally I cannot guarentee that the file will be there at 10pm. Therefore I want to Poll the folder and not start package2 until I have the file. I am using the If file exists method.

How do I poll for a file, and if its not there wait for 5 mins and poll again until I find the file.

Thanks in advanceHave you tried FSO objects?

Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")|||I have tried the FSO and thats what I am using.

My problem is that if the file is not there, I want to wait for a period of
time ie 5 mins and then try again. And keep trying every five mins until I get the file.

Some thing like this:

========================
Function Main()

dim result

set objFSO = CreateObject("Scripting.FileSystemObject")

result = 1

DO WHILE result = 1
If objFSO.FileExists("c:\test.txt") Then
//Start other Package
result = 99
Else
wait(5)
//Go to start and check for file again
End if

LOOP

End Function
=========================

So in essence the above code will LOOP until it finds the file.
I just need something to replace the wait(5)

Any Ideas

Thanks in advance

I have wait(5) but wait is not a valid function|||EXEC [master].[dbo].[xp_fileexist] 'c:\new_auth.dat1'

This might help|||Originally posted by superquinn
I have tried the FSO and thats what I am using.

My problem is that if the file is not there, I want to wait for a period of
time ie 5 mins and then try again. And keep trying every five mins until I get the file.

Some thing like this:

========================
Function Main()

dim result

set objFSO = CreateObject("Scripting.FileSystemObject")

result = 1

DO WHILE result = 1
If objFSO.FileExists("c:\test.txt") Then
//Start other Package
result = 99
Else
wait(5)
//Go to start and check for file again
End if

LOOP

End Function
=========================

So in essence the above code will LOOP until it finds the file.
I just need something to replace the wait(5)

Any Ideas

Thanks in advance

I have wait(5) but wait is not a valid function

Why do not create a new function (I did not check it, sorry) and call it:

Function wait(theDate)
Do Until DateDiff("n", Now, theDate)<5
Loop
End Function|||I dont want to write a loop function like you have suggested as this constant looping might be very hard on the CPU. I was hoping there was a clever way or else an in built wait/sleep function available to me in the ActiveX component of the DTS.

Can Anyone help?|||You could write a Agent Job that will run every 5 minutes from 10 to 12. Sounds like the easiest way.|||Hi,

Im not quiet sure I understand what you mean by an agent Job.

I am only new to SQL Server and DTS.

The polling for a file is causing a lot of trouble for me.
Can someone please help|||In enterprise Manager, expand Management, SQL Server Agent, then click on Jobs. From there you can add a new job, which can execute ActiveX scripts, T-SQL scripts, even DTS packages. You can add one or many schedules to kick off the job.

I think it may be what you are looking for.

You can get started by right-clicking on the DTS package you created, and selecting Schedule Package, which will set the DTS package up to run as a job. You can then adjust the schedule to your liking, add more steps, etc.|||Would the command WAITFOR DELAY be useful?

Here is the help from MS SQL Server Books Online...
WAITFOR
Specifies a time, time interval, or event that triggers the execution of a statement block, stored procedure, or transaction.

Syntax
WAITFOR { DELAY 'time' | TIME 'time' }

Arguments
DELAY

Instructs Microsoft SQL Server to wait until the specified amount of time has passed, up to a maximum of 24 hours.

'time'

Is the amount of time to wait. time can be specified in one of the acceptable formats for datetime data, or it can be specified as a local variable. Dates cannot be specified; therefore, the date portion of the datetime value is not allowed.

TIME

Instructs SQL Server to wait until the specified time.

Remarks
After executing the WAITFOR statement, you cannot use your connection to SQL Server until the time or event that you specified occurs.

To see the active and waiting processes, use sp_who.

Examples
A. Use WAITFOR TIME
This example executes the stored procedure update_all_stats at 10:20 P.M.

BEGIN
WAITFOR TIME '22:20'
EXECUTE update_all_stats
END

For more information about using this procedure to update all statistics for a database, see the examples in UPDATE STATISTICS.

B. Use WAITFOR DELAY
This example shows how a local variable can be used with the WAITFOR DELAY option. A stored procedure is created to wait for a variable amount of time and then returns information to the user as to the number of hours, minutes, and seconds that have elapsed.

CREATE PROCEDURE time_delay @.@.DELAYLENGTH char(9)
AS
DECLARE @.@.RETURNINFO varchar(255)
BEGIN
WAITFOR DELAY @.@.DELAYLENGTH
SELECT @.@.RETURNINFO = 'A total time of ' +
SUBSTRING(@.@.DELAYLENGTH, 1, 3) +
' hours, ' +
SUBSTRING(@.@.DELAYLENGTH, 5, 2) +
' minutes, and ' +
SUBSTRING(@.@.DELAYLENGTH, 8, 2) +
' seconds, ' +
'has elapsed! Your time is up.'
PRINT @.@.RETURNINFO
END
GO
-- This next statement executes the time_delay procedure.
EXEC time_delay '000:00:10'
GO

Here is the result set:

A total time of 000 hours, 00 minutes, and 10 seconds, has elapsed! Your time is up.|||Hi,

Thanks for your reply. I dont think I am explaining myself fully

I know how to sechdule the Package.
I know how to check if file exists

What I need to know is how to halt processing in a activex script
for a period of time.

If the file is not there initially, I want the wait a while and the reloop to
the start of the package and so on until the file is there

==========ACTIVEX SCRIPT========

Set foundfile = 0

Do While foundfile = 0

if foundfile = 1 then
set foundfile = 1 (This breaks loop)
//Carry on processing
Set Success
else
//Halt procesing for 5 mins and then continue
//This is where I need HELP!!

end if

loop|||I think we understand what you are asking, but are offering solutions that differ from the model you are chasing.

For instance, when I mentioned a scheduled job, I meant that you could create a task that would check for the file's existence. If were not there, the job would schedule itself to run again in a few minutes, then exit. If it were there, proceed to the next step, which would kick off your DTS package.|||The problem with having an ActiveX script wait, is that you are tying up a thread and processor resources just counting away clock cycles. The SQL Agent dooes that already, so you might as well take advantage of it.|||Originally posted by bpdWork
I think we understand what you are asking, but are offering solutions that differ from the model you are chasing.

For instance, when I mentioned a scheduled job, I meant that you could create a task that would check for the file's existence. If were not there, the job would schedule itself to run again in a few minutes, then exit. If it were there, proceed to the next step, which would kick off your DTS package.

=====================================
This sounds EXACTLY like what I want to do. Im sorry about this
but Im new to SQL Server.

How do you get a Job to reschedule itself in code?
I assume this is done in ActiveX|||Off the top of my head, I would say that you would need to use an ActiveX script to access the SQLDMO object, and control it from there. I have done such a thing before. I will see what I can find in my old code heap.|||I think I can help

You should create your package wiht the activex script ect...
Then schedule it to run every 5 mins. as a SQL job.

The active x script should look like this. No need to make the activex script wait, just have it run again and again. If no file, it just quits, when it finds one it runs the other import package.

Function Main()

Dim objFSO
Dim objFolder
Dim objFile
Dim oPKG
Dim fileName
Dim folderName

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("\\server\share$\dir\")

For Each objFile in objFolder.Files

fileName = objFile.Path

Set oPKG = CreateObject("DTS.Package")
oPKG.LoadFromSQLServer "Server", "sa", "", , , , , "2nd package name here"
oPKG.GlobalVariables("fileName").Value = fileName
oPKG.Execute
oPKG.Uninitialize()
Set oPKG = Nothing

objFSO.MoveFile fileName, folderName 'move file somewhere
Next

Main = DTSTaskExecResult_Success

End Function

Hope this helps

Steve|||yes thats the easiest way,

The first step in your package will be a activeX task with the following script inside

==========================================
Function Main()
Dim fs, MyFile
Dim FileLocation
Dim FileName
Dim FileInfo

FileName = "file.txt"

FileLocation = DTSGlobalVariables("Invoice_Input_Location").Value

FileInfo = FileLocation & FileName

Set fs = CreateObject("Scripting.FileSystemObject")

If (fs.FileExists(FileInfo)) Then
fs.MoveFile (FileInfo),(FileLocation & "new_file.txt")
set fs=nothing
Main = DTSTaskExecResult_Success
exit function
Else
Main = DTSTaskExecResult_Failure
exit function
End If

End Function
==========================================

rest of the steps inside the DTS will be after success of this task. The package will be schedules to run after every 5 mins, if your file is present, it will be renamed with a different name (so that next time when the package runs afetr 5 mins it does not process it all over again), this renamed file can be used for further transformations. This way the package will run successfully just once everyday and will fail for rest of the times. which is what you want.

Friday, March 23, 2012

Point-in-time recovery using Log file backups newer than full back

Hopefully I can ask this question w/o too much confusion. The example I am
about to give may not be practical, but the answer should help me understand
db and log backups a little better.
Scenario:
Full db backup performed 3 times in a day - morning, afternoon, and evening
(T1, T2, T3 respectively)
Log backup performed in morning (T1) and evening (T3) immediately after the
morning full db backups (no afternoon (T2) log backup)
Then server db drive fails after the evening db and log backups
The evening full backup is unrestorable (bad tape)
The evening log backup is good (stored on another device).
Could I restore the db to the point of failure using the afternoon full db
backup (T2) and the evening log backup (T3)?
db: T1--T2--T3
log: T1--T3
In other words, when restoring the evening log backup, against the afternoon
full db backup, would the restore process read through the evening log backup
to find the transactions begining at T2, or does the log being restored need
to be from a backup that occurs after the full backup was created?
My "guess" is that the restore would read through the T3 log and apply the
transactions that began after the T2 full db backup.If you ask whether you can "skip" a db backup, then the answer it yes. You cannot "skip" a log
backup, though. Perhaps easier with an examples. Say the time goes from top to bottom:
A Db
B Log
C Log
D Db
E Log
F Log
G Db
H Log
I Log
Here are a couple of examples of what you *can* do:
a, b, c, d, e, h, i
d, e, f, h, i
g, h, i
Here's a couple of examples of what you *cannot* do:
a, c, e, f, h, i
a, e, f, h, i
Short answer is that you need an unbroken chain of log backup. Db backups in between do not matter.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"GRakaska" <GRakaska@.discussions.microsoft.com> wrote in message
news:E20FF009-56C4-4B91-A31A-9720FB1404CD@.microsoft.com...
> Hopefully I can ask this question w/o too much confusion. The example I am
> about to give may not be practical, but the answer should help me understand
> db and log backups a little better.
> Scenario:
> Full db backup performed 3 times in a day - morning, afternoon, and evening
> (T1, T2, T3 respectively)
> Log backup performed in morning (T1) and evening (T3) immediately after the
> morning full db backups (no afternoon (T2) log backup)
> Then server db drive fails after the evening db and log backups
> The evening full backup is unrestorable (bad tape)
> The evening log backup is good (stored on another device).
> Could I restore the db to the point of failure using the afternoon full db
> backup (T2) and the evening log backup (T3)?
> db: T1--T2--T3
> log: T1--T3
> In other words, when restoring the evening log backup, against the afternoon
> full db backup, would the restore process read through the evening log backup
> to find the transactions begining at T2, or does the log being restored need
> to be from a backup that occurs after the full backup was created?
> My "guess" is that the restore would read through the T3 log and apply the
> transactions that began after the T2 full db backup.
>|||> A Db
> B Log
> C Log
> D Db
> E Log
> F Log
> G Db
> H Log
> I Log
> Here are a couple of examples of what you *can* do:
> a, b, c, d, e, h, i
> d, e, f, h, i
> g, h, i
I think an error has found it's way in the first row. You can't skip the F,
since that will break the log chain - and you also say that the chain can
not be broken :)
/Sjang|||> I think an error has found it's way in the first row.
Yes, thanks for catching that. It should have been:
a, b, c, e, f, h, i
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Henrik Davidsen" <none@.none.dk> wrote in message news:lBBDj.7440$9m.7234@.fe25.usenetserver.com...
>> A Db
>> B Log
>> C Log
>> D Db
>> E Log
>> F Log
>> G Db
>> H Log
>> I Log
>> Here are a couple of examples of what you *can* do:
>> a, b, c, d, e, h, i
>> d, e, f, h, i
>> g, h, i
>
> I think an error has found it's way in the first row. You can't skip the F,
> since that will break the log chain - and you also say that the chain can
> not be broken :)
> /Sjang
>
>

Pointing my new .ADP file to my new SQL Server DB

I hope this question belongs in this forum.

I have a .ADP application (access 2000 front end, SQL Server 2000 back end)
I basically want to create a new .ADP file and point it to a different SQL Server 2000 Database.

I've copied the current SQL Server DB and recreated it. Same for the .ADP file, but it is currently pointing to the old Db, where do I go to have it point to the new SQL Server DB?

Thanksi figured this out thanks.|||You know, you don't need to create a copy of the ADP file. You can easily change the datasource as long as the schemas in both databases are the same.

Tuesday, March 20, 2012

Plz help me SQL 2005 ( Attach database File .mdf )

when i try to attach file there is an error occur
" An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified) "
Plz help me i try all things
Enable remote connections on the instance of SQL Server that you want
to connect to from a remote computer.
Turn on the SQL Server Browser service.
Configure the firewall to allow network traffic that is related to SQL
Server and to the SQL Server Browser service
but still error occur
Plz help me
*** Sent via Developersdex http://www.codecomments.com ***
Are you able to connect to SQL Server Management studio and exeute simple
queries like SP_WHO and all?
If no; then verify the network connectivity from host to server.
Thanks
Hari
"hossam mohamed" <hosshoss2@.yahoo.com> wrote in message
news:umAN$vEBHHA.2140@.TK2MSFTNGP02.phx.gbl...
> when i try to attach file there is an error occur
> " An error has occurred while establishing a connection to the server.
> When connecting to SQL Server 2005, this failure may be caused by the
> fact that under the default settings SQL Server does not allow remote
> connections. (provider: SQL Network Interfaces, error: 26 - Error
> Locating Server/Instance Specified) "
>
> Plz help me i try all things
> . Enable remote connections on the instance of SQL Server that you want
> to connect to from a remote computer.
> . Turn on the SQL Server Browser service.
> . Configure the firewall to allow network traffic that is related to SQL
> Server and to the SQL Server Browser service
>
> but still error occur
> Plz help me
> *** Sent via Developersdex http://www.codecomments.com ***

Plz help me SQL 2005 ( Attach database File .mdf )

when i try to attach file there is an error occur
" An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified) "
Plz help me i try all things
Enable remote connections on the instance of SQL Server that you want
to connect to from a remote computer.
Turn on the SQL Server Browser service.
Configure the firewall to allow network traffic that is related to SQL
Server and to the SQL Server Browser service
but still error occur
Plz help me
*** Sent via Developersdex http://www.codecomments.com ***Are you able to connect to SQL Server Management studio and exeute simple
queries like SP_WHO and all?
If no; then verify the network connectivity from host to server.
Thanks
Hari
"hossam mohamed" <hosshoss2@.yahoo.com> wrote in message
news:umAN$vEBHHA.2140@.TK2MSFTNGP02.phx.gbl...
> when i try to attach file there is an error occur
> " An error has occurred while establishing a connection to the server.
> When connecting to SQL Server 2005, this failure may be caused by the
> fact that under the default settings SQL Server does not allow remote
> connections. (provider: SQL Network Interfaces, error: 26 - Error
> Locating Server/Instance Specified) "
>
> Plz help me i try all things
> . Enable remote connections on the instance of SQL Server that you want
> to connect to from a remote computer.
> . Turn on the SQL Server Browser service.
> . Configure the firewall to allow network traffic that is related to SQL
> Server and to the SQL Server Browser service
>
> but still error occur
> Plz help me
> *** Sent via Developersdex http://www.codecomments.com ***

Plz Clarify my query in SSIS

Hi There,

I have Task in SSIS to import the flat file to the table and break the table and insert and update the other tables in the same database.

I searched every where i couldnt find appropriate tutorial for this.

Please advice me how to achieve this task.

Thanks in Advance

Regards

Savera

Savera wrote:

Hi There,

I have Task in SSIS to import the flat file to the table and break the table

What do you mean by "break the table"?

Savera wrote:

and insert and update the other tables in the same database.

What other tables? where are you inserting FROM?

Savera wrote:

I searched every where i couldnt find appropriate tutorial for this. Please advice me how to achieve this task.

Which bit?

Savera wrote:

Thanks in Advance

Regards

Savera

-Jamie

|||Load the table first in one data flow. Then in a second data flow, select from that table as the source. Use a conditional split transformation to direct the rows to other destinations based on your criteria.|||

HI Jamie,

Thanks a lot.

I have some more queries to clarify.

I have some complicated criteria like join the tables and set the flag in main table if any of the table updation tasks fails.Will it be done in Conditional split Transformation if its not please let me know how to get this task done.

Thanks in Advance.

Regards

|||

Savera wrote:

HI Jamie,

Thanks a lot.

I have some more queries to clarify.

I have some complicated criteria like join the tables and set the flag in main table if any of the table updation tasks fails.Will it be done in Conditional split Transformation if its not please let me know how to get this task done.

Thanks in Advance.

Regards

To set a flag in a table you would probably use an Execute SQL Task. Put an OnError precedence constraint between your data-flow and this new Execute SQL Task. Something like that anyway - I don't really understand why you're talking about a conditional split.

-Jamie

|||

Jamie,

Thanks for the reply.

I wanted to ask you that whether complicated query can be set in conditional split transformation or have to use Execute sql task ?

Please let me know how to put an OnError precedence constraint between your data-flow and this new Execute SQL.

Ans also i am getting an error while mapping between flat file to database tables the error is column cannot convert between unicode and non unicode string data types.Please advice how it can be solved.

Many thanks in Advance.

Regards,

|||

Savera wrote:

Jamie,

Thanks for the reply.

I wanted to ask you that whether complicated query can be set in conditional split transformation or have to use Execute sql task ?

This makes no snse. You cannot execute queries from the Conditional Split component.

Savera wrote:

Please let me know how to put an OnError precedence constraint between your data-flow and this new Execute SQL.

Drag a precedence constraint between the two tasks (it will be OnSuccessby default) and edit the properties of it. Make it an OnError constraint.

Savera wrote:

Ans also i am getting an error while mapping between flat file to database tables the error is column cannot convert between unicode and non unicode string data types.Please advice how it can be solved.

Somewhere you are trying to push a unicode value into a non-unicode field. You should use a Data Conversion component to explicitly make the change that you need.

-Jamie

|||Savera,
Please read through my posts in this thread. I think you should go through some tutorials so that you can obtain a better understanding of SSIS.|||

Phil Brammer wrote:

Savera,
Please read through my posts in this thread. I think you should go through some tutorials so that you can obtain a better understanding of SSIS.

Agreed.

This may be of use:

Online Beginner Resources
(http://blogs.conchango.com/jamiethomson/archive/2007/01/30/SSIS_3A00_-Online-Beginner-Resources.aspx)

-Jamie

Wednesday, March 7, 2012

Please helpLog file will not reduce in SQL 2000 database

My Database plan is as follows:

Full Database backup every night, Full recovery mode.
T-Log backups , every 4 hours.

both are appended to media,

there are no active transactions,

but Log file will not shrink or reduce in size.

what would you suggest.

Thanks,Pls refer the below links,
http://support.microsoft.com/kb/110139 and http://support.microsoft.com/kb/873235
if you need to shrink the tran log you can perform as below,

Backup log DATABASENAME with truncate_only and then shrink the log file using DBCC shrinkfile command refer BOL for the syntax ! but it is not recommended to shrink file often

Thanxx
Deepak
|||

I guess you mean the physical LDF file does not reduce in size? While a backup of the log file truncates the contents of the log, it will not give that space back to the operating system. This is by design. In almost all cases, there is no point in shrinking the physical file every time it is backed up as it will almost certainly need to grow again in the near future.

To actually increase the size of the file, SQL Server has to request space from the OS and this is quite a "costly" operation in terms of resources. Therefore, you want to minimise the amount of times the log file has to grow and the easiest way of doing this is to keep it at its "optimum" size.ie your log file should be sized according to how large it will typically grow.

If your Transcation Log is huge (maybe due to a one off reindex or data purge) then you can physically shrink it by issuing a DBCC SHRINKFILE statement. Check Books Online for details.

HTH!

Saturday, February 25, 2012

PLease Help, thanks!

Hello how can I upload my aspnetdb.mdf file which was created by defualt when i inserted some login controls to my site using visual web develpoer express. It tried to just upload it to my App_data folder on my server and I receive this error when I try to use the controls:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Could anyone please help or atleast point me in the right direction? I have been trying to fix this for several days and it is really getting frustrating. I apreciate it very much. Thank You!

GregAre you sure the SQL 2005 is installed on the server?|||Well, I think that is where the problem is. I know I opened and installed a SQL server on the server, actually they did it I just had to pick a username and password. It created a database named DB_63184 which I cannot change and the url to it is wh***-v**.prod.mesa*.secureserver.net. I dont know how to upload it though. I use godaddy.com hosting buy the way if that helps. Thanks

_________________________________________________________________________
Edited by moderator tmorton -- please do not reveal more about your servers and passwords than is absolutely necessary, and obfuscate wherever possible.|||

If you are using Godaddy hosting then you need to create the user/pass in the db control panel and to use them in your connectionstring!

Regards

|||I suppose you have used Godaddy? So if i create a password and username which I have already done, I can just copy the database to a folder on my hosting account and I will be able to connect to it?

Monday, February 20, 2012

Please help, database will not truncate free space at end of file

I'll explain the process, then I'll explain the problem.
SQL Server Enterprise Edition, Windows NT, SP2
We have a main database server A, and a report server B.
This is all done through Enterprise Manager:
We reindex database A, which causes it to grow in size, backup the
transaction log, shrink the database, truncate free space at the end of the
file, back it up, then restore it to the report server. We HAVE to shrink it
because there's little room left on server B for the database.
We did this same process recently, however the free space at the end of the
database file will not truncate. It did before, but not now.
I've read some of the articles posted, and I'm shy about trying any of them
since this is main production and would be bad, to say the least, if anything
should happen. One article I read said that I should do this in QA with a
TRUNCATEONLY switch, will the data be affected?
If any of you have a simple explanation or help I would really appreciate it.
Thanks in advance.
Message posted via droptable.com
http://www.droptable.com/Uwe/Forums...erver/200609/1
It sounds like you have an open transaction in the database. What does DBCC
OPENTRAN() say for that db? The process you are going thru is very flawed
in that the shrink process undoes most of what you tried to accomplish with
the reindexing in the first place. The proper answer is get more disk space
on the reporting server and you can alleviate that whole process and have a
much better operation overall.
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
Andrew J. Kelly SQL MVP
"fnadal via droptable.com" <u10790@.uwe> wrote in message
news:6662f70524ce3@.uwe...
> I'll explain the process, then I'll explain the problem.
> SQL Server Enterprise Edition, Windows NT, SP2
> We have a main database server A, and a report server B.
> This is all done through Enterprise Manager:
> We reindex database A, which causes it to grow in size, backup the
> transaction log, shrink the database, truncate free space at the end of
> the
> file, back it up, then restore it to the report server. We HAVE to shrink
> it
> because there's little room left on server B for the database.
> We did this same process recently, however the free space at the end of
> the
> database file will not truncate. It did before, but not now.
> I've read some of the articles posted, and I'm shy about trying any of
> them
> since this is main production and would be bad, to say the least, if
> anything
> should happen. One article I read said that I should do this in QA with a
> TRUNCATEONLY switch, will the data be affected?
> If any of you have a simple explanation or help I would really appreciate
> it.
> Thanks in advance.
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forums...erver/200609/1
>
|||I ran opentran and this is the message:
No active open transactions.
DBCC execution completed. If DBCC printed error messages, contact your system
administrator.
Is it true that shrinking the database fragments it? Which ties in with what
you said in your post. Yeah, bottom line, disk space is the answer. Thanks!
Andrew J. Kelly wrote:[vbcol=seagreen]
>It sounds like you have an open transaction in the database. What does DBCC
>OPENTRAN() say for that db? The process you are going thru is very flawed
>in that the shrink process undoes most of what you tried to accomplish with
>the reindexing in the first place. The proper answer is get more disk space
>on the reporting server and you can alleviate that whole process and have a
>much better operation overall.
>http://www.karaszi.com/SQLServer/info_dont_shrink.asp
>[quoted text clipped - 26 lines]
Message posted via http://www.droptable.com
|||> Is it true that shrinking the database fragments it?
Yep. Or, to be more specific, it will fragment the indexes. Or to be even more specific, it will
move pages towards the beginning of the files, page-by-page, possibly resulting in an index which is
more fragmented than it was before the shrink (assuming you had a contiguous index before the
shrink). This is easy to test...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"fnadal via droptable.com" <u10790@.uwe> wrote in message news:666545dd8a649@.uwe...
>I ran opentran and this is the message:
> No active open transactions.
> DBCC execution completed. If DBCC printed error messages, contact your system
> administrator.
> Is it true that shrinking the database fragments it? Which ties in with what
> you said in your post. Yeah, bottom line, disk space is the answer. Thanks!
> Andrew J. Kelly wrote:
> --
> Message posted via http://www.droptable.com
>

Please help, database will not truncate free space at end of file

I'll explain the process, then I'll explain the problem.
SQL Server Enterprise Edition, Windows NT, SP2
We have a main database server A, and a report server B.
This is all done through Enterprise Manager:
We reindex database A, which causes it to grow in size, backup the
transaction log, shrink the database, truncate free space at the end of the
file, back it up, then restore it to the report server. We HAVE to shrink it
because there's little room left on server B for the database.
We did this same process recently, however the free space at the end of the
database file will not truncate. It did before, but not now.
I've read some of the articles posted, and I'm shy about trying any of them
since this is main production and would be bad, to say the least, if anythin
g
should happen. One article I read said that I should do this in QA with a
TRUNCATEONLY switch, will the data be affected?
If any of you have a simple explanation or help I would really appreciate it
.
Thanks in advance.
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200609/1It sounds like you have an open transaction in the database. What does DBCC
OPENTRAN() say for that db? The process you are going thru is very flawed
in that the shrink process undoes most of what you tried to accomplish with
the reindexing in the first place. The proper answer is get more disk space
on the reporting server and you can alleviate that whole process and have a
much better operation overall.
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
--
Andrew J. Kelly SQL MVP
"fnadal via droptable.com" <u10790@.uwe> wrote in message
news:6662f70524ce3@.uwe...
> I'll explain the process, then I'll explain the problem.
> SQL Server Enterprise Edition, Windows NT, SP2
> We have a main database server A, and a report server B.
> This is all done through Enterprise Manager:
> We reindex database A, which causes it to grow in size, backup the
> transaction log, shrink the database, truncate free space at the end of
> the
> file, back it up, then restore it to the report server. We HAVE to shrink
> it
> because there's little room left on server B for the database.
> We did this same process recently, however the free space at the end of
> the
> database file will not truncate. It did before, but not now.
> I've read some of the articles posted, and I'm shy about trying any of
> them
> since this is main production and would be bad, to say the least, if
> anything
> should happen. One article I read said that I should do this in QA with a
> TRUNCATEONLY switch, will the data be affected?
> If any of you have a simple explanation or help I would really appreciate
> it.
> Thanks in advance.
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forum...server/200609/1
>|||I ran opentran and this is the message:
No active open transactions.
DBCC execution completed. If DBCC printed error messages, contact your syste
m
administrator.
Is it true that shrinking the database fragments it? Which ties in with what
you said in your post. Yeah, bottom line, disk space is the answer. Thanks!
Andrew J. Kelly wrote:[vbcol=seagreen]
>It sounds like you have an open transaction in the database. What does DBCC
>OPENTRAN() say for that db? The process you are going thru is very flawed
>in that the shrink process undoes most of what you tried to accomplish with
>the reindexing in the first place. The proper answer is get more disk space
>on the reporting server and you can alleviate that whole process and have a
>much better operation overall.
>http://www.karaszi.com/SQLServer/info_dont_shrink.asp
>[quoted text clipped - 26 lines]
Message posted via http://www.droptable.com|||> Is it true that shrinking the database fragments it?
Yep. Or, to be more specific, it will fragment the indexes. Or to be even mo
re specific, it will
move pages towards the beginning of the files, page-by-page, possibly result
ing in an index which is
more fragmented than it was before the shrink (assuming you had a contiguous
index before the
shrink). This is easy to test...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"fnadal via droptable.com" <u10790@.uwe> wrote in message news:666545dd8a649@.uwe...agreen">
>I ran opentran and this is the message:
> No active open transactions.
> DBCC execution completed. If DBCC printed error messages, contact your sys
tem
> administrator.
> Is it true that shrinking the database fragments it? Which ties in with wh
at
> you said in your post. Yeah, bottom line, disk space is the answer. Thanks
!
> Andrew J. Kelly wrote:
> --
> Message posted via http://www.droptable.com
>

Please help, database will not truncate free space at end of file

I'll explain the process, then I'll explain the problem.
SQL Server Enterprise Edition, Windows NT, SP2
We have a main database server A, and a report server B.
This is all done through Enterprise Manager:
We reindex database A, which causes it to grow in size, backup the
transaction log, shrink the database, truncate free space at the end of the
file, back it up, then restore it to the report server. We HAVE to shrink it
because there's little room left on server B for the database.
We did this same process recently, however the free space at the end of the
database file will not truncate. It did before, but not now.
I've read some of the articles posted, and I'm shy about trying any of them
since this is main production and would be bad, to say the least, if anything
should happen. One article I read said that I should do this in QA with a
TRUNCATEONLY switch, will the data be affected?
If any of you have a simple explanation or help I would really appreciate it.
Thanks in advance.
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200609/1It sounds like you have an open transaction in the database. What does DBCC
OPENTRAN() say for that db? The process you are going thru is very flawed
in that the shrink process undoes most of what you tried to accomplish with
the reindexing in the first place. The proper answer is get more disk space
on the reporting server and you can alleviate that whole process and have a
much better operation overall.
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
--
Andrew J. Kelly SQL MVP
"fnadal via SQLMonster.com" <u10790@.uwe> wrote in message
news:6662f70524ce3@.uwe...
> I'll explain the process, then I'll explain the problem.
> SQL Server Enterprise Edition, Windows NT, SP2
> We have a main database server A, and a report server B.
> This is all done through Enterprise Manager:
> We reindex database A, which causes it to grow in size, backup the
> transaction log, shrink the database, truncate free space at the end of
> the
> file, back it up, then restore it to the report server. We HAVE to shrink
> it
> because there's little room left on server B for the database.
> We did this same process recently, however the free space at the end of
> the
> database file will not truncate. It did before, but not now.
> I've read some of the articles posted, and I'm shy about trying any of
> them
> since this is main production and would be bad, to say the least, if
> anything
> should happen. One article I read said that I should do this in QA with a
> TRUNCATEONLY switch, will the data be affected?
> If any of you have a simple explanation or help I would really appreciate
> it.
> Thanks in advance.
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200609/1
>|||I ran opentran and this is the message:
No active open transactions.
DBCC execution completed. If DBCC printed error messages, contact your system
administrator.
Is it true that shrinking the database fragments it? Which ties in with what
you said in your post. Yeah, bottom line, disk space is the answer. Thanks!
Andrew J. Kelly wrote:
>It sounds like you have an open transaction in the database. What does DBCC
>OPENTRAN() say for that db? The process you are going thru is very flawed
>in that the shrink process undoes most of what you tried to accomplish with
>the reindexing in the first place. The proper answer is get more disk space
>on the reporting server and you can alleviate that whole process and have a
>much better operation overall.
>http://www.karaszi.com/SQLServer/info_dont_shrink.asp
>> I'll explain the process, then I'll explain the problem.
>[quoted text clipped - 26 lines]
>> Thanks in advance.
--
Message posted via http://www.sqlmonster.com|||> Is it true that shrinking the database fragments it?
Yep. Or, to be more specific, it will fragment the indexes. Or to be even more specific, it will
move pages towards the beginning of the files, page-by-page, possibly resulting in an index which is
more fragmented than it was before the shrink (assuming you had a contiguous index before the
shrink). This is easy to test...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"fnadal via SQLMonster.com" <u10790@.uwe> wrote in message news:666545dd8a649@.uwe...
>I ran opentran and this is the message:
> No active open transactions.
> DBCC execution completed. If DBCC printed error messages, contact your system
> administrator.
> Is it true that shrinking the database fragments it? Which ties in with what
> you said in your post. Yeah, bottom line, disk space is the answer. Thanks!
> Andrew J. Kelly wrote:
>>It sounds like you have an open transaction in the database. What does DBCC
>>OPENTRAN() say for that db? The process you are going thru is very flawed
>>in that the shrink process undoes most of what you tried to accomplish with
>>the reindexing in the first place. The proper answer is get more disk space
>>on the reporting server and you can alleviate that whole process and have a
>>much better operation overall.
>>http://www.karaszi.com/SQLServer/info_dont_shrink.asp
>> I'll explain the process, then I'll explain the problem.
>>[quoted text clipped - 26 lines]
>> Thanks in advance.
> --
> Message posted via http://www.sqlmonster.com
>

Please help! How to execute a Query without keeping log?

I try ro delete many data from a table but the log file is always full so
that I cannot delete the uncessary data in a table.
How can I disable the keeping log function so that I can execute the Query
successfully.
--
Regards,
Anthony LamHi Anthony,
If it is SQL server 2000 , check the recovary model. If the database is not
critical u can change the model to Simple and run the command Backup tran
dbname with no_log.
After this u can run the delete statement.
In the other way if u database is very critical , perform a backup logdbname
to disk='c:\dbname.trn'
after this run the delete statement again.
If you are running SQL 7 , Simple recovary model is equalent to "truncate
log on checkpoint' db option. The rest of things are same as SQL 2000.
Thanks
Hari
MCDBA
"AA" <anthony@.jadeflex.com> wrote in message
news:uTgtSMfmDHA.1244@.TK2MSFTNGP11.phx.gbl...
> I try ro delete many data from a table but the log file is always full so
> that I cannot delete the uncessary data in a table.
> How can I disable the keeping log function so that I can execute the Query
> successfully.
> --
> Regards,
> Anthony Lam
>|||If it was a problem about running out of the log space with a single DELETE
statement, changing the recovery model to SIMPLE will not help.
1. You may get away with TRUNCATE TABLE because it uses less tran log space
by only recording the page deallocations in the tran log.
2. Or you can put your DELETE in a loop and delete a smaller chunk each time
followed by a BACKUP LOG statement. The size of the 'chunk' is basically the
number of rows to delete.
--
Linchi Shea
linchi_shea@.NOSPAMml.com
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:OMC3BUfmDHA.2528@.TK2MSFTNGP10.phx.gbl...
> Hi Anthony,
> If it is SQL server 2000 , check the recovary model. If the database is
not
> critical u can change the model to Simple and run the command Backup tran
> dbname with no_log.
> After this u can run the delete statement.
> In the other way if u database is very critical , perform a backup
logdbname
> to disk='c:\dbname.trn'
> after this run the delete statement again.
> If you are running SQL 7 , Simple recovary model is equalent to "truncate
> log on checkpoint' db option. The rest of things are same as SQL 2000.
> Thanks
> Hari
> MCDBA
>
> "AA" <anthony@.jadeflex.com> wrote in message
> news:uTgtSMfmDHA.1244@.TK2MSFTNGP11.phx.gbl...
> > I try ro delete many data from a table but the log file is always full
so
> > that I cannot delete the uncessary data in a table.
> > How can I disable the keeping log function so that I can execute the
Query
> > successfully.
> >
> > --
> > Regards,
> >
> > Anthony Lam
> >
> >
>

Please help! How to execute a Query with keeping log?

I try ro delete many data from a table but the log file is always full so
that I cannot delete the uncessary data in a table.
How can I disable the keeping log function so that I can execute the Query
successfully.
--
Regards,
Anthony LamAlready answered in another group. Please don't multipost.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"AA" <anthony@.jadeflex.com> wrote in message news:%23HPc5EfmDHA.2160@.TK2MSFTNGP10.phx.gbl...
> I try ro delete many data from a table but the log file is always full so
> that I cannot delete the uncessary data in a table.
> How can I disable the keeping log function so that I can execute the Query
> successfully.
> --
> Regards,
> Anthony Lam
>