Click here to monitor SSC
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
Sean Lange
Sean Lange
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16550 Visits: 17004

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)
Brandie Tarvin
Brandie Tarvin
SSCertifiable
SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)

Group: General Forum Members
Points: 7771 Visits: 8731
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 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 (6.8K reputation)

Group: Moderators
Points: 6774 Visits: 1911
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
@‌kbriankelley
Greg Edwards-268690
Greg Edwards-268690
SSC Eights!
SSC Eights! (817 reputation)SSC Eights! (817 reputation)SSC Eights! (817 reputation)SSC Eights! (817 reputation)SSC Eights! (817 reputation)SSC Eights! (817 reputation)SSC Eights! (817 reputation)SSC Eights! (817 reputation)

Group: General Forum Members
Points: 817 Visits: 8256
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.
K. Brian Kelley
K. Brian Kelley
Keeper of the Duck
Keeper of the Duck (6.8K reputation)

Group: Moderators
Points: 6774 Visits: 1911
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
@‌kbriankelley
Brandie Tarvin
Brandie Tarvin
SSCertifiable
SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)

Group: General Forum Members
Points: 7771 Visits: 8731
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 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 (6.8K reputation)

Group: Moderators
Points: 6774 Visits: 1911
Multi-tasking is bad! :-)

K. Brian Kelley
@‌kbriankelley
Gazareth
Gazareth
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2863 Visits: 5331
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


Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45028 Visits: 39893
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.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Brandie Tarvin
Brandie Tarvin
SSCertifiable
SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)

Group: General Forum Members
Points: 7771 Visits: 8731
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 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