Showing posts with label transaction. Show all posts
Showing posts with label transaction. Show all posts

Thursday, March 29, 2012

Attach DB Without Transaction Logs

Hi, there,

I have multiple transaction log files. I don't need the transaction logs and intended to remove them. I have tried detaching the database, rename the logs and trying to re-attach the database without the logs but to no avail. The error message mentioned something like file activation failed and SQL couldn't rebuild the transaction logs.

Is there a way to get rid of the transaction log files?

Thank you.

Regards,

Yong Hwee

Hi,

you can use sp_attach_single_file_db but it works only on databases that have a single log file.

When sp_attach_single_file_db attaches the database to the server, it builds a new log file. If the database is read-only, the log file is built in its previous location.

...

OR by reading this thread attaching DB without .ldf file ?

CU

tosc

|||

Hi, Tosc,

Thank you for your immediate reply. It seems like there is no workaround for database with multiple log files.

Regards,

Yong Hwee

|||

There are lot of limitation with sp_attach_single_file_db. The database should not have morethan one LOG and Datafile and the database should be properly detached. So in your case this process will not do. You requirement is to remove the Secondary LOG File, if am correct. What you can do is, Remove the secondary log file first using

DBCC SHRINKFILE (,EMPTYFILE)
alter database test remove file .

Then you can trucate the primary log file to any size you want. Please take backup of the database before starting anything

Madhu

Refer : http://madhuottapalam.blogspot.com/search?q=Transaction+Log

Madhu

|||

In SQL Server 2005 you can you use CREATE DATABASE syntax to rebuild the log. The ATTACH_REBUILD_LOG syntax should work even if there are multiple log files.

|||

Hi, there,

Thank you for your reply. I managed to delete the log by first backup with option to truncate log after which I change the database to simple recovery. I can delete the logs this way.

Thank you.

Regards,

Yong Hwee

Attach db without transaction log file

Hi!
Is it possible attach db without transaction log file?
With store procedure like sp_attach_db and sp_attach_single_file_db it isn't go. Server still looking for transaction log file.
Thanks your helpHi,
You can use sp_attach_single_file_db only on databases that have a single
log file.
Instead try to update the database status to emergency mode and create a new
database and use DTS to transafer all objects to new database.
Steps:
1. Update the database to Emergency mode
update sysdatabases set status=32768 where name=<name of the database>
2. Craete a new database
3. Use DTS to transfer all objects
Thanks
Hari
MCDBA
"Ondrik" <anonymous@.discussions.microsoft.com> wrote in message
news:B3D1753B-C678-4A7E-AEFF-5FD7725FCC2C@.microsoft.com...
> Hi!
> Is it possible attach db without transaction log file?
> With store procedure like sp_attach_db and sp_attach_single_file_db it
isn't go. Server still looking for transaction log file.
> Thanks your help|||Try this:
http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
--
Andrew J. Kelly
SQL Server MVP
"Ondrik" <anonymous@.discussions.microsoft.com> wrote in message
news:B3D1753B-C678-4A7E-AEFF-5FD7725FCC2C@.microsoft.com...
> Hi!
> Is it possible attach db without transaction log file?
> With store procedure like sp_attach_db and sp_attach_single_file_db it
isn't go. Server still looking for transaction log file.
> Thanks your help|||You must first: sp_detach_db
then: delete the ..._log.sfd
then: sp_attach_single_file_db
Bye
Uwe

Attach db w/no log file

