none
求高手 如果查看sql2005日志? RRS feed

  • 问题

  •  求助
    哪个高手帮一下
    如何查看sql2005的日志?
    比如:我在某个表里面删了一条数据,它会不会记下来我删了具体的哪条记录?
    具体会记下来哪些东西?
    如果我删除了XX数据库的XX表内的第一条记录,这条记录里面内容是1,1。
    日志会不会记成在XX年XX月...删除了XX数据库的XX表内的X条记录,记录的内容是1.1。
    求助啊
    急。。。。。。。。。。。。。。。。。。。。。。。。。
    dqjk
    2009年2月5日 3:52

答案

For SQL Server 2000 and 2005, you could use Profiler and T-SQL to trace all what you want.

Hope this helps.

Dannol Liu


Mark as Answer if it helps. This posting is provided "AS IS" with no warranties, confers no rights.
2009年2月5日 7:50
  • zjcxc is right, you can't find those info even with third party log read tools if database is in simple recovery model and transaction is committed. With sql auditing, you have to enable it all the time. But sql2k5 doesn't have that feature.
    2009年2月6日 1:25
  • 全部回复

    • 试试这个,没用过

      http://download.csdn.net/down/772740/zxjay


      http://feiyun0112.cnblogs.com/
      2009年2月5日 4:18
    • 如果直接查看的话,可以通过DBCC LOG命令查看,比如:DBCC LOG('tempdb',3),显示的结果集,还是能读懂一些的,有操作的类型,操作时间,操作的对象

      不过建议你还是网络搜索"Log explorer"查看日志的专门工具来解决你的问题.


      http://blog.csdn.net/cn_sql
      2009年2月5日 4:21
      版主
    • sql server 没有这样的日志可查

      数据库的日志文件中会包含一些相关的信息, 但是否可查取决于你的数据库恢复模型及最后一次事务日志截断的时间
      另外, sql server也没有提供直观的查询事务日志文件内容的方法
      2009年2月5日 4:39
    •  Log explorer。我用过,很不错,有图型界面
      郭勇成
      2009年2月5日 7:28
    • So as my understanding, besides reading the database log, SQL Server Audit also could be what you are looking for. It will resolve your requirement.

      Understanding SQL Server Audit

      Auditing an instance of SQL Server or a SQL Server database involves tracking and logging events that occur on the system. You can use several methods of auditing for SQL Server, as described in Auditing (Database Engine). Beginning in SQL Server 2008 Enterprise, you can also set up automatic auditing by using SQL Server Audit.

      There are several levels of auditing for SQL Server, depending on government or standards requirements for your installation. SQL Server Audit provides the tools and processes you must have to enable, store, and view audits on various server and database objects.

      You can record server audit action groups per-instance, and either database audit action groups or database audit actions per database. The audit event will occur every time that the auditable action is encountered. 

      Understanding SQL Server Audit:
      http://msdn.microsoft.com/en-us/library/cc280386.aspx

    • How to: Create a Server Audit and Server Audit Specification
    • How to: Create a Server Audit and Database Audit Specification
    • How to: View an Audit Log

    For SQL Server 2000 and 2005, you could use Profiler and T-SQL to trace all what you want.

    Hope this helps.

    Dannol Liu


    Mark as Answer if it helps. This posting is provided "AS IS" with no warranties, confers no rights.
    2009年2月5日 7:50
  • zjcxc is right, you can't find those info even with third party log read tools if database is in simple recovery model and transaction is committed. With sql auditing, you have to enable it all the time. But sql2k5 doesn't have that feature.
    2009年2月6日 1:25
  •  LogExplorer4.1 For Sqlserver

    Download from:
    http://www.windbi.com/showtopic-1290.aspx
    2009年2月6日 6:51