Solved

Determine the last time a database was accessed

Posted on 2003-10-23
8
273 Views
Last Modified: 2012-10-18
Is there a way to tell when the last time that a certain database was accessed is in SQL Server 2000?  I'm not a DBA, it's just kind of a side thing that I've been stuck with (I'm a programmer).
0
Comment
Question by:mnashadka
8 Comments
 
LVL 19

Assisted Solution

by:Dexstar
Dexstar earned 40 total points
ID: 9610439
mnashadka,

> Is there a way to tell when the last time that a certain database was accessed
> is in SQL Server 2000?

Well, there is a way, but I'm not sure you'll like it.  You can enable security auditing for SQL Server which log all the accesses to the NT Event Log.  Then you can programmatically audit the log to determine when that database was accessed.  If you think that solution will work for you, I can go into how to do it in more detail.

Hope that helps,
Dex*
0
 
LVL 8

Author Comment

by:mnashadka
ID: 9610471
Thanks Dexstar.  But if I do that, it won't help me retroactively determine when a database that hasn't been accessed in a while is accessed.  Also, the event logs will get huge if I have to save them for a month or so.  Is there any other way?

Thanks again.
0
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 9611703
I have not had any issues DTS from Excel to MS SQL Server. But I often use a funcky way to import data from excel to MS SQL Server.

For Example, say I have data listed below in a spreadsheet
Col1  Col2   Col2       Col4
1       A       XXXX    
2       B       YYYY


For Col4, I use excel function CANCATENATE to come up with a sql statement concatenating values in the other columns

=CONCATENATE( " INSERT INTO MYTBALE (COL1, COL2, COl3) VALUES (", A1, ",'", B1, "','", C1,"')" )

Then copy the column 4 data to Query explorer and execute it. The data is imported.

You may want to use this method if nothing helps.

Namasi.

0
 
LVL 8

Author Comment

by:mnashadka
ID: 9611811
Namasi, how does that help me determine the last time a database was accessed?
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 9613345
Sorry, I have answered the wrong question. This is the answer for a different question.
0
 
LVL 15

Assisted Solution

by:namasi_navaretnam
namasi_navaretnam earned 40 total points
ID: 9613378
I am not sure if there is a sql or command to find out. Can you not check the dat and time MS SQL SERVER data file was modified. But this was not the date and time database was accessed, but modified.
0
 
LVL 30

Accepted Solution

by:
nmcdermaid earned 45 total points
ID: 9613658
You could use profiler to audit database logins. Tell Profiler to export the data to a file then process the file.

I think you can also use performance monitor/Trace logs to audit SQL logins, and save that to a file, also you can automaitcally truncate the file and do stuff like that.
0
 
LVL 8

Author Comment

by:mnashadka
ID: 9614307
Namasi, that's not really accurate.  The timestamp only gets updated when it gets flushed, or when you back up and truncate the data.  I'll look at using the profiler.  Thanks to all for your help.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL joining table to itself to combine rows 5 31
TSQL previous 5 23
Add '#' to end of file 2 29
Extract string portion 2 12
I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

914 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

18 Experts available now in Live!

Get 1:1 Help Now