I had a client run out of disk space because their transaction log grew too
large. They accidentally deleted the tran log (didn't go to Recycle bin
because of size), and their last good backup was from 3 weeks ago. If I try
to attach the database either through Enterprise Manager or QA it tells me
the physical file name for the ldf is incorrect. Is there a way to get
around this error? Can I restore the old backup to a different name and use
its ldf file? Where is the info stored that tells the system what log file
is associated with the database? Can I modify that somehow? Thanks!Look up sp_attach_single_file_db in BOL
"Roger" <Roger@.discussions.microsoft.com> wrote in message
news:FC936F6C-7280-4DD7-933B-08F7D6A112ED@.microsoft.com...
>I had a client run out of disk space because their transaction log grew too
> large. They accidentally deleted the tran log (didn't go to Recycle bin
> because of size), and their last good backup was from 3 weeks ago. If I
> try
> to attach the database either through Enterprise Manager or QA it tells me
> the physical file name for the ldf is incorrect. Is there a way to get
> around this error? Can I restore the old backup to a different name and
> use
> its ldf file? Where is the info stored that tells the system what log
> file
> is associated with the database? Can I modify that somehow? Thanks!|||Thanks for the reply. I just tried this and it is still telling me that the
ldf file 'may be incorrect.' Can I reattach using the old log file? Or
would that potentially mess up my database? Thanks.
"Michael C#" wrote:
> Look up sp_attach_single_file_db in BOL
> "Roger" <Roger@.discussions.microsoft.com> wrote in message
> news:FC936F6C-7280-4DD7-933B-08F7D6A112ED@.microsoft.com...
> >I had a client run out of disk space because their transaction log grew too
> > large. They accidentally deleted the tran log (didn't go to Recycle bin
> > because of size), and their last good backup was from 3 weeks ago. If I
> > try
> > to attach the database either through Enterprise Manager or QA it tells me
> > the physical file name for the ldf is incorrect. Is there a way to get
> > around this error? Can I restore the old backup to a different name and
> > use
> > its ldf file? Where is the info stored that tells the system what log
> > file
> > is associated with the database? Can I modify that somehow? Thanks!
>
>|||You can't add an unmacthing transaction log file to a database. The purpose of a transaction log is
amongst other things to support recovery. SQL Server does a check at startup that the lsn number for
the log records matches with what to expect for the database. If restore isn't a viable option, I
suggest you let MS Support help you. They might have a way to get the database back, in some shape.
And, make sure you give access to the system to people who might do these operations as well as have
a good backup strategy in the future. But I guess you know this by now. :-)
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Roger" <Roger@.discussions.microsoft.com> wrote in message
news:ADE099E2-854A-426E-9A54-64CB430CE5CD@.microsoft.com...
> Thanks for the reply. I just tried this and it is still telling me that the
> ldf file 'may be incorrect.' Can I reattach using the old log file? Or
> would that potentially mess up my database? Thanks.
> "Michael C#" wrote:
>> Look up sp_attach_single_file_db in BOL
>> "Roger" <Roger@.discussions.microsoft.com> wrote in message
>> news:FC936F6C-7280-4DD7-933B-08F7D6A112ED@.microsoft.com...
>> >I had a client run out of disk space because their transaction log grew too
>> > large. They accidentally deleted the tran log (didn't go to Recycle bin
>> > because of size), and their last good backup was from 3 weeks ago. If I
>> > try
>> > to attach the database either through Enterprise Manager or QA it tells me
>> > the physical file name for the ldf is incorrect. Is there a way to get
>> > around this error? Can I restore the old backup to a different name and
>> > use
>> > its ldf file? Where is the info stored that tells the system what log
>> > file
>> > is associated with the database? Can I modify that somehow? Thanks!
>>|||Check and see if it actually attached. If I recall correctly,
sp_attach_single_file_db will give a warning message when it doesn't find
the log file, but it should still attach successfully.
"Roger" <Roger@.discussions.microsoft.com> wrote in message
news:ADE099E2-854A-426E-9A54-64CB430CE5CD@.microsoft.com...
> Thanks for the reply. I just tried this and it is still telling me that
> the
> ldf file 'may be incorrect.' Can I reattach using the old log file? Or
> would that potentially mess up my database? Thanks.
> "Michael C#" wrote:
>> Look up sp_attach_single_file_db in BOL
>> "Roger" <Roger@.discussions.microsoft.com> wrote in message
>> news:FC936F6C-7280-4DD7-933B-08F7D6A112ED@.microsoft.com...
>> >I had a client run out of disk space because their transaction log grew
>> >too
>> > large. They accidentally deleted the tran log (didn't go to Recycle
>> > bin
>> > because of size), and their last good backup was from 3 weeks ago. If
>> > I
>> > try
>> > to attach the database either through Enterprise Manager or QA it tells
>> > me
>> > the physical file name for the ldf is incorrect. Is there a way to get
>> > around this error? Can I restore the old backup to a different name
>> > and
>> > use
>> > its ldf file? Where is the info stored that tells the system what log
>> > file
>> > is associated with the database? Can I modify that somehow? Thanks!
>>|||I double-checked and it is not attached. A few other users on a different
forum mentioned the same thing. Someone else mentioned an Emergency Mode and
a log re buid resolution they received from MS. Hopefully this will help.
Thank you for your responses.
"Michael C#" wrote:
> Check and see if it actually attached. If I recall correctly,
> sp_attach_single_file_db will give a warning message when it doesn't find
> the log file, but it should still attach successfully.
>
> "Roger" <Roger@.discussions.microsoft.com> wrote in message
> news:ADE099E2-854A-426E-9A54-64CB430CE5CD@.microsoft.com...
> > Thanks for the reply. I just tried this and it is still telling me that
> > the
> > ldf file 'may be incorrect.' Can I reattach using the old log file? Or
> > would that potentially mess up my database? Thanks.
> >
> > "Michael C#" wrote:
> >
> >> Look up sp_attach_single_file_db in BOL
> >>
> >> "Roger" <Roger@.discussions.microsoft.com> wrote in message
> >> news:FC936F6C-7280-4DD7-933B-08F7D6A112ED@.microsoft.com...
> >> >I had a client run out of disk space because their transaction log grew
> >> >too
> >> > large. They accidentally deleted the tran log (didn't go to Recycle
> >> > bin
> >> > because of size), and their last good backup was from 3 weeks ago. If
> >> > I
> >> > try
> >> > to attach the database either through Enterprise Manager or QA it tells
> >> > me
> >> > the physical file name for the ldf is incorrect. Is there a way to get
> >> > around this error? Can I restore the old backup to a different name
> >> > and
> >> > use
> >> > its ldf file? Where is the info stored that tells the system what log
> >> > file
> >> > is associated with the database? Can I modify that somehow? Thanks!
> >>
> >>
> >>
>
>|||One more thing. Make sure the MDF file is not marked READ-ONLY by the
operating system (for instance, if you burned it on a CD, and copied it
back). If it is, make it read/write and try again. Hope you find a
resolution quickly.
"Roger" <Roger@.discussions.microsoft.com> wrote in message
news:00FC1F66-801D-4BC6-8C72-3884BBDDB250@.microsoft.com...
>I double-checked and it is not attached. A few other users on a different
> forum mentioned the same thing. Someone else mentioned an Emergency Mode
> and
> a log re buid resolution they received from MS. Hopefully this will help.
> Thank you for your responses.
> "Michael C#" wrote:
>> Check and see if it actually attached. If I recall correctly,
>> sp_attach_single_file_db will give a warning message when it doesn't find
>> the log file, but it should still attach successfully.
>>
>> "Roger" <Roger@.discussions.microsoft.com> wrote in message
>> news:ADE099E2-854A-426E-9A54-64CB430CE5CD@.microsoft.com...
>> > Thanks for the reply. I just tried this and it is still telling me
>> > that
>> > the
>> > ldf file 'may be incorrect.' Can I reattach using the old log file?
>> > Or
>> > would that potentially mess up my database? Thanks.
>> >
>> > "Michael C#" wrote:
>> >
>> >> Look up sp_attach_single_file_db in BOL
>> >>
>> >> "Roger" <Roger@.discussions.microsoft.com> wrote in message
>> >> news:FC936F6C-7280-4DD7-933B-08F7D6A112ED@.microsoft.com...
>> >> >I had a client run out of disk space because their transaction log
>> >> >grew
>> >> >too
>> >> > large. They accidentally deleted the tran log (didn't go to Recycle
>> >> > bin
>> >> > because of size), and their last good backup was from 3 weeks ago.
>> >> > If
>> >> > I
>> >> > try
>> >> > to attach the database either through Enterprise Manager or QA it
>> >> > tells
>> >> > me
>> >> > the physical file name for the ldf is incorrect. Is there a way to
>> >> > get
>> >> > around this error? Can I restore the old backup to a different name
>> >> > and
>> >> > use
>> >> > its ldf file? Where is the info stored that tells the system what
>> >> > log
>> >> > file
>> >> > is associated with the database? Can I modify that somehow?
>> >> > Thanks!
>> >>
>> >>
>> >>
>>

Attach db w/no log file

I had a client run out of disk space because their transaction log grew too
large. They accidentally deleted the tran log (didn't go to Recycle bin
because of size), and their last good backup was from 3 weeks ago. If I try
to attach the database either through Enterprise Manager or QA it tells me
the physical file name for the ldf is incorrect. Is there a way to get
around this error? Can I restore the old backup to a different name and use
its ldf file? Where is the info stored that tells the system what log file
is associated with the database? Can I modify that somehow? Thanks!Look up sp_attach_single_file_db in BOL
"Roger" <Roger@.discussions.microsoft.com> wrote in message
news:FC936F6C-7280-4DD7-933B-08F7D6A112ED@.microsoft.com...
>I had a client run out of disk space because their transaction log grew too
> large. They accidentally deleted the tran log (didn't go to Recycle bin
> because of size), and their last good backup was from 3 weeks ago. If I
> try
> to attach the database either through Enterprise Manager or QA it tells me
> the physical file name for the ldf is incorrect. Is there a way to get
> around this error? Can I restore the old backup to a different name and
> use
> its ldf file? Where is the info stored that tells the system what log
> file
> is associated with the database? Can I modify that somehow? Thanks!|||Thanks for the reply. I just tried this and it is still telling me that the
ldf file 'may be incorrect.' Can I reattach using the old log file? Or
would that potentially mess up my database? Thanks.
"Michael C#" wrote:

