Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Prevent users from accessing the db

Author  Topic 

hanifikri
Starting Member

14 Posts

Posted - 2011-03-16 : 05:55:58
Hi,

I want to shrink the db and i want to prevent/stop the users from accessing to the db. How to do that?

Thank you.

Sachin.Nand

2937 Posts

Posted - 2011-03-16 : 06:28:55
It can be done.But why is it that you want to shrink the DB in first place?It is a very very bad idea to shrink the database.

PBUH

Go to Top of Page

hanifikri
Starting Member

14 Posts

Posted - 2011-03-16 : 10:29:33
sorry for my mistake. not shrink the db but shrink the log files. currently we have two log files with same the size. only the names are different. so i just want to have 1 log file.

in order to do that i want to prevent the users from accessing the db. how can i do that?

kindly advise and thank you.
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2011-03-16 : 12:54:01
You can set the DB to single user mode.

Just of curiosity are you trying to merge those 2 log files ?

PBUH

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-03-16 : 14:08:45
Just remove the second file, you don't need to shrink it and you don't need to be in single-user mode. Log files are not used concurrently. A second file is only used if the first file has filled up. If you aren't in that condition right now, then you should be able to just remove the second file from the database.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2011-03-16 : 15:16:05
look upo ALTER DATABASE in Books online for ROLLBACK IMMEDIATE

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

hanifikri
Starting Member

14 Posts

Posted - 2011-03-17 : 06:06:43
Thank you very much.

Sachin.Nand, I don't want to merge the files. I just one to remove 1 file.


Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-03-17 : 12:48:37
There's no merging of tlog files anyway.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -