How to: Create a Server-level Audit
Aby można było utworzyć specyfikację inspekcji poziom serwera należy utworzyć i skonfigurować SQL Server Obiekt inspekcji, które mogą być używane dla inspekcji serwera.
Wykonania tego zadania polega na użyciu Edytor kwerend w SQL Server Management Studio Aby wykonać poniższą procedurę. Poniższy przykład tworzy inspekcji poziomie serwera logowania działań, wysyłania inspekcji w dzienniku zdarzeń aplikacji systemu Windows.
Aby utworzyć inspekcji poziomie serwera
Obiekt inspekcji należy utworzyć i zdefiniować miejsce docelowe.
/* Create the SQL Server Audit object, and send the results to the Windows Application event log. */ CREATE SERVER AUDIT Test_SQL_Server_Audit TO APPLICATION_LOG /* The Queue Delay is set to 1000, meaning one second intervals to write to the target. */ WITH ( QUEUE_DELAY = 1000, ON_FAILURE = CONTINUE); GO;Tworzenie specyfikacji inspekcji serwera i mapować go na obiekt inspekcji.
/* Create the Server Audit Specification object by using an Audit event group. */ CREATE SERVER AUDIT SPECIFICATION Test_Server_Audit_Specification FOR SERVER AUDIT Test_SQL_Server_Audit ADD (FAILED_LOGIN_GROUP);Włączenie inspekcji.
/* Enable the audit. */ ALTER SERVER AUDIT Test_SQL_Server_Audit WITH (STATE = ON); GO