Create A Server Audit and Database Audit Specification
Create A Server Audit and Database Audit Specification
http://msdn.microsoft.com/en-us/library/cc280424.aspx
1 dari 5
14-Apr-2013 11:13 PM
http://msdn.microsoft.com/en-us/library/cc280424.aspx
server-scope objects, such as the system views. If server-scoped objects are included, the audit will be created. However, the server-scoped objects will not be included, and no error will be returned. To audit server-scope objects, use a database audit specification in the master database. Database audit specifications reside in the database where they are created, with the exception of the tempdb system database.
Security
Permissions
Users with the ALTER ANY DATABASE AUDIT permission can create database audit specifications and bind them to any audit. After a database audit specification is created, it can be viewed by principals with the CONTROL SERVER, ALTER ANY DATABASE AUDIT permissions, or the sysadmin account. [Top]
2 dari 5
14-Apr-2013 11:13 PM
http://msdn.microsoft.com/en-us/library/cc280424.aspx
Database Audit Specification dialog box. Name The name of the database audit specification. This is generated automatically when you create a new server audit specification but is editable. Audit The name of an existing database audit. Either type in the name of the audit or select it from the list. Audit Action Type Specifies the database-level audit action groups and audit actions to capture. For the list of database-level audit action groups and audit actions and a description of the events they contain, see SQL Server Audit Action Groups and Actions. Object Schema Displays the schema for the specified Object Name. Object Name The name of the object to audit. This is only available for audit actions; it does not apply to audit groups. Ellipsis () Opens the Select Objects dialog to browse for and select an available object, based on the specified Audit Action Type. Principal Name The account to filter the audit by for the object being audited. Ellipsis () Opens the Select Objects dialog to browse for and select an available object, based on the specified Object Name. 4. When you are finished selecting option, click OK. [Top]
Using Transact-SQL
To create a server audit
1. In Object Explorer, connect to an instance of Database
3 dari 5
14-Apr-2013 11:13 PM
http://msdn.microsoft.com/en-us/library/cc280424.aspx
Engine. 2. On the Standard bar, click New Query. 3. Copy and paste the following example into the query window and click Execute.
USE master ; GO -- Create the server audit. CREATE SERVER AUDIT Payrole_Security_Audit TO FILE ( FILEPATH = 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQL GO -- Enable the server audit. ALTER SERVER AUDIT Payrole_Security_Audit WITH (STATE = ON) ;
USE AdventureWorks2012 ; GO -- Create the database audit specification. CREATE DATABASE AUDIT SPECIFICATION Audit_Pay_Tables FOR SERVER AUDIT Payrole_Security_Audit ADD (SELECT , INSERT ON HumanResources.EmployeePayHistory BY dbo ) WITH (STATE = ON) ; GO For more information, see CREATE SERVER AUDIT (Transact-SQL) and CREATE DATABASE AUDIT SPECIFICATION (Transact-SQL). [Top]
4 dari 5
14-Apr-2013 11:13 PM
http://msdn.microsoft.com/en-us/library/cc280424.aspx
Community Additions
5 dari 5
14-Apr-2013 11:13 PM