> Look up sp_attach_single_file_db in BOL
> "Roger" <Roger@.discussions.microsoft.com> wrote in message
> news:FC936F6C-7280-4DD7-933B-08F7D6A112ED@.microsoft.com...
>
>|||You can't add an unmacthing transaction log file to a database. The purpose
of a transaction log is
amongst other things to support recovery. SQL Server does a check at startup
that the lsn number for
the log records matches with what to expect for the database. If restore isn
't a viable option, I
suggest you let MS Support help you. They might have a way to get the databa
se back, in some shape.
And, make sure you give access to the system to people who might do these op
erations as well as have
a good backup strategy in the future. But I guess you know this by now. :-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Roger" <Roger@.discussions.microsoft.com> wrote in message
news:ADE099E2-854A-426E-9A54-64CB430CE5CD@.microsoft.com...[vbcol=seagreen]
> Thanks for the reply. I just tried this and it is still telling me that t
he
> ldf file 'may be incorrect.' Can I reattach using the old log file? Or
> would that potentially mess up my database? Thanks.
> "Michael C#" wrote:
>|||Check and see if it actually attached. If I recall correctly,
sp_attach_single_file_db will give a warning message when it doesn't find
the log file, but it should still attach successfully.
"Roger" <Roger@.discussions.microsoft.com> wrote in message
news:ADE099E2-854A-426E-9A54-64CB430CE5CD@.microsoft.com...[vbcol=seagreen]
> Thanks for the reply. I just tried this and it is still telling me that
> the
> ldf file 'may be incorrect.' Can I reattach using the old log file? Or
> would that potentially mess up my database? Thanks.
> "Michael C#" wrote:
>|||I double-checked and it is not attached. A few other users on a different
forum mentioned the same thing. Someone else mentioned an Emergency Mode an
d
a log re buid resolution they received from MS. Hopefully this will help.
Thank you for your responses.
"Michael C#" wrote:

> Check and see if it actually attached. If I recall correctly,
> sp_attach_single_file_db will give a warning message when it doesn't find
> the log file, but it should still attach successfully.
>
> "Roger" <Roger@.discussions.microsoft.com> wrote in message
> news:ADE099E2-854A-426E-9A54-64CB430CE5CD@.microsoft.com...
>
>|||One more thing. Make sure the MDF file is not marked READ-ONLY by the
operating system (for instance, if you burned it on a CD, and copied it
back). If it is, make it read/write and try again. Hope you find a
resolution quickly.
"Roger" <Roger@.discussions.microsoft.com> wrote in message
news:00FC1F66-801D-4BC6-8C72-3884BBDDB250@.microsoft.com...[vbcol=seagreen]
>I double-checked and it is not attached. A few other users on a different
> forum mentioned the same thing. Someone else mentioned an Emergency Mode
> and
> a log re buid resolution they received from MS. Hopefully this will help.
> Thank you for your responses.
> "Michael C#" wrote:
>

Sunday, March 25, 2012

Attach Database

Is there a way to attach a database and leave it in a read-
only mode to restore additional transaction log files just
like restoring from a backup file '
Thanks.You are talking about two different things here. When you attach a database,
the db is going to be online, unlike 'restoring from a backup'.
Could you explain what it is that you are trying to do?
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"David" <anonymous@.discussions.microsoft.com> wrote in message
news:fa8f01c43e76$29d56350$a601280a@.phx.gbl...
Is there a way to attach a database and leave it in a read-
only mode to restore additional transaction log files just
like restoring from a backup file '
Thanks.|||Why it is so different. In both cases, the database can be
online. It is much faster to attach a database than
restoring a database from a backup. If the database is
large (More that 50 GB) copying the *.mdf and *.ldf files
to a backup server rather than backing up it may take
shorter time.

>--Original Message--
>You are talking about two different things here. When you
attach a database,
>the db is going to be online, unlike 'restoring from a
backup'.
>Could you explain what it is that you are trying to do?
>--
>HTH,
>Vyas, MVP (SQL Server)
>http://vyaskn.tripod.com/
>Is .NET important for a database professional?
>http://vyaskn.tripod.com/poll.htm
>
>"David" <anonymous@.discussions.microsoft.com> wrote in
message
>news:fa8f01c43e76$29d56350$a601280a@.phx.gbl...
>Is there a way to attach a database and leave it in a
read-
>only mode to restore additional transaction log files just
>like restoring from a backup file '
>Thanks.
>
>.
>|||Like the other post said the restoration and attaching are two different
things. Now if you want to put a database into read-only mode after the
attach you can issue the following T-SQL command:
exec sp_dboption 'yourdb','read only','true'
To turn off read only issue the follwoing:
exec sp_dboption 'yourdb','read only','false'
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"David" <anonymous@.discussions.microsoft.com> wrote in message
news:fa8f01c43e76$29d56350$a601280a@.phx.gbl...
> Is there a way to attach a database and leave it in a read-
> only mode to restore additional transaction log files just
> like restoring from a backup file '
> Thanks.|||What?
If you're attaching a database you detached, how are you confident that you
can accurately apply transaction logs to it to bring it up to date?
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"David" <anonymous@.discussions.microsoft.com> wrote in message
news:fbb301c43e79$757bd070$a501280a@.phx.gbl...[vbcol=seagreen]
> Why it is so different. In both cases, the database can be
> online. It is much faster to attach a database than
> restoring a database from a backup. If the database is
> large (More that 50 GB) copying the *.mdf and *.ldf files
> to a backup server rather than backing up it may take
> shorter time.
>
>
> attach a database,
> backup'.
> message
> read-|||I am stopping the SQL Server services to copy the *.mdf
and *.ldf file. When I started the services transaction
log backups resumes according to the maintenance plan. SO,
what is so different. What does Stopping and restarting
services changes''/

>--Original Message--
>What?
>If you're attaching a database you detached, how are you
confident that you
>can accurately apply transaction logs to it to bring it
up to date?
>--
>Aaron Bertrand
>SQL Server MVP
>http://www.aspfaq.com/
>
>
>"David" <anonymous@.discussions.microsoft.com> wrote in
message
>news:fbb301c43e79$757bd070$a501280a@.phx.gbl...
be[vbcol=seagreen]
files[vbcol=seagreen]
you[vbcol=seagreen]
just[vbcol=seagreen]
>
>.
>|||That's not a proper detach! So now you're assuming that your hack method
will allow you to attach such an MDF file without problems? Have you tested
this scenario? Why would you use this method as opposed to accepted and
proven methods?
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"David" <anonymous@.discussions.microsoft.com> wrote in message
news:fbfa01c43e7c$80b3cb70$a501280a@.phx.gbl...[vbcol=seagreen]
> I am stopping the SQL Server services to copy the *.mdf
> and *.ldf file. When I started the services transaction
> log backups resumes according to the maintenance plan. SO,
> what is so different. What does Stopping and restarting
> services changes''/
>
> confident that you
> up to date?
> message
> be
> files
> you
> just|||It is a HACK method to you and not to me. What difference
would it make if I detach it and copy it '? The
question is why the same options (READ_ONLY, SINGLE_USER
e.t.c) that can be applied to backup restore can not be
applied to attach database...........

