Monitoring all user activity in database
I need to log the activity of all user database accounts so I can review the activity periodically and look out for strange behavior for audit purposes.
And if this sort of logging already exist, is there a table in the database that holds such information?
Unfortunately I'm completely new to SQL Server.
Can anyone assist?
sql-server
bumped to the homepage by Community♦ 3 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I need to log the activity of all user database accounts so I can review the activity periodically and look out for strange behavior for audit purposes.
And if this sort of logging already exist, is there a table in the database that holds such information?
Unfortunately I'm completely new to SQL Server.
Can anyone assist?
sql-server
bumped to the homepage by Community♦ 3 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
4
Hard to give a really specific answer here because we have no idea what “strange” means to you, but it sounds like you should look up SQL Server Audit.
– Aaron Bertrand♦
Dec 23 '17 at 13:08
OK - new to Microsoft SQL Server - how about other systems?
– Vérace
Dec 23 '17 at 14:35
add a comment |
I need to log the activity of all user database accounts so I can review the activity periodically and look out for strange behavior for audit purposes.
And if this sort of logging already exist, is there a table in the database that holds such information?
Unfortunately I'm completely new to SQL Server.
Can anyone assist?
sql-server
I need to log the activity of all user database accounts so I can review the activity periodically and look out for strange behavior for audit purposes.
And if this sort of logging already exist, is there a table in the database that holds such information?
Unfortunately I'm completely new to SQL Server.
Can anyone assist?
sql-server
sql-server
asked Dec 23 '17 at 10:49
IkennaIkenna
132
132
bumped to the homepage by Community♦ 3 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 3 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
4
Hard to give a really specific answer here because we have no idea what “strange” means to you, but it sounds like you should look up SQL Server Audit.
– Aaron Bertrand♦
Dec 23 '17 at 13:08
OK - new to Microsoft SQL Server - how about other systems?
– Vérace
Dec 23 '17 at 14:35
add a comment |
4
Hard to give a really specific answer here because we have no idea what “strange” means to you, but it sounds like you should look up SQL Server Audit.
– Aaron Bertrand♦
Dec 23 '17 at 13:08
OK - new to Microsoft SQL Server - how about other systems?
– Vérace
Dec 23 '17 at 14:35
4
4
Hard to give a really specific answer here because we have no idea what “strange” means to you, but it sounds like you should look up SQL Server Audit.
– Aaron Bertrand♦
Dec 23 '17 at 13:08
Hard to give a really specific answer here because we have no idea what “strange” means to you, but it sounds like you should look up SQL Server Audit.
– Aaron Bertrand♦
Dec 23 '17 at 13:08
OK - new to Microsoft SQL Server - how about other systems?
– Vérace
Dec 23 '17 at 14:35
OK - new to Microsoft SQL Server - how about other systems?
– Vérace
Dec 23 '17 at 14:35
add a comment |
1 Answer
1
active
oldest
votes
I would respond by a question. Why do you need to monitor those user ? If they can do stuff they shouldn't be able to do, then I guess you need to tune the security on the database.
If you monitor and log everything users do, this will have a high price in ressource consumption and may affect database performance.
If you still want to do it anyways, you can then use database audit and specify what you want to track.
If you want all queries then you could create an extended even or a trace (depending of the SQL version).
*Trace can log in a table and ext. event will create files that can be read in SQL.
Other option could be to create triggers that will store specific kind of operations (if you don't need to track everything). Triggers are rarely the best practice but in some specific situation, it could be ok.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f193884%2fmonitoring-all-user-activity-in-database%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I would respond by a question. Why do you need to monitor those user ? If they can do stuff they shouldn't be able to do, then I guess you need to tune the security on the database.
If you monitor and log everything users do, this will have a high price in ressource consumption and may affect database performance.
If you still want to do it anyways, you can then use database audit and specify what you want to track.
If you want all queries then you could create an extended even or a trace (depending of the SQL version).
*Trace can log in a table and ext. event will create files that can be read in SQL.
Other option could be to create triggers that will store specific kind of operations (if you don't need to track everything). Triggers are rarely the best practice but in some specific situation, it could be ok.
add a comment |
I would respond by a question. Why do you need to monitor those user ? If they can do stuff they shouldn't be able to do, then I guess you need to tune the security on the database.
If you monitor and log everything users do, this will have a high price in ressource consumption and may affect database performance.
If you still want to do it anyways, you can then use database audit and specify what you want to track.
If you want all queries then you could create an extended even or a trace (depending of the SQL version).
*Trace can log in a table and ext. event will create files that can be read in SQL.
Other option could be to create triggers that will store specific kind of operations (if you don't need to track everything). Triggers are rarely the best practice but in some specific situation, it could be ok.
add a comment |
I would respond by a question. Why do you need to monitor those user ? If they can do stuff they shouldn't be able to do, then I guess you need to tune the security on the database.
If you monitor and log everything users do, this will have a high price in ressource consumption and may affect database performance.
If you still want to do it anyways, you can then use database audit and specify what you want to track.
If you want all queries then you could create an extended even or a trace (depending of the SQL version).
*Trace can log in a table and ext. event will create files that can be read in SQL.
Other option could be to create triggers that will store specific kind of operations (if you don't need to track everything). Triggers are rarely the best practice but in some specific situation, it could be ok.
I would respond by a question. Why do you need to monitor those user ? If they can do stuff they shouldn't be able to do, then I guess you need to tune the security on the database.
If you monitor and log everything users do, this will have a high price in ressource consumption and may affect database performance.
If you still want to do it anyways, you can then use database audit and specify what you want to track.
If you want all queries then you could create an extended even or a trace (depending of the SQL version).
*Trace can log in a table and ext. event will create files that can be read in SQL.
Other option could be to create triggers that will store specific kind of operations (if you don't need to track everything). Triggers are rarely the best practice but in some specific situation, it could be ok.
answered Dec 29 '17 at 14:41
Dominique BoucherDominique Boucher
37117
37117
add a comment |
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f193884%2fmonitoring-all-user-activity-in-database%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
4
Hard to give a really specific answer here because we have no idea what “strange” means to you, but it sounds like you should look up SQL Server Audit.
– Aaron Bertrand♦
Dec 23 '17 at 13:08
OK - new to Microsoft SQL Server - how about other systems?
– Vérace
Dec 23 '17 at 14:35