Showing posts with label method. Show all posts
Showing posts with label method. Show all posts

Thursday, March 29, 2012

Database in recovery

I have a database currently showing to be in recovery. I have not been able to find a GUI method to monitor the progress (to determine when it might complete) so is there a command line T-SQL method to monitor the recovery process?

If this is 2005, this might be what you need:

select der.session_id, der.command, der.status, der.percent_complete, *
from sys.dm_exec_requests as der

It works for other types of commands that have known progress indicators. If not, then I really don't think it tells you. You might also check the error log to see how long it took the previous time...

|||

Thanks Louis! It worked fine and the database eventually did recover.

|||Thanks Louis, it works for me too..

Monday, March 19, 2012

database encryption

Hi,
i want to encrypt my database(sql server2005) fully. Can anyone suggest me any third party tool or any other method.
Please its urgent.
Thanx in advance:(What do you mean encrypt the database? Encrypt a backup of the database? Because you can backup "with password = 'xxx'"

Checkout redgate sql tools, they have some good stuff.

Sunday, February 19, 2012

Database Design - Boolean Fields

I am designing a table where the object(s) that the table represents could have hundreds of boolean attributes.

Which method of design would you chose for this scenario:

    Keep the booleans in the original object's table, potential for hundreds of nulls in a rowCreate a 2 more tables, one that has the boolean value names & ID. Another that relates an object (in original table) to a boolean value name/ID. No nulls, lots of joining

So second method would probably normalize it, but I would suffer a performance cost, whereas the 1st method would be the easiest/quickest for joins but tons of null records.

Thanks

Ben

Can you post some sample data so I can "see" what you mean..

|||

For example, say I have a table of homes. The homes table will have general attributes that all home objects share (address, sq ft, price) but then there are optional boolean fields that are attributes of homes (Is TwoStory, HasGasStove, HasAlarmSystem).

So would you store these boolean fields in the homes table, or create a table of attributes and a relationship table?

The first choice would have the potential for many null values in the table for each record. Most likely this table would not be normalized.

The second option would normalize the table, but suffer from the performance penalty of the joining 3 tables (tbl_homes, tbl_homeattributes, tbl_relationship_homes_attributes) to get the information. There would not be any null values though.

This situation could apply to any object that has boolean attributes: clothes, cars, computers, buildings.

Thanks

Ben

|||

I would create an Attributes lookup table with an AttributeId mapped to an attribute

AttribId AttribName
---------
1 IsTwoStory
2 HasGasStove
3 HasAlarmSystem

Then there would be a cross-reference table with a Home mapped to all its atributes.

HomeId AttribId
------
1 1
1 2
2 1
2 2
2 3
3 1

this way, if any new attributes get added in future you just add them to the attributes table and if there are homes that match that attribute you add them to the cross ref table. Similarly if existing attributes get removed or if a home loses some attributes you just update the cross ref table appropriately. This approach will give you a properly normalized structure with best scalability.

Tuesday, February 14, 2012

database corrupt

What can I do if I failed to attach a database by EM?
If the database is corrupted, any method to recover the
database?
hi Tony,
"Tony" <anonymous@.discussions.microsoft.com> ha scritto nel messaggio
news:06b901c4a073$d7dd8a40$a401280a@.phx.gbl
> What can I do if I failed to attach a database by EM?
> If the database is corrupted, any method to recover the
> database?
if you have a clean backup, this usually is the best solution to go but, if
the database can be saved, perhaps the advices by Jasper as per
http://tinyurl.com/3pxhv can be helpfull
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Hi,
What is the error you are getting while attaching?
Best option after a corrruption will be restoring from a good backup. If you
do not have the backup try below:-
1. Execute DBCC CHECKDB('db_name','REPAIR_REBUILD') , this will corrupt
minor issues.
If you do not have any options try with Jaspers suggestion
http://www.google.it/groups?q=+%22sp...ftngp09&rnum=1
Thanks
Hari
MCDBA
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:2re0b2F18k52cU1@.uni-berlin.de...
> hi Tony,
> "Tony" <anonymous@.discussions.microsoft.com> ha scritto nel messaggio
> news:06b901c4a073$d7dd8a40$a401280a@.phx.gbl
> if you have a clean backup, this usually is the best solution to go but,
> if
> the database can be saved, perhaps the advices by Jasper as per
> http://tinyurl.com/3pxhv can be helpfull
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>