Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««1234»»»

How to deny restore database in sql server to SA? Expand / Collapse
Author
Message
Posted Wednesday, August 28, 2013 6:49 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 11:08 AM
Points: 21,655, Visits: 15,322
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


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1489486
Posted Wednesday, August 28, 2013 8:14 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 6:07 AM
Points: 1,232, Visits: 6,644
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.
Post #1489497
Posted Thursday, August 29, 2013 4:39 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:35 AM
Points: 7,197, Visits: 6,342
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 Administrator

Webpage: http://www.BrandieTarvin.net
LiveJournal Blog: http://brandietarvin.livejournal.com/
On LinkedIn!, Google+, and Twitter.

Freelance Writer: Shadowrun
Latchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Post #1489634
Posted Thursday, August 29, 2013 6:54 AM


Keeper of the Duck

Keeper of the Duck

Group: Moderators
Last Login: Monday, August 18, 2014 8:24 AM
Points: 6,634, Visits: 1,871
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, CISA, MCSE, Security+, MVP - SQL Server
Regular Columnist (Security), SQLServerCentral.com
Author of Introduction to SQL Server: Basic Skills for Any SQL Server User
| Professional Development blog | Technical Blog | LinkedIn | Twitter
Post #1489686
Posted Thursday, August 29, 2013 6:59 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:35 AM
Points: 7,197, Visits: 6,342
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 Administrator

Webpage: http://www.BrandieTarvin.net
LiveJournal Blog: http://brandietarvin.livejournal.com/
On LinkedIn!, Google+, and Twitter.

Freelance Writer: Shadowrun
Latchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Post #1489691
Posted Thursday, August 29, 2013 7:01 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, August 27, 2014 10:03 AM
Points: 6, Visits: 99
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.
Post #1489692
Posted Thursday, August 29, 2013 7:05 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, August 28, 2014 3:25 AM
Points: 519, Visits: 165
Here's another vote for multiple logins.

How about creating a new SA account with SA rights then revoke SA
Post #1489694
Posted Thursday, August 29, 2013 7:10 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 11:31 AM
Points: 42,844, Visits: 35,973
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 2008, MVP
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

Post #1489696
Posted Thursday, August 29, 2013 7:11 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, August 27, 2014 10:03 AM
Points: 6, Visits: 99
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 ?
Post #1489701
Posted Thursday, August 29, 2013 7:13 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:35 AM
Points: 7,197, Visits: 6,342
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 Administrator

Webpage: http://www.BrandieTarvin.net
LiveJournal Blog: http://brandietarvin.livejournal.com/
On LinkedIn!, Google+, and Twitter.

Freelance Writer: Shadowrun
Latchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Post #1489702
« Prev Topic | Next Topic »

Add to briefcase ««1234»»»

Permissions Expand / Collapse