>--Original Message--
>That's not a proper detach! So now you're assuming that
your hack method
>will allow you to attach such an MDF file without
problems? Have you tested
>this scenario? Why would you use this method as
opposed to accepted and
>proven methods?
>--
>Aaron Bertrand
>SQL Server MVP
>http://www.aspfaq.com/
>
>
>"David" <anonymous@.discussions.microsoft.com> wrote in
message
>news:fbfa01c43e7c$80b3cb70$a501280a@.phx.gbl...
SO,[vbcol=seagreen]
you[vbcol=seagreen]
can[vbcol=seagreen]
is[vbcol=seagreen]
When[vbcol=seagreen]
from a[vbcol=seagreen]
do?[vbcol=seagreen]
in[vbcol=seagreen]
a[vbcol=seagreen]
files[vbcol=seagreen]
>
>.
>|||> What difference would it make if I detach it and copy it '?
Because the system does a proper detach and makes sure the db/log are in
sync and can be attached to other systems flawlessly. If you stop the SQL
Server service, this synchronization is not necessarily going to be done for
you (because this SQL Server knows it can resume any ongoing operations, or
roll them back, when the server comes back online...).
What is the BENEFIT you are deriving from stopping the service and copying
the files (which is, absolutely, a hack) as compared to using generally
accepted methods (restore/backup, detach/attach, etc)?
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/|||To make a long story short,
You cannot do this. In order to restore the transaction logs you have to
first restore the database and then restore all the logs in the proper
order, starting with the first one after teh most recent backup.. You
cannot pick and choose which logs you want to restore. So attaching is a
moot point because you still have to restore the database backup in order
to restore any of the logs..
To answer your question more simply:
SQL Server was not designed to work in the manner in which are suggesting.
Rand
This posting is provided "as is" with no warranties and confers no rights.sql

Attach Database

Is there a way to attach a database and leave it in a read-
only mode to restore additional transaction log files just
like restoring from a backup file '
Thanks.You are talking about two different things here. When you attach a database,
the db is going to be online, unlike 'restoring from a backup'.
Could you explain what it is that you are trying to do?
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"David" <anonymous@.discussions.microsoft.com> wrote in message
news:fa8f01c43e76$29d56350$a601280a@.phx.gbl...
Is there a way to attach a database and leave it in a read-
only mode to restore additional transaction log files just
like restoring from a backup file '
Thanks.|||Why it is so different. In both cases, the database can be
online. It is much faster to attach a database than
restoring a database from a backup. If the database is
large (More that 50 GB) copying the *.mdf and *.ldf files
to a backup server rather than backing up it may take
shorter time.
>--Original Message--
>You are talking about two different things here. When you
attach a database,
>the db is going to be online, unlike 'restoring from a
backup'.
>Could you explain what it is that you are trying to do?
>--
>HTH,
>Vyas, MVP (SQL Server)
>http://vyaskn.tripod.com/
>Is .NET important for a database professional?
>http://vyaskn.tripod.com/poll.htm
>
>"David" <anonymous@.discussions.microsoft.com> wrote in
message
>news:fa8f01c43e76$29d56350$a601280a@.phx.gbl...
>Is there a way to attach a database and leave it in a
read-
>only mode to restore additional transaction log files just
>like restoring from a backup file '
>Thanks.
>
>.
>|||Like the other post said the restoration and attaching are two different
things. Now if you want to put a database into read-only mode after the
attach you can issue the following T-SQL command:
exec sp_dboption 'yourdb','read only','true'
To turn off read only issue the follwoing:
exec sp_dboption 'yourdb','read only','false'
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"David" <anonymous@.discussions.microsoft.com> wrote in message
news:fa8f01c43e76$29d56350$a601280a@.phx.gbl...
> Is there a way to attach a database and leave it in a read-
> only mode to restore additional transaction log files just
> like restoring from a backup file '
> Thanks.|||What?
If you're attaching a database you detached, how are you confident that you
can accurately apply transaction logs to it to bring it up to date?
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"David" <anonymous@.discussions.microsoft.com> wrote in message
news:fbb301c43e79$757bd070$a501280a@.phx.gbl...
> Why it is so different. In both cases, the database can be
> online. It is much faster to attach a database than
> restoring a database from a backup. If the database is
> large (More that 50 GB) copying the *.mdf and *.ldf files
> to a backup server rather than backing up it may take
> shorter time.
>
> >--Original Message--
> >You are talking about two different things here. When you
> attach a database,
> >the db is going to be online, unlike 'restoring from a
> backup'.
> >
> >Could you explain what it is that you are trying to do?
> >--
> >HTH,
> >Vyas, MVP (SQL Server)
> >http://vyaskn.tripod.com/
> >Is .NET important for a database professional?
> >http://vyaskn.tripod.com/poll.htm
> >
> >
> >"David" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:fa8f01c43e76$29d56350$a601280a@.phx.gbl...
> >Is there a way to attach a database and leave it in a
> read-
> >only mode to restore additional transaction log files just
> >like restoring from a backup file '
> >
> >Thanks.
> >
> >
> >.
> >|||I am stopping the SQL Server services to copy the *.mdf
and *.ldf file. When I started the services transaction
log backups resumes according to the maintenance plan. SO,
what is so different. What does Stopping and restarting
services changes''/
>--Original Message--
>What?
>If you're attaching a database you detached, how are you
confident that you
>can accurately apply transaction logs to it to bring it
up to date?
>--
>Aaron Bertrand
>SQL Server MVP
>http://www.aspfaq.com/
>
>
>"David" <anonymous@.discussions.microsoft.com> wrote in
message
>news:fbb301c43e79$757bd070$a501280a@.phx.gbl...
>> Why it is so different. In both cases, the database can
be
>> online. It is much faster to attach a database than
>> restoring a database from a backup. If the database is
>> large (More that 50 GB) copying the *.mdf and *.ldf
files
>> to a backup server rather than backing up it may take
>> shorter time.
>>
>> >--Original Message--
>> >You are talking about two different things here. When
you
>> attach a database,
>> >the db is going to be online, unlike 'restoring from a
>> backup'.
>> >
>> >Could you explain what it is that you are trying to do?
>> >--
>> >HTH,
>> >Vyas, MVP (SQL Server)
>> >http://vyaskn.tripod.com/
>> >Is .NET important for a database professional?
>> >http://vyaskn.tripod.com/poll.htm
>> >
>> >
>> >"David" <anonymous@.discussions.microsoft.com> wrote in
>> message
>> >news:fa8f01c43e76$29d56350$a601280a@.phx.gbl...
>> >Is there a way to attach a database and leave it in a
>> read-
>> >only mode to restore additional transaction log files
just
>> >like restoring from a backup file '
>> >
>> >Thanks.
>> >
>> >
>> >.
>> >
>
>.
>|||That's not a proper detach! So now you're assuming that your hack method
will allow you to attach such an MDF file without problems? Have you tested
this scenario? Why would you use this method as opposed to accepted and
proven methods?
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"David" <anonymous@.discussions.microsoft.com> wrote in message
news:fbfa01c43e7c$80b3cb70$a501280a@.phx.gbl...
> I am stopping the SQL Server services to copy the *.mdf
> and *.ldf file. When I started the services transaction
> log backups resumes according to the maintenance plan. SO,
> what is so different. What does Stopping and restarting
> services changes''/
>
> >--Original Message--
> >What?
> >
> >If you're attaching a database you detached, how are you
> confident that you
> >can accurately apply transaction logs to it to bring it
> up to date?
> >
> >--
> >Aaron Bertrand
> >SQL Server MVP
> >http://www.aspfaq.com/
> >
> >
> >
> >
> >"David" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:fbb301c43e79$757bd070$a501280a@.phx.gbl...
> >> Why it is so different. In both cases, the database can
> be
> >> online. It is much faster to attach a database than
> >> restoring a database from a backup. If the database is
> >> large (More that 50 GB) copying the *.mdf and *.ldf
> files
> >> to a backup server rather than backing up it may take
> >> shorter time.
> >>
> >>
> >>
> >> >--Original Message--
> >> >You are talking about two different things here. When
> you
> >> attach a database,
> >> >the db is going to be online, unlike 'restoring from a
> >> backup'.
> >> >
> >> >Could you explain what it is that you are trying to do?
> >> >--
> >> >HTH,
> >> >Vyas, MVP (SQL Server)
> >> >http://vyaskn.tripod.com/
> >> >Is .NET important for a database professional?
> >> >http://vyaskn.tripod.com/poll.htm
> >> >
> >> >
> >> >"David" <anonymous@.discussions.microsoft.com> wrote in
> >> message
> >> >news:fa8f01c43e76$29d56350$a601280a@.phx.gbl...
> >> >Is there a way to attach a database and leave it in a
> >> read-
> >> >only mode to restore additional transaction log files
> just
> >> >like restoring from a backup file '
> >> >
> >> >Thanks.
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >|||It is a HACK method to you and not to me. What difference
would it make if I detach it and copy it '? The
question is why the same options (READ_ONLY, SINGLE_USER
e.t.c) that can be applied to backup restore can not be
applied to attach database...........
>--Original Message--
>That's not a proper detach! So now you're assuming that
your hack method
>will allow you to attach such an MDF file without
problems? Have you tested
>this scenario? Why would you use this method as
opposed to accepted and
>proven methods?
>--
>Aaron Bertrand
>SQL Server MVP
>http://www.aspfaq.com/
>
>
>"David" <anonymous@.discussions.microsoft.com> wrote in
message
>news:fbfa01c43e7c$80b3cb70$a501280a@.phx.gbl...
>> I am stopping the SQL Server services to copy the *.mdf
>> and *.ldf file. When I started the services transaction
>> log backups resumes according to the maintenance plan.
SO,
>> what is so different. What does Stopping and restarting
>> services changes''/
>>
>> >--Original Message--
>> >What?
>> >
>> >If you're attaching a database you detached, how are
you
>> confident that you
>> >can accurately apply transaction logs to it to bring it
>> up to date?
>> >
>> >--
>> >Aaron Bertrand
>> >SQL Server MVP
>> >http://www.aspfaq.com/
>> >
>> >
>> >
>> >
>> >"David" <anonymous@.discussions.microsoft.com> wrote in
>> message
>> >news:fbb301c43e79$757bd070$a501280a@.phx.gbl...
>> >> Why it is so different. In both cases, the database
can
>> be
>> >> online. It is much faster to attach a database than
>> >> restoring a database from a backup. If the database
is
>> >> large (More that 50 GB) copying the *.mdf and *.ldf
>> files
>> >> to a backup server rather than backing up it may take
>> >> shorter time.
>> >>
>> >>
>> >>
>> >> >--Original Message--
>> >> >You are talking about two different things here.
When
>> you
>> >> attach a database,
>> >> >the db is going to be online, unlike 'restoring
from a
>> >> backup'.
>> >> >
>> >> >Could you explain what it is that you are trying to
do?
>> >> >--
>> >> >HTH,
>> >> >Vyas, MVP (SQL Server)
>> >> >http://vyaskn.tripod.com/
>> >> >Is .NET important for a database professional?
>> >> >http://vyaskn.tripod.com/poll.htm
>> >> >
>> >> >
>> >> >"David" <anonymous@.discussions.microsoft.com> wrote
in
>> >> message
>> >> >news:fa8f01c43e76$29d56350$a601280a@.phx.gbl...
>> >> >Is there a way to attach a database and leave it in
a
>> >> read-
>> >> >only mode to restore additional transaction log
files
>> just
>> >> >like restoring from a backup file '
>> >> >
>> >> >Thanks.
>> >> >
>> >> >
>> >> >.
>> >> >
>> >
>> >
>> >.
>> >
>
>.
>|||> What difference would it make if I detach it and copy it '?
Because the system does a proper detach and makes sure the db/log are in
sync and can be attached to other systems flawlessly. If you stop the SQL
Server service, this synchronization is not necessarily going to be done for
you (because this SQL Server knows it can resume any ongoing operations, or
roll them back, when the server comes back online...).
What is the BENEFIT you are deriving from stopping the service and copying
the files (which is, absolutely, a hack) as compared to using generally
accepted methods (restore/backup, detach/attach, etc)?
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/|||To make a long story short,
You cannot do this. In order to restore the transaction logs you have to
first restore the database and then restore all the logs in the proper
order, starting with the first one after teh most recent backup.. You
cannot pick and choose which logs you want to restore. So attaching is a
moot point because you still have to restore the database backup in order
to restore any of the logs..
To answer your question more simply:
SQL Server was not designed to work in the manner in which are suggesting.
Rand
This posting is provided "as is" with no warranties and confers no rights.|||Rand voiced my opinion much more succinctly. ;-)|||I did not mean to be harsh on anyone. I am aware of all of
this. It was just an idea I was throwing it may be
possible one day..........
I was looking for a way out from database backup taking 4
hours every night and restoring on the backup server. When
you have a few database on production server that take too
long to backup and restore along with all the other
processes (Nightly loads, data extracts e.t.c) there isn't
enough time to do everything. Plus a cheap management who
don't want to pay for any third party tools.
Thanks everyone.........
>--Original Message--
>To make a long story short,
>You cannot do this. In order to restore the transaction
logs you have to
>first restore the database and then restore all the logs
in the proper
>order, starting with the first one after teh most recent
backup.. You
>cannot pick and choose which logs you want to restore. So
attaching is a
>moot point because you still have to restore the database
backup in order
>to restore any of the logs..
>To answer your question more simply:
>SQL Server was not designed to work in the manner in
which are suggesting.
>Rand
>This posting is provided "as is" with no warranties and
confers no rights.
>.
>|||Log shipping? Transactional replication? Clustering?
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"David" <anonymous@.discussions.microsoft.com> wrote in message
news:fd9401c43ea6$c3862c20$a601280a@.phx.gbl...
> I did not mean to be harsh on anyone. I am aware of all of
> this. It was just an idea I was throwing it may be
> possible one day..........
> I was looking for a way out from database backup taking 4
> hours every night and restoring on the backup server. When
> you have a few database on production server that take too
> long to backup and restore along with all the other
> processes (Nightly loads, data extracts e.t.c) there isn't
> enough time to do everything. Plus a cheap management who
> don't want to pay for any third party tools.
> Thanks everyone.........|||It is SQL Server 2000 Standard. Our manager thinks
Transactional replication is resource intense......
>--Original Message--
>log shipping is the best way and the cheapest way, if you
have sql server enterprise edition
> -- Aaron Bertrand - MVP wrote: --
> Log shipping? Transactional replication?
Clustering?
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
> "David" <anonymous@.discussions.microsoft.com> wrote
in message
> news:fd9401c43ea6$c3862c20$a601280a@.phx.gbl...
> > I did not mean to be harsh on anyone. I am aware
of all of
> > this. It was just an idea I was throwing it may be
> > possible one day..........
> >> I was looking for a way out from database backup
taking 4
> > hours every night and restoring on the backup
server. When
> > you have a few database on production server that
take too
> > long to backup and restore along with all the other
> > processes (Nightly loads, data extracts e.t.c)
there isn't
> > enough time to do everything. Plus a cheap
management who
> > don't want to pay for any third party tools.
> >> Thanks everyone.........
>
>.
>|||> Our manager thinks
Well, that's scary on its own.
However, instead of letting the manager think something, why not test it and
prove it one way or the other? Rejecting an option because of someone's
perception is a huge mistake, and the manager should be the *first* to
recognize that, if he's worth his salt.
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/|||Log shipping can be performed with any edition, you just cannot just the built-in stuff in EM and Maint wiz
for it. Search and you will find scripts on the net that does the same.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"roy" <anonymous@.discussions.microsoft.com> wrote in message
news:7F7BB8B6-90B8-471F-91B9-6111E79BF8AE@.microsoft.com...
> log shipping is the best way and the cheapest way, if you have sql server enterprise edition
> -- Aaron Bertrand - MVP wrote: --
> Log shipping? Transactional replication? Clustering?
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
> "David" <anonymous@.discussions.microsoft.com> wrote in message
> news:fd9401c43ea6$c3862c20$a601280a@.phx.gbl...
> > I did not mean to be harsh on anyone. I am aware of all of
> > this. It was just an idea I was throwing it may be
> > possible one day..........
> >> I was looking for a way out from database backup taking 4
> > hours every night and restoring on the backup server. When
> > you have a few database on production server that take too
> > long to backup and restore along with all the other
> > processes (Nightly loads, data extracts e.t.c) there isn't
> > enough time to do everything. Plus a cheap management who
> > don't want to pay for any third party tools.
> >> Thanks everyone.........
>
>

