存档

文章标签 ‘恢复’,文章数:10

专注于Sybase ASE以及Sybase ASA数据库文件的恢复。专注于各种勒索病毒加密数据库的修复。

联系手机: 13811580958(微信),QQ: 289965371!
郑重承诺,修不好不收费。客户验证数据的正确性后,再付款。

一、Sybase ASE数据库恢复工具READSYBDEVICE主要功能有:

  1.  被勒索病毒加密数据文件及备份文件情况下的恢复; 
  2.  系统崩溃只剩下数据文件的情况下的恢复,甚至数据库文件不存在而只有损坏的备份文件情况下的恢复;
  3.   因断电、硬盘坏道等造成数据库文件损坏情况下的恢复;
  4.   delete数据恢复、误update数据恢复、误删除表(drop)恢复、误truncate表恢复  等;
  5.   各种sybase内部系统表损坏、索引错误的修复;
  6.   master数据库损坏而无法正常运行情况下的恢复;
  7.   sybase数据库被标记为可疑,不可用等情况的恢复;
  8.   sybase数据库中数据文件内部出现坏块情况下的恢复;
  9.   sybase数据库无数据文件但有日志文件的情况下的恢复;
  10.  sybase数据库只有数据文件无任何日志文件的情况下的恢复;
  11.  sybase数据文件被误删除情况下的碎片提取恢复;
  12.  磁盘阵列上的sybase数据库被误格式化情况下的数据库恢复;
  13.  数据库sysobjects等系统表损坏无法正常应用情况下的恢复;
  14.  sybase数据库还原数据库出现失败情况下的恢复;
  15.  sybase数据库只剩下损坏的备份文件情况下的恢复。

 

二、Sybase ASE数据库恢复工具READSYBDEVICE支持的版本:
Sybase ASE 11.0.x,11.5.x,11.9.2,12.0.x,12.5.x,15.0.x,15.5.x,15.7.x,16.0.x

 

三、Sybase SQL Anywhere (ASA)数据库恢复工具ReadASADB功能:
       能够从损坏的SQL Anywhere数据文件(.db)和UltraLite数据文件(.udb)上提取数据的非常规恢复工具

  1.      适用于所有的SQL Anywhere版本    包括:5.x,6.x,7.x,8.x,9.x,10.x,11.x,12.x,16.x
  2.     适用于所有的UltraLite版本
  3.     能够恢复出来表结构和数据
  4.     能够恢复自定义数据类型
  5.     能够恢复存储过程等对象的语法
  6.     能够导出到目标数据库
  7.     能够导出到SQL文件并生成导入脚本
  8.     支持多种字符集  包括:cp850、cp936、gb18030、utf8等
  9.     能够恢复未加密或者简单加密类型的数据
  10.    简单易用
  11.    限制:不支持AES加密的数据文件

四、Sybase SQL Anywhere (ASA)数据库恢复工具ReadASADB适用场景:

各种误操作:

  1.     误截断表(truncate table)
  2.     误删除表(drop table)
  3.     错误的where条件误删数据
  4.     误删除db或log文件
  5.     误删除表中的字段

专注于SQL Server数据库的恢复。专注于各种勒索病毒加密数据库的修复。

联系手机:(微信),QQ:
郑重承诺,修不好不收费。客户验证数据的正确性后,再付款。

SQLRescue可用于从损坏的 MS SQL Server 数据库数据文件(*.mdf  *.ndf 文件)中恢复数据。它可以保存关键数据,避免其丢失。

一、SQLRescue主要功能有:

  1. 系统崩溃只剩下数据文件的情况下的恢复,即无日志文件或者日志文件损坏情况下的恢复;

  2. 断电导致数据库文件损坏情况下的恢复;

  3. 硬盘坏道造成数据库损坏情况下的恢复;

  4. 数据文件内部存在坏页情况下的恢复;

  5. 企业管理器误删除数据表记录,管理软件误删除数据表记录的恢复;

  6. 并闩锁错误、格式化、误删除后导致软件不能使用的情况;

  7. 无法读取并闩锁页sysindexes失败情况下的修复;

  8. 数据文件被误删除情况下的碎片提取恢复;

  9. 系统表损坏、索引错误、误删除数据库表、删除记录的数据找回;

  10. master数据库损坏而无法正常运行情况下的恢复;

  11. 数据文件无法附加情况下的数据恢复;

  12. 数据库被标记为可疑,质疑,不可用等情况的恢复;

  13. 数据库sysobjects等系统表损坏情况下的恢复;

  14. 数据被误(drop、delete、truncate)删除表数据的恢复,误update后的数据恢复等;

  15. 还原时报一致性错误,错误823等情况下的数据恢复,各种错误提示的数据库文件修复;

  16. 数据库被误格式化等情况下的数据库恢复;

  17. 日志收缩造成数据库损坏情况下的恢复;

  18. 仅剩损坏的备份文件情况下的恢复。


二、SQLRescue主要技术特点:

只要SQL Server数据库的数据文件存在,我们就有办法帮您从数据文件中找回重要数据。

  1. 从数据文件中直接恢复数据

  2. 不能附加时直接恢复数据并生成新的数据库

  3. 系统表损坏的数据库修复

  4. 快速修复SQL 823错误、连接中断错误

三、SQLRescue支持的版本:

Microsoft SQL Server 6.5, 7.0, 2000, 2005, 2008, 2008R2, 2012, 2014, 2016, 2017。

专注于Sybase Adaptive Server Enterprise(ASE)以及 Sybase SQL Anywhere(ASA)数据库文件的恢复。

联系手机:(微信),QQ:
郑重承诺,修不好不收费。客户验证数据的正确性后,再付款。

Sybase SQL Anywhere(ASA)数据库非常规恢复工具

ReadASADB---一个不依赖数据库管理系统、直接从db文件上提取数据的业内领先的恢复工具!

一、SQL Anywhere、UltraLite介绍
SQL Anywhere  一个免维护、易管理的移动数据库。

