Friday, March 30, 2012
Log issues
I have 2 issues with my log files.
1) I have a database where I combine 20 tables from 20
DBs into one very large table. Each table in the 20 DBs
are the same. My procedure uses 20 insert into
statements. For some reason my log file fills and the job
fails. Does anyone know how I can stop the file from
growing like this?
2) I created my Dbs with 400MB trans file. I only use
about 30MB. Is there a way to drop the size down to 50MB
and let it grow from there?
TIA
Joe
1) you can either change the recovery model to simple(if you do not wish to
log the process), however if you are deleting a large number of records in
one transaction(in which case, you will still exceed your configured trans
log size of 400Mb) then you will have to batch these deletes and do them in
smaller/manageable batches.
2) dbcc shrinkfile(<logicalname logfile>,50,turncateonly)
check out BOL for more info.
"JOE" wrote:
> Hi All,
> I have 2 issues with my log files.
> 1) I have a database where I combine 20 tables from 20
> DBs into one very large table. Each table in the 20 DBs
> are the same. My procedure uses 20 insert into
> statements. For some reason my log file fills and the job
> fails. Does anyone know how I can stop the file from
> growing like this?
> 2) I created my Dbs with 400MB trans file. I only use
> about 30MB. Is there a way to drop the size down to 50MB
> and let it grow from there?
> TIA
> Joe
>
|||Thanks for the info.
I will try the simple.
I do not delete but I do Truncate my table before I stert
the inserts. I Truncate because I know it does not hit
the Trans Log.
Joe
Log issues
I have 2 issues with my log files.
1) I have a database where I combine 20 tables from 20
DBs into one very large table. Each table in the 20 DBs
are the same. My procedure uses 20 insert into
statements. For some reason my log file fills and the job
fails. Does anyone know how I can stop the file from
growing like this?
2) I created my Dbs with 400MB trans file. I only use
about 30MB. Is there a way to drop the size down to 50MB
and let it grow from there?
TIA
JoeThanks for the info.
I will try the simple.
I do not delete but I do Truncate my table before I stert
the inserts. I Truncate because I know it does not hit
the Trans Log.
Joe
log into one sql server from another server
one is where I have my webpages. The second one is where
I have my sql tables. The second server's IIS has
anonymous login unchecked (same with the first server). I
want to use the person's windows login for authentication.
In the first server's include file, my connection code is:
Dim cn
set cn=server.createobject("ADODB.Connection")
cn.open "Provider=sqloledb;Data
Source=secondservername;Initial Catalog=Client;Integrated
Security=SSPI"
When I try to view a webpage with the include file, I get
this error:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
Where is this error coming from?
If I put the webpages on the secondserver, the pages are
viewed just fine.
NganYou need to use delegation in AD with kerberos enabled to
use Windows logins across linked servers. You can find more
info on this in books online under the topic:
Security Account Delegation
You are probably experiencing the issues addressed in the
following article:
PRB: Message 18456 from a Distributed Query
http://support.microsoft.com/?id=238477
If you aren't using AD, kerberos then you will need to use
the work around with SQL logins as mentioned in the above
article.
-Sue
On Thu, 24 Jun 2004 11:22:49 -0700, "ngan"
<anonymous@.discussions.microsoft.com> wrote:
>I have two servers that have IIS and SQL 2000. the first
>one is where I have my webpages. The second one is where
>I have my sql tables. The second server's IIS has
>anonymous login unchecked (same with the first server). I
>want to use the person's windows login for authentication.
>In the first server's include file, my connection code is:
>Dim cn
>set cn=server.createobject("ADODB.Connection")
>cn.open "Provider=sqloledb;Data
>Source=secondservername;Initial Catalog=Client;Integrated
>Security=SSPI"
>When I try to view a webpage with the include file, I get
>this error:
>Microsoft OLE DB Provider for SQL Server (0x80040E4D)
>Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
>Where is this error coming from?
>If I put the webpages on the secondserver, the pages are
>viewed just fine.
>Ngan
>
log into one sql server from another server
one is where I have my webpages. The second one is where
I have my sql tables. The second server's IIS has
anonymous login unchecked (same with the first server). I
want to use the person's windows login for authentication.
In the first server's include file, my connection code is:
Dim cn
set cn=server.createobject("ADODB.Connection")
cn.open "Provider=sqloledb;Data
Source=secondservername;Initial Catalog=Client;Integrated
Security=SSPI"
When I try to view a webpage with the include file, I get
this error:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
Where is this error coming from?
If I put the webpages on the secondserver, the pages are
viewed just fine.
Ngan
You need to use delegation in AD with kerberos enabled to
use Windows logins across linked servers. You can find more
info on this in books online under the topic:
Security Account Delegation
You are probably experiencing the issues addressed in the
following article:
PRB: Message 18456 from a Distributed Query
http://support.microsoft.com/?id=238477
If you aren't using AD, kerberos then you will need to use
the work around with SQL logins as mentioned in the above
article.
-Sue
On Thu, 24 Jun 2004 11:22:49 -0700, "ngan"
<anonymous@.discussions.microsoft.com> wrote:
>I have two servers that have IIS and SQL 2000. the first
>one is where I have my webpages. The second one is where
>I have my sql tables. The second server's IIS has
>anonymous login unchecked (same with the first server). I
>want to use the person's windows login for authentication.
>In the first server's include file, my connection code is:
>Dim cn
>set cn=server.createobject("ADODB.Connection")
>cn.open "Provider=sqloledb;Data
>Source=secondservername;Initial Catalog=Client;Integrated
>Security=SSPI"
>When I try to view a webpage with the include file, I get
>this error:
>Microsoft OLE DB Provider for SQL Server (0x80040E4D)
>Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
>Where is this error coming from?
>If I put the webpages on the secondserver, the pages are
>viewed just fine.
>Ngan
>
sql
Wednesday, March 21, 2012
Log file Problem
I am using SQL server 2000 and i was working on Strore procedure and
manupulating tables.Sql Server shows me messages that ur log size is
Increased
and as a result it does not allow me to do any manupulations.so
I de attached the database and rename it and increase its log file.
Now ,I try to re attached the database,but Server show me
messages ,Its
not valid log file.
Then i rename it to its origional name,but the problem remains the
same.
Its not a valid log file.
then i move it to some other place and try to attacah but its not
again.
after that i move this log and mdf files to other Ms SQL server.But
problem
is not solved.
Plz help in this regard.
You can try sp_attach_single_file_db. If that doesn't work, you should restore from your most recent
backup.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Me On Line" <jawadsmail@.gmail.com> wrote in message
news:1178171246.741385.324940@.h2g2000hsg.googlegro ups.com...
> Hi EveryBody...
> I am using SQL server 2000 and i was working on Strore procedure and
> manupulating tables.Sql Server shows me messages that ur log size is
> Increased
> and as a result it does not allow me to do any manupulations.so
> I de attached the database and rename it and increase its log file.
> Now ,I try to re attached the database,but Server show me
> messages ,Its
> not valid log file.
> Then i rename it to its origional name,but the problem remains the
> same.
> Its not a valid log file.
> then i move it to some other place and try to attacah but its not
> again.
> after that i move this log and mdf files to other Ms SQL server.But
> problem
> is not solved.
> Plz help in this regard.
>
|||The next question would be - Why do you mess around with your sql server
logs like that? To me it makes no sense. From your description it sounds
like your logfile was full and it wasn't allowed to grow, but why don't
you just backup (or truncate) the logfile?
Regards
Steen Schlter Persson
Database Administrator / System Administrator
Tibor Karaszi wrote:
> You can try sp_attach_single_file_db. If that doesn't work, you should
> restore from your most recent backup.
>
Log File Problem
I am using SQL server 2000 and i was working on Strore procedure and
manupulating tables.Sql Server shows me messages that ur log size is
Increased
and as a result it does not allow me to do any manupulations.so
I de attached the database and rename it and increase its log file.
Now ,I try to re attached the database,but Server show me
messages ,Its
not valid log file.
Then i rename it to its origional name,but the problem remains the
same.
Its not a valid log file.
then i move it to some other place and try to attacah but its not
again.
after that i move this log and mdf files to other Ms SQL server.But
problem
is not solved.
Plz help in this regard.Meonline (jawadsmail@.gmail.com) writes:
Quote:
Originally Posted by
I am using SQL server 2000 and i was working on Strore procedure and
manupulating tables.Sql Server shows me messages that ur log size is
Increased and as a result it does not allow me to do any
manupulations.so I de attached the database and rename it and increase
its log file. Now ,I try to re attached the database,but Server show me
messages ,Its not valid log file.
>
Then i rename it to its origional name,but the problem remains the
same.
Its not a valid log file.
then i move it to some other place and try to attacah but its not
again.
>
after that i move this log and mdf files to other Ms SQL server.But
problem is not solved.
Looks you got yourself into things you should not have touched. I don't
see what the point would with renaming the database files, if you ran
out of disk space? The normal procedure would be to add more disk, or
add a new log file on a second partition. Or simply investigate whether
it was reasonable that your procedure resulted in such an increase in
log space consumption.
Anwyay, if you detached the databse cleanly, you should be able to
reattach it with sp_attach_single_file_db.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspxsql
Log file Problem
I am using SQL server 2000 and i was working on Strore procedure and
manupulating tables.Sql Server shows me messages that ur log size is
Increased
and as a result it does not allow me to do any manupulations.so
I de attached the database and rename it and increase its log file.
Now ,I try to re attached the database,but Server show me
messages ,Its
not valid log file.
Then i rename it to its origional name,but the problem remains the
same.
Its not a valid log file.
then i move it to some other place and try to attacah but its not
again.
after that i move this log and mdf files to other Ms SQL server.But
problem
is not solved.
Plz help in this regard.You can try sp_attach_single_file_db. If that doesn't work, you should restore from your most recent
backup.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Me On Line" <jawadsmail@.gmail.com> wrote in message
news:1178171246.741385.324940@.h2g2000hsg.googlegroups.com...
> Hi EveryBody...
> I am using SQL server 2000 and i was working on Strore procedure and
> manupulating tables.Sql Server shows me messages that ur log size is
> Increased
> and as a result it does not allow me to do any manupulations.so
> I de attached the database and rename it and increase its log file.
> Now ,I try to re attached the database,but Server show me
> messages ,Its
> not valid log file.
> Then i rename it to its origional name,but the problem remains the
> same.
> Its not a valid log file.
> then i move it to some other place and try to attacah but its not
> again.
> after that i move this log and mdf files to other Ms SQL server.But
> problem
> is not solved.
> Plz help in this regard.
>|||The next question would be - Why do you mess around with your sql server
logs like that? To me it makes no sense. From your description it sounds
like your logfile was full and it wasn't allowed to grow, but why don't
you just backup (or truncate) the logfile?
--
Regards
Steen Schlüter Persson
Database Administrator / System Administrator
Tibor Karaszi wrote:
> You can try sp_attach_single_file_db. If that doesn't work, you should
> restore from your most recent backup.
>
Log file Problem
I am using SQL server 2000 and i was working on Strore procedure and
manupulating tables.Sql Server shows me messages that ur log size is
Increased
and as a result it does not allow me to do any manupulations.so
I de attached the database and rename it and increase its log file.
Now ,I try to re attached the database,but Server show me
messages ,Its
not valid log file.
Then i rename it to its origional name,but the problem remains the
same.
Its not a valid log file.
then i move it to some other place and try to attacah but its not
again.
after that i move this log and mdf files to other Ms SQL server.But
problem
is not solved.
Plz help in this regard.You can try sp_attach_single_file_db. If that doesn't work, you should resto
re from your most recent
backup.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Me On Line" <jawadsmail@.gmail.com> wrote in message
news:1178171246.741385.324940@.h2g2000hsg.googlegroups.com...
> Hi EveryBody...
> I am using SQL server 2000 and i was working on Strore procedure and
> manupulating tables.Sql Server shows me messages that ur log size is
> Increased
> and as a result it does not allow me to do any manupulations.so
> I de attached the database and rename it and increase its log file.
> Now ,I try to re attached the database,but Server show me
> messages ,Its
> not valid log file.
> Then i rename it to its origional name,but the problem remains the
> same.
> Its not a valid log file.
> then i move it to some other place and try to attacah but its not
> again.
> after that i move this log and mdf files to other Ms SQL server.But
> problem
> is not solved.
> Plz help in this regard.
>|||The next question would be - Why do you mess around with your sql server
logs like that? To me it makes no sense. From your description it sounds
like your logfile was full and it wasn't allowed to grow, but why don't
you just backup (or truncate) the logfile?
Regards
Steen Schlter Persson
Database Administrator / System Administrator
Tibor Karaszi wrote:
> You can try sp_attach_single_file_db. If that doesn't work, you should
> restore from your most recent backup.
>
Monday, March 19, 2012
Log file grows (Error 9002).
We have a project where we store the state of object instances in Sql Server
tables. Primarely these tables consist of an id column and an IMAGE type
column. We use .NET binary serialization to create byte arrays and use
(ordinary) INSERT, UPDATE and SELECT statements (in conjunction with the
System.Data.SqlClient classes) to write to and read from Sql's IMAGE type.
The size of a binary array is approximately 300-350k. The database is set to
automatically grow the data en log files. The recovery model is set to
SIMPLE. Our problem is that the log file grows (huge!) until error 9002 shows
up. Backing up the log file helps, but... what is caution this error? Are we
using the wrong CRUD
statements (should we use WRITETEXT and READTEXT instead)? I'm so suprised
to see that the log file grows (why isn't Sql reclaiming the used (old)
space): am I missing the point of the SIMPLE recovery model?
(btw: I'm pretty sure there are no transactions 'hanging')
Many thanks in advance!
Kind regards,
Johan Bouwhuis.Try issuing Checkpoint through the application or whenever a heavy
transaction is applied...
"Johan Bouwhuis" wrote:
> Hello Group,
> We have a project where we store the state of object instances in Sql Server
> tables. Primarely these tables consist of an id column and an IMAGE type
> column. We use .NET binary serialization to create byte arrays and use
> (ordinary) INSERT, UPDATE and SELECT statements (in conjunction with the
> System.Data.SqlClient classes) to write to and read from Sql's IMAGE type.
> The size of a binary array is approximately 300-350k. The database is set to
> automatically grow the data en log files. The recovery model is set to
> SIMPLE. Our problem is that the log file grows (huge!) until error 9002 shows
> up. Backing up the log file helps, but... what is caution this error? Are we
> using the wrong CRUD
> statements (should we use WRITETEXT and READTEXT instead)? I'm so suprised
> to see that the log file grows (why isn't Sql reclaiming the used (old)
> space): am I missing the point of the SIMPLE recovery model?
> (btw: I'm pretty sure there are no transactions 'hanging')
> Many thanks in advance!
> Kind regards,
> Johan Bouwhuis.
>|||Hi,
Since the recover for your database is SIMPLE, the transction will be
cleared after each recovery interval. In your case looks like you
are doing a bulk DML operation. In this case the coomit will be done only
after completing the entire operation. To overcome this
instead of doing bulk DML operation do a batch by batch DML operation. THis
will ensure that your LDF will not grow to a higher
extend.
In SIMPLE recovery the log will be cleared automatically and you can not
perform a transaction log backup. If it is a production server then
it is recommened to go for FULL recovery model and schedule a Transaction
log backup. This will help you to recover the database fully/POINT IN TIME.
Thanks
Hari
SQL Server MVP
"Johan Bouwhuis" <JohanBouwhuis@.discussions.microsoft.com> wrote in message
news:E60F4B7A-430D-4E85-94AD-EC41A6187DE9@.microsoft.com...
> Hello Group,
> We have a project where we store the state of object instances in Sql
> Server
> tables. Primarely these tables consist of an id column and an IMAGE type
> column. We use .NET binary serialization to create byte arrays and use
> (ordinary) INSERT, UPDATE and SELECT statements (in conjunction with the
> System.Data.SqlClient classes) to write to and read from Sql's IMAGE type.
> The size of a binary array is approximately 300-350k. The database is set
> to
> automatically grow the data en log files. The recovery model is set to
> SIMPLE. Our problem is that the log file grows (huge!) until error 9002
> shows
> up. Backing up the log file helps, but... what is caution this error? Are
> we
> using the wrong CRUD
> statements (should we use WRITETEXT and READTEXT instead)? I'm so suprised
> to see that the log file grows (why isn't Sql reclaiming the used (old)
> space): am I missing the point of the SIMPLE recovery model?
> (btw: I'm pretty sure there are no transactions 'hanging')
> Many thanks in advance!
> Kind regards,
> Johan Bouwhuis.
>
Monday, March 12, 2012
Log File Error
We have a nightly DTS job, which uploads data, to a number of tables (35
tables). However the DTS job failed last night, due to the following error
returned :
****
Error Source: Microsoft OLE DB Provider for SQL Server
Error Description:The log file for database 'G_Data' is full. Back up the
transaction log for the database to free up some log space.
****
However, on the properties of the Database (G_Data) , the option for Auto
File Growth was selected and Increase by 20 percent. So I am somewhat
puzzled that there error occured?
This isn't a recurring error, since the last time this error had happened
was about 6 months ago - Is it in connnection with the frequency of jobs
that I am runnning or is there something wrong with the settings I have
selected?
Kind Regards
Ricky
(Win2K Server/SQL2K-SP4)maybe an_available_free_space_of_the_volume_wh
ich_the_tlog_is_resided_on <
a_current_size_of_the_tlog * 1.2
--
Andrey Odegov
avodeGOV@.yandex.ru
(remove GOV to respond)
"Ricky" <MSN.MSN.com> wrote in message
news:ebu38YSDGHA.2436@.TK2MSFTNGP15.phx.gbl...
> Good Morning
> We have a nightly DTS job, which uploads data, to a number of tables (35
> tables). However the DTS job failed last night, due to the following
> error
> returned :
> ****
> Error Source: Microsoft OLE DB Provider for SQL Server
> Error Description:The log file for database 'G_Data' is full. Back up the
> transaction log for the database to free up some log space.
> ****
> However, on the properties of the Database (G_Data) , the option for Auto
> File Growth was selected and Increase by 20 percent. So I am somewhat
> puzzled that there error occured?
> This isn't a recurring error, since the last time this error had happened
> was about 6 months ago - Is it in connnection with the frequency of jobs
> that I am runnning or is there something wrong with the settings I have
> selected?
> Kind Regards
> Ricky
> (Win2K Server/SQL2K-SP4)
>|||A file will only grow until there's enough free space on the disk. More
critically - why don't you backup your transaction log?
ML
http://milambda.blogspot.com/|||After backing up, do I delete it?
"ML" <ML@.discussions.microsoft.com> wrote in message
news:19632D48-8D08-4F4D-97EE-B0F0C2F2A4E8@.microsoft.com...
> A file will only grow until there's enough free space on the disk. More
> critically - why don't you backup your transaction log?
>
> ML
> --
> http://milambda.blogspot.com/|||... or an account which the sql server runs in is restricted with quota
settings of the volume
--
Andrey Odegov
avodeGOV@.yandex.ru
(remove GOV to respond)
"Andrey Odegov" <avodeGOV@.mail.ru> wrote in message
news:eiUSgySDGHA.2300@.TK2MSFTNGP15.phx.gbl...
> maybe an_available_free_space_of_the_volume_wh
ich_the_tlog_is_resided_on <
> a_current_size_of_the_tlog * 1.2
> --
> Andrey Odegov
> avodeGOV@.yandex.ru
> (remove GOV to respond)
> "Ricky" <MSN.MSN.com> wrote in message
> news:ebu38YSDGHA.2436@.TK2MSFTNGP15.phx.gbl...
>|||NO! After you back it up, there should be free space available because the
backed-up transactions can be overwritten.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Ricky" <MSN.MSN.com> wrote in message
news:u1lVCCTDGHA.2040@.TK2MSFTNGP14.phx.gbl...
> After backing up, do I delete it?
> "ML" <ML@.discussions.microsoft.com> wrote in message
> news:19632D48-8D08-4F4D-97EE-B0F0C2F2A4E8@.microsoft.com...
>
Friday, February 24, 2012
Log all updated tables
Is there any way to find out what tables are being updated and store it in another table?IF you are running MS-SQL 2000, then use SQL Profiler.
-PatP|||I thought of that but they want this to run all the time. And profiler can cause some overhead. Is there any way to view what's in the transaction log?|||My first thought would be Lumigent Log Explorer (http://www.lumigent.com/products/le_sql.html), but there are options involving triggers that could also do what you've described.
-PatP|||You can take help of server side trace, as the PROFILER is a resource intensive operation.
http://vyaskn.tripod.com/server_side_tracing_in_sql_server.htm & KBA http://support.microsoft.com/?kbid=822853
Monday, February 20, 2012
Locks the tables while running Report...Very Very Urgent....
When i Run the report in reporting services, it locks the tables.
so is there any option to Unlock the tables. I m using just select query to run the report but when i run the report it locks the tables.
I used with(nolock) option in select query but it didnt work...still showing me lock on the tables.
Pls help...its urgent
Thanking You,
Rupali Rane.
If this is SQL server you could try changing the query to a stored procedure and putting "set transaction isolation level read uncommitted" in the beginning of the procedure.
|||"set transaction isolation level read uncommitted" is the equivelant of specifying (NOLOCK) on all tables.
rupamp- Where are you seeing the locks, what type of locks, and do you have a (NOLOCK) on all tables, even in subqueries/derived tables?
As stated above, if you specify "set transaction isolation level read uncommitted" at the beginning of the query, you can skip the (NOLOCK) in the query.
BobP
locks on tables...
configured and
when updates (UPDATEs and DELETEs wrapped in a single transaction) are
executed on the subscriber the changes EVENTUALLY make it back to the
publisher as they should.
the problem i am having is when these sp_MSsync_upd_<tablename> and
sp_MSupd_<tablename> sprocs run on the publisher when the changes occur on
the subscriber they are locking these tables and the entire website (on
publisher side) is unusable due to locks on the records.
but whats weird is that a trace on the publisher that shows all the
sp_MSsync_upd_<tablename> and sp_MSupd_<tablename> calls have SO MANY OF
THEM compared to the actual number of records being deleted on the
subscriber.
Any ideas.
-Terry
Yes, this is one of the problems of using updateable subscribers. Each
singleton in a batch is fired over the network and can cause huge latency
issues, like the one you are seeing. Perhaps you should revisit how you are
doing your replication and select a more appropriate model.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Terry Mulvany" <terry.mulvany@.rouseservices.com> wrote in message
news:OYEe4tnZHHA.3928@.TK2MSFTNGP03.phx.gbl...
>i have transactional replication with a push, updatable subscriber
>configured and
> when updates (UPDATEs and DELETEs wrapped in a single transaction) are
> executed on the subscriber the changes EVENTUALLY make it back to the
> publisher as they should.
> the problem i am having is when these sp_MSsync_upd_<tablename> and
> sp_MSupd_<tablename> sprocs run on the publisher when the changes occur on
> the subscriber they are locking these tables and the entire website (on
> publisher side) is unusable due to locks on the records.
> but whats weird is that a trace on the publisher that shows all the
> sp_MSsync_upd_<tablename> and sp_MSupd_<tablename> calls have SO MANY OF
> THEM compared to the actual number of records being deleted on the
> subscriber.
> Any ideas.
> -Terry
>
>