Showing posts with label suspect. Show all posts
Showing posts with label suspect. Show all posts

Wednesday, March 28, 2012

Help! Suspect Databases - Hardware Failure

We have numerous suspect databases across multiple serverse due to a hardware
failure on our SAN. The part of the SAN that failed had a combination of data
and log files, but not both for a given database.
Right now we have services shut down on the server. When we bring the server
back up, after fixing our hardware failure, what would be the best steps?
Message posted via droptable.com
http://www.droptable.com/Uwe/Forums.aspx/sql-server/200703/1
"cbrichards via droptable.com" <u3288@.uwe> wrote in message
news:6eca09c69ec9c@.uwe...
> We have numerous suspect databases across multiple serverse due to a
> hardware
> failure on our SAN. The part of the SAN that failed had a combination of
> data
> and log files, but not both for a given database.
> Right now we have services shut down on the server. When we bring the
> server
> back up, after fixing our hardware failure, what would be the best steps?
BEFORE bringing up the server, make complete backups of all files.
Then once you bring up the server, check the logs and find out why the
databases are suspect.
In some cases it may be as simple as the drive letters or paths no longer
being right and once you fix those, the database may come up cleanly.
If it's more complex, you'll have to do different things, but hard to
recommend w/o knowing in advance the exact nature of the problems.
No matter what I'd make sure to do a DBCC checkdb once the database is back
up, just to be sure.
(btw, I've found that it takes pretty bad problems to outright corrupt a SQL
2000/2005 database, so you may luck out.)

> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forums.aspx/sql-server/200703/1
>
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com http://www.greenms.com
|||Thanks Greg. Once the hardware was repaired and we restarted the services (we
had complete backups available) all databases came up cleanly.
If I were to set a job to execute DBCC CHECKDB WITH NO_INFOMSGS to run after
hours, if there were errors encountered, would I still be informed, even
though I had the "WITH NO_INFOMSGS" option?
Greg D. Moore (Strider) wrote:
>[quoted text clipped - 5 lines]
>BEFORE bringing up the server, make complete backups of all files.
>Then once you bring up the server, check the logs and find out why the
>databases are suspect.
>In some cases it may be as simple as the drive letters or paths no longer
>being right and once you fix those, the database may come up cleanly.
>If it's more complex, you'll have to do different things, but hard to
>recommend w/o knowing in advance the exact nature of the problems.
>No matter what I'd make sure to do a DBCC checkdb once the database is back
>up, just to be sure.
>(btw, I've found that it takes pretty bad problems to outright corrupt a SQL
>2000/2005 database, so you may luck out.)
>
Message posted via droptable.com
http://www.droptable.com/Uwe/Forums.aspx/sql-server/200703/1
|||"cbrichards via droptable.com" <u3288@.uwe> wrote in message
news:6ecae312206bc@.uwe...
> Thanks Greg. Once the hardware was repaired and we restarted the services
> (we
> had complete backups available) all databases came up cleanly.
>
Glad to hear it.

> If I were to set a job to execute DBCC CHECKDB WITH NO_INFOMSGS to run
> after
> hours, if there were errors encountered, would I still be informed, even
> though I had the "WITH NO_INFOMSGS" option?
I believe so.

>
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com http://www.greenms.com

Help! Suspect Databases - Hardware Failure

