sql server备份恢复注意事项

来源:互联网 发布:数据资源共享平台 编辑:程序博客网 时间:2024/06/05 18:00
1。千万不要使用simple备份模式,否则有很多麻烦事儿
2。出现问题后,立即停止操作,开始进行恢复准备工作
3。日志的查看有以下几种可行的方法
   (1)使用   SELECT   *   From   ::fn_dblog(Default,Default) 
   (2)使用

    DBCC log ( {dbid|dbname}, [, type={0|1|2|3|4}] )

 

    例如:DBCC log (master,0)
    参数:
  Dbid or dbname - 任一数据库的ID或名字
  type - 输出结果的类型:
  0 - 最少信息(operation, context, transaction id)
  1 - 更多信息(plus flags, tags, row length)
  2 - 非常详细的信息(plus object name, index name,page id, slot id)
  3 - 每种操作的全部信息
  4 - 每种操作的全部信息加上该事务的16进制信息
  默认 type = 0
  要查看MSATER数据库的事务日志可以用以下命令:


    DBCC log (master)

    

    (3)使用Log Explorer for SQL Server工具




In SQL 2000 - there are 2 interfaces by which I can access the transaction
LOG:
DBCC LOG is not a very convinient API in many aspects.

::FN_DBLOG() is much more tempting but - surprisingly - it does not display
the [row data] columns - as seen below:

SELECT [Current LSN],[Transaction ID],[Object Name],[row data]
FROM ::fn_dblog(null,null) where operation='LOP_INSERT_ROWS'

0000000b:0000018b:0002    0000:000005bf    dbo.jobs (1977058079)    0x
0000000b:00000190:0002    0000:000005c1    dbo.jobs (1977058079)    0x
0000000b:00000190:0003    0000:000005c1    dbo.jobs (1977058079)    0x


There is data associated with these records - as seen below:

dbcc log(DB5,3,logrecs,'LOP_INSERT_ROWS')

0000000b:0000018b:0002    ...0000:000005bf...     dbo.jobs (1977058079)...    
0x3000080025004749040000010030004261636B75705F3139313931393139313931393139313931393139313931393139


Did I miss something in the ::FN_DBLOG() invocation - or- what...?



http://borland.mblogger.cn/jinjazz/posts/19073.aspx