Microsoft SQL Server 2012 管理 (2): Auditing
- -- Demostratin 2A (Using SQL Server Audit)
- -- Step 1: Use the master database
- USE master;
- GO
- -- Step 2: Create a SQL Server Audit and define tis target as
- -- application log
- Create Server Audit MarketDevLog
- To Application_log
- With (QUEUE_DELAY = 1000, ON_FAILURE = CONTINUE)
- GO
- -- Step 3: Change to the MarketDev database
- USE MarketDev;
- GO
- -- Step 4: Create a database audit specification for SELECT
- -- activity on the Marketing schema
- CREATE DATABASE AUDIT SPECIFICATION MrketingSelectSpec
- FOR SERVER AUDIT MarketDevLog
- ADD (SELECT ON SCHEMA::Marketing BY public);
- GO
- -- Step 5: Query the sys.server_audits system view.
- -- Scroll to the right and note the available columns.
- -- particular, note the is_state_enabled column.
- SELECT * FROM sys.server_audits;
- GO
- -- Step 6: Change to master database
- USE master;
- GO
- -- Step 7: Enable the server audit
- ALTER SERVER AUDIT MarketDevLog WITH (STATE=ON);
- GO
- -- Step 8: Change to MarketDev database
- USE MarketDev;
- GO
- -- Step 9: Enable the MarketingSelectSpec audit specification
- ALTER DATABASE AUDIT SPECIFICATION MarketingSelectSpec
- WITH (STATE = ON);
- -- Step 10: Query the sys.server_audits and
- -- sys.database_audit_specifications and
- -- sys.database_audit_specification_details system view
- -- Note that the audit is now started and scroll to
- -- see the details provided for the audit specification
- SELECT * FROM sys.server_audits;
- SELECT * FROM sys.database_audit_specifications;
- SELECT * FROM sys.database_audit_specification_details;
- GO
- -- Step 11: Geenerate an auditable event by querying a table
- -- in the Marketing schema. Also execute a query
- -- that should not be audited.
- SELECT * FROM Marketing.PostalCode;
- GO
- SELECT * FROM DirectMarketing.City;
- GO
- -- Step 12: Check the contents of the Application log
- -- (Do this by Start, Right-click My Computer, then
- -- Expand Diagnostics, Event Viewer, and Windows Logs
- -- click Application. Click on each of the MSSQLSERVER
- -- the upper pane For each evetn, click on the detail
- -- the lower pane and review the contents). the close
- -- management windows.
- -- Step 13: Change to the master database
- USE master;
- GO
- -- Step 14: Disable the server audit
- ALTER SERVER AUDIT MarketDevLog WITH (STATE=OFF);
- GO
- -- Step 15: Change to the MarketDev database
- USE MarketDev;
- GO
- -- Step 16: Disable the MarketingSelectSpec audit specification
- ALTER DATABASE AUDIT SPECIFICATION MarketingSelectSpec
- WITH (STATE = OFF);
Microsoft SQL Server 2012 管理 (2): Auditing的更多相关文章
- Microsoft SQL Server 2012 管理 (1): 安装配置SQL Server 重点
SQL Server 可以在实例,数据库,列,查询分别指定排序规则 /* Module 1 - working with Clollations */ -- 1.1 Obtain the Instan ...
- Microsoft SQL Server 2012 管理 (2): 实例与数据库管理
1.加密数据库 /* Module 2 Implementing Transparent Data Encryption */ -- 2.1 Create DataBase Master Key US ...
- Querying Microsoft SQL Server 2012 读书笔记:查询和管理XML数据 1 -使用FOR XML返回XML结果集
XML 介绍 <CustomersOrders> <Customer custid="1" companyname="Customer NRZBB&qu ...
- 【转】Microsoft® SQL Server® 2012 Performance Dashboard Reports
http://www.cnblogs.com/shanyou/archive/2013/02/12/2910232.html SQL Server Performance Dashboard Repo ...
- Microsoft SQL server 2012数据库学习总结(一)
一.Microsoft SQL Server2012简介 1.基本概要 Microsoft SQL Server 2012是微软发布的新一代数据平台产品,全面支持云技术与平台,并且能够快速构建相应的解 ...
- 微软推出的免费新书《Introducing Microsoft SQL Server 2012》
微软推出的免费新书<Introducing Microsoft SQL Server 2012>,该书详细介绍微软SQL 2012数据库服务最新功能以及功能应用和使用技巧. 该书适合SQL ...
- Exam 70-462 Administering Microsoft SQL Server 2012 Databases 复习帖
好吧最近堕落没怎么看书,估计这个月前是考不过了,还是拖到国庆之后考试吧.想着自己复习考试顺便也写点自己的复习的概要,这样一方面的给不准备背题库的童鞋有简便的复习方法(好吧不被题库的同学和我一样看MSD ...
- Microsoft® SQL Server® 2012 功能包
Microsoft® SQL Server® 2012 功能包 http://www.microsoft.com/zh-cn/download/details.aspx?id=29065 Micros ...
- sql server 安装出现需要sqlncli.msi文件,错误为 microsoft sql server 2012 native client
在安装sql server 2017 时出现 弹框标题为 microsoft sql server 2012 native client 内容为需要sqlncli.msi文件 去本地目录找本身的那 ...
随机推荐
- spring jpa exists
Subquery<A> subquery = criteriaQuery.subquery(A.class);Root<A> root1 = subquery.from(A.c ...
- 带图标的input
<style> .text{ border:solid 2px #ccc; width:400px; height:40px; background:url(http://d.lanren ...
- 84直方图最大矩形覆盖 · Largest Rectangle in Histogram
[抄题]: Given n non-negative integers representing the histogram's bar height where the width of each ...
- 4sum, 4sum closest
4sum [抄题]: [思维问题]: 以为很复杂,其实是“排序+双指针”的最高阶模板 [一句话思路]: [输入量特别大怎么办]: [画图]: [一刷]: 先排序! if (i > 0 & ...
- 苹果 重置APPID密保问题及更新开发者协议
[链接]重置AppleID密保问题 https://www.jianshu.com/p/37e7f2852eda [链接]苹果开发者计划许可协议更新:持续更新 https://www.jianshu. ...
- [leetcode]381. Insert Delete GetRandom O(1) - Duplicates allowed常数时间插入删除取随机值
Design a data structure that supports all following operations in average O(1) time. Note: Duplicate ...
- Kuberentes-入门
一.kubernetes架构介绍和集群规划 点击链接查看: 系统环境初始化:https://www.cnblogs.com/hwlong/p/9105742.html 二.CA证书创建和分发 点击链接 ...
- centos7下源码安装mysql5.7.16
一.下载源码包下载mysql源码包 http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.16.tar.gz 二.安装约定: 用户名:mysql 安装目录 ...
- jquery获取radio单选框的值
1.获取原有单选框的值 var value=$("input[name='is_setting']:checked").val(); 2.获取重选后的单选框的值 <tr> ...
- ipconfig 查看本机IP地址
打开cmd 窗口 然后输入ipconfig 就会为你展示你想要的IP地址了...