SQL Anywhere 提供了企业级的功能,包括完全的事务处理、无与伦比的可靠性和功能,包括参照完整性、存储过程、触发器、行级锁、自动的任务安排和自动恢复等功能

  • 易于使用,易于管理 ,降低最终用户的日常管理费用!
  • 多平台支持
  • 资源效率高
  • 配套的定时数据同步工具Mobilink

UltraLite 是一种用于小型、移动和嵌入式设备的、具有同步功能的关系数据库

  • 稳健的数据管理
  • 强大的同步功能
  • 直接简明的开发
  • 多平台可用性

您可以开发和部署用于 Windows CE、 Palm OS 和基于 Java 的设备的 UltraLite 数据库应用程序!

二、ReadASADB功能
能够从损坏的SQL Anywhere数据文件(.db)和UltraLite数据文件(.udb)上提取数据的非常规恢复工具

  1. 适用于所有的SQL Anywhere版本    包括:5.x,6.x,7.x,8.x,9.x,10.x,11.x,12.x,16.x
  2. 适用于所有的UltraLite版本
  3. 能够恢复出来表结构和数据
  4. 能够恢复自定义数据类型
  5. 能够恢复存储过程等对象的语法
  6. 能够导出到目标数据库
  7. 能够导出到SQL文件并生成导入脚本
  8. 支持多种字符集  包括:cp850、cp936、gb18030、utf8等
  9. 能够恢复未加密或者简单加密类型的数据
  10. 简单易用
  11. 限制:不支持AES加密的数据文件