We have numerous suspect databases across multiple serverse due to a hardware
failure on our SAN. The part of the SAN that failed had a combination of data
and log files, but not both for a given database.
Right now we have services shut down on the server. When we bring the server
back up, after fixing our hardware failure, what would be the best steps?
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200703/1"cbrichards via SQLMonster.com" <u3288@.uwe> wrote in message
news:6eca09c69ec9c@.uwe...
> We have numerous suspect databases across multiple serverse due to a
> hardware
> failure on our SAN. The part of the SAN that failed had a combination of
> data
> and log files, but not both for a given database.
> Right now we have services shut down on the server. When we bring the
> server
> back up, after fixing our hardware failure, what would be the best steps?
BEFORE bringing up the server, make complete backups of all files.
Then once you bring up the server, check the logs and find out why the
databases are suspect.
In some cases it may be as simple as the drive letters or paths no longer
being right and once you fix those, the database may come up cleanly.
If it's more complex, you'll have to do different things, but hard to
recommend w/o knowing in advance the exact nature of the problems.
No matter what I'd make sure to do a DBCC checkdb once the database is back
up, just to be sure.
(btw, I've found that it takes pretty bad problems to outright corrupt a SQL
2000/2005 database, so you may luck out.)
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200703/1
>
--
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com http://www.greenms.com|||Thanks Greg. Once the hardware was repaired and we restarted the services (we
had complete backups available) all databases came up cleanly.
If I were to set a job to execute DBCC CHECKDB WITH NO_INFOMSGS to run after
hours, if there were errors encountered, would I still be informed, even
though I had the "WITH NO_INFOMSGS" option?
Greg D. Moore (Strider) wrote:
>> We have numerous suspect databases across multiple serverse due to a
>> hardware
>[quoted text clipped - 5 lines]
>> server
>> back up, after fixing our hardware failure, what would be the best steps?
>BEFORE bringing up the server, make complete backups of all files.
>Then once you bring up the server, check the logs and find out why the
>databases are suspect.
>In some cases it may be as simple as the drive letters or paths no longer
>being right and once you fix those, the database may come up cleanly.
>If it's more complex, you'll have to do different things, but hard to
>recommend w/o knowing in advance the exact nature of the problems.
>No matter what I'd make sure to do a DBCC checkdb once the database is back
>up, just to be sure.
>(btw, I've found that it takes pretty bad problems to outright corrupt a SQL
>2000/2005 database, so you may luck out.)
>
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200703/1|||"cbrichards via SQLMonster.com" <u3288@.uwe> wrote in message
news:6ecae312206bc@.uwe...
> Thanks Greg. Once the hardware was repaired and we restarted the services
> (we
> had complete backups available) all databases came up cleanly.
>
Glad to hear it.
> If I were to set a job to execute DBCC CHECKDB WITH NO_INFOMSGS to run
> after
> hours, if there were errors encountered, would I still be informed, even
> though I had the "WITH NO_INFOMSGS" option?
I believe so.
>
--
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com http://www.greenms.com|||On 06.03.2007 22:11, cbrichards via SQLMonster.com wrote:
> Thanks Greg. Once the hardware was repaired and we restarted the services (we
> had complete backups available) all databases came up cleanly.
> If I were to set a job to execute DBCC CHECKDB WITH NO_INFOMSGS to run after
> hours, if there were errors encountered, would I still be informed, even
> though I had the "WITH NO_INFOMSGS" option?
Wouldn't it be better to run this first before using the DB again? I
mean if there were issues you'd rather want to fix them before you put
the DB back in production.
Kind regards
robert

Help! Suspect Databases - Hardware Failure

We have numerous suspect databases across multiple serverse due to a hardwar
e
failure on our SAN. The part of the SAN that failed had a combination of dat
a
and log files, but not both for a given database.
Right now we have services shut down on the server. When we bring the server
back up, after fixing our hardware failure, what would be the best steps?
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200703/1"cbrichards via droptable.com" <u3288@.uwe> wrote in message
news:6eca09c69ec9c@.uwe...
> We have numerous suspect databases across multiple serverse due to a
> hardware
> failure on our SAN. The part of the SAN that failed had a combination of
> data
> and log files, but not both for a given database.
> Right now we have services shut down on the server. When we bring the
> server
> back up, after fixing our hardware failure, what would be the best steps?
BEFORE bringing up the server, make complete backups of all files.
Then once you bring up the server, check the logs and find out why the
databases are suspect.
In some cases it may be as simple as the drive letters or paths no longer
being right and once you fix those, the database may come up cleanly.
If it's more complex, you'll have to do different things, but hard to
recommend w/o knowing in advance the exact nature of the problems.
No matter what I'd make sure to do a DBCC checkdb once the database is back
up, just to be sure.
(btw, I've found that it takes pretty bad problems to outright corrupt a SQL
2000/2005 database, so you may luck out.)

> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forum...server/200703/1
>
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com http://www.greenms.com|||Thanks Greg. Once the hardware was repaired and we restarted the services (w
e
had complete backups available) all databases came up cleanly.
If I were to set a job to execute DBCC CHECKDB WITH NO_INFOMSGS to run after
hours, if there were errors encountered, would I still be informed, even
though I had the "WITH NO_INFOMSGS" option?
Greg D. Moore (Strider) wrote:
>[quoted text clipped - 5 lines]
>BEFORE bringing up the server, make complete backups of all files.
>Then once you bring up the server, check the logs and find out why the
>databases are suspect.
>In some cases it may be as simple as the drive letters or paths no longer
>being right and once you fix those, the database may come up cleanly.
>If it's more complex, you'll have to do different things, but hard to
>recommend w/o knowing in advance the exact nature of the problems.
>No matter what I'd make sure to do a DBCC checkdb once the database is back
>up, just to be sure.
>(btw, I've found that it takes pretty bad problems to outright corrupt a SQ
L
>2000/2005 database, so you may luck out.)
>
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200703/1|||"cbrichards via droptable.com" <u3288@.uwe> wrote in message
news:6ecae312206bc@.uwe...
> Thanks Greg. Once the hardware was repaired and we restarted the services
> (we
> had complete backups available) all databases came up cleanly.
>
Glad to hear it.

> If I were to set a job to execute DBCC CHECKDB WITH NO_INFOMSGS to run
> after
> hours, if there were errors encountered, would I still be informed, even
> though I had the "WITH NO_INFOMSGS" option?
I believe so.

>
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com http://www.greenms.com|||On 06.03.2007 22:11, cbrichards via droptable.com wrote:
> Thanks Greg. Once the hardware was repaired and we restarted the services
(we
> had complete backups available) all databases came up cleanly.
> If I were to set a job to execute DBCC CHECKDB WITH NO_INFOMSGS to run aft
er
> hours, if there were errors encountered, would I still be informed, even
> though I had the "WITH NO_INFOMSGS" option?
Wouldn't it be better to run this first before using the DB again? I
mean if there were issues you'd rather want to fix them before you put
the DB back in production.
Kind regards
robertsql

Monday, March 12, 2012

Help! Databases marked as suspect..

Last night we had a major storm hit us and the power went out. The SQL 2000
server has a UPS on it so should have went down gracefully - but who knows.
Anyway, this morning no one was able to get into the data. When I checked
the server, I noticed that all of our databases (except the test databases
installed by default when you install SQL Server) were marked as 'suspect'.
Drilling down in th4e database yields no tables or anything. It jsut says no
items present.
I am new to SQL server and have never seen this before. The server has been
rebooted - it did not help. All services are running just fine. I checked
the event viewer and do not see anything wrong there. Is there a specific
SQL server log somewhere ?
Help!! What do I do to get these databases back up? All my users are
chompoing at the bit!!!
Thanks, Brad
Definately read Tibor's link and pay attention to the part about backing up
the log with no_truncate to get everything you can get restored.
DatabaseAdmins.com
Remote DBA services
"Tibor Karaszi" wrote:

> There's a possibility that it is restore time, so you might as well initiate the process to find
> your backups.
> SQL Servers error log file is in the folder for your instance\log. for instance, on my machine, with
> a named 2000 instance:
> C:\Program Files\Microsoft SQL Server\MSSQL$SS2000I1\LOG
> Here are my general recommendations for suspect and corrupt databases:
> http://www.karaszi.com/SQLServer/info_corrupt_suspect_db.asp
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Brad Pears" <bradp@.truenorthloghomes.com> wrote in message
> news:OTXUGaOXHHA.388@.TK2MSFTNGP04.phx.gbl...
>

Help! Databases marked as suspect..

Last night we had a major storm hit us and the power went out. The SQL 2000
server has a UPS on it so should have went down gracefully - but who knows.
Anyway, this morning no one was able to get into the data. When I checked
the server, I noticed that all of our databases (except the test databases
installed by default when you install SQL Server) were marked as 'suspect'.
Drilling down in th4e database yields no tables or anything. It jsut says no
items present.
I am new to SQL server and have never seen this before. The server has been
rebooted - it did not help. All services are running just fine. I checked
the event viewer and do not see anything wrong there. Is there a specific
SQL server log somewhere ?
Help!! What do I do to get these databases back up? All my users are
chompoing at the bit!!!
Thanks, Brad
Definately read Tibor's link and pay attention to the part about backing up
the log with no_truncate to get everything you can get restored.
DatabaseAdmins.com
Remote DBA services
"Tibor Karaszi" wrote:

> There's a possibility that it is restore time, so you might as well initiate the process to find
> your backups.
> SQL Servers error log file is in the folder for your instance\log. for instance, on my machine, with
> a named 2000 instance:
> C:\Program Files\Microsoft SQL Server\MSSQL$SS2000I1\LOG
> Here are my general recommendations for suspect and corrupt databases:
> http://www.karaszi.com/SQLServer/info_corrupt_suspect_db.asp
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Brad Pears" <bradp@.truenorthloghomes.com> wrote in message
> news:OTXUGaOXHHA.388@.TK2MSFTNGP04.phx.gbl...
>

Help! Databases marked as suspect..

Last night we had a major storm hit us and the power went out. The SQL 2000
server has a UPS on it so should have went down gracefully - but who knows.
Anyway, this morning no one was able to get into the data. When I checked
the server, I noticed that all of our databases (except the test databases
installed by default when you install SQL Server) were marked as 'suspect'.
Drilling down in th4e database yields no tables or anything. It jsut says no
items present.
I am new to SQL server and have never seen this before. The server has been
rebooted - it did not help. All services are running just fine. I checked
the event viewer and do not see anything wrong there. Is there a specific
SQL server log somewhere ?
Help!! What do I do to get these databases back up? All my users are
chompoing at the bit!!!
Thanks, Brad
Definately read Tibor's link and pay attention to the part about backing up
the log with no_truncate to get everything you can get restored.
DatabaseAdmins.com
Remote DBA services
"Tibor Karaszi" wrote:

> There's a possibility that it is restore time, so you might as well initiate the process to find
> your backups.
> SQL Servers error log file is in the folder for your instance\log. for instance, on my machine, with
> a named 2000 instance:
> C:\Program Files\Microsoft SQL Server\MSSQL$SS2000I1\LOG
> Here are my general recommendations for suspect and corrupt databases:
> http://www.karaszi.com/SQLServer/info_corrupt_suspect_db.asp
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Brad Pears" <bradp@.truenorthloghomes.com> wrote in message
> news:OTXUGaOXHHA.388@.TK2MSFTNGP04.phx.gbl...
>

Help! Databases marked as suspect..

Last night we had a major storm hit us and the power went out. The SQL 2000
server has a UPS on it so should have went down gracefully - but who knows.
Anyway, this morning no one was able to get into the data. When I checked
the server, I noticed that all of our databases (except the test databases
installed by default when you install SQL Server) were marked as 'suspect'.
Drilling down in th4e database yields no tables or anything. It jsut says no
items present.
I am new to SQL server and have never seen this before. The server has been
rebooted - it did not help. All services are running just fine. I checked
the event viewer and do not see anything wrong there. Is there a specific
SQL server log somewhere '
Help!! What do I do to get these databases back up' All my users are
chompoing at the bit!!!
Thanks, BradThere's a possibility that it is restore time, so you might as well initiate
the process to find
your backups.
SQL Servers error log file is in the folder for your instance\log. for insta
nce, on my machine, with
a named 2000 instance:
C:\Program Files\Microsoft SQL Server\MSSQL$SS2000I1\LOG
Here are my general recommendations for suspect and corrupt databases:
http://www.karaszi.com/SQLServer/in..._suspect_db.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Brad Pears" <bradp@.truenorthloghomes.com> wrote in message
news:OTXUGaOXHHA.388@.TK2MSFTNGP04.phx.gbl...
> Last night we had a major storm hit us and the power went out. The SQL 200
0 server has a UPS on it
> so should have went down gracefully - but who knows. Anyway, this morning
no one was able to get
> into the data. When I checked the server, I noticed that all of our databa
ses (except the test
> databases installed by default when you install SQL Server) were marked as
'suspect'. Drilling
> down in th4e database yields no tables or anything. It jsut says no items
present.
> I am new to SQL server and have never seen this before. The server has bee
n rebooted - it did not
> help. All services are running just fine. I checked the event viewer and d
o not see anything wrong
> there. Is there a specific SQL server log somewhere '
> Help!! What do I do to get these databases back up' All my users are cho
mpoing at the bit!!!
> Thanks, Brad
>|||Definately read Tibor's link and pay attention to the part about backing up
the log with no_truncate to get everything you can get restored.
DatabaseAdmins.com
Remote DBA services
"Tibor Karaszi" wrote:

> There's a possibility that it is restore time, so you might as well initia
te the process to find
> your backups.
> SQL Servers error log file is in the folder for your instance\log. for ins
tance, on my machine, with
> a named 2000 instance:
> C:\Program Files\Microsoft SQL Server\MSSQL$SS2000I1\LOG
> Here are my general recommendations for suspect and corrupt databases:
> http://www.karaszi.com/SQLServer/in..._suspect_db.asp
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Brad Pears" <bradp@.truenorthloghomes.com> wrote in message
> news:OTXUGaOXHHA.388@.TK2MSFTNGP04.phx.gbl...
>

Friday, February 24, 2012

Help with XQuery

I am trying to query an XML Datatype column in SQL Server, but getting no data back, and I suspect the XQuery but don't know what I am doing wrong:

SELECT

nref.value('AdvTxnID[1]', 'integer') AdvTxnID,

nref.value('SvcSysCode[1]', 'varchar(2)') SvcSysCode

FROM

myData CROSS APPLY [xmldata].nodes('/AdvanceTxnDoc/AdvanceTxn') AS R(nref)

<AdvanceTxnDoc xmlns="http://GMAC.RFC.COM/RCG/XML/Schema/ALM.AdvanceTxnDoc">

<AdvanceTxn>

<AdvTxnID>4125281</AdvTxnID>

<SvcSysCode>MS</SvcSysCode>

<LoanID>8484664</LoanID>

<AdvTypeCode>P&amp;I</AdvTypeCode>

<AdvEffDate>2005-08-25T00:00:00</AdvEffDate>

<AdvTxnAmt>.04</AdvTxnAmt>

<TxnCrtDate>2005-08-19T00:00:00</TxnCrtDate>

</AdvanceTxn>

<TxnCount>1</TxnCount>

</AdvanceTxnDoc>

What am I doing wrong?

Need to declare namespace in your xquery. Two way to do it as following example:

declare @.x xml
set @.x =
N'<AdvanceTxnDoc xmlns="http://GMAC.RFC.COM/RCG/XML/Schema/ALM.AdvanceTxnDoc">
<AdvanceTxn>
<AdvTxnID>4125281</AdvTxnID>
<SvcSysCode>MS</SvcSysCode>
<LoanID>8484664</LoanID>
<AdvTypeCode>P&amp;I</AdvTypeCode>
<AdvEffDate>2005-08-25T00:00:00</AdvEffDate>
<AdvTxnAmt>.04</AdvTxnAmt>
<TxnCrtDate>2005-08-19T00:00:00</TxnCrtDate>
</AdvanceTxn>
<TxnCount>1</TxnCount>
</AdvanceTxnDoc>'

with xmlnamespaces(default 'http://GMAC.RFC.COM/RCG/XML/Schema/ALM.AdvanceTxnDoc')
SELECT
nref.value('AdvTxnID[1]', 'integer') AdvTxnID,
nref.value('SvcSysCode[1]', 'varchar(2)') SvcSysCode
FROM
@.x.nodes('/AdvanceTxnDoc/AdvanceTxn') AS R(nref)

SELECT
nref.value('declare default element namespace "http://GMAC.RFC.COM/RCG/XML/Schema/ALM.AdvanceTxnDoc"; AdvTxnID[1]', 'integer') AdvTxnID,
nref.value('declare default element namespace "http://GMAC.RFC.COM/RCG/XML/Schema/ALM.AdvanceTxnDoc"; SvcSysCode[1]', 'varchar(2)') SvcSysCode
FROM
@.x.nodes('declare default element namespace "http://GMAC.RFC.COM/RCG/XML/Schema/ALM.AdvanceTxnDoc";/AdvanceTxnDoc/AdvanceTxn') AS R(nref)

|||

Worked great. Thanks!

-Kory