Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Identifying Databases

Author  Topic 

honey_191
Starting Member

49 Posts

Posted - 2008-05-06 : 23:32:25
Hi,can anybody tell me how to identify all the databases from all the servers that are being accessed by a particular group

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-05-06 : 23:36:14
Only from SQL profiler.
Go to Top of Page

honey_191
Starting Member

49 Posts

Posted - 2008-05-07 : 00:02:45
no,i mean those databases that a particular group has permissions to acess.for example,i need to find out all the databases that can be access by mainframe.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-05-07 : 00:19:53
quote:
Originally posted by sodeep

sp_helplogins 'Loginname'

Go to Top of Page

honey_191
Starting Member

49 Posts

Posted - 2008-05-07 : 00:58:40
Do i need to run each and every login on every server?
Go to Top of Page

mcrowley
Aged Yak Warrior

771 Posts

Posted - 2008-05-07 : 10:28:37
To identify all databases that a particular Windows group has access to, you would have to run through the following checklist:

1) Is the group in the Windows local admin group of the server and BUILTIN\ADMINISTRATORS is still in the sysadmin server role?
2) Does the group have access to the server? (i.e. it is in sys.server_principals)
3) Is the group a member of the sysadmin server role on the instance?
4) If yes, then does the group show up in any of the databases (sys.database_principals in each database)

So, technically, no you will not have to go through each and every database, but you will likely go through a lot of them.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-05-07 : 10:34:38
Didn't get your question? You are saying Particular group and each and every logins. Post your question correctly.What is the requirement?
Go to Top of Page

mcrowley
Aged Yak Warrior

771 Posts

Posted - 2008-05-07 : 11:12:17
To be fair, is the question "which databases can be accessed?" or "what databases are they actually using?" The second question can only be answered by Profiler, but gets highly muddled when you introduce web applications that can proxy users under a different login such as an application pool in IIS. In general, it is almost more effective to go to the group, and ask them what they are using.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-05-07 : 15:33:21
Sp_helplogins lists all sql logins and which db they have permission.
Go to Top of Page

honey_191
Starting Member

49 Posts

Posted - 2008-05-08 : 15:06:10
If i want to find out on all the servers then?is there any query to find out on all the servers?
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-05-08 : 15:11:09
NO. What does sp_helplogins return ? Are you talking about particular group or each and every logins?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-05-08 : 15:30:49
You can query sp_helplogins on each of your servers if you were to run sqlcmd with sp_helplogins once per server. If you've got a list of your servers somewhere, it'd be fairly easy to write out each sqlcmd command.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page
   

- Advertisement -