Attach Database

Is there a way to attach a database and leave it in a read-
only mode to restore additional transaction log files just
like restoring from a backup file ?
Thanks.
You are talking about two different things here. When you attach a database,
the db is going to be online, unlike 'restoring from a backup'.
Could you explain what it is that you are trying to do?
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"David" <anonymous@.discussions.microsoft.com> wrote in message
news:fa8f01c43e76$29d56350$a601280a@.phx.gbl...
Is there a way to attach a database and leave it in a read-
only mode to restore additional transaction log files just
like restoring from a backup file ?
Thanks.
|||Why it is so different. In both cases, the database can be
online. It is much faster to attach a database than
restoring a database from a backup. If the database is
large (More that 50 GB) copying the *.mdf and *.ldf files
to a backup server rather than backing up it may take
shorter time.

>--Original Message--
>You are talking about two different things here. When you
attach a database,
>the db is going to be online, unlike 'restoring from a
backup'.
>Could you explain what it is that you are trying to do?
>--
>HTH,
>Vyas, MVP (SQL Server)
>http://vyaskn.tripod.com/
>Is .NET important for a database professional?
>http://vyaskn.tripod.com/poll.htm
>
>"David" <anonymous@.discussions.microsoft.com> wrote in
message
>news:fa8f01c43e76$29d56350$a601280a@.phx.gbl...
>Is there a way to attach a database and leave it in a
read-
>only mode to restore additional transaction log files just
>like restoring from a backup file ?
>Thanks.
>
>.
>
|||Like the other post said the restoration and attaching are two different
things. Now if you want to put a database into read-only mode after the
attach you can issue the following T-SQL command:
exec sp_dboption 'yourdb','read only','true'
To turn off read only issue the follwoing:
exec sp_dboption 'yourdb','read only','false'
----
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"David" <anonymous@.discussions.microsoft.com> wrote in message
news:fa8f01c43e76$29d56350$a601280a@.phx.gbl...
> Is there a way to attach a database and leave it in a read-
> only mode to restore additional transaction log files just
> like restoring from a backup file ?
> Thanks.
|||What?
If you're attaching a database you detached, how are you confident that you
can accurately apply transaction logs to it to bring it up to date?
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"David" <anonymous@.discussions.microsoft.com> wrote in message
news:fbb301c43e79$757bd070$a501280a@.phx.gbl...[vbcol=seagreen]
> Why it is so different. In both cases, the database can be
> online. It is much faster to attach a database than
> restoring a database from a backup. If the database is
> large (More that 50 GB) copying the *.mdf and *.ldf files
> to a backup server rather than backing up it may take
> shorter time.
>
> attach a database,
> backup'.
> message
> read-
|||I am stopping the SQL Server services to copy the *.mdf
and *.ldf file. When I started the services transaction
log backups resumes according to the maintenance plan. SO,
what is so different. What does Stopping and restarting
services changes??/

>--Original Message--
>What?
>If you're attaching a database you detached, how are you
confident that you
>can accurately apply transaction logs to it to bring it
up to date?
>--
>Aaron Bertrand
>SQL Server MVP
>http://www.aspfaq.com/
>
>
>"David" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:fbb301c43e79$757bd070$a501280a@.phx.gbl...
be[vbcol=seagreen]
files[vbcol=seagreen]
you[vbcol=seagreen]
just
>
>.
>
|||That's not a proper detach! So now you're assuming that your hack method
will allow you to attach such an MDF file without problems? Have you tested
this scenario? Why would you use this method as opposed to accepted and
proven methods?
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"David" <anonymous@.discussions.microsoft.com> wrote in message
news:fbfa01c43e7c$80b3cb70$a501280a@.phx.gbl...[vbcol=seagreen]
> I am stopping the SQL Server services to copy the *.mdf
> and *.ldf file. When I started the services transaction
> log backups resumes according to the maintenance plan. SO,
> what is so different. What does Stopping and restarting
> services changes??/
>
> confident that you
> up to date?
> message
> be
> files
> you
> just
|||It is a HACK method to you and not to me. What difference
would it make if I detach it and copy it ?? The
question is why the same options (READ_ONLY, SINGLE_USER
e.t.c) that can be applied to backup restore can not be
applied to attach database...........

