Showing posts with label switch. Show all posts
Showing posts with label switch. Show all posts

Thursday, March 29, 2012

Database in 'In recovery' mode

Hi,
There was the most awful case. During a update of a DB there was a
switching-off of power supplies. After switch on of a server the base has
passed in mode 'Suspect'. To restore base by standard way it was not
possible. Substitution of files and had turned out to open changes of the
status of base data.
Has executed substitution of files of a database. Has successfully opened a
database, structure - all is accessible.
Check of a file of a database on integrity is executed successfully, errors
are not present (DBCC CHECKDB).
I can not create backup, gives out the message that are opened deferred
transactions.
Also, at change of some objects there is a lag of a server that leads to
change of the status of database 'In Recovery'. In 2 and more hours the
status has not changed.
Whether it is necessary to wait for restoration? How to commit deferred tran?
Thank you for any help.
p.s. Backups very old :(Not sure if this is going to work ... a little bit risky but worth a try (I
guess)...
It seemed that some transaction are not clearing so try to rollback the
transaction and then try to backup the database and then try to turn the
database back online, so the command would look like:
USE master
GO
-- First set it to read only and rollback any active transaction
ALTER DATABASE [DatabaseName]
SET READ_ONLY WITH ROLLBACK IMMEDIATE
GO
-- Backup the database, hopefully it should work since there should not be
any active transaction
BACKUP DATABASE [DatabaseName]
TO DISK = '[FilePathAndName]'
WITH INIT
GO
-- Turn the database back online
ALTER DATABASE [DatabaseName]
SET ONLINE WITH ROLLBACK IMMEDIATE
GO
Hopefully that would work (but no guarantee...)
Lucas
"int64" wrote:
> Hi,
> There was the most awful case. During a update of a DB there was a
> switching-off of power supplies. After switch on of a server the base has
> passed in mode 'Suspect'. To restore base by standard way it was not
> possible. Substitution of files and had turned out to open changes of the
> status of base data.
> Has executed substitution of files of a database. Has successfully opened a
> database, structure - all is accessible.
> Check of a file of a database on integrity is executed successfully, errors
> are not present (DBCC CHECKDB).
> I can not create backup, gives out the message that are opened deferred
> transactions.
> Also, at change of some objects there is a lag of a server that leads to
> change of the status of database 'In Recovery'. In 2 and more hours the
> status has not changed.
> Whether it is necessary to wait for restoration? How to commit deferred tran?
> Thank you for any help.
> p.s. Backups very old :(
>

Monday, March 19, 2012

Database dropdown, Query Analyzer

I didn't see my previous post in the last half hour, so reposting again.
Ok. Whenever I have to switch to a different database in my DEV server, if I
click the dropdown box, it takes for ever to show the list of databases on
that server.I tried few things, but didn't work. I truncated the Log files,
Shrink database & log files. Any clues how this can be rectified. Or any
pointers or corners I haven't looked at.
Have you looked to see if your request is blocked? Sometimes the system
tables can be blocked during database changes.
"S" <S@.discussions.microsoft.com> wrote in message
news:5015D71C-05CA-47F5-9950-C63C25DE830B@.microsoft.com...
>I didn't see my previous post in the last half hour, so reposting again.
> Ok. Whenever I have to switch to a different database in my DEV server, if
> I
> click the dropdown box, it takes for ever to show the list of databases on
> that server.I tried few things, but didn't work. I truncated the Log
> files,
> Shrink database & log files. Any clues how this can be rectified. Or any
> pointers or corners I haven't looked at.
>
|||This happens every time I try to switch to a different database. I have
checked for open/ blocked transactions but there are none.
"Danny" wrote:

> Have you looked to see if your request is blocked? Sometimes the system
> tables can be blocked during database changes.
>
> "S" <S@.discussions.microsoft.com> wrote in message
> news:5015D71C-05CA-47F5-9950-C63C25DE830B@.microsoft.com...
>
>
|||Check to ensure the 'auto close' option is off in all databases. This
option can elongate database enumeration.
Hope this helps.
Dan Guzman
SQL Server MVP
"S" <S@.discussions.microsoft.com> wrote in message
news:5015D71C-05CA-47F5-9950-C63C25DE830B@.microsoft.com...
>I didn't see my previous post in the last half hour, so reposting again.
> Ok. Whenever I have to switch to a different database in my DEV server, if
> I
> click the dropdown box, it takes for ever to show the list of databases on
> that server.I tried few things, but didn't work. I truncated the Log
> files,
> Shrink database & log files. Any clues how this can be rectified. Or any
> pointers or corners I haven't looked at.
>
|||Did you run a Profiler trace, like Kalen suggested, catch the TSQL submitted by QA and execute that
same TSQL from a QA query Window?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"S" <S@.discussions.microsoft.com> wrote in message
news:5015D71C-05CA-47F5-9950-C63C25DE830B@.microsoft.com...
>I didn't see my previous post in the last half hour, so reposting again.
> Ok. Whenever I have to switch to a different database in my DEV server, if I
> click the dropdown box, it takes for ever to show the list of databases on
> that server.I tried few things, but didn't work. I truncated the Log files,
> Shrink database & log files. Any clues how this can be rectified. Or any
> pointers or corners I haven't looked at.
>
|||I found the problem and fixed it. Thanks for your time for helping me to
resolve this.
This also helped me.
http://www.sqlservercentral.com/foru...ssageid=206193
"Tibor Karaszi" wrote:

> Did you run a Profiler trace, like Kalen suggested, catch the TSQL submitted by QA and execute that
> same TSQL from a QA query Window?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "S" <S@.discussions.microsoft.com> wrote in message
> news:5015D71C-05CA-47F5-9950-C63C25DE830B@.microsoft.com...
>
>
|||Can you say what the problem was? The link doesn't work if you're not a member...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"S" <S@.discussions.microsoft.com> wrote in message
news:F510727E-F5E7-4545-9BD4-3169D600A440@.microsoft.com...[vbcol=seagreen]
>I found the problem and fixed it. Thanks for your time for helping me to
> resolve this.
> This also helped me.
> http://www.sqlservercentral.com/foru...ssageid=206193
> "Tibor Karaszi" wrote:

Database dropdown, Query Analyzer

I didn't see my previous post in the last half hour, so reposting again.
Ok. Whenever I have to switch to a different database in my DEV server, if I
click the dropdown box, it takes for ever to show the list of databases on
that server.I tried few things, but didn't work. I truncated the Log files,
Shrink database & log files. Any clues how this can be rectified. Or any
pointers or corners I haven't looked at.Have you looked to see if your request is blocked? Sometimes the system
tables can be blocked during database changes.
"S" <S@.discussions.microsoft.com> wrote in message
news:5015D71C-05CA-47F5-9950-C63C25DE830B@.microsoft.com...
>I didn't see my previous post in the last half hour, so reposting again.
> Ok. Whenever I have to switch to a different database in my DEV server, if
> I
> click the dropdown box, it takes for ever to show the list of databases on
> that server.I tried few things, but didn't work. I truncated the Log
> files,
> Shrink database & log files. Any clues how this can be rectified. Or any
> pointers or corners I haven't looked at.
>|||This happens every time I try to switch to a different database. I have
checked for open/ blocked transactions but there are none.
"Danny" wrote:

> Have you looked to see if your request is blocked? Sometimes the system
> tables can be blocked during database changes.
>
> "S" <S@.discussions.microsoft.com> wrote in message
> news:5015D71C-05CA-47F5-9950-C63C25DE830B@.microsoft.com...
>
>|||Check to ensure the 'auto close' option is off in all databases. This
option can elongate database enumeration.
Hope this helps.
Dan Guzman
SQL Server MVP
"S" <S@.discussions.microsoft.com> wrote in message
news:5015D71C-05CA-47F5-9950-C63C25DE830B@.microsoft.com...
>I didn't see my previous post in the last half hour, so reposting again.
> Ok. Whenever I have to switch to a different database in my DEV server, if
> I
> click the dropdown box, it takes for ever to show the list of databases on
> that server.I tried few things, but didn't work. I truncated the Log
> files,
> Shrink database & log files. Any clues how this can be rectified. Or any
> pointers or corners I haven't looked at.
>|||Did you run a Profiler trace, like Kalen suggested, catch the TSQL submitted
by QA and execute that
same TSQL from a QA query Window?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"S" <S@.discussions.microsoft.com> wrote in message
news:5015D71C-05CA-47F5-9950-C63C25DE830B@.microsoft.com...
>I didn't see my previous post in the last half hour, so reposting again.
> Ok. Whenever I have to switch to a different database in my DEV server, if
I
> click the dropdown box, it takes for ever to show the list of databases on
> that server.I tried few things, but didn't work. I truncated the Log files
,
> Shrink database & log files. Any clues how this can be rectified. Or any
> pointers or corners I haven't looked at.
>|||I found the problem and fixed it. Thanks for your time for helping me to
resolve this.
This also helped me.
[url]http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=5&messageid=206193[
/url]
"Tibor Karaszi" wrote:

> Did you run a Profiler trace, like Kalen suggested, catch the TSQL submitt
ed by QA and execute that
> same TSQL from a QA query Window?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "S" <S@.discussions.microsoft.com> wrote in message
> news:5015D71C-05CA-47F5-9950-C63C25DE830B@.microsoft.com...
>
>|||Can you say what the problem was? The link doesn't work if you're not a memb
er...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"S" <S@.discussions.microsoft.com> wrote in message
news:F510727E-F5E7-4545-9BD4-3169D600A440@.microsoft.com...[vbcol=seagreen]
>I found the problem and fixed it. Thanks for your time for helping me to
> resolve this.
> This also helped me.
> http://www.sqlservercentral.com/for...=20619
3
> "Tibor Karaszi" wrote:
>

Database dropdown, Query Analyzer

I didn't see my previous post in the last half hour, so reposting again.
Ok. Whenever I have to switch to a different database in my DEV server, if I
click the dropdown box, it takes for ever to show the list of databases on
that server.I tried few things, but didn't work. I truncated the Log files,
Shrink database & log files. Any clues how this can be rectified. Or any
pointers or corners I haven't looked at.Have you looked to see if your request is blocked? Sometimes the system
tables can be blocked during database changes.
"S" <S@.discussions.microsoft.com> wrote in message
news:5015D71C-05CA-47F5-9950-C63C25DE830B@.microsoft.com...
>I didn't see my previous post in the last half hour, so reposting again.
> Ok. Whenever I have to switch to a different database in my DEV server, if
> I
> click the dropdown box, it takes for ever to show the list of databases on
> that server.I tried few things, but didn't work. I truncated the Log
> files,
> Shrink database & log files. Any clues how this can be rectified. Or any
> pointers or corners I haven't looked at.
>|||This happens every time I try to switch to a different database. I have
checked for open/ blocked transactions but there are none.
"Danny" wrote:
> Have you looked to see if your request is blocked? Sometimes the system
> tables can be blocked during database changes.
>
> "S" <S@.discussions.microsoft.com> wrote in message
> news:5015D71C-05CA-47F5-9950-C63C25DE830B@.microsoft.com...
> >I didn't see my previous post in the last half hour, so reposting again.
> >
> > Ok. Whenever I have to switch to a different database in my DEV server, if
> > I
> > click the dropdown box, it takes for ever to show the list of databases on
> > that server.I tried few things, but didn't work. I truncated the Log
> > files,
> > Shrink database & log files. Any clues how this can be rectified. Or any
> > pointers or corners I haven't looked at.
> >
>
>|||Check to ensure the 'auto close' option is off in all databases. This
option can elongate database enumeration.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"S" <S@.discussions.microsoft.com> wrote in message
news:5015D71C-05CA-47F5-9950-C63C25DE830B@.microsoft.com...
>I didn't see my previous post in the last half hour, so reposting again.
> Ok. Whenever I have to switch to a different database in my DEV server, if
> I
> click the dropdown box, it takes for ever to show the list of databases on
> that server.I tried few things, but didn't work. I truncated the Log
> files,
> Shrink database & log files. Any clues how this can be rectified. Or any
> pointers or corners I haven't looked at.
>|||Did you run a Profiler trace, like Kalen suggested, catch the TSQL submitted by QA and execute that
same TSQL from a QA query Window?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"S" <S@.discussions.microsoft.com> wrote in message
news:5015D71C-05CA-47F5-9950-C63C25DE830B@.microsoft.com...
>I didn't see my previous post in the last half hour, so reposting again.
> Ok. Whenever I have to switch to a different database in my DEV server, if I
> click the dropdown box, it takes for ever to show the list of databases on
> that server.I tried few things, but didn't work. I truncated the Log files,
> Shrink database & log files. Any clues how this can be rectified. Or any
> pointers or corners I haven't looked at.
>|||I found the problem and fixed it. Thanks for your time for helping me to
resolve this.
This also helped me.
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=5&messageid=206193
"Tibor Karaszi" wrote:
> Did you run a Profiler trace, like Kalen suggested, catch the TSQL submitted by QA and execute that
> same TSQL from a QA query Window?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "S" <S@.discussions.microsoft.com> wrote in message
> news:5015D71C-05CA-47F5-9950-C63C25DE830B@.microsoft.com...
> >I didn't see my previous post in the last half hour, so reposting again.
> >
> > Ok. Whenever I have to switch to a different database in my DEV server, if I
> > click the dropdown box, it takes for ever to show the list of databases on
> > that server.I tried few things, but didn't work. I truncated the Log files,
> > Shrink database & log files. Any clues how this can be rectified. Or any
> > pointers or corners I haven't looked at.
> >
>
>|||Can you say what the problem was? The link doesn't work if you're not a member...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"S" <S@.discussions.microsoft.com> wrote in message
news:F510727E-F5E7-4545-9BD4-3169D600A440@.microsoft.com...
>I found the problem and fixed it. Thanks for your time for helping me to
> resolve this.
> This also helped me.
> http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=5&messageid=206193
> "Tibor Karaszi" wrote:
>> Did you run a Profiler trace, like Kalen suggested, catch the TSQL submitted by QA and execute
>> that
>> same TSQL from a QA query Window?
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "S" <S@.discussions.microsoft.com> wrote in message
>> news:5015D71C-05CA-47F5-9950-C63C25DE830B@.microsoft.com...
>> >I didn't see my previous post in the last half hour, so reposting again.
>> >
>> > Ok. Whenever I have to switch to a different database in my DEV server, if I
>> > click the dropdown box, it takes for ever to show the list of databases on
>> > that server.I tried few things, but didn't work. I truncated the Log files,
>> > Shrink database & log files. Any clues how this can be rectified. Or any
>> > pointers or corners I haven't looked at.
>> >
>>