SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to deny restore database in sql server to SA?


How to deny restore database in sql server to SA?

Author
Message
SQLRNNR
SQLRNNR
SSC Guru
SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)

Group: General Forum Members
Points: 68757 Visits: 18570
Here's another vote for multiple logins.

In addition, another vote for taking greater care and caution when attempting to do a restore.

The server trigger may work, but I agree with Brian that it shouldn't be relied upon.

I checked throughout PBM as well and there is no means there to prevent the restore either (not without preventing the user to login).



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw

Greg Edwards-268690
Greg Edwards-268690
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4428 Visits: 8601
Another vote for separate account for Dev and Production.
The separate shares for the backups is also good for this.
In some ways, there is some safety in having to request another person who normally does not work in the environment to do this.
Yes, it can slow things down a bit. But it's probably well worth avoiding the mistake.
Brandie Tarvin
Brandie Tarvin
SSC-Dedicated
SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)

Group: General Forum Members
Points: 39386 Visits: 9291
The main issue with having separate accounts and instances for Dev and Prod is that for one-stop shops like the one I work it, a sysadmin can still have multiple windows of SSMS open and can still restore Dev over Prod if (s)he is not paying attention.

That's one of the reasons I color code my instances' query windows in SSMS (green for Dev, yellow for Test, orange for QC, and red for Production). The colors help me remember what environment I'm currently connected to. Also, I stop before I hit any okay buttons and verify everything in the windows to make sure I'm pointing to the correct instance.

In the case of a restore, we have different drive letters for all our instances, so it makes it easy to see at a glance if we're restoring to the correct drive letter. If I'm restoring to D: instead of G: for instance, I know I've hit the wrong instance before I even click OK.

Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
K. Brian Kelley
K. Brian Kelley
Keeper of the Duck
Keeper of the Duck (25K reputation)

Group: Moderators
Points: 25754 Visits: 1917
A great product for ensuring the proper color coding based on server name, for instance, is Mladen's SSMS Tools Pack. You can set the color and how big the visual cue is. Works wonderfully. I rely on it heavily in my environments. I have production coded as red. That stands out.

http://www.ssmstoolspack.com/]SSMS Tools Pack

K. Brian Kelley
@‌kbriankelley
Brandie Tarvin
Brandie Tarvin
SSC-Dedicated
SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)

Group: General Forum Members
Points: 39386 Visits: 9291
K. Brian Kelley (8/29/2013)
A great product for ensuring the proper color coding based on server name, for instance, is Mladen's SSMS Tools Pack.


I just use the regular OPTIONS available with native SSMS. But then, it only color codes the bottom of the window and can be reset to default if something strange happens to SSMS.

Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
das.saroj09
das.saroj09
Valued Member
Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)

Group: General Forum Members
Points: 70 Visits: 277
That's one of the reasons I color code my instances' query windows in SSMS (green for Dev, yellow for Test, orange for QC, and red for Production). The colors help me remember what environment I'm currently connected to. Also, I stop before I hit any okay buttons and verify everything in the windows to make sure I'm pointing to the correct instance.


How to do the color code on the instance. can you please provide the steps on SSMS how to do.
RandomEvent
RandomEvent
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1553 Visits: 528
Here's another vote for multiple logins.

How about creating a new SA account with SA rights then revoke SA
GilaMonster
GilaMonster
SSC Guru
SSC Guru (233K reputation)SSC Guru (233K reputation)SSC Guru (233K reputation)SSC Guru (233K reputation)SSC Guru (233K reputation)SSC Guru (233K reputation)SSC Guru (233K reputation)SSC Guru (233K reputation)

Group: General Forum Members
Points: 233727 Visits: 46361
You can't revoke or deny to a sysadmin account. The login named 'sa' cannot have any permissions changed, it can only be disabled.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


das.saroj09
das.saroj09
Valued Member
Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)

Group: General Forum Members
Points: 70 Visits: 277
Hi Brandie Tarvin & K. Brian Kelley,

can you please let me know how to change colour of the new query window for prod(red) and dev(green), it can be a great help for this kind of situation and can it be as permanent for the server. where will change or it can only for the persion who changed it ?
Brandie Tarvin
Brandie Tarvin
SSC-Dedicated
SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)

Group: General Forum Members
Points: 39386 Visits: 9291
das.saroj09 (8/29/2013)
That's one of the reasons I color code my instances' query windows in SSMS (green for Dev, yellow for Test, orange for QC, and red for Production). The colors help me remember what environment I'm currently connected to. Also, I stop before I hit any okay buttons and verify everything in the windows to make sure I'm pointing to the correct instance.



How to do the color code on the instance. can you please provide the steps on SSMS how to do.


Open SSMS. Click the button to open a new query window with a new connection (to the right of the New Query button) or navigate to File -> New -> Database Engine Query (CTRL - O also opens this window).

When the connection window pops up, click OPTIONS. It will flip you over to the Connection Properties tab. Check the "Use custom color:" box. Then hit the SELECT button to the right of it. A color palette will open up for you to choose your colors. Choose your color, click OK. Then hit Connect.

From now on (until SSMS resets itself due to weird errors or sometimes installs of service packs), any queries using that specific instance connection will be that color across the bottom bar of the SSMS window.

Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search