在用SQL Server 2005进行一项测试:如何一次删除所有用户数据库时,没注意到当前数据库是master,结果,把这里的一些表都给删除了,从而,数据库引擎可以正常使 用,但如果右击任一数据库,都会出现查找master里的一个表的操作(对象名 master.dbo.spt_values' 无效。 (Microsoft SQL Server,错误: 208)),而这个表被我删除了,所以就运行不成功了,想压缩数据库还行用SQL语句,很麻烦。

在网上找的大都是SQL Server 2000 master数据库重建帖子,关于SQL Server 2005 重建master的帖子基本上都是只有提问的,没有回答的,于是在国外网站上搜索了下,发现一个,但也很不好使,后来顺着他的关键词:rebuid sql Server 2005 master找到了微软的网站,没想到微软早就解决这问题了,按他说的做了一遍,OK,成功,在写这文章时又把他的MSDN地址改了下,看看有没有中文版 的,没想到还真有,可怜的搜索引擎呀,这么好的东西我怎么在baidu及google里都找不到呢。

虽然问题是解决了,不过还有一个问题,就是:重建后相当于数据库重新安装了一次,所有的登录用户,数据库都没了(听说数据都在master里,master被重建了里面的数据库相关信息当然没了。数据库文件还在,没被删除。),所以重建或者说修复好后,你还得把每个数据库都附加进来,并建相关用户。

微软官方解决方法:
start /wait <CD or DVD Drive>\setup.exe /qn INSTANCENAME=<InstanceName> REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=<NewStrongPassword>
举例:
start /wait L:\Servers\setup.exe /qn INSTANCENAME="MSSQLSERVER" REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=www_yongfa365_com

如果重装、重建或修复其它服务,详情参见:
英文版:http://msdn.microsoft.com/en-us/library/ms144259(SQL.90).aspx
中文版:http://msdn.microsoft.com/zh-cn/library/ms144259(SQL.90).aspx
引用本页地址:http://www.yongfa365.com/item/SQL-Server-2005-Rebuild-System-Databases.html

在测试load tran with until_time 的时候出现了错误。

先执行:dump tran andkylee to "d:\andkylee_tran2.dmp" with no_truncate 然后,进行数据库的恢复。

先进行全库恢复,接着进行下面的日志恢复,并恢复到指定的时间点。

但是报下面的错误:

1> load tran andkylee from "d:\andkylee_tran2.dmp" with until_time='Jun 28 2010 5:24:10 PM'
2> go
Backup Server session id is:  111.  Use this value when executing the
'sp_volchanged' system stored procedure after fulfilling any volume change
request from the Backup Server.
Backup Server: 6.28.1.1: Dumpfile name 'ndkylee101790F554' section number 1
mounted on disk file 'd:\andkylee_tran2.dmp'
Backup Server: 4.58.1.1: Database andkylee: 75548 kilobytes LOADed.
Msg 623, Level 21, State 1:
Server 'TEST', Line 1:
Adaptive Server failed to retrieve a row via its RID in database 'andkylee'
because the target page is not a data page. Rid pageid = 0x16381; row num = 0x0.

Page pointer = 0x240FA000, pageno = 0, status = 0x300, ptnid = 99, indexid = 0,
level = 0.

用dbcc page查看pageid = 0x16381 的页面内容,发现此页面为日志页。页面号0x16381为十六进制,转化成十进制为:91009

今天试验了一下不同ASE版本跨平台远程备份数据库的操作。

环境:

源数据端:solaris 10 SPARC 64bit,ASE 12.5.4,称为:server1

目的数据端:windows xp x86,ASE15.0.3,称为:server2

 

任务:

测试将源数据端solaris上的ASE数据库服务器里面的andkylee库远程备份到目的windows-xp机子上。


第一步:在server1的interfaces文件中添加远程服务器条目

在server2的连接接口配置文件%SYBASE%\ini\sql.ini中,备份服务器的名称为:TEST_BS.

在server1的 /db/sybase/ase1254/interfaces中添加:

TEST_BS
        master tcp ether 192.168.2.173 5001
        query tcp ether 192.168.2.173 5001

 

注意:添加到server1的远程备份服务器名称务必和server2中的备份服务器名称保持一致。

 

第二步:连接上server1的ASE服务器,添加远程备份服务器的条目

isql -Usa -P -Sase1254

sp_addserver TEST_BS

这一步不是必须的!

第三步:在server1的ASE中执行远程备份命令

dump database andkylee to "d:\andkylee_remote.dmp" at TEST_BS

可以使用stripe on进行远程备份文件分片,最大分片数为32。

如果想压缩远程备份文件的话,必须使用with compression=[0-9]选项;兼容选项compress::只支持本地备份。

最后检查,在远程服务器server2上D盘发现有远程备份生成的文件:andkylee_remote.dmp。 远程备份数据库操作完成!

 

————————————————————————————————-
—- 本文为andkylee个人原创,请在尊重作者劳动成果的前提下进行转载;
—- 转载务必注明原始出处 : http://www.dbainfo.net
—- 关键字:ase cross-platform dump load solaris windows 跨平台 远程 备份恢复
————————————————————————————————-

演示一次sybase ASE15.0.3跨平台备份恢复的过程。

源数据库版本为:

1> select @@version
2> go
 -----------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
----------------------------------------------------------------------------
 Adaptive Server Enterprise/15.0.3/EBF 16738 ESD#2/P/NT (IX86)/Windows 2003/ase1
         503/2708/32-bit/OPT/Mon Jul 27 20:19:56 2009
 

目的数据库版本为:

1> select @@version
2> go
 -----------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
----------------------------------------------------------------------------
 Adaptive Server Enterprise/15.0.3/EBF 16548 ESD#1/P/Sun_svr4/OS 5.8/ase1503/268
         0/64-bit/FBO/Thu Mar  5 09:39:28 2009
 

跨平台恢复的详细过程如下:

(1). 检查欲备份的数据库testdb的完整性,利用checkdb和checkalloc

1> dbcc traceon(3604)
2> go
1> dbcc checkdb(testdb)
2> go
1> dbcc checkalloc(testdb)
2> go

(2). 将数据库testdb设置为单用户模式

1> use master
2> go
1> sp_dboption testdb,"single",true
2> go

(3). 清空testdb的日志,并设置检查点

1> dump tran testdb with no_log
2> go
1> checkpoint
2> go

(4). 将属于数据库testdb的脏页写到磁盘上面去,并发出检查点命令。 在发出sp_flushstats系统过程后要等待一段时间,保证数据库有足够的时间把页面信息刷新到磁盘上。

1> sp_flushstats
2> go
1> checkpoint
2> go

(5). 备份数据库testdb

1> dump database testdb to "d:\testdb-20100409.dmp"
2> go

(6). 利用ftp服务器将备份出来的testdb-20100409.dmp文件拷贝到solaris服务器上。

(7).用isql连接到目的数据库服务器上面,执行恢复命令

1> load database testdb from "/app/sybdata/testdb-20100409.dmp"
2> go

(8). 将目的数据库服务器中的testdb调整成在线。

1> online database testdb
2> go

(9). 进入testdb,执行sp_post_xpload系统存储过程来重建用户表的索引。

1> use testdb
2> go 
1> sp_post_xpload
2> go 

至此,跨平台备份恢复过程完成!

补充:以下为load database过程显示的所有的反馈信息。

1> sp_helpdb  testdb
2> go
 name   db_size       owner dbid created      status
 ------ ------------- ----- ---- ------------ -------------
 testdb     1300.0 MB sa       4 Apr 09, 2010 don't recover
(1 row affected)
 device_fragments               size          usage
         created                   free kbytes
 ------------------------------ ------------- --------------------
         ------------------------- ----------------
 testdb_dat                         1000.0 MB data only
         Apr  9 2010  7:05PM                1016720
 testdb_log                          300.0 MB log only
         Apr  9 2010  7:05PM       not applicable
Msg 921, Level 14, State 2:
Server 'SYB_NFJD_TEST', Procedure 'sp_helpdb', Line 588:
Database 'testdb' has not been recovered yet - please wait and try again.
 --------------------------------------------------------------
 log only free kbytes = 0
(return status = 0)
1> load database testdb from "/app/sybdata/testdb-20100409.dmp"
2> go
Backup Server session id is:  19.  Use this value when executing the
'sp_volchanged' system stored procedure after fulfilling any volume change
request from the Backup Server.
Backup Server: 6.28.1.1: Dumpfile name 'scourt5100990F2E6' section number 1
mounted on disk file '/app/sybdata/testdb-20100409.dmp'
Backup Server: 4.188.1.1: Database testdb: 23940 kilobytes (1%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 58630 kilobytes (4%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 93320 kilobytes (7%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 127118 kilobytes (9%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 151180 kilobytes (11%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 172814 kilobytes (12%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 194448 kilobytes (14%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 216082 kilobytes (16%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 237716 kilobytes (17%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 259350 kilobytes (19%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 280984 kilobytes (21%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 302618 kilobytes (22%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 324252 kilobytes (24%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 345886 kilobytes (25%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 367520 kilobytes (27%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 389154 kilobytes (29%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 409636 kilobytes (30%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 409646 kilobytes (100%) LOADED.
Backup Server: 3.42.1.1: LOAD is complete (database testdb).
Started cross-platform conversion for database testdb.
Started cross-platform conversion for system objects.
Cross-platform conversion for database testdb: 672 pages completed.
Completed cross-platform conversion for system objects.
Started cross-platform conversion for user objects.
Cross-platform conversion for database testdb: 10073 pages completed.
Cross-platform conversion for database testdb: 20273 pages completed.
Cross-platform conversion for database testdb: 30458 pages completed.
Cross-platform conversion for database testdb: 40604 pages completed.
Cross-platform conversion for database testdb: 50796 pages completed.
Cross-platform conversion for database testdb: 60924 pages completed.
Cross-platform conversion for database testdb: 71117 pages completed.
Cross-platform conversion for database testdb: 81317 pages completed.
Cross-platform conversion for database testdb: 91517 pages completed.
Cross-platform conversion for database testdb: 101717 pages completed.
Completed cross-platform conversion for user objects.
Started cross-platform conversion for log records.
Cross-platform conversion for database testdb: 11119 pages completed.
Completed cross-platform conversion for log records.
Completed cross-platform conversion for database testdb.
Caution:  You have set up this database to include space on disk 5 for both data
and the transaction log.  This can make recovery impossible if that disk fails.
All dumped pages have been loaded. ASE is now clearing pages above page 102400,
which were not present in the database just loaded.
ASE has finished clearing database pages.
Started estimating recovery log boundaries for database 'testdb'.
Database 'testdb', checkpoint=(79128, 0), first=(79128, 0), last=(79128, 0).
Completed estimating recovery log boundaries for database 'testdb'.
Started ANALYSIS pass for database 'testdb'.
Completed ANALYSIS pass for database 'testdb'.
Started REDO pass for database 'testdb'. The total number of log records to
process is 1.
Completed REDO pass for database 'testdb'.
Use the ONLINE DATABASE command to bring this database online; ASE will not
bring it online automatically.
1> online database testdb
2> go
Started estimating recovery log boundaries for database 'testdb'.
Database 'testdb', checkpoint=(79128, 0), first=(79128, 0), last=(79128, 0).
Completed estimating recovery log boundaries for database 'testdb'.
Started ANALYSIS pass for database 'testdb'.
Completed ANALYSIS pass for database 'testdb'.
Recovery of database 'testdb' will undo incomplete nested top actions.
Checking table 'sysstatistics' (object ID 24): Logical page size is 4096 bytes.
Checking partition 'sysstatistics_24' (partition ID 24) of table
'sysstatistics'. The logical page size of this table is 4096 bytes.
The indexes for 'sysstatistics' are already correct.  They will not be rebuilt.
(1 row affected)
(1 row affected)
(485 rows affected)
(1 row affected)
(57 rows affected)
(1 row affected)
(16 rows affected)
(1 row affected)
(3 rows affected)
(1 row affected)
(0 rows affected)
(915 rows affected)
Checking table 'sysobjects' (object ID 1): Logical page size is 4096 bytes.
Checking partition 'sysobjects_1' (partition ID 1) of table 'sysobjects'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysobjects' are already correct.  They will not be rebuilt.
Checking table 'sysindexes' (object ID 2): Logical page size is 4096 bytes.
Checking partition 'sysindexes_2' (partition ID 2) of table 'sysindexes'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysindexes' are already correct.  They will not be rebuilt.
Checking table 'syscolumns' (object ID 3): Logical page size is 4096 bytes.
Checking partition 'syscolumns_3' (partition ID 3) of table 'syscolumns'. The
logical page size of this table is 4096 bytes.
The indexes for 'syscolumns' are already correct.  They will not be rebuilt.
Checking table 'systypes' (object ID 4): Logical page size is 4096 bytes.
Checking partition 'systypes_4' (partition ID 4) of table 'systypes'. The
logical page size of this table is 4096 bytes.
The indexes for 'systypes' are already correct.  They will not be rebuilt.
Checking table 'sysprocedures' (object ID 5): Logical page size is 4096 bytes.
Checking partition 'sysprocedures_5' (partition ID 5) of table 'sysprocedures'.
The logical page size of this table is 4096 bytes.
The indexes for 'sysprocedures' are already correct.  They will not be rebuilt.
Checking table 'syscomments' (object ID 6): Logical page size is 4096 bytes.
Checking partition 'syscomments_6' (partition ID 6) of table 'syscomments'. The
logical page size of this table is 4096 bytes.
The indexes for 'syscomments' are already correct.  They will not be rebuilt.
Checking table 'syssegments' (object ID 7): Logical page size is 4096 bytes.
Checking partition 'syssegments_7' (partition ID 7) of table 'syssegments'. The
logical page size of this table is 4096 bytes.
The table 'syssegments' has no indexes.
Checking table 'syslogs' (object ID 8): Logical page size is 4096 bytes.
Checking partition 'syslogs_8' (partition ID 8) of table 'syslogs'. The logical
page size of this table is 4096 bytes.
*** NOTICE: Space used on the log segment is 101 pages (0.39 MB), 0.39%.
*** NOTICE: Space reserved on the log segment is 0 pages (0.00 MB), 0.00%.
*** NOTICE: Space free on the log segment is 25499 pages (99.61 MB), 99.61%.
The table 'syslogs' has no indexes.
Checking table 'sysprotects' (object ID 9): Logical page size is 4096 bytes.
Checking partition 'sysprotects_9' (partition ID 9) of table 'sysprotects'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysprotects' are already correct.  They will not be rebuilt.
Checking table 'sysusers' (object ID 10): Logical page size is 4096 bytes.
Checking partition 'sysusers_10' (partition ID 10) of table 'sysusers'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysusers' are already correct.  They will not be rebuilt.
Checking table 'sysalternates' (object ID 11): Logical page size is 4096 bytes.
Checking partition 'sysalternates_11' (partition ID 11) of table
'sysalternates'. The logical page size of this table is 4096 bytes.
The indexes for 'sysalternates' are already correct.  They will not be rebuilt.
Checking table 'sysdepends' (object ID 12): Logical page size is 4096 bytes.
Checking partition 'sysdepends_12' (partition ID 12) of table 'sysdepends'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysdepends' are already correct.  They will not be rebuilt.
Checking table 'syskeys' (object ID 13): Logical page size is 4096 bytes.
Checking partition 'syskeys_13' (partition ID 13) of table 'syskeys'. The
logical page size of this table is 4096 bytes.
The indexes for 'syskeys' are already correct.  They will not be rebuilt.
Checking table 'sysgams' (object ID 14): Logical page size is 4096 bytes.
The total number of data pages in this table is 8.
The indexes for 'sysgams' are already correct.  They will not be rebuilt.
Checking table 'sysusermessages' (object ID 15): Logical page size is 4096
bytes.
Checking partition 'csysusermessages_15' (partition ID 15) of table
'sysusermessages'. The logical page size of this table is 4096 bytes.
The indexes for 'sysusermessages' are already correct.  They will not be
rebuilt.
Checking table 'sysreferences' (object ID 16): Logical page size is 4096 bytes.
Checking partition 'sysreferences_16' (partition ID 16) of table
'sysreferences'. The logical page size of this table is 4096 bytes.
The indexes for 'sysreferences' are already correct.  They will not be rebuilt.
Checking table 'sysconstraints' (object ID 17): Logical page size is 4096
bytes.
Checking partition 'sysconstraints_17' (partition ID 17) of table
'sysconstraints'. The logical page size of this table is 4096 bytes.
The indexes for 'sysconstraints' are already correct.  They will not be
rebuilt.
Checking table 'systhresholds' (object ID 18): Logical page size is 4096 bytes.
Checking partition 'systhresholds_18' (partition ID 18) of table
'systhresholds'. The logical page size of this table is 4096 bytes.
The table 'systhresholds' has no indexes.
Checking table 'sysroles' (object ID 19): Logical page size is 4096 bytes.
Checking partition 'sysroles_19' (partition ID 19) of table 'sysroles'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysroles' are already correct.  They will not be rebuilt.
Checking table 'sysattributes' (object ID 21): Logical page size is 4096 bytes.
Checking partition 'sysattributes_21' (partition ID 21) of table
'sysattributes'. The logical page size of this table is 4096 bytes.
The indexes for 'sysattributes' are already correct.  They will not be rebuilt.
Checking table 'sysslices' (object ID 22): Logical page size is 4096 bytes.
Checking partition 'csysslices_22' (partition ID 22) of table 'sysslices'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysslices' are already correct.  They will not be rebuilt.
Checking table 'systabstats' (object ID 23): Logical page size is 4096 bytes.
Checking partition 'systabstats_23' (partition ID 23) of table 'systabstats'.
The logical page size of this table is 4096 bytes.
The indexes for 'systabstats' are already correct.  They will not be rebuilt.
Checking table 'sysstatistics' (object ID 24): Logical page size is 4096 bytes.
Checking partition 'sysstatistics_24' (partition ID 24) of table
'sysstatistics'. The logical page size of this table is 4096 bytes.
The indexes for 'sysstatistics' are already correct.  They will not be rebuilt.
Checking table 'sysxtypes' (object ID 25): Logical page size is 4096 bytes.
Checking partition 'sysxtypes_25' (partition ID 25) of table 'sysxtypes'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysxtypes' are already correct.  They will not be rebuilt.
Checking table 'sysjars' (object ID 26): Logical page size is 4096 bytes.
Checking partition 'sysjars_26' (partition ID 26) of table 'sysjars'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysjars' are already correct.  They will not be rebuilt.
Checking table 'sysqueryplans' (object ID 27): Logical page size is 4096 bytes.
Checking partition 'sysqueryplans_27' (partition ID 27) of table
'sysqueryplans'. The logical page size of this table is 4096 bytes.
The indexes for 'sysqueryplans' are already correct.  They will not be rebuilt.
Checking table 'syspartitions' (object ID 28): Logical page size is 4096 bytes.
Checking partition 'syspartitions_28' (partition ID 28) of table
'syspartitions'. The logical page size of this table is 4096 bytes.
The indexes for 'syspartitions' are already correct.  They will not be rebuilt.
Checking table 'syspartitionkeys' (object ID 29): Logical page size is 4096
bytes.
Checking partition 'syspartitionkeys_29' (partition ID 29) of table
'syspartitionkeys'. The logical page size of this table is 4096 bytes.
The indexes for 'syspartitionkeys' are already correct.  They will not be
rebuilt.
Checking table 'sysencryptkeys' (object ID 98): Logical page size is 4096
bytes.
Checking partition 'sysencryptkeys_98' (partition ID 98) of table
'sysencryptkeys'. The logical page size of this table is 4096 bytes.
Msg 9989, Level 16, State 1:
Server 'SYB_NFJD_TEST', Line 1:
The number of deleted rows (65535) in the page header of DOL datapage 633,
partition ID 98 is incorrect. This value cannot be negative.
One or more indexes are corrupt.  They will be rebuilt.
There are 0.000000 rows in 1 pages for object 'sysencryptkeys'.
Clustered index 'csysencryptkeys' (ID = 2) successfully restored for object
'sysencryptkeys' in 'testdb' database.
(50 rows affected)
(0 rows affected)
(0 rows affected)
WARNING: One or more indexes on user tables may have been marked as 'suspect'
making these indexes unusable. Use the sp_post_xpload stored procedure to check
and rebuild these indexes.
Database 'testdb' is now online.
1> use testdb
2> go
1> sp_indsuspect
2> go
Suspect indexes in database testdb:
 Own.Tab.Ind (Obj_ID, Ind_ID)
 -----------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
---------------------------------------------------------------
 testuser.S_OFFICE.S_OFFICE_IND1_x (395145422, 2)
 dbo.office.unique_indx_officeid (439669583, 2)
 testuser.S_USER.S_USER_IND1_x (699146505, 2)
 testuser.S_USER.S_USER_IND2_x (699146505, 3)
 dbo.devices.abc (704002508, 2)
 dbo.databases.abc (736002622, 2)
 dbo.usages.abcd (768002736, 2)
 testuser.LAN_PAGENO_RANGE.aaaaa (788194827, 2)
 dbo.pbcattbl.pbcattbl_idx (800002850, 2)
 dbo.pbcatcol.pbcatcol_idx (848003021, 2)
 dbo.pbcatfmt.pbcatfmt_idx (896003192, 2)
 testuser.LAN_SYS_syscolumns.LAN_SYS_syscolumns (1012195625, 2)
 testuser.WF_EFORM.PK_WF_EFORM_x (1019147645, 2)
 testuser.LAN_SYS_sysobjects.LAN_SYS_sysobjects (1060195796, 2)
 testuser.ARCHIVES.PK_ARCHIVES_x (1084527866, 2)
 
 /**************************************************
 
 省略一部分表的索引............
 **************************************************/
 
 testuser.LAN_SYS_sysindexes.LAN_SYS_sysindexes (1108195967, 2)
 dbo.PartitionTestTable.idx_PartitionTestTable_id (1223672376, 2)
 dbo.PartitionTestTable.idx_PartitionTestTable_name (1223672376, 3)
 dbo.test3.idx_test3_id (1351672832, 2)
 dbo.test4.idx_test4_id (1399673003, 2)
 testuser.LAN_sysdevices.namesss (1828198532, 2)
 testuser.LAN_sysusages.pk_lan_sysusages (1892198760, 2)
 testuser.LAN_sysdatabases.pk_lan_sysdatabases (1940198931, 2)
 dbo.lzftest.idx_lzftest_id (1975675055, 2)
 testuser.Usertype_relation.Idx_Usertype_relation (2020199216, 2)
Msg 17870, Level 16, State 1:
Server 'SYB_NFJD_TEST', Procedure 'sp_autoformat', Line 267:
Table '#temp1' does not exist in database 'tempdb'.
(return status = 0)
1>
2> sp_post_xpload
3> go
sp_post_xpload: Processing table AIX_PAGENOS (1/419)
sp_post_xpload: Processing table AIX_PAGENO_RANGE (2/419)
sp_post_xpload: Processing table AIX_SYS_syscolumns (3/419)
sp_post_xpload: Processing table AIX_SYS_sysindexes (4/419)
sp_post_xpload: Processing table AIX_SYS_sysobjects (5/419)
sp_post_xpload: Processing table AJDACG (6/419)
sp_post_xpload: Processing table AJDAJY (7/419)
sp_post_xpload: Processing table AJGDB (8/419)
Checking table 'AJGDB' (object ID 796526840): Logical page size is 4096 bytes.
Checking partition 'AJGDB_796526840' (partition ID 796526840) of table 'AJGDB'.
The logical page size of this table is 4096 bytes.
One or more indexes are corrupt.  They will be rebuilt.
There are 127204.000000 rows in 10481 pages for object 'AJGDB'.
Non-clustered index 'PK_AJGDB_x' (ID = 2) successfully restored for object
'AJGDB' in 'testdb' database.
There are 127204.000000 rows in 10481 pages for object 'AJGDB'.
Non-clustered index 'INDX_AJGDB_SN_x' (ID = 3) successfully restored for object
'AJGDB' in 'testdb' database.
There are 127204.000000 rows in 10481 pages for object 'AJGDB'.
Non-clustered index 'PK_AJGDB_SN_x' (ID = 4) successfully restored for object
'AJGDB' in 'testdb' database.
sp_post_xpload: Processing table ARCHIVES (15/419)
Checking table 'ARCHIVES' (object ID 1084527866): Logical page size is 4096
bytes.
Checking partition 'ARCHIVES_1084527866' (partition ID 1084527866) of table
'ARCHIVES'. The logical page size of this table is 4096 bytes.
The indexes for 'ARCHIVES' are already correct.  They will not be rebuilt.
sp_post_xpload: Processing table CASES_SXGG (118/419)
sp_post_xpload: Processing table CASES_TB (119/419)
sp_post_xpload: Processing table CASES_TJGL (120/419)
sp_post_xpload: Processing table CASES_WS (121/419)
sp_post_xpload: Processing table CASES_XS1 (122/419)
sp_post_xpload: Processing table CASES_XS2 (123/419)
sp_post_xpload: Processing table CASES_XSBHR (124/419)
sp_post_xpload: Processing table CASES_XSFDMSSSZX (125/419)
sp_post_xpload: Processing table CASES_XZ1 (126/419)
sp_post_xpload: Processing table CASES_XZBG (127/419)
sp_post_xpload: Processing table CASES_YS (128/419)
sp_post_xpload: Processing table CASES_ZBGZB (129/419)
sp_post_xpload: Processing table CASES_ZHENGR (130/419)
sp_post_xpload: Processing table CASES_ZHESJG (131/419)
sp_post_xpload: Processing table CASES_ZHESJGYJ (132/419)
sp_post_xpload: Processing table CASES_ZJ (133/419)
sp_post_xpload: Processing table CASES_ZJLT (134/419)
sp_post_xpload: Processing table CASES_ZX1 (135/419)
Checking table 'DATACODE' (object ID 1189576245): Logical page size is 4096
bytes.
Checking partition 'DATACODE_1189576245' (partition ID 1189576245) of table
'DATACODE'. The logical page size of this table is 4096 bytes.
The indexes for 'DATACODE' are already correct.  They will not be rebuilt.
sp_post_xpload: Processing table DB_10 (146/419)
sp_post_xpload: Processing table DB_11 (147/419)
sp_post_xpload: Processing table DB_5 (148/419)
sp_post_xpload: Processing table DB_6 (149/419)
sp_post_xpload: Processing table DB_7 (150/419)
sp_post_xpload: Processing table DB_8 (151/419)
sp_post_xpload: Processing table DB_9 (152/419)
sp_post_xpload: Processing table DGKJZMX (153/419)
sp_post_xpload: Processing table DSR (154/419)
.........................
sp_post_xpload: Processing table LAN_PAGENOS (243/419)
sp_post_xpload: Processing table LAN_PAGENOS_DB10 (244/419)
sp_post_xpload: Processing table LAN_PAGENOS_DB11 (245/419)
sp_post_xpload: Processing table LAN_PAGENOS_DB5 (246/419)
sp_post_xpload: Processing table LAN_PAGENOS_DB6 (247/419)
sp_post_xpload: Processing table LAN_PAGENOS_DB7 (248/419)
sp_post_xpload: Processing table LAN_PAGENOS_DB8 (249/419)
sp_post_xpload: Processing table LAN_PAGENOS_DB9 (250/419)
sp_post_xpload: Processing table LAN_PAGENO_RANGE (251/419)
Checking table 'LAN_PAGENO_RANGE' (object ID 788194827): Logical page size is
4096 bytes.
Checking partition 'LAN_PAGENO_RANGE_788194827' (partition ID 788194827) of
table 'LAN_PAGENO_RANGE'. The logical page size of this table is 4096 bytes.
The indexes for 'LAN_PAGENO_RANGE' are already correct.  They will not be
rebuilt.
sp_post_xpload: Processing table LAN_PAGENO_RANGE2 (252/419)
sp_post_xpload: Processing table LAN_PAGENO_RANGE3 (253/419)
sp_post_xpload: Processing table LAN_SYS_syscolumns (254/419)
Checking table 'LAN_SYS_syscolumns' (object ID 1012195625): Logical page size is
4096 bytes.
Checking partition 'LAN_SYS_syscolumns_1012195625' (partition ID 1012195625) of
table 'LAN_SYS_syscolumns'. The logical page size of this table is 4096 bytes.
The indexes for 'LAN_SYS_syscolumns' are already correct.  They will not be
rebuilt.
sp_post_xpload: Processing table LAN_SYS_sysindexes (255/419)
Checking table 'LAN_SYS_sysindexes' (object ID 1108195967): Logical page size is
4096 bytes.
Checking partition 'LAN_SYS_sysindexes_1108195967' (partition ID 1108195967) of
table 'LAN_SYS_sysindexes'. The logical page size of this table is 4096 bytes.
The indexes for 'LAN_SYS_sysindexes' are already correct.  They will not be
rebuilt.
sp_post_xpload: Processing table LAN_SYS_sysobjects (256/419)
Checking table 'LAN_SYS_sysobjects' (object ID 1060195796): Logical page size is
4096 bytes.
Checking partition 'LAN_SYS_sysobjects_1060195796' (partition ID 1060195796) of
table 'LAN_SYS_sysobjects'. The logical page size of this table is 4096 bytes.
The indexes for 'LAN_SYS_sysobjects' are already correct.  They will not be
rebuilt.
sp_post_xpload: Processing table LAN_sysdatabases (257/419)
Checking table 'LAN_sysdatabases' (object ID 1940198931): Logical page size is
4096 bytes.
Checking partition 'LAN_sysdatabases_1940198931' (partition ID 1940198931) of
table 'LAN_sysdatabases'. The logical page size of this table is 4096 bytes.
The indexes for 'LAN_sysdatabases' are already correct.  They will not be
rebuilt.
sp_post_xpload: Processing table LAN_sysdevices (258/419)
Checking table 'LAN_sysdevices' (object ID 1828198532): Logical page size is
4096 bytes.
Checking partition 'LAN_sysdevices_1828198532' (partition ID 1828198532) of
table 'LAN_sysdevices'. The logical page size of this table is 4096 bytes.
The indexes for 'LAN_sysdevices' are already correct.  They will not be
rebuilt.
sp_post_xpload: Processing table LAN_sysusages (259/419)
Checking table 'LAN_sysusages' (object ID 1892198760): Logical page size is 4096
bytes.
Checking partition 'LAN_sysusages_1892198760' (partition ID 1892198760) of table
'LAN_sysusages'. The logical page size of this table is 4096 bytes.
The indexes for 'LAN_sysusages' are already correct.  They will not be rebuilt.
sp_post_xpload: Processing table PartitionTestTable (271/419)
Checking table 'PartitionTestTable' (object ID 1223672376): Logical page size is
4096 bytes.
Checking partition 'zhang' (partition ID 1239672433) of table
'PartitionTestTable'. The logical page size of this table is 4096 bytes.
Checking partition 'liu' (partition ID 1255672490) of table
'PartitionTestTable'. The logical page size of this table is 4096 bytes.
Checking partition 'wang' (partition ID 1271672547) of table
'PartitionTestTable'. The logical page size of this table is 4096 bytes.
Checking partition 'li' (partition ID 1287672604) of table 'PartitionTestTable'.
The logical page size of this table is 4096 bytes.
One or more indexes are corrupt.  They will be rebuilt.
There are 262144.000000 rows in 1082 pages for object 'PartitionTestTable'.
Non-clustered index 'idx_PartitionTestTable_id' (ID = 2) successfully restored
for object 'PartitionTestTable' in 'testdb' database.
There are 262144.000000 rows in 1082 pages for object 'PartitionTestTable'.
Non-clustered index 'idx_PartitionTestTable_name' (ID = 3) successfully restored
for object 'PartitionTestTable' in 'testdb' database.
sp_post_xpload: Processing table S_OFFICE (346/419)
Checking table 'S_OFFICE' (object ID 395145422): Logical page size is 4096
bytes.
Checking partition 'PK_S_OFFICE_x_395145422' (partition ID 395145422) of table
'S_OFFICE'. The logical page size of this table is 4096 bytes.
The indexes for 'S_OFFICE' are already correct.  They will not be rebuilt.
sp_post_xpload: Processing table Usertype_relation (364/419)
Checking table 'Usertype_relation' (object ID 2020199216): Logical page size is
4096 bytes.
Checking partition 'Usertype_relation_2020199216' (partition ID 2020199216) of
table 'Usertype_relation'. The logical page size of this table is 4096 bytes.
The indexes for 'Usertype_relation' are already correct.  They will not be
rebuilt.
sp_post_xpload: Processing table databases (395/419)
Checking table 'databases' (object ID 736002622): Logical page size is 4096
bytes.
Checking partition 'databases_736002622' (partition ID 736002622) of table
'databases'. The logical page size of this table is 4096 bytes.
The indexes for 'databases' are already correct.  They will not be rebuilt.
sp_post_xpload: Processing table devices (396/419)
Checking table 'devices' (object ID 704002508): Logical page size is 4096
bytes.
Checking partition 'devices_704002508' (partition ID 704002508) of table
'devices'. The logical page size of this table is 4096 bytes.
The indexes for 'devices' are already correct.  They will not be rebuilt.
sp_post_xpload: Processing table employee (397/419)
sp_post_xpload: Processing table employee_bak (398/419)
sp_post_xpload: Processing table kqjcb (399/419)
sp_post_xpload: Processing table lzftest (400/419)
Checking table 'lzftest' (object ID 1975675055): Logical page size is 4096
bytes.
 /**************************************************
 
 省略一部分表的索引重建过程............
 **************************************************/
Checking partition 'li' (partition ID 1991675112) of table 'lzftest'. The
logical page size of this table is 4096 bytes.
Checking partition 'liu' (partition ID 2007675169) of table 'lzftest'. The
logical page size of this table is 4096 bytes.
Checking partition 'wang' (partition ID 2023675226) of table 'lzftest'. The
logical page size of this table is 4096 bytes.
Checking partition 'zhang' (partition ID 2039675283) of table 'lzftest'. The
logical page size of this table is 4096 bytes.
Checking partition 'zhu' (partition ID 2071675397) of table 'lzftest'. The
logical page size of this table is 4096 bytes.
The indexes for 'lzftest' are already correct.  They will not be rebuilt.
sp_post_xpload: Processing table office (401/419)
Checking table 'office' (object ID 439669583): Logical page size is 4096 bytes.
Checking partition 'office_439669583' (partition ID 439669583) of table
'office'. The logical page size of this table is 4096 bytes.
The indexes for 'office' are already correct.  They will not be rebuilt.
sp_post_xpload: Processing table office_bak (402/419)
sp_post_xpload: Processing table pbcatcol (403/419)
Checking table 'pbcatcol' (object ID 848003021): Logical page size is 4096
bytes.
Checking partition 'pbcatcol_848003021' (partition ID 848003021) of table
'pbcatcol'. The logical page size of this table is 4096 bytes.
The indexes for 'pbcatcol' are already correct.  They will not be rebuilt.
sp_post_xpload: Processing table pbcatedt (404/419)
sp_post_xpload: Processing table pbcatfmt (405/419)
Checking table 'pbcatfmt' (object ID 896003192): Logical page size is 4096
bytes.
Checking partition 'pbcatfmt_896003192' (partition ID 896003192) of table
'pbcatfmt'. The logical page size of this table is 4096 bytes.
The indexes for 'pbcatfmt' are already correct.  They will not be rebuilt.
sp_post_xpload: Processing table pbcattbl (406/419)
Checking table 'pbcattbl' (object ID 800002850): Logical page size is 4096
bytes.
Checking partition 'pbcattbl_800002850' (partition ID 800002850) of table
'pbcattbl'. The logical page size of this table is 4096 bytes.
The indexes for 'pbcattbl' are already correct.  They will not be rebuilt.
sp_post_xpload: Processing table pbcatvld (407/419)
sp_post_xpload: Processing table syscolumn (408/419)
sp_post_xpload: Processing table sysobjects1 (409/419)
sp_post_xpload: Processing table temp2 (410/419)
sp_post_xpload: Processing table temptbl (411/419)
sp_post_xpload: Processing table test (412/419)
sp_post_xpload: Processing table test (413/419)
sp_post_xpload: Processing table test2 (414/419)
sp_post_xpload: Processing table test3 (415/419)
Checking table 'test3' (object ID 1351672832): Logical page size is 4096 bytes.
Checking partition 'pk_test3_id_1351672832' (partition ID 1351672832) of table
'test3'. The logical page size of this table is 4096 bytes.
The indexes for 'test3' are already correct.  They will not be rebuilt.
sp_post_xpload: Processing table test4 (416/419)
Checking table 'test4' (object ID 1399673003): Logical page size is 4096 bytes.
Checking partition 'pk_test4_id_1399673003' (partition ID 1399673003) of table
'test4'. The logical page size of this table is 4096 bytes.
The indexes for 'test4' are already correct.  They will not be rebuilt.
sp_post_xpload: Processing table testtimestamp (417/419)
sp_post_xpload: Processing table testvarchar (418/419)
sp_post_xpload: Processing table usages (419/419)
Checking table 'usages' (object ID 768002736): Logical page size is 4096 bytes.
Checking partition 'usages_768002736' (partition ID 768002736) of table
'usages'. The logical page size of this table is 4096 bytes.
The indexes for 'usages' are already correct.  They will not be rebuilt.
(return status = 0)
1> sp_indsuspect
2> go
There are no suspect indexes in database testdb.
(return status = 0)
1>
 

————————————————————————————————-
—- 本文为andkylee个人原创,请在尊重作者劳动成果的前提下进行转载;
—- 转载务必注明原始出处 : http://www.dbainfo.net
—- 关键字: ASE 15.0.3 跨平台 备份 恢复 Solaris windows
————————————————————————————————-

-- 创建测试数据库
CREATE DATABASE Db
GO

-- 对数据库进行备份
BACKUP DATABASE Db TO DISK = ' c:\db.bak ' WITH FORMAT
GO

-- 创建测试表
CREATE TABLE Db.dbo.TB_test(ID int )

-- 延时1秒钟,再进行后面的操作(这是由于SQL Server的时间精度最大为百分之三秒,不延时的话,可能会导致还原到时间点的操作失败)
WAITFOR DELAY ' 00:00:01 '
GO

-- 假设我们现在误操作删除了 Db.dbo.TB_test 这个表
DROP TABLE Db.dbo.TB_test

-- 保存删除表的时间
SELECT dt = GETDATE () INTO #
GO

-- 在删除操作后,发现不应该删除表 Db.dbo.TB_test

-- 下面演示了如何恢复这个误删除的表 Db.dbo.TB_test

-- 首先,备份事务日志(使用事务日志才能还原到指定的时间点)
BACKUP LOG Db TO DISK = ' c:\db_log.bak ' WITH FORMAT
GO

-- 接下来,我们要先还原完全备份(还原日志必须在还原完全备份的基础上进行)
RESTORE DATABASE Db FROM DISK = ' c:\db.bak ' WITH REPLACE ,NORECOVERY
GO

-- 将事务日志还原到删除操作前(这里的时间对应上面的删除时间,并比删除时间略早
DECLARE @dt datetime
SELECT @dt = DATEADD (ms, - 20 ,dt) FROM #  -- 获取比表被删除的时间略早的时间
RESTORE LOG Db FROM DISK = ' c:\db_log.bak ' WITH RECOVERY,STOPAT = @dt
GO

-- 查询一下,看表是否恢复
SELECT * FROM Db.dbo.TB_test

/* --结果:
ID
-----------

(所影响的行数为 0 行)
-- */

-- 测试成功
GO

-- 最后删除我们做的测试环境
DROP DATABASE  Db
DROP TABLE #