>--Original Message--
>That's not a proper detach! So now you're assuming that
your hack method
>will allow you to attach such an MDF file without
problems? Have you tested
>this scenario? Why would you use this method as
opposed to accepted and
>proven methods?
>--
>Aaron Bertrand
>SQL Server MVP
>http://www.aspfaq.com/
>
>
>"David" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:fbfa01c43e7c$80b3cb70$a501280a@.phx.gbl...
SO,[vbcol=seagreen]
you[vbcol=seagreen]
can[vbcol=seagreen]
is[vbcol=seagreen]
When[vbcol=seagreen]
from a[vbcol=seagreen]
do?[vbcol=seagreen]
in[vbcol=seagreen]
a[vbcol=seagreen]
files
>
>.
>
|||> What difference would it make if I detach it and copy it ??
Because the system does a proper detach and makes sure the db/log are in
sync and can be attached to other systems flawlessly. If you stop the SQL
Server service, this synchronization is not necessarily going to be done for
you (because this SQL Server knows it can resume any ongoing operations, or
roll them back, when the server comes back online...).
What is the BENEFIT you are deriving from stopping the service and copying
the files (which is, absolutely, a hack) as compared to using generally
accepted methods (restore/backup, detach/attach, etc)?
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
|||To make a long story short,
You cannot do this. In order to restore the transaction logs you have to
first restore the database and then restore all the logs in the proper
order, starting with the first one after teh most recent backup.. You
cannot pick and choose which logs you want to restore. So attaching is a
moot point because you still have to restore the database backup in order
to restore any of the logs..
To answer your question more simply:
SQL Server was not designed to work in the manner in which are suggesting.
Rand
This posting is provided "as is" with no warranties and confers no rights.

Thursday, March 22, 2012

Atomic Transaction

Hi all,

If I have 2 database operations
1. Update ...
2. Delete ...

I want these 2 operations to execute atomically, thus I make use of

BEGIN Transaction ...
Update ...
Delete ...
COMMIT Transaction ...

But if one of these operation fails, it locks up the database. Does anyone have a resolution for this? How do I detect sql Exceptions to release the transaction so that it doesn't lock up the database?

Thanx

James :)I assume this is written in a stored procedure.

In that case

After your first UPDATE you need to chek

@.@.ERROR

If its Zero continue otherwise you need to ROLLBACK the transaction as the update failed. The same is true for your Delete statement. You should only COMMIT when both succeed. You should report or log the error somehow of course.

Have a look in Books Online under the topic

Using @.@.ERROR

its under Accessing and Changing relational Data :: Advanced Query Concepts :: Error Handling

regards

Steve|||Thanx, I will give that a try.
I love dbforums, people here's always got the answer.

James :D

Tuesday, March 20, 2012

Association Rules

1) I use the identifier of transaction and attribute in one table.

Do I can to build a association rules structure without the use of the nested tables?

I tried - did not turn out...

2) As it is necessary to use a main and child table, can not build a prediction query.

When I try to add the predict column in a criteria/argument (Field=PredictSupport), i'll given message:

"Nested table column cannot be used as an argument in a data mining function."

I can not use other columns, because they are not predicable.

You have to have a nested table, but you can use the same table as the case and nested tables. Just mark the transaction key as the key for the "case" table, and the transaction item as the key for the "nested" table.

In your prediction query you would predict the nested table ( you are essentially predicting which rows will be there). For example, if your model was like this:

TransID LONG KEY,
Products TABLE PREDICT
(
ProductName TEXT KEY
)

You would issue a statement like

SELECT Predict(Products, 5) FROM MyModel PREDICTION JOIN ....

|||

Yes, turned out to build a model! Thanks!
But at an attempt to take advantage of builder of queries, there is an error:

Unable to retrieve the list of distinct states for mining model column Utp Doc Id.

ADDITIONAL INFORMATION:

Error (Data mining): The specified DMX column was not found in the context at line 1, column 17. (Microsoft SQL Server 2005 Analysis Services)


Without a builder - a query works :)
And yet question - as possible to apply a function, as though, PredictSupport? She needs a column, and for me does not turn out to use her from a table...

P.S.: I am sorry for my English =)

Wednesday, March 7, 2012

Assertion Errors, temdb guest account, and other errors

Last night, we had a sql server (2000, sp3) whose transaction logs get
backed up to a share have the log backup jobs fail. At the same time, a
database that is a replication publisher became unavailable. We were getting
the following errors in the sql server error log but this error was written
only once to the W2003 Application event log:
Error: 3624, Severity: 20, State: 1.
SQL Server Assertion: File: <sysscan.cpp>, line=565
Failed Assertion = 'xdes->GetDbId () == sDbid'.
I'm still researching this error.
The replicated database showed up in EM but there were no tables (not even
system tables). We tried to detach it to see if we could perhaps re-attach
the files and return it to availability but since it was being replicated,
it would not allow us to do so. We tried various ways of dropping the
publication but since the database was unavailable, we were unable to drop
it.
Since regardless of our resolution to bringing this database back on-line
(restore, etc.) was going to require that we get rid of it as it is, we
restarted the sql server service. The database showed up again and seemed to
be fine. However, this morning, after numerous reports from people unable to
see the databases on this server and errors related to invalid login in
tempdb, I discovered that the guest account was disabled. I granted access
to tempdb to the guest account and that resolved this problem.
We have also had a number of problems with the linked servers that were
previously functional to and from this server.
We recreated the replication of the database that had the problem last night
and the conflict tables are named aonflict% instead of conflict%. We're not
sure if this is related or not but the other problems certainly seem to be
related.
Everything seems to be functional now but I am faced with the task of
putting all of these pieces together in order to determine the cause and to
prevent it from happening again. Any advice on any of these possibly related
issues would be appreciated.It appears as if guest was disabled in model which would explain why it was
disabled in tempdb after restarting the sql server service. I'm not sure why
it was disabled in model.
We're calling MS PSS regarding the assertion errors.
It appears as if the funny conflict table names are due to the failure to
clean up the old publication and/or subscription.
"michelle" <michelle@.nospam.com> wrote in message
news:uUP169kdEHA.1604@.TK2MSFTNGP11.phx.gbl...
> Last night, we had a sql server (2000, sp3) whose transaction logs get
> backed up to a share have the log backup jobs fail. At the same time, a
> database that is a replication publisher became unavailable. We were
getting
> the following errors in the sql server error log but this error was
written
> only once to the W2003 Application event log:
> Error: 3624, Severity: 20, State: 1.
> SQL Server Assertion: File: <sysscan.cpp>, line=565
> Failed Assertion = 'xdes->GetDbId () == sDbid'.
> I'm still researching this error.
> The replicated database showed up in EM but there were no tables (not even
> system tables). We tried to detach it to see if we could perhaps re-attach
> the files and return it to availability but since it was being replicated,
> it would not allow us to do so. We tried various ways of dropping the
> publication but since the database was unavailable, we were unable to drop
> it.
> Since regardless of our resolution to bringing this database back on-line
> (restore, etc.) was going to require that we get rid of it as it is, we
> restarted the sql server service. The database showed up again and seemed
to
> be fine. However, this morning, after numerous reports from people unable
to
> see the databases on this server and errors related to invalid login in
> tempdb, I discovered that the guest account was disabled. I granted access
> to tempdb to the guest account and that resolved this problem.
> We have also had a number of problems with the linked servers that were
> previously functional to and from this server.
> We recreated the replication of the database that had the problem last
night
> and the conflict tables are named aonflict% instead of conflict%. We're
not
> sure if this is related or not but the other problems certainly seem to be
> related.
> Everything seems to be functional now but I am faced with the task of
> putting all of these pieces together in order to determine the cause and
to
> prevent it from happening again. Any advice on any of these possibly
related
> issues would be appreciated.
>

