I have several databases in a loading state, I have tried using the detach
option (via EM) but I get the following error: Microsoft SQL-DMO (ODBC
SQLState: 42000)
Error 15010: The database 'name' does not exist. Use sp_helpdb to show
available databases.
When using the sp_helpdb command, of course it only shows the databases that
are not in the loading state.
I need to get the databases that in loading state, detached or removed
completely. My nightly backups are failing since they can not attach to the
databases (loading)
All assistance in this matter is greatly appreciated and thanks in advance
Forgot to advise. Using SQL 2000 with SP 3 on Win2K server
"scuba79" wrote:
> I have several databases in a loading state, I have tried using the detach
> option (via EM) but I get the following error: Microsoft SQL-DMO (ODBC
> SQLState: 42000)
> Error 15010: The database 'name' does not exist. Use sp_helpdb to show
> available databases.
> When using the sp_helpdb command, of course it only shows the databases that
> are not in the loading state.
> I need to get the databases that in loading state, detached or removed
> completely. My nightly backups are failing since they can not attach to the
> databases (loading)
> All assistance in this matter is greatly appreciated and thanks in advance
|||Never mind... I found the solution... Forgot that I needed to use the
RECOVERY DATABASE WITH RECOVERY command
"scuba79" wrote:
> I have several databases in a loading state, I have tried using the detach
> option (via EM) but I get the following error: Microsoft SQL-DMO (ODBC
> SQLState: 42000)
> Error 15010: The database 'name' does not exist. Use sp_helpdb to show
> available databases.
> When using the sp_helpdb command, of course it only shows the databases that
> are not in the loading state.
> I need to get the databases that in loading state, detached or removed
> completely. My nightly backups are failing since they can not attach to the
> databases (loading)
> All assistance in this matter is greatly appreciated and thanks in advance
sql
Showing posts with label state. Show all posts
Showing posts with label state. Show all posts
Thursday, March 29, 2012
Database in loading state
I have several databases in a loading state, I have tried using the detach
option (via EM) but I get the following error: Microsoft SQL-DMO (ODBC
SQLState: 42000)
Error 15010: The database 'name' does not exist. Use sp_helpdb to show
available databases.
When using the sp_helpdb command, of course it only shows the databases that
are not in the loading state.
I need to get the databases that in loading state, detached or removed
completely. My nightly backups are failing since they can not attach to the
databases (loading)
All assistance in this matter is greatly appreciated and thanks in advanceForgot to advise. Using SQL 2000 with SP 3 on Win2K server
"scuba79" wrote:
> I have several databases in a loading state, I have tried using the detach
> option (via EM) but I get the following error: Microsoft SQL-DMO (ODBC
> SQLState: 42000)
> Error 15010: The database 'name' does not exist. Use sp_helpdb to show
> available databases.
> When using the sp_helpdb command, of course it only shows the databases that
> are not in the loading state.
> I need to get the databases that in loading state, detached or removed
> completely. My nightly backups are failing since they can not attach to the
> databases (loading)
> All assistance in this matter is greatly appreciated and thanks in advance|||Never mind... I found the solution... Forgot that I needed to use the
RECOVERY DATABASE WITH RECOVERY command
"scuba79" wrote:
> I have several databases in a loading state, I have tried using the detach
> option (via EM) but I get the following error: Microsoft SQL-DMO (ODBC
> SQLState: 42000)
> Error 15010: The database 'name' does not exist. Use sp_helpdb to show
> available databases.
> When using the sp_helpdb command, of course it only shows the databases that
> are not in the loading state.
> I need to get the databases that in loading state, detached or removed
> completely. My nightly backups are failing since they can not attach to the
> databases (loading)
> All assistance in this matter is greatly appreciated and thanks in advance
option (via EM) but I get the following error: Microsoft SQL-DMO (ODBC
SQLState: 42000)
Error 15010: The database 'name' does not exist. Use sp_helpdb to show
available databases.
When using the sp_helpdb command, of course it only shows the databases that
are not in the loading state.
I need to get the databases that in loading state, detached or removed
completely. My nightly backups are failing since they can not attach to the
databases (loading)
All assistance in this matter is greatly appreciated and thanks in advanceForgot to advise. Using SQL 2000 with SP 3 on Win2K server
"scuba79" wrote:
> I have several databases in a loading state, I have tried using the detach
> option (via EM) but I get the following error: Microsoft SQL-DMO (ODBC
> SQLState: 42000)
> Error 15010: The database 'name' does not exist. Use sp_helpdb to show
> available databases.
> When using the sp_helpdb command, of course it only shows the databases that
> are not in the loading state.
> I need to get the databases that in loading state, detached or removed
> completely. My nightly backups are failing since they can not attach to the
> databases (loading)
> All assistance in this matter is greatly appreciated and thanks in advance|||Never mind... I found the solution... Forgot that I needed to use the
RECOVERY DATABASE WITH RECOVERY command
"scuba79" wrote:
> I have several databases in a loading state, I have tried using the detach
> option (via EM) but I get the following error: Microsoft SQL-DMO (ODBC
> SQLState: 42000)
> Error 15010: The database 'name' does not exist. Use sp_helpdb to show
> available databases.
> When using the sp_helpdb command, of course it only shows the databases that
> are not in the loading state.
> I need to get the databases that in loading state, detached or removed
> completely. My nightly backups are failing since they can not attach to the
> databases (loading)
> All assistance in this matter is greatly appreciated and thanks in advance
Database in loading state
I have several databases in a loading state, I have tried using the detach
option (via EM) but I get the following error: Microsoft SQL-DMO (ODBC
SQLState: 42000)
Error 15010: The database 'name' does not exist. Use sp_helpdb to show
available databases.
When using the sp_helpdb command, of course it only shows the databases that
are not in the loading state.
I need to get the databases that in loading state, detached or removed
completely. My nightly backups are failing since they can not attach to the
databases (loading)
All assistance in this matter is greatly appreciated and thanks in advanceForgot to advise. Using SQL 2000 with SP 3 on Win2K server
"scuba79" wrote:
> I have several databases in a loading state, I have tried using the detach
> option (via EM) but I get the following error: Microsoft SQL-DMO (ODBC
> SQLState: 42000)
> Error 15010: The database 'name' does not exist. Use sp_helpdb to show
> available databases.
> When using the sp_helpdb command, of course it only shows the databases th
at
> are not in the loading state.
> I need to get the databases that in loading state, detached or removed
> completely. My nightly backups are failing since they can not attach to t
he
> databases (loading)
> All assistance in this matter is greatly appreciated and thanks in advance|||Never mind... I found the solution... Forgot that I needed to use the
RECOVERY DATABASE WITH RECOVERY command
"scuba79" wrote:
> I have several databases in a loading state, I have tried using the detach
> option (via EM) but I get the following error: Microsoft SQL-DMO (ODBC
> SQLState: 42000)
> Error 15010: The database 'name' does not exist. Use sp_helpdb to show
> available databases.
> When using the sp_helpdb command, of course it only shows the databases th
at
> are not in the loading state.
> I need to get the databases that in loading state, detached or removed
> completely. My nightly backups are failing since they can not attach to t
he
> databases (loading)
> All assistance in this matter is greatly appreciated and thanks in advance
option (via EM) but I get the following error: Microsoft SQL-DMO (ODBC
SQLState: 42000)
Error 15010: The database 'name' does not exist. Use sp_helpdb to show
available databases.
When using the sp_helpdb command, of course it only shows the databases that
are not in the loading state.
I need to get the databases that in loading state, detached or removed
completely. My nightly backups are failing since they can not attach to the
databases (loading)
All assistance in this matter is greatly appreciated and thanks in advanceForgot to advise. Using SQL 2000 with SP 3 on Win2K server
"scuba79" wrote:
> I have several databases in a loading state, I have tried using the detach
> option (via EM) but I get the following error: Microsoft SQL-DMO (ODBC
> SQLState: 42000)
> Error 15010: The database 'name' does not exist. Use sp_helpdb to show
> available databases.
> When using the sp_helpdb command, of course it only shows the databases th
at
> are not in the loading state.
> I need to get the databases that in loading state, detached or removed
> completely. My nightly backups are failing since they can not attach to t
he
> databases (loading)
> All assistance in this matter is greatly appreciated and thanks in advance|||Never mind... I found the solution... Forgot that I needed to use the
RECOVERY DATABASE WITH RECOVERY command
"scuba79" wrote:
> I have several databases in a loading state, I have tried using the detach
> option (via EM) but I get the following error: Microsoft SQL-DMO (ODBC
> SQLState: 42000)
> Error 15010: The database 'name' does not exist. Use sp_helpdb to show
> available databases.
> When using the sp_helpdb command, of course it only shows the databases th
at
> are not in the loading state.
> I need to get the databases that in loading state, detached or removed
> completely. My nightly backups are failing since they can not attach to t
he
> databases (loading)
> All assistance in this matter is greatly appreciated and thanks in advance
Sunday, March 25, 2012
Database goes into Supect or Loading state after Restore
This is the scenario:
I am do log shipping from one server to another. I have 9 databases
that I am shipping. 8 of them work flawlessly. I have one that for
some reason either always goes into a Suspect state or into a Loading
state. It just stays there until I do a manual restore. I have
created all of the store procedures exactly the same. The weird thing
is that I can do a manual restore of the exact same file that the
store procedure is trying to restore and it does it perfectly. The
only difference between this database and the others is the size. It
is a little over 6 gig versus 3 gig or less on the others.
I am stumped and not quite sure what to do. It is almost like the
stored procedure is either timing out or the job is advancing to the
next step before the restore is complete. Oh, one other thing, the
job is showing a status of completed successfully. The following is
the stored procedure I am using to restore the database:
CREATE PROCEDURE Restore_Database_W3Data_Backups AS
RESTORE DATABASE W3Data
FROM DISK = 'e:\sqlbackups\W3Data\W3Data.bak'
WITH
REPLACE,
STANDBY = 'e:\sqlbackups\W3Data\undo_W3Data.ldf',
MOVE 'w3data_dat' TO 'E:\SQL Data\MSSQL\Data\w3data_data.mdf',
MOVE 'w3data_log' TO 'E:\SQL Data\MSSQL\Data\w3data_log.ldf'
WAITFOR DELAY '00:00:05'
EXEC sp_dboption 'W3Data', 'single user', true
GO
Does Anyone have any ideas?
TIA!
Neil Mowatt
Network Administrator
The Nottingham Company
Hi
The restore fails if you run out of disk space on the Undo drive. How much
free space do you have on E:?
Regards
"Neil Mowatt" wrote:
> This is the scenario:
> I am do log shipping from one server to another. I have 9 databases
> that I am shipping. 8 of them work flawlessly. I have one that for
> some reason either always goes into a Suspect state or into a Loading
> state. It just stays there until I do a manual restore. I have
> created all of the store procedures exactly the same. The weird thing
> is that I can do a manual restore of the exact same file that the
> store procedure is trying to restore and it does it perfectly. The
> only difference between this database and the others is the size. It
> is a little over 6 gig versus 3 gig or less on the others.
> I am stumped and not quite sure what to do. It is almost like the
> stored procedure is either timing out or the job is advancing to the
> next step before the restore is complete. Oh, one other thing, the
> job is showing a status of completed successfully. The following is
> the stored procedure I am using to restore the database:
> CREATE PROCEDURE Restore_Database_W3Data_Backups AS
> RESTORE DATABASE W3Data
> FROM DISK = 'e:\sqlbackups\W3Data\W3Data.bak'
> WITH
> REPLACE,
> STANDBY = 'e:\sqlbackups\W3Data\undo_W3Data.ldf',
> MOVE 'w3data_dat' TO 'E:\SQL Data\MSSQL\Data\w3data_data.mdf',
> MOVE 'w3data_log' TO 'E:\SQL Data\MSSQL\Data\w3data_log.ldf'
> WAITFOR DELAY '00:00:05'
> EXEC sp_dboption 'W3Data', 'single user', true
> GO
>
> Does Anyone have any ideas?
> TIA!
> Neil Mowatt
> Network Administrator
> The Nottingham Company
>
|||I have over 140 Gig free. I don't think that is the problem. Thank
You though. Any other suggestions or ideas?
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message news:<41C9445C-7C5E-4A5A-94BB-A698ED1BE18E@.microsoft.com>...[vbcol=seagreen]
> Hi
> The restore fails if you run out of disk space on the Undo drive. How much
> free space do you have on E:?
> Regards
> "Neil Mowatt" wrote:
|||neil@.ncfunds.com (Neil Mowatt) wrote in message news:<fbbc61a6.0409240644.a6ad096@.posting.google.c om>...[vbcol=seagreen]
> I have over 140 Gig free. I don't think that is the problem. Thank
> You though. Any other suggestions or ideas?
> "Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message news:<41C9445C-7C5E-4A5A-94BB-A698ED1BE18E@.microsoft.com>...
Any other suggestions or ideas?
I am do log shipping from one server to another. I have 9 databases
that I am shipping. 8 of them work flawlessly. I have one that for
some reason either always goes into a Suspect state or into a Loading
state. It just stays there until I do a manual restore. I have
created all of the store procedures exactly the same. The weird thing
is that I can do a manual restore of the exact same file that the
store procedure is trying to restore and it does it perfectly. The
only difference between this database and the others is the size. It
is a little over 6 gig versus 3 gig or less on the others.
I am stumped and not quite sure what to do. It is almost like the
stored procedure is either timing out or the job is advancing to the
next step before the restore is complete. Oh, one other thing, the
job is showing a status of completed successfully. The following is
the stored procedure I am using to restore the database:
CREATE PROCEDURE Restore_Database_W3Data_Backups AS
RESTORE DATABASE W3Data
FROM DISK = 'e:\sqlbackups\W3Data\W3Data.bak'
WITH
REPLACE,
STANDBY = 'e:\sqlbackups\W3Data\undo_W3Data.ldf',
MOVE 'w3data_dat' TO 'E:\SQL Data\MSSQL\Data\w3data_data.mdf',
MOVE 'w3data_log' TO 'E:\SQL Data\MSSQL\Data\w3data_log.ldf'
WAITFOR DELAY '00:00:05'
EXEC sp_dboption 'W3Data', 'single user', true
GO
Does Anyone have any ideas?
TIA!
Neil Mowatt
Network Administrator
The Nottingham Company
Hi
The restore fails if you run out of disk space on the Undo drive. How much
free space do you have on E:?
Regards
"Neil Mowatt" wrote:
> This is the scenario:
> I am do log shipping from one server to another. I have 9 databases
> that I am shipping. 8 of them work flawlessly. I have one that for
> some reason either always goes into a Suspect state or into a Loading
> state. It just stays there until I do a manual restore. I have
> created all of the store procedures exactly the same. The weird thing
> is that I can do a manual restore of the exact same file that the
> store procedure is trying to restore and it does it perfectly. The
> only difference between this database and the others is the size. It
> is a little over 6 gig versus 3 gig or less on the others.
> I am stumped and not quite sure what to do. It is almost like the
> stored procedure is either timing out or the job is advancing to the
> next step before the restore is complete. Oh, one other thing, the
> job is showing a status of completed successfully. The following is
> the stored procedure I am using to restore the database:
> CREATE PROCEDURE Restore_Database_W3Data_Backups AS
> RESTORE DATABASE W3Data
> FROM DISK = 'e:\sqlbackups\W3Data\W3Data.bak'
> WITH
> REPLACE,
> STANDBY = 'e:\sqlbackups\W3Data\undo_W3Data.ldf',
> MOVE 'w3data_dat' TO 'E:\SQL Data\MSSQL\Data\w3data_data.mdf',
> MOVE 'w3data_log' TO 'E:\SQL Data\MSSQL\Data\w3data_log.ldf'
> WAITFOR DELAY '00:00:05'
> EXEC sp_dboption 'W3Data', 'single user', true
> GO
>
> Does Anyone have any ideas?
> TIA!
> Neil Mowatt
> Network Administrator
> The Nottingham Company
>
|||I have over 140 Gig free. I don't think that is the problem. Thank
You though. Any other suggestions or ideas?
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message news:<41C9445C-7C5E-4A5A-94BB-A698ED1BE18E@.microsoft.com>...[vbcol=seagreen]
> Hi
> The restore fails if you run out of disk space on the Undo drive. How much
> free space do you have on E:?
> Regards
> "Neil Mowatt" wrote:
|||neil@.ncfunds.com (Neil Mowatt) wrote in message news:<fbbc61a6.0409240644.a6ad096@.posting.google.c om>...[vbcol=seagreen]
> I have over 140 Gig free. I don't think that is the problem. Thank
> You though. Any other suggestions or ideas?
> "Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message news:<41C9445C-7C5E-4A5A-94BB-A698ED1BE18E@.microsoft.com>...
Any other suggestions or ideas?
Saturday, February 25, 2012
Database design question
I am trying to find more elegant design solution for the following
scenario:
TABLE: RULE
--
RULE_ID STATE PRODUCT MARKET
--
R1 ALL ALL ALL
R2 NY DOL NULL
R2 CA NULL NULL
In front-end application we need to know what rule to use based on what
state, product and market we are using at the moment.
Selection Criteria for the rules might expand (ex. in the future we
might add EMPLOYEE column to the RULE table)
In this set-up if I need to know what rule to use for the state OF CA
than my query would be as following:
SELECT RULE_ID
WHERE STATE='CA' and PRODUCT is NULL and MARKET is null
That would return me the R3.
For all others default with ALL values would be used.
"ALL" is not a valid state so there is some hardcoding required to
return this default record.
Is it better to repeat all states and all products and all markets in
the RULE table?
Is there way to avoid changing table structure every time I add new
criteria for selecting the rules?
I hope I was clear enough...
Thanks in advance.Hi
It is not clear why you are checking PRODUCT and MARKET if you want a rule
applicable to 'CA' And why you ignore R1 for CA?
Rule Type Values
R1 State All
R1 Product All
R1 Market All
R2 State CA
R2 State NY
R2 Product DOL
You could also make Type a lookup table and use the key value in your table.
Your queries will be simplified if you do not have the 'All' option. To keep
your existing code and use the new table you could create a view
John
"unklevo" wrote:
> I am trying to find more elegant design solution for the following
> scenario:
>
> TABLE: RULE
> --
> RULE_ID STATE PRODUCT MARKET
> --
> R1 ALL ALL ALL
> R2 NY DOL NULL
> R2 CA NULL NULL
>
> In front-end application we need to know what rule to use based on what
> state, product and market we are using at the moment.
> Selection Criteria for the rules might expand (ex. in the future we
> might add EMPLOYEE column to the RULE table)
> In this set-up if I need to know what rule to use for the state OF CA
> than my query would be as following:
> SELECT RULE_ID
> WHERE STATE='CA' and PRODUCT is NULL and MARKET is null
> That would return me the R3.
> For all others default with ALL values would be used.
>
> "ALL" is not a valid state so there is some hardcoding required to
> return this default record.
> Is it better to repeat all states and all products and all markets in
> the RULE table?
> Is there way to avoid changing table structure every time I add new
> criteria for selecting the rules?
> I hope I was clear enough...
> Thanks in advance.
>|||Thank you for your response John.
I made a mistake in my table data.
It should look like this.
TABLE: RULE
--
RULE_ID STATE PRODUCT MARKET
--
R1 ALL ALL ALL
R2 NY DOL NULL
R3 CA NULL NULL
The reason I am checking for MARKET and PRODUCT for 'CA' is that if I
fill in the product for R3 record
R3 CA DOL NULL
than using just a state='CA' is not sufficient.
All 'CA' accounts that have product other than 'DOL' will use rule R1
but accounts with state='CA' and PRODUCT='DOL' will use R3.
In set-up that you are offering can you give me an example of your
query where you want to find rule for state='NY' and product='DOL'and
market='A'
Thanks,
Igor.|||Hi
One Way:
SELECT DISTINCT R.Rule
FROM MyRules R
WHERE EXISTS ( SELECT * FROM MyRules S WHERE S.Type = 'State' AND
S.Value = 'CA' AND R.Rule = S.Rule )
AND EXISTS ( SELECT * FROM MyRules P WHERE P.Type = 'Product' AND
P.Value = 'DOL' AND R.Rule = P.Rule )
AND EXISTS ( SELECT * FROM MyRules M WHERE M.Type = 'Market' AND
M.Value = 'A' AND R.Rule = P.Rule )
Or
CREATE VIEW MyRulesView AS
SELECT R.Rule, S.Value AS State, P.Value AS Product, M.Value AS Market
FROM MyRules R
FULL OUTER JOIN MyRules S ON R.Rule = S.Rule AND S.Type = 'State'
FULL OUTER JOIN MyRules P ON R.Rule = P.Rule AND P.Type = 'Product'
FULL OUTER JOIN MyRules M ON R.Rule = M.Rule AND P.Type = 'Market'
SELECT Rule, State, Product, Market
FROM MyRulesView
WHERE State = 'CA'
AND Product = 'DOL'
AND Market = 'A'
John|||Can you explain in terms of a logical data model why you think that
state, product and market are values and not attributes that take on
values. See the problem? This is an EAV design, which is always a
disaster.
scenario:
TABLE: RULE
--
RULE_ID STATE PRODUCT MARKET
--
R1 ALL ALL ALL
R2 NY DOL NULL
R2 CA NULL NULL
In front-end application we need to know what rule to use based on what
state, product and market we are using at the moment.
Selection Criteria for the rules might expand (ex. in the future we
might add EMPLOYEE column to the RULE table)
In this set-up if I need to know what rule to use for the state OF CA
than my query would be as following:
SELECT RULE_ID
WHERE STATE='CA' and PRODUCT is NULL and MARKET is null
That would return me the R3.
For all others default with ALL values would be used.
"ALL" is not a valid state so there is some hardcoding required to
return this default record.
Is it better to repeat all states and all products and all markets in
the RULE table?
Is there way to avoid changing table structure every time I add new
criteria for selecting the rules?
I hope I was clear enough...
Thanks in advance.Hi
It is not clear why you are checking PRODUCT and MARKET if you want a rule
applicable to 'CA' And why you ignore R1 for CA?
Rule Type Values
R1 State All
R1 Product All
R1 Market All
R2 State CA
R2 State NY
R2 Product DOL
You could also make Type a lookup table and use the key value in your table.
Your queries will be simplified if you do not have the 'All' option. To keep
your existing code and use the new table you could create a view
John
"unklevo" wrote:
> I am trying to find more elegant design solution for the following
> scenario:
>
> TABLE: RULE
> --
> RULE_ID STATE PRODUCT MARKET
> --
> R1 ALL ALL ALL
> R2 NY DOL NULL
> R2 CA NULL NULL
>
> In front-end application we need to know what rule to use based on what
> state, product and market we are using at the moment.
> Selection Criteria for the rules might expand (ex. in the future we
> might add EMPLOYEE column to the RULE table)
> In this set-up if I need to know what rule to use for the state OF CA
> than my query would be as following:
> SELECT RULE_ID
> WHERE STATE='CA' and PRODUCT is NULL and MARKET is null
> That would return me the R3.
> For all others default with ALL values would be used.
>
> "ALL" is not a valid state so there is some hardcoding required to
> return this default record.
> Is it better to repeat all states and all products and all markets in
> the RULE table?
> Is there way to avoid changing table structure every time I add new
> criteria for selecting the rules?
> I hope I was clear enough...
> Thanks in advance.
>|||Thank you for your response John.
I made a mistake in my table data.
It should look like this.
TABLE: RULE
--
RULE_ID STATE PRODUCT MARKET
--
R1 ALL ALL ALL
R2 NY DOL NULL
R3 CA NULL NULL
The reason I am checking for MARKET and PRODUCT for 'CA' is that if I
fill in the product for R3 record
R3 CA DOL NULL
than using just a state='CA' is not sufficient.
All 'CA' accounts that have product other than 'DOL' will use rule R1
but accounts with state='CA' and PRODUCT='DOL' will use R3.
In set-up that you are offering can you give me an example of your
query where you want to find rule for state='NY' and product='DOL'and
market='A'
Thanks,
Igor.|||Hi
One Way:
SELECT DISTINCT R.Rule
FROM MyRules R
WHERE EXISTS ( SELECT * FROM MyRules S WHERE S.Type = 'State' AND
S.Value = 'CA' AND R.Rule = S.Rule )
AND EXISTS ( SELECT * FROM MyRules P WHERE P.Type = 'Product' AND
P.Value = 'DOL' AND R.Rule = P.Rule )
AND EXISTS ( SELECT * FROM MyRules M WHERE M.Type = 'Market' AND
M.Value = 'A' AND R.Rule = P.Rule )
Or
CREATE VIEW MyRulesView AS
SELECT R.Rule, S.Value AS State, P.Value AS Product, M.Value AS Market
FROM MyRules R
FULL OUTER JOIN MyRules S ON R.Rule = S.Rule AND S.Type = 'State'
FULL OUTER JOIN MyRules P ON R.Rule = P.Rule AND P.Type = 'Product'
FULL OUTER JOIN MyRules M ON R.Rule = M.Rule AND P.Type = 'Market'
SELECT Rule, State, Product, Market
FROM MyRulesView
WHERE State = 'CA'
AND Product = 'DOL'
AND Market = 'A'
John|||Can you explain in terms of a logical data model why you think that
state, product and market are values and not attributes that take on
values. See the problem? This is an EAV design, which is always a
disaster.
Database design question
I am trying to find more elegant design solution for the following
scenario:
TABLE: RULE
--
RULE_ID STATE PRODUCT MARKET
--
R1 ALL ALL ALL
R2 NY DOL NULL
R2 CA NULL NULL
In front-end application we need to know what rule to use based on what
state, product and market we are using at the moment.
Selection Criteria for the rules might expand (ex. in the future we
might add EMPLOYEE column to the RULE table)
In this set-up if I need to know what rule to use for the state OF CA
than my query would be as following:
SELECT RULE_ID
WHERE STATE='CA' and PRODUCT is NULL and MARKET is null
That would return me the R3.
For all others default with ALL values would be used.
"ALL" is not a valid state so there is some hardcoding required to
return this default record.
Is it better to repeat all states and all products and all markets in
the RULE table?
Is there way to avoid changing table structure every time I add new
criteria for selecting the rules?
I hope I was clear enough...
Thanks in advance.This is a SQL version of a decision table with NULL as the "don't care
token". I would replace 'ALL' with NULL and write the query as:
SELECT rule_id
FROM Rules
WHERE state = COALESCE (@.mystate, state)
AND product_code = COALESCE (@.myproduct, product_code)
AND market = COALESCE(@.mymarket, market);
If more than one rule applies, you will get all of them back. You will
always have R1 in the set. If you must pick one and only one rule,
with R1 as the default, then use:
SELECT MAX (rule_id)
FROM Rules
WHERE state = COALESCE (@.mystate, state)
AND product_code = COALESCE (@.myproduct, product_code)
AND market = COALESCE(@.mymarket, market)
HAVING COUNT(*) = 2;
This means that you have one rule and R1.|||Celko,
Thank you for offering this solution.
I think that this is more elegant than the one I and John were
offering.
I will try to implement it.
Thanks again,
Igor.
scenario:
TABLE: RULE
--
RULE_ID STATE PRODUCT MARKET
--
R1 ALL ALL ALL
R2 NY DOL NULL
R2 CA NULL NULL
In front-end application we need to know what rule to use based on what
state, product and market we are using at the moment.
Selection Criteria for the rules might expand (ex. in the future we
might add EMPLOYEE column to the RULE table)
In this set-up if I need to know what rule to use for the state OF CA
than my query would be as following:
SELECT RULE_ID
WHERE STATE='CA' and PRODUCT is NULL and MARKET is null
That would return me the R3.
For all others default with ALL values would be used.
"ALL" is not a valid state so there is some hardcoding required to
return this default record.
Is it better to repeat all states and all products and all markets in
the RULE table?
Is there way to avoid changing table structure every time I add new
criteria for selecting the rules?
I hope I was clear enough...
Thanks in advance.This is a SQL version of a decision table with NULL as the "don't care
token". I would replace 'ALL' with NULL and write the query as:
SELECT rule_id
FROM Rules
WHERE state = COALESCE (@.mystate, state)
AND product_code = COALESCE (@.myproduct, product_code)
AND market = COALESCE(@.mymarket, market);
If more than one rule applies, you will get all of them back. You will
always have R1 in the set. If you must pick one and only one rule,
with R1 as the default, then use:
SELECT MAX (rule_id)
FROM Rules
WHERE state = COALESCE (@.mystate, state)
AND product_code = COALESCE (@.myproduct, product_code)
AND market = COALESCE(@.mymarket, market)
HAVING COUNT(*) = 2;
This means that you have one rule and R1.|||Celko,
Thank you for offering this solution.
I think that this is more elegant than the one I and John were
offering.
I will try to implement it.
Thanks again,
Igor.
Friday, February 24, 2012
Database Design Problem
I have to keep detail of detail gender based DB like this where there may be
a number of incidents per state
Create table gender
(
State_id
Male_killed
Male_injured
male_affected
Female_killed
female_affected
female_injured
Child_killed
Child_injured
child_affected
Date
Incident_type
remarks
)
All these are numbers and can be 2 male_killed and 2 female injured in the
same incident
so what is the best way to desing a DB for this type I cannot think anything
other than putting these all into one table.Depending on your needs you might come up with something like this...
Create table gender (gender_cd char(1) not null, gender_name varchar(8) not
null) --m, male f, female
Create table persontype( person_cd char(1) not null, person_name varchar(8)
not null) -A, Adult C,Child
Create table incidenttype(incident_id int identity(1,1) not null,
incident_name varchar(24) not null) --whatever
Create table resulttype(result_cd char(1) not null, resultname varchar(12)
not null) -- K, Killed I, Injured A, Affected
Create table states(state_cd char(2) not null, statename varchar(24) not
null) --NC, North Carolina
Create table things(id int identity(1,1) not null,
state_cd char(2) not null references
states(state_cd),
incident_id int not null references
incidenttype(incident_id),
thing_dt datetime not null,
remarks varchar(2000) null)
Create table thingdetail (id int identity(1,1) not null,
thing int not null references things(id),
gender_cd char(1) not null references
gender(gender_cd),
person_cd char(1) not null references
persontype(person_cd),
result_cd char(1) not null references
resulttype(result_cd),
NumberOfPeople int not null)
Although I did this quick and dirty, I think it is in third normal form...
You may not need this much normalization, but this is a beginning..
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Anup" <anup_pokhrel@.hotmail.com> wrote in message
news:e$dztHBWEHA.2408@.tk2msftngp13.phx.gbl...
> I have to keep detail of detail gender based DB like this where there may
be
> a number of incidents per state
> Create table gender
> (
> State_id
> Male_killed
> Male_injured
> male_affected
> Female_killed
> female_affected
> female_injured
> Child_killed
> Child_injured
> child_affected
> Date
> Incident_type
> remarks
> )
> All these are numbers and can be 2 male_killed and 2 female injured in the
> same incident
> so what is the best way to desing a DB for this type I cannot think
anything
> other than putting these all into one table.
>|||Based on your narrative and sample schema, one has to guess your conceptual
model, the attributes and the functional dependencies that exist among them
before suggesting something meaningful. In general, requesting solutions for
design problems in newsgroup may not be a worthwhile effort since there is a
fair chance that the problem could be misunderstood, miscommunicated or
misread and so are the suggested solutions.
With such a caveat, here is a try:
CREATE TABLE Incidents(
Incident_id INT NOT NULL PRIMARY KEY,
State CHAR(2) NOT NULL
REFERENCES States( State ),
Incident_date DATETIME NOT NULL,
Inident_type INT NOT NULL CHECK (...) -- or reference it
Remarks VARCHAR(8000) NOT NULL
DEFAULT '--NA--'
UNIQUE ( State, Incident_date, Inident_type) );
CREATE TABLE Details (
Incident_id INT NOT NULL
REFERENCES Incidents ( Incident_id )
Outcome VARCHAR(10) NOT NULL
CHECK ( Outcome IN ( 'Injured', 'Affected', 'Killed',
'Unknown' ) ) -- or reference it
Person_type VARCHAR(6) NOT NULL
CHECK Person_type IN ( 'Man', 'Women', 'Child', 'Unknown' ) )
-- or reference it
Incident_count INT NOT NULL DEFAULT(0)
PRIMARY KEY ( Incident_id, Outcome, Person_type ) ) ;
The check constraint values, if are of a higher number, can be substituted
with a referenced table with corresponding foriegn key constraint.
--
Anith|||thnaks
but the only problem is that I have a file with 1000 records that comes in
and I am importing through excel so any suggestions asto how to handle it if
I am to adopt the above design considerations
Anup Help is awaited
thanks
anup
"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:uRQ16uFWEHA.2928@.tk2msftngp13.phx.gbl...
> Based on your narrative and sample schema, one has to guess your
conceptual
> model, the attributes and the functional dependencies that exist among
them
> before suggesting something meaningful. In general, requesting solutions
for
> design problems in newsgroup may not be a worthwhile effort since there is
a
> fair chance that the problem could be misunderstood, miscommunicated or
> misread and so are the suggested solutions.
> With such a caveat, here is a try:
> CREATE TABLE Incidents(
> Incident_id INT NOT NULL PRIMARY KEY,
> State CHAR(2) NOT NULL
> REFERENCES States( State ),
> Incident_date DATETIME NOT NULL,
> Inident_type INT NOT NULL CHECK (...) -- or reference it
> Remarks VARCHAR(8000) NOT NULL
> DEFAULT '--NA--'
> UNIQUE ( State, Incident_date, Inident_type) );
> CREATE TABLE Details (
> Incident_id INT NOT NULL
> REFERENCES Incidents ( Incident_id )
> Outcome VARCHAR(10) NOT NULL
> CHECK ( Outcome IN ( 'Injured', 'Affected', 'Killed',
> 'Unknown' ) ) -- or reference it
> Person_type VARCHAR(6) NOT NULL
> CHECK Person_type IN ( 'Man', 'Women', 'Child', 'Unknown' ) )
> -- or reference it
> Incident_count INT NOT NULL DEFAULT(0)
> PRIMARY KEY ( Incident_id, Outcome, Person_type ) ) ;
> The check constraint values, if are of a higher number, can be substituted
> with a referenced table with corresponding foriegn key constraint.
> --
> Anith
>|||You have a couple of workarounds. Have the data Bulk inserted or DTS'ed to a
staging table with the same structure as the spreadsheet. Then you can write
up a simple script to populate the data into well normalized tables as
mentioned.
Another option is to use a client programming language like C or VB to read
the file & split the data accordingly. Then you can do the inserts directly
into the tables from the program.
Again, to reiterate the general sentiment, the table structures posted as
the response to your initial post is just a guildline and there is little
chance that your business model conforms to the assumptions we made while
posting such a schema.
--
Anith
a number of incidents per state
Create table gender
(
State_id
Male_killed
Male_injured
male_affected
Female_killed
female_affected
female_injured
Child_killed
Child_injured
child_affected
Date
Incident_type
remarks
)
All these are numbers and can be 2 male_killed and 2 female injured in the
same incident
so what is the best way to desing a DB for this type I cannot think anything
other than putting these all into one table.Depending on your needs you might come up with something like this...
Create table gender (gender_cd char(1) not null, gender_name varchar(8) not
null) --m, male f, female
Create table persontype( person_cd char(1) not null, person_name varchar(8)
not null) -A, Adult C,Child
Create table incidenttype(incident_id int identity(1,1) not null,
incident_name varchar(24) not null) --whatever
Create table resulttype(result_cd char(1) not null, resultname varchar(12)
not null) -- K, Killed I, Injured A, Affected
Create table states(state_cd char(2) not null, statename varchar(24) not
null) --NC, North Carolina
Create table things(id int identity(1,1) not null,
state_cd char(2) not null references
states(state_cd),
incident_id int not null references
incidenttype(incident_id),
thing_dt datetime not null,
remarks varchar(2000) null)
Create table thingdetail (id int identity(1,1) not null,
thing int not null references things(id),
gender_cd char(1) not null references
gender(gender_cd),
person_cd char(1) not null references
persontype(person_cd),
result_cd char(1) not null references
resulttype(result_cd),
NumberOfPeople int not null)
Although I did this quick and dirty, I think it is in third normal form...
You may not need this much normalization, but this is a beginning..
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Anup" <anup_pokhrel@.hotmail.com> wrote in message
news:e$dztHBWEHA.2408@.tk2msftngp13.phx.gbl...
> I have to keep detail of detail gender based DB like this where there may
be
> a number of incidents per state
> Create table gender
> (
> State_id
> Male_killed
> Male_injured
> male_affected
> Female_killed
> female_affected
> female_injured
> Child_killed
> Child_injured
> child_affected
> Date
> Incident_type
> remarks
> )
> All these are numbers and can be 2 male_killed and 2 female injured in the
> same incident
> so what is the best way to desing a DB for this type I cannot think
anything
> other than putting these all into one table.
>|||Based on your narrative and sample schema, one has to guess your conceptual
model, the attributes and the functional dependencies that exist among them
before suggesting something meaningful. In general, requesting solutions for
design problems in newsgroup may not be a worthwhile effort since there is a
fair chance that the problem could be misunderstood, miscommunicated or
misread and so are the suggested solutions.
With such a caveat, here is a try:
CREATE TABLE Incidents(
Incident_id INT NOT NULL PRIMARY KEY,
State CHAR(2) NOT NULL
REFERENCES States( State ),
Incident_date DATETIME NOT NULL,
Inident_type INT NOT NULL CHECK (...) -- or reference it
Remarks VARCHAR(8000) NOT NULL
DEFAULT '--NA--'
UNIQUE ( State, Incident_date, Inident_type) );
CREATE TABLE Details (
Incident_id INT NOT NULL
REFERENCES Incidents ( Incident_id )
Outcome VARCHAR(10) NOT NULL
CHECK ( Outcome IN ( 'Injured', 'Affected', 'Killed',
'Unknown' ) ) -- or reference it
Person_type VARCHAR(6) NOT NULL
CHECK Person_type IN ( 'Man', 'Women', 'Child', 'Unknown' ) )
-- or reference it
Incident_count INT NOT NULL DEFAULT(0)
PRIMARY KEY ( Incident_id, Outcome, Person_type ) ) ;
The check constraint values, if are of a higher number, can be substituted
with a referenced table with corresponding foriegn key constraint.
--
Anith|||thnaks
but the only problem is that I have a file with 1000 records that comes in
and I am importing through excel so any suggestions asto how to handle it if
I am to adopt the above design considerations
Anup Help is awaited
thanks
anup
"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:uRQ16uFWEHA.2928@.tk2msftngp13.phx.gbl...
> Based on your narrative and sample schema, one has to guess your
conceptual
> model, the attributes and the functional dependencies that exist among
them
> before suggesting something meaningful. In general, requesting solutions
for
> design problems in newsgroup may not be a worthwhile effort since there is
a
> fair chance that the problem could be misunderstood, miscommunicated or
> misread and so are the suggested solutions.
> With such a caveat, here is a try:
> CREATE TABLE Incidents(
> Incident_id INT NOT NULL PRIMARY KEY,
> State CHAR(2) NOT NULL
> REFERENCES States( State ),
> Incident_date DATETIME NOT NULL,
> Inident_type INT NOT NULL CHECK (...) -- or reference it
> Remarks VARCHAR(8000) NOT NULL
> DEFAULT '--NA--'
> UNIQUE ( State, Incident_date, Inident_type) );
> CREATE TABLE Details (
> Incident_id INT NOT NULL
> REFERENCES Incidents ( Incident_id )
> Outcome VARCHAR(10) NOT NULL
> CHECK ( Outcome IN ( 'Injured', 'Affected', 'Killed',
> 'Unknown' ) ) -- or reference it
> Person_type VARCHAR(6) NOT NULL
> CHECK Person_type IN ( 'Man', 'Women', 'Child', 'Unknown' ) )
> -- or reference it
> Incident_count INT NOT NULL DEFAULT(0)
> PRIMARY KEY ( Incident_id, Outcome, Person_type ) ) ;
> The check constraint values, if are of a higher number, can be substituted
> with a referenced table with corresponding foriegn key constraint.
> --
> Anith
>|||You have a couple of workarounds. Have the data Bulk inserted or DTS'ed to a
staging table with the same structure as the spreadsheet. Then you can write
up a simple script to populate the data into well normalized tables as
mentioned.
Another option is to use a client programming language like C or VB to read
the file & split the data accordingly. Then you can do the inserts directly
into the tables from the program.
Again, to reiterate the general sentiment, the table structures posted as
the response to your initial post is just a guildline and there is little
chance that your business model conforms to the assumptions we made while
posting such a schema.
--
Anith
Tuesday, February 14, 2012
Database corruption
Good morning.
The error 8510 can indicate a database corruption ? And
error 3437 ? (Error 8510, Severity: 20, State :1).
Thank you very much.
DanielThe 8510 error message is considered unnecessary because
the state of the transaction is already aborted or
committed before the error message occurs.
The 8510 error message occurs when two (2) SQL Server
SPIDs are working on behalf of the same MS DTC
transaction. One of the SPIDs is completing a successful
abort or commit operation. The second SPID is attempting
to re-enlist or reset the connection state. The reset is
generally associated with connection pooling operations.
The second SPID incorrectly looks for the MS DTC
transaction and encounters the 8510 error message when it
can no longer locate the transaction by a globally unique
identifier (GUID) because it was aborted or committed
successfully.
For error 3437:
There are 3 ways we can resolve the transaction. We used
the 2nd option (II) to
resolve the issue. We made sure to stop SQL Server
services and MSDTC. We
restarted MSDTC and then used the command line arguments
to start SQL, details
bellow:
I) To resolve the problem transactions using the MSDTC
Administrative Console.
1) On Windows NT server, you can invoke that by
running DAC.EXE from Start\
Run. Then under Transactions tab, right click the
transaction, and select
Resolve.
2) On Windows 2000, follow the below steps:
a. Open the MMC Console by typing MMC.exe in the Run
dialog box.
b. In the MMC console dialog box, click Console, and
then click Add/Remove
Snap-in.
c. In the Add/Remove Snap-in dialog box, click Add.
d. In the Add Standalone Snap-in dialog box, click
Component Services, and then
click ADD to add the snap-in. Click Close.
e. In the Add/Remove Snap-in dialog box, click OK.
f. In the console root under Component Services,
expand Component Services,
point to Computers, point to My Computer, and then click
Distributed
Transaction Coordinator.
g. Select Transaction List. The right window will
show the transactions. Right
click the transaction, and select Resolve. Now there are 3
options. Commit,
Abort or Forget.
We tried selecting from the resolve menu these options and
got the error:
Abort - the transaction cannot be forced to abort or
commit because the
transaction state is not ?in doubt?.
Forget - either the transaction is not committed or the
are resource managers
or subordinate MSDTC transaction managers still connected.
II) As the dB is receiving error 3437 during recovery, is
to start SQL Server
under a trace flag from the command prompt, as follows:
sqlservr -c -m -T3421 -T3605
You will be prompted for each transaction in the prepared
state and will be
able to manually commit or rollback the transaction as
desired. In my case we
opted to rollback the transactions.
See the section "Manually Resolving Transactions" in Books
Online for more
details on the ramifications of manually resolving
transactions.
After resolving the transaction, you can stop the server
from the command
prompt by clicking CTRL+C.
III) Use the KILL command passing the Unit of Work ID
(UOW) value. So we should
use
KILL UOW WITH { COMMIT | ROLLBACK }
This posting is provided "AS IS" with no warranties, and
confers no rights.
http://www.microsoft.com/info/cpyright.htm
>--Original Message--
> Good morning.
> The error 8510 can indicate a database corruption ? And
>error 3437 ? (Error 8510, Severity: 20, State :1).
>
>Thank you very much.
>Daniel
>.
>|||Thank you very very very much!
Regards.
Daniel
>--Original Message--
>The 8510 error message is considered unnecessary because
>the state of the transaction is already aborted or
>committed before the error message occurs.
>
>The 8510 error message occurs when two (2) SQL Server
>SPIDs are working on behalf of the same MS DTC
>transaction. One of the SPIDs is completing a successful
>abort or commit operation. The second SPID is attempting
>to re-enlist or reset the connection state. The reset is
>generally associated with connection pooling operations.
>The second SPID incorrectly looks for the MS DTC
>transaction and encounters the 8510 error message when it
>can no longer locate the transaction by a globally unique
>identifier (GUID) because it was aborted or committed
>successfully.
>For error 3437:
>There are 3 ways we can resolve the transaction. We used
>the 2nd option (II) to
>resolve the issue. We made sure to stop SQL Server
>services and MSDTC. We
>restarted MSDTC and then used the command line arguments
>to start SQL, details
>bellow:
>
>I) To resolve the problem transactions using the MSDTC
>Administrative Console.
>1) On Windows NT server, you can invoke that by
>running DAC.EXE from Start\
>Run. Then under Transactions tab, right click the
>transaction, and select
>Resolve.
>2) On Windows 2000, follow the below steps:
>a. Open the MMC Console by typing MMC.exe in the Run
>dialog box.
>b. In the MMC console dialog box, click Console, and
>then click Add/Remove
>Snap-in.
>c. In the Add/Remove Snap-in dialog box, click Add.
>d. In the Add Standalone Snap-in dialog box, click
>Component Services, and then
>click ADD to add the snap-in. Click Close.
>e. In the Add/Remove Snap-in dialog box, click OK.
>f. In the console root under Component Services,
>expand Component Services,
>point to Computers, point to My Computer, and then click
>Distributed
>Transaction Coordinator.
>g. Select Transaction List. The right window will
>show the transactions. Right
>click the transaction, and select Resolve. Now there are
3
>options. Commit,
>Abort or Forget.
>
>We tried selecting from the resolve menu these options
and
>got the error:
>Abort - the transaction cannot be forced to abort or
>commit because the
>transaction state is not ?in doubt?.
>Forget - either the transaction is not committed or the
>are resource managers
>or subordinate MSDTC transaction managers still
connected.
>
>II) As the dB is receiving error 3437 during recovery, is
>to start SQL Server
>under a trace flag from the command prompt, as follows:
>sqlservr -c -m -T3421 -T3605
>You will be prompted for each transaction in the prepared
>state and will be
>able to manually commit or rollback the transaction as
>desired. In my case we
>opted to rollback the transactions.
>See the section "Manually Resolving Transactions" in
Books
>Online for more
>details on the ramifications of manually resolving
>transactions.
>After resolving the transaction, you can stop the server
>from the command
>prompt by clicking CTRL+C.
>
>III) Use the KILL command passing the Unit of Work ID
>(UOW) value. So we should
>use
>KILL UOW WITH { COMMIT | ROLLBACK }
>
>This posting is provided "AS IS" with no warranties, and
>confers no rights.
>http://www.microsoft.com/info/cpyright.htm
>>--Original Message--
>> Good morning.
>> The error 8510 can indicate a database corruption ? And
>>error 3437 ? (Error 8510, Severity: 20, State :1).
>>
>>Thank you very much.
>>Daniel
>>.
>.
>
The error 8510 can indicate a database corruption ? And
error 3437 ? (Error 8510, Severity: 20, State :1).
Thank you very much.
DanielThe 8510 error message is considered unnecessary because
the state of the transaction is already aborted or
committed before the error message occurs.
The 8510 error message occurs when two (2) SQL Server
SPIDs are working on behalf of the same MS DTC
transaction. One of the SPIDs is completing a successful
abort or commit operation. The second SPID is attempting
to re-enlist or reset the connection state. The reset is
generally associated with connection pooling operations.
The second SPID incorrectly looks for the MS DTC
transaction and encounters the 8510 error message when it
can no longer locate the transaction by a globally unique
identifier (GUID) because it was aborted or committed
successfully.
For error 3437:
There are 3 ways we can resolve the transaction. We used
the 2nd option (II) to
resolve the issue. We made sure to stop SQL Server
services and MSDTC. We
restarted MSDTC and then used the command line arguments
to start SQL, details
bellow:
I) To resolve the problem transactions using the MSDTC
Administrative Console.
1) On Windows NT server, you can invoke that by
running DAC.EXE from Start\
Run. Then under Transactions tab, right click the
transaction, and select
Resolve.
2) On Windows 2000, follow the below steps:
a. Open the MMC Console by typing MMC.exe in the Run
dialog box.
b. In the MMC console dialog box, click Console, and
then click Add/Remove
Snap-in.
c. In the Add/Remove Snap-in dialog box, click Add.
d. In the Add Standalone Snap-in dialog box, click
Component Services, and then
click ADD to add the snap-in. Click Close.
e. In the Add/Remove Snap-in dialog box, click OK.
f. In the console root under Component Services,
expand Component Services,
point to Computers, point to My Computer, and then click
Distributed
Transaction Coordinator.
g. Select Transaction List. The right window will
show the transactions. Right
click the transaction, and select Resolve. Now there are 3
options. Commit,
Abort or Forget.
We tried selecting from the resolve menu these options and
got the error:
Abort - the transaction cannot be forced to abort or
commit because the
transaction state is not ?in doubt?.
Forget - either the transaction is not committed or the
are resource managers
or subordinate MSDTC transaction managers still connected.
II) As the dB is receiving error 3437 during recovery, is
to start SQL Server
under a trace flag from the command prompt, as follows:
sqlservr -c -m -T3421 -T3605
You will be prompted for each transaction in the prepared
state and will be
able to manually commit or rollback the transaction as
desired. In my case we
opted to rollback the transactions.
See the section "Manually Resolving Transactions" in Books
Online for more
details on the ramifications of manually resolving
transactions.
After resolving the transaction, you can stop the server
from the command
prompt by clicking CTRL+C.
III) Use the KILL command passing the Unit of Work ID
(UOW) value. So we should
use
KILL UOW WITH { COMMIT | ROLLBACK }
This posting is provided "AS IS" with no warranties, and
confers no rights.
http://www.microsoft.com/info/cpyright.htm
>--Original Message--
> Good morning.
> The error 8510 can indicate a database corruption ? And
>error 3437 ? (Error 8510, Severity: 20, State :1).
>
>Thank you very much.
>Daniel
>.
>|||Thank you very very very much!
Regards.
Daniel
>--Original Message--
>The 8510 error message is considered unnecessary because
>the state of the transaction is already aborted or
>committed before the error message occurs.
>
>The 8510 error message occurs when two (2) SQL Server
>SPIDs are working on behalf of the same MS DTC
>transaction. One of the SPIDs is completing a successful
>abort or commit operation. The second SPID is attempting
>to re-enlist or reset the connection state. The reset is
>generally associated with connection pooling operations.
>The second SPID incorrectly looks for the MS DTC
>transaction and encounters the 8510 error message when it
>can no longer locate the transaction by a globally unique
>identifier (GUID) because it was aborted or committed
>successfully.
>For error 3437:
>There are 3 ways we can resolve the transaction. We used
>the 2nd option (II) to
>resolve the issue. We made sure to stop SQL Server
>services and MSDTC. We
>restarted MSDTC and then used the command line arguments
>to start SQL, details
>bellow:
>
>I) To resolve the problem transactions using the MSDTC
>Administrative Console.
>1) On Windows NT server, you can invoke that by
>running DAC.EXE from Start\
>Run. Then under Transactions tab, right click the
>transaction, and select
>Resolve.
>2) On Windows 2000, follow the below steps:
>a. Open the MMC Console by typing MMC.exe in the Run
>dialog box.
>b. In the MMC console dialog box, click Console, and
>then click Add/Remove
>Snap-in.
>c. In the Add/Remove Snap-in dialog box, click Add.
>d. In the Add Standalone Snap-in dialog box, click
>Component Services, and then
>click ADD to add the snap-in. Click Close.
>e. In the Add/Remove Snap-in dialog box, click OK.
>f. In the console root under Component Services,
>expand Component Services,
>point to Computers, point to My Computer, and then click
>Distributed
>Transaction Coordinator.
>g. Select Transaction List. The right window will
>show the transactions. Right
>click the transaction, and select Resolve. Now there are
3
>options. Commit,
>Abort or Forget.
>
>We tried selecting from the resolve menu these options
and
>got the error:
>Abort - the transaction cannot be forced to abort or
>commit because the
>transaction state is not ?in doubt?.
>Forget - either the transaction is not committed or the
>are resource managers
>or subordinate MSDTC transaction managers still
connected.
>
>II) As the dB is receiving error 3437 during recovery, is
>to start SQL Server
>under a trace flag from the command prompt, as follows:
>sqlservr -c -m -T3421 -T3605
>You will be prompted for each transaction in the prepared
>state and will be
>able to manually commit or rollback the transaction as
>desired. In my case we
>opted to rollback the transactions.
>See the section "Manually Resolving Transactions" in
Books
>Online for more
>details on the ramifications of manually resolving
>transactions.
>After resolving the transaction, you can stop the server
>from the command
>prompt by clicking CTRL+C.
>
>III) Use the KILL command passing the Unit of Work ID
>(UOW) value. So we should
>use
>KILL UOW WITH { COMMIT | ROLLBACK }
>
>This posting is provided "AS IS" with no warranties, and
>confers no rights.
>http://www.microsoft.com/info/cpyright.htm
>>--Original Message--
>> Good morning.
>> The error 8510 can indicate a database corruption ? And
>>error 3437 ? (Error 8510, Severity: 20, State :1).
>>
>>Thank you very much.
>>Daniel
>>.
>.
>
Subscribe to:
Posts (Atom)