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 Thursday, August 29, 2013 7:14 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 12:18 PM
Points: 13,135, Visits: 11,972

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.


When you have the login screen open click on options on the bottom. Then click on the second tab (connection properties). There is a checkbox at the bottom for "use custom color". Once you check the box there will be a select button on the right. Pick the color you want and off you go.

--EDIT--

Looks like Brandie posted the same while I was typing.


_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1489703
Posted Thursday, August 29, 2013 7:17 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:24 AM
Points: 7,133, Visits: 6,295
das.saroj09 (8/29/2013)
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 ?


It is not a permanent thing as it can be reset to any color (or no color at all) at any time, including things that cause SSMS to reset to default settings.

As far as I know, all OPTIONS for SQL Server are user sensitive only and do not translate to all people touching the server.


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 #1489705
Posted Thursday, August 29, 2013 7:24 AM


Keeper of the Duck

Keeper of the Duck

Group: Moderators
Last Login: Thursday, July 10, 2014 1:34 PM
Points: 6,623, Visits: 1,855
This is why I love Mladen's tool, especially if your servers follow a naming convention to define the environments. It allows you to build RegEx to color code the instances.


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 #1489713
Posted Thursday, August 29, 2013 7:32 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 9:52 AM
Points: 1,220, Visits: 6,571
Although color can be a reminder, it is only a reminder.
And it is a personal setting, not universal, So if you have more than 1 sysadmin, it is much less effective.

We used to extend the concept even to the Windows environment.
Even a Domain Admin, or a Server Admin, would use a separate account for admin activities.
This has the benefit of easier auditing and tracability.

As you can see, convenience and speed has some danger.
Just think if you have a large production environment, and someone truncates a table.
Then suppose you cannot just restore the table selectively.
Could be a huge problem, even if the table is small.
Post #1489717
Posted Thursday, August 29, 2013 7:50 AM


Keeper of the Duck

Keeper of the Duck

Group: Moderators
Last Login: Thursday, July 10, 2014 1:34 PM
Points: 6,623, Visits: 1,855
The two accounts is a bit different than maintaining a separate admin account in development.

The main reason for the two accounts is to help reduce the risk of drive-by attacks (where you hit a web site and an exploit automatically fires, taking advantage of some security weakness in the browser or a linked app, such as Adobe Acrobat Reader) and emails which effectively do the same thing.

Your non-privileged account is used for email, web browsing, etc., and if it has any admin rights, it's only over the workstation. Therefore, other systems can't be infected with the credentials. That would require administrative rights on those systems, which is what the second account is for.

With the different accounts in different environments, they are all admin accounts. Just one works for dev and one works for prod and dev never has the ability to work in prod.


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 #1489726
Posted Thursday, August 29, 2013 7:59 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:24 AM
Points: 7,133, Visits: 6,295
K. Brian Kelley (8/29/2013)
With the different accounts in different environments, they are all admin accounts. Just one works for dev and one works for prod and dev never has the ability to work in prod.


Unless the same person is doing both and happens to have different SSMS windows open. In which case, it doesn't matter what that person does to prevent these things from happening in the future, they still will happen unless that person double-checks and pays attention.


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 #1489732
Posted Thursday, August 29, 2013 8:04 AM


Keeper of the Duck

Keeper of the Duck

Group: Moderators
Last Login: Thursday, July 10, 2014 1:34 PM
Points: 6,623, Visits: 1,855
Multi-tasking is bad!

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 #1489735
Posted Thursday, August 29, 2013 8:27 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 10:59 AM
Points: 1,879, Visits: 3,010
I used to do something like this to make sure I wasn't running an operation on live.
Not sure if it'd work for restore (does it have to be the only statement in a batch?)

IF @@SERVERNAME = 'Live Server'
BEGIN
PRINT 'You''re on the Live Server!'
END
ELSE
BEGIN
RESTORE DATABASE...
END

Post #1489750
Posted Thursday, August 29, 2013 5:36 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 11:28 AM
Points: 36,786, Visits: 31,244
Brandie Tarvin (8/29/2013)
K. Brian Kelley (8/29/2013)
With the different accounts in different environments, they are all admin accounts. Just one works for dev and one works for prod and dev never has the ability to work in prod.


Unless the same person is doing both and happens to have different SSMS windows open. In which case, it doesn't matter what that person does to prevent these things from happening in the future, they still will happen unless that person double-checks and pays attention.


But you won't be able to restore prod over dev or vice versa because the boxes themselves cannot see the backups of the other.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1489972
Posted Friday, August 30, 2013 10:39 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:24 AM
Points: 7,133, Visits: 6,295
Jeff Moden (8/29/2013)
Brandie Tarvin (8/29/2013)
K. Brian Kelley (8/29/2013)
With the different accounts in different environments, they are all admin accounts. Just one works for dev and one works for prod and dev never has the ability to work in prod.


Unless the same person is doing both and happens to have different SSMS windows open. In which case, it doesn't matter what that person does to prevent these things from happening in the future, they still will happen unless that person double-checks and pays attention.


But you won't be able to restore prod over dev or vice versa because the boxes themselves cannot see the backups of the other.


Okay, I think you've taken this conversation up a level.

The boxes will and can see backups saved to disk assuming the Agent account (which is not the accounts we were talking about earlier) can see the backup paths. I know this because this is how it works in our environment. We have different agent accounts in prod and dev, yet because they do have perms on the backup path, we can restore without issue.

But the conversation (the way I understood it) was that the users should have different accounts for the boxes (which still won't prevent restoring over stuff).

Did I misunderstand something here?


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 #1490226
« Prev Topic | Next Topic »

Add to briefcase «««1234»»

Permissions Expand / Collapse