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.
| Author |
Topic |
|
mdhingra01
Posting Yak Master
179 Posts |
Posted - 2007-10-02 : 08:48:16
|
| Is there a way to log the queries or results of sql statments executed on a server. I don't mean writing the results to file, but logging the user name and the executed queries for each, to have an audit trail?Thanks |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-10-02 : 08:53:06
|
| SQL Profiler might be what you are looking for.There are also 3rd party auditing toolsKristen |
 |
|
|
mdhingra01
Posting Yak Master
179 Posts |
Posted - 2007-10-02 : 09:04:53
|
| Thanks Kristen. Is profiler part of SQL Server? The background on the situation is this: I help support a PROD application. When issues arise, I haven't any relevant test data to investigate in SQL Server. My only means is to authenticate throgh the front end application and see the misrepresented data or problem. My only recours then is to fish for a something similar in DEV and try to recreate the problem. This could take days maybe even weeks. I am now trying to build a case to allow PROD data replication to DEV envionments so testing and troubleshooting is more efficient and productive. The policy states, that whithout logging into the application there isn't an audit trail. So the reason for the trail is for Departmental Security. Is the product you are referring to sufficient for this? |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-10-02 : 09:14:33
|
| "Is profiler part of SQL Server?"Yes, its one of the "client utilities"FWIW: We have our application log EVERY SQL call and every Web Page, including all the GET/POST data, cookies, and so on. We can then evaluate this after-the-fact. The data is stored per session, so we can view all the activity within a specific session, and reproduce the steps the user (and their bug-ridden browser!) took.Kristen |
 |
|
|
mdhingra01
Posting Yak Master
179 Posts |
Posted - 2007-10-02 : 09:17:33
|
| Thanks again. I will have a look at Profiler. The application is currently logging all queries, I am trying to get read access to the backend on PROD DB, so I can create analyze the problem in it entirity. |
 |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-10-02 : 22:33:31
|
| You neeed more than read permission to run profiler trace. |
 |
|
|
Zoroaster
Aged Yak Warrior
702 Posts |
Posted - 2007-10-02 : 23:04:59
|
The minimum needed to run traces are the ALTER TRACE permissions. Future guru in the making. |
 |
|
|
|
|
|
|
|