Saturday, February 25, 2012

ASPState database transaction log out control

I am developing an Asp.Net web site which is using SQL Server session state
being held in the ASPState database. I noticed recently that the ASPState
database transaction log had grown to 7.5GB despite the face that only a
small number of users were using the web site which is still under
development. Any reason for this runaway growth? Build as below
..Net Framework 1.1
Windows Server 2003 Standard Edition SP1
Sql Server 2000 Standard Edition SP4
Scott
Hi
Your are in Full recovery mode and are not backup up your log.
http://msdn.microsoft.com/library/de...kprst_565v.asp
http://www.dbazine.com/sql/sql-artic...lins-sqlserver
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"scottrm" <scottrm@.newsgroup.nospam> wrote in message
news:36A7060E-C318-46AC-B128-DB491B883A0B@.microsoft.com...
>I am developing an Asp.Net web site which is using SQL Server session state
> being held in the ASPState database. I noticed recently that the ASPState
> database transaction log had grown to 7.5GB despite the face that only a
> small number of users were using the web site which is still under
> development. Any reason for this runaway growth? Build as below
> .Net Framework 1.1
> Windows Server 2003 Standard Edition SP1
> Sql Server 2000 Standard Edition SP4
> --
> Scott
|||"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:eVSUQoL$FHA.3096@.tk2msftngp13.phx.gbl...
> Hi
> Your are in Full recovery mode and are not backup up your log.
>
You should run the ASP.NET state database in simple recovery mode unless you
are trying to do log shipping or something with it. Better yet, use the
script to create all its objects in TempDB intead of their own database.
David
|||Hi Scott,
You may also refer the articles below for more information
INF: Transaction Log Grows Unexpectedly or Becomes Full on SQL Server
http://support.microsoft.com/kb/317375/en-us
How to stop the transaction log of a SQL Server database from growing
unexpectedly
http://support.microsoft.com/kb/873235/en-us
Topic: DBCC SHRINKDATABASE / DBCC SHRINKFILE in BOL
If you have any questions or concerns, don't hesitate to let me know. We
are always here to be of assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.

ASPState database transaction log out control

I am developing an Asp.Net web site which is using SQL Server session state
being held in the ASPState database. I noticed recently that the ASPState
database transaction log had grown to 7.5GB despite the face that only a
small number of users were using the web site which is still under
development. Any reason for this runaway growth' Build as below
.Net Framework 1.1
Windows Server 2003 Standard Edition SP1
Sql Server 2000 Standard Edition SP4
--
ScottHi
Your are in Full recovery mode and are not backup up your log.
http://msdn.microsoft.com/library/d... />
t_565v.asp
http://www.dbazine.com/sql/sql-arti...llins-sqlserver
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"scottrm" <scottrm@.newsgroup.nospam> wrote in message
news:36A7060E-C318-46AC-B128-DB491B883A0B@.microsoft.com...
>I am developing an Asp.Net web site which is using SQL Server session state
> being held in the ASPState database. I noticed recently that the ASPState
> database transaction log had grown to 7.5GB despite the face that only a
> small number of users were using the web site which is still under
> development. Any reason for this runaway growth' Build as below
> .Net Framework 1.1
> Windows Server 2003 Standard Edition SP1
> Sql Server 2000 Standard Edition SP4
> --
> Scott|||"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:eVSUQoL$FHA.3096@.tk2msftngp13.phx.gbl...
> Hi
> Your are in Full recovery mode and are not backup up your log.
>
You should run the ASP.NET state database in simple recovery mode unless you
are trying to do log shipping or something with it. Better yet, use the
script to create all its objects in TempDB intead of their own database.
David|||Hi Scott,
You may also refer the articles below for more information
INF: Transaction Log Grows Unexpectedly or Becomes Full on SQL Server
http://support.microsoft.com/kb/317375/en-us
How to stop the transaction log of a SQL Server database from growing
unexpectedly
http://support.microsoft.com/kb/873235/en-us
Topic: DBCC SHRINKDATABASE / DBCC SHRINKFILE in BOL
If you have any questions or concerns, don't hesitate to let me know. We
are always here to be of assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

ASPState database transaction log out control

I am developing an Asp.Net web site which is using SQL Server session state
being held in the ASPState database. I noticed recently that the ASPState
database transaction log had grown to 7.5GB despite the face that only a
small number of users were using the web site which is still under
development. Any reason for this runaway growth' Build as below
.Net Framework 1.1
Windows Server 2003 Standard Edition SP1
Sql Server 2000 Standard Edition SP4
--
ScottHi
Your are in Full recovery mode and are not backup up your log.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_bkprst_565v.asp
http://www.dbazine.com/sql/sql-articles/mullins-sqlserver
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"scottrm" <scottrm@.newsgroup.nospam> wrote in message
news:36A7060E-C318-46AC-B128-DB491B883A0B@.microsoft.com...
>I am developing an Asp.Net web site which is using SQL Server session state
> being held in the ASPState database. I noticed recently that the ASPState
> database transaction log had grown to 7.5GB despite the face that only a
> small number of users were using the web site which is still under
> development. Any reason for this runaway growth' Build as below
> .Net Framework 1.1
> Windows Server 2003 Standard Edition SP1
> Sql Server 2000 Standard Edition SP4
> --
> Scott|||"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:eVSUQoL$FHA.3096@.tk2msftngp13.phx.gbl...
> Hi
> Your are in Full recovery mode and are not backup up your log.
>
You should run the ASP.NET state database in simple recovery mode unless you
are trying to do log shipping or something with it. Better yet, use the
script to create all its objects in TempDB intead of their own database.
David|||Hi Scott,
You may also refer the articles below for more information
INF: Transaction Log Grows Unexpectedly or Becomes Full on SQL Server
http://support.microsoft.com/kb/317375/en-us
How to stop the transaction log of a SQL Server database from growing
unexpectedly
http://support.microsoft.com/kb/873235/en-us
Topic: DBCC SHRINKDATABASE / DBCC SHRINKFILE in BOL
If you have any questions or concerns, don't hesitate to let me know. We
are always here to be of assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.