tracking logins 2008 r2 auditing

Posted on 2015-01-21
Last Modified: 2015-01-27
I need to identify which sql server db's are active in my instance of sql server.
the sql server is running sql 2008 r2 standard.

when I try to setup an audit through management studio, it err's out and tells me auditing is not a feature allowed
on this type of sql application "2008 r2 standard"
does anyone know away I can accurately track logins to sql server databases by the database name?  I have inherited a sql server that has 80 db's and I don't know which ones are being actively used.

My plan was to track logins over a week and see which db's are being utilized.
Question by:jamesmetcalf74
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
LVL 25

Accepted Solution

jogos earned 500 total points
ID: 40562404
With the management views you can see different versions of active: active now, recent, most active ...
LVL 25

Assisted Solution

jogos earned 500 total points
ID: 40562413
"My plan was to track logins over a week and see which db's are being utilized."
With a login you don't see which database is being used.

Author Comment

ID: 40562439
I've done a query select * from sys.dm_db_db_index_usage_stats and it has a column called database_id

the database_id I would assume is tracking an actual db... please correct if im wrong.
so if I associate that with the database name.... isn't there another column in the output of this query that specifies high or no usage?

sample of output attached
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

LVL 25

Expert Comment

ID: 40562457
Indeed mamanagent views return data from usage .... that is more exaclty since last restart or clean of that data.

db_Name(database_id) and you even got the name of that database

Author Comment

ID: 40562478
how can I get it to display the name of the db?  or is this something I need to cross reference?
and which columns to you think would indicate real usage of the db?
Thanks Jogos

Author Comment

ID: 40562480
how can I get the query to display the name of the db  *correction from earlier post
LVL 25

Expert Comment

ID: 40562506
DB_NAME() gives the name of current db,  DB_NAME(database_id) gives name of database which id you are passing

Author Comment

ID: 40562514
im a little confused as I am new to being a dba.

are you saying that I can write a select statement that will give me the db name in the output.
the output from my first query

select * from sys.dm_db_db_index_usage_stats
was posted in the excel spreadsheet

I don't see any db names in the output
could you assist in query creation that would put that attribute in the output?
LVL 25

Expert Comment

ID: 40562525
Not used is more difficult to track than certainly used
Some ways to track usage and an idea on why it can mislead you
LVL 25

Expert Comment

ID: 40562544
How to get db-name and example on why it is important to give an id as parameter to that function
select  DB_NAME(database_id),* from sys.dm_db_db_index_usage_stats

use master 
select  DB_NAME()
use msdb
select DB_NAME()

Open in new window


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
TSQL Challenge... 7 59
Are triggers slow? 7 30
query optimization 6 31
Need to create and populate a column map table 5 62
     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below.…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question