July 1, 2011 at 10:37 am
I have an SQL Server account that has lost the mapping to a database twice now. There are only a couple of people who have access to change this. The account is a datareader that I use to access the database from SSRS. It's a MS NAV database.
What's the best type of monitoring to put in place to see when this is happens.
July 1, 2011 at 10:41 am
When you say that an Account lost it's mapping to the Database could you be more specific?
Specifically what happens and when does it happen?
Do you have orphan users?
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 1, 2011 at 10:42 am
There wasn't a database restore done was there?
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
July 1, 2011 at 11:13 am
There was no database restore. When I say mapping, under user mapping on the Login properties the map field was unchecked. This is alos a MS NAV database so I'm not aware of any utilities in NAV that would do this.
July 1, 2011 at 11:19 am
tmkruse (7/1/2011)
There was no database restore. When I say mapping, under user mapping on the Login properties the map field was unchecked. This is alos a MS NAV database so I'm not aware of any utilities in NAV that would do this.
Yes. I asked about the restore because that can cause the very issue you are referencing. It sounded a lot like orphaned users so wanted to verify.
To find who changed it, you could check the default trace.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
July 1, 2011 at 11:21 am
Someone or something removed the permission to the database for these Logins.
It did not happen by itself.
Auditing?
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 1, 2011 at 11:24 am
Welsh Corgi (7/1/2011)
Someone or something removed the permission to the database for these Loins.
You had access too? 😉
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
July 1, 2011 at 11:25 am
I'm looking at setting up auditing now, any good references?
July 1, 2011 at 11:42 am
You could start here.
http://msdn.microsoft.com/en-us/library/ms190378.aspx
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
July 1, 2011 at 12:57 pm
Thanks Jason, I guess I just got too used to using Idera's auditing tool. Looking to set this up on a dev box today.
July 1, 2011 at 1:34 pm
Is the machine that you are loosing the mappings on a Dev & QA Box?
Please answer!
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 1, 2011 at 2:08 pm
The server is a production server, SQL 2008 R2 Standard 10.50.1600 (no Auditing)
I'm setting up a DDL Trigger (in dev first) on the DROP_USER event that will log the user and ddl statement in a table and send an email to our IT group.
Thanks for everyone's help.
July 1, 2011 at 2:16 pm
Lowell (7/1/2011)
any chance there is a script or job doing something like this?since you said it happens "regularly, maybe there's an obscure snippet in a job or something
IF EXISTS (SELECT * FROM sys.database_principals WHERE name = N'YOURROLE' AND type = 'S')
DROP USER YOURROLE
GO
CREATE USER YOURROLE
Lowell
July 1, 2011 at 2:18 pm
That's what I'm looking for Lowell and the DDL trigger looks like it will work to monitor.
Thanks,
T
July 1, 2011 at 2:22 pm
Viewing 15 posts - 1 through 15 (of 23 total)
You must be logged in to reply to this topic. Login to reply