Solved

tracking logins 2008 r2 auditing

Posted on 2015-01-21
10
50 Views
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.
0
Comment
Question by:jamesmetcalf74
  • 6
  • 4
10 Comments
 
LVL 25

Accepted Solution

by:
jogos earned 500 total points
Comment Utility
With the management views you can see different versions of active: active now, recent, most active ...
https://msdn.microsoft.com/en-us/library/ms188068.aspx
0
 
LVL 25

Assisted Solution

by:jogos
jogos earned 500 total points
Comment Utility
"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.
0
 

Author Comment

by:jamesmetcalf74
Comment Utility
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
output-of-query.xlsx
0
 
LVL 25

Expert Comment

by:jogos
Comment Utility
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
0
 

Author Comment

by:jamesmetcalf74
Comment Utility
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
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:jamesmetcalf74
Comment Utility
how can I get the query to display the name of the db  *correction from earlier post
0
 
LVL 25

Expert Comment

by:jogos
Comment Utility
DB_NAME() gives the name of current db,  DB_NAME(database_id) gives name of database which id you are passing
0
 

Author Comment

by:jamesmetcalf74
Comment Utility
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?
0
 
LVL 25

Expert Comment

by:jogos
Comment Utility
Not used is more difficult to track than certainly used
Some ways to track usage and an idea on why it can mislead you
http://www.brentozar.com/archive/2014/05/4-lightweight-ways-tell-database-used/
0
 
LVL 25

Expert Comment

by:jogos
Comment Utility
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

0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

     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 …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now