祝愿大家身体健康!

 站点注册  找回密码
 站点注册

QQ登录

只需一步,快速开始

查看: 5329|回复: 2

[参考资料] 【转】Sybase跨平台dump/load 操作说明

[复制链接]

[参考资料] 【转】Sybase跨平台dump/load 操作说明

[复制链接]
ehxz

主题

0

回帖

57万

积分

管理员

积分
570784
贡献
在线时间
小时
2011-10-21 13:03:55 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?站点注册

×
ASE 12.5.3以上的版本可以进行跨平台dump/load 。

Dumping a database(卸载数据库)
Before you run dump database, use the following procedures to move the database to a transactional quiescent status:
在运行卸载数据库前,采用如下的处理过程将数据库置为事务静止状态:
1Verify the database runs cleanly by executing dbcc checkdb or any other dbcc command.
通过执行的dbcc checkdb或任何其他dbcc命令来校验数据库运行干净。
2To prevent concurrent updates from open transactions by other processes during the dump database, place the database in a single user mode with sp_dboption.
为了防止在卸载数据库时发生其它事务进程进行并行更新,使用sp_dboption设置数据为单用户模式。
3Flush statistics to systabstats with sp_flushstats. You must wait for at least ten seconds for the process to complete.
使用sp_flushstats将内存中存储的统计信息刷新到systabstats系统表。你必须至少等待10秒钟,等待进程完成。
4Run checkpoint against the database to flush updated pages. You must wait for at least ten seconds for the process to complete.
运行checkpoint命令将所有脏页(自上次写入以来被更新的页)写入到数据库设备。你必须至少等待10秒钟,等待进程完成。
5Run dump database.
运行卸载数据库。
Loading a database(装载数据库)
Once you load the database, Adaptive Server automatically identifies the endian type on the dump file and performs all necessary conversions during the load database and online database.
一旦你装载数据库,数据库服务器自动识别卸载文件的字节类型,在加载数据库和联机数据库时执行所有需要的转换。
Note When Adaptive Server converts the order for the index rows some may be incorrect, you must recreate the indexes after loading the database. See “sp_post_xpload” on page 27 for rebuilding indexes.
注意:当数据库服务器转变索引行的顺序时可能出现一些错误,你必须在加载数据库后使索引正确。“sp_post_xpload”重建索引。









Sybase跨平台dump/load 操作实例说明

一.执行的dbcc checkdb或任何其他dbcc命令来校验数据库运行干净
$ isql -Usa -P -SASE125
1> dbcc checkdb("tec")
2> go
Checking tec: Logical pagesize is 2048 bytes
Checking sysobjects: Logical pagesize is 2048 bytes
The total number of data pages in this table is 32.
Table has 336 data rows.
……………………………………………………….
……………………………………………………….
Checking tgh_jx: Logical pagesize is 2048 bytes
The total number of data pages in this table is 1.
Table has 25 data rows.
Checking gy_con_area: Logical pagesize is 2048 bytes
The total number of data pages in this table is 1.
Table has 17 data rows.
Checking gy_user_work_card_s1: Logical pagesize is 2048 bytes
The total number of data pages in this table is 3.
Table has 106 data rows.
DBCC execution completed. If DBCC printed error messages, contact a user with
System Administrator (SA) role.

二.使用sp_dboption设置数据为单用户模式
1> use master
2> go
1> sp_dboption tec,"single user",true
2> go
Database option 'single user' turned ON for database 'tec'.
Running CHECKPOINT on database 'tec' for option 'single user' to take effect.
(return status = 0)

三.使用sp_flushstats将内存中存储的统计信息刷新到systabstats系统表。你必须至少等待10秒钟,等待进程完成
1> use tec
2> go
1> sp_flushstats
2> go
DBCC execution completed. If DBCC printed error messages, contact a user with
System Administrator (SA) role.
DBCC execution completed. If DBCC printed error messages, contact a user with
System Administrator (SA) role.
(return status = 0)

四.运行checkpoint命令将所有脏页(自上次写入以来被更新的页)写入到数据库设备。你必须至少等待10秒钟,等待进程完成。
1> checkpoint
2> go

五.运行卸载数据库。
1> use master
2> go
1> dump database tec to "/data_backup/tec0912zm"
2> go
Backup Server session id is:   4.   Use this value when executing the
'sp_volchanged' system stored procedure after fulfilling any volume change
request from the Backup Server.
Backup Server: 4.41.1.1: Creating new disk file /data_backup/tec0912zm.
Backup Server: 6.28.1.1: Dumpfile name 'tec0825608D59 ' section number 1
mounted on disk file '/data_backup/tec0912zm'
Backup Server: 4.58.1.1: Database tec: 14644 kilobytes DUMPED.
Backup Server: 4.58.1.1: Database tec: 36278 kilobytes DUMPED.
Backup Server: 4.58.1.1: Database tec: 57912 kilobytes DUMPED.
…………………………………………………………………………….
Backup Server: 4.58.1.1: Database tec: 585206 kilobytes DUMPED.
Backup Server: 4.58.1.1: Database tec: 586744 kilobytes DUMPED.
Backup Server: 3.43.1.1: Dump phase number 1 completed.
Backup Server: 3.43.1.1: Dump phase number 2 completed.
Backup Server: 3.43.1.1: Dump phase number 3 completed.
Backup Server: 4.58.1.1: Database tec: 586752 kilobytes DUMPED.
Backup Server: 3.42.1.1: DUMP is complete (database tec).

六.取消sp_dboption单用户模式设置
1> sp_dboption tec,"single user",false
2> go
Database option 'single user' turned OFF for database 'tec'.
Running CHECKPOINT on database 'tec' for option 'single user' to take effect.
(return status = 0)

(必须在master库   更改database options
You must be in the 'master' database in order to change database options.)

七.将dump文件拷贝到windows-ASE服务器中
1.可使用ftp拷贝
Microsoft Windows [版本 5.2.3790]
(C) 版权所有 1985-2003 Microsoft Corp.
C:\Documents and Settings\Administrator>d:
D:\>ftp 172.16.23.202
Connected to 172.16.23.202.
220 Part2_inf FTP server (Version 4.2 Thu Jul 21 05:28:02 CDT 2005) ready.
User (172.16.23.202none)): root
331 Password required for root.
Password:
230-Last unsuccessful login: Tue Mar 17 14:42:53 2009 on /dev/pts/0 from 172.17.
190.180
230-Last login: Wed Mar 18 15:38:15 2009 on ftp from ::ffff:172.17.190.180
230 User root logged in.
ftp> cd data_backup
250 CWD command successful.
ftp> ls
200 PORT command successful.
150 Opening data connection for ..
lost+found
webquery090317zm.dmp
shodb0012
arv_tgh.dmp
advdb0011
exit
226 Transfer complete.
ftp: 162 bytes received in 0.00Seconds 162000.00Kbytes/sec.
ftp> binary
200 Type set to I.
ftp> get webquery090317zm.dmp "d:\data_backup\webquery090317.dmp"
200 PORT command successful.
150 Opening data connection for webquery090317zm.dmp (65941504 bytes).
226 Transfer complete.
ftp: 65941504 bytes received in 5.59Seconds 11790.01Kbytes/sec.
ftp>bye

2.也可以使用ftp工具拷贝


八.将windows-ASE服务器中建设备、建数据库
disk init   name   = 'webquery_data',
physname   = 'c:\sybase\data\webquery_data.dat',
size   = '300M',
go

disk init   name   = 'webquery_log',
physname   = 'c:\sybase\data\webquery_log.dat',
size   = '90M',
go

九.建数据库
CREATE DATABASE cpy_webquery
       ON webquery_data = '300M'
LOG ON webquery_data = '90M'
go

十.Load数据库
load database cpy_webquery from "d:\data_backup\webquery090317.dat"

十一.数据库联机
online database cpy_webqeury

十二.重编译索引
sp_post_xpload  


以下为官方文档原文:
Dump and Load a Database Across Platforms
Adaptive Server Enterprise supports both the big endian and little endian platforms.
Overview
Adaptive Server Enterprise, version 12.5.2, allowed the dump and load of databases across platforms with the same endianness architecture.
With Adaptive Server Enterprise, version 12.5.3, the dump and load databases across platforms can now be done with different endianness architecture. This means that a dump database and load database can be done from a big endian platform to a little endian platform and from a little endian platform to a big endian platform.
A big endian platform is where the most significant byte is with the lowest address. The little endian platform is where, within a given 16 or 32 bit word, bytes at the lower addresses have a lower significance.
There is no syntax change with dump or load database in version 12.5.3. Adaptive Server automatically detects the endian of the database dump file at the time of a load database, then performs the necessary conversions. Loads in an older version, such as 11.9 and 12.0, are also supported. The dump and load can be from 32 bit to 64 bit platforms, and vice versa.
Endian platforms
Platforms supported:

Big endian Solaris 32/64 IBM 32/64 SGI 32/64 HPPA 64 HPIA 64 MAC 32

Little endian Linux 1A 32 Linux 1A 64 NT Sun X86
Dump and load across platforms with the same endian architecture
When dump database and load database are done across platforms with the same endian architecture, user and system data do not require conversions. There are no limitations on operations with the dump and load of a database. Adaptive Server Enterprise supports dump and load processes for transactions and databases across platforms.
Dump and load across platforms with different endian architecture
Dumping a database
Before you run dump database, use the following procedures to move the database to a transactional quiescent status:
1Verify the database runs cleanly by executing dbcc checkdb or any other dbcc command.
2To prevent concurrent updates from open transactions by other processes during the dump database, place the database in a single user mode with sp_dboption.
3Flush statistics to systabstats with sp_flushstats. You must wait for at least ten seconds for the process to complete.
4Run checkpoint against the database to flush updated pages. You must wait for at least ten seconds for the process to complete.
5Run dump database.
Loading a database
Once you load the database, Adaptive Server automatically identifies the endian type on the dump file and performs all necessary conversions during the load database and online database.
Note When Adaptive Server converts the order for the index rows some may be incorrect, you must recreate the indexes after loading the database. See “sp_post_xpload” on page 27 for rebuilding indexes.
Restrictions
•Remote dump transaction and load transaction to or from a back up server are not supported.
•A password protected dump file cannot be loaded across platforms.
•dump transaction and load transaction is not allowed across platforms.
•If you dump database and load database for a parsed XML object, you must parse the text again after the load database is completed.
•You cannot perform the dump database and load database across platforms on Adaptive Servers version earlier than 11.9.
•Embedded data structures stored as binary, varbinary, or image columns are not done because Adaptive Server cannot translate these structures.
•When you dump and load a master database, you must recreate all logins in the syslogins because passwords are incompatible between platforms.
•Reset the password using the command line argument -psa on a master database after the load database is completed.
共享共进共赢Sharing And Win-win Results
SYBASEBBS - 免责申明1、欢迎访问“SYBASEBBS.COM”,本文内容及相关资源来源于网络,版权归版权方所有!本站原创内容版权归本站所有,请勿转载!
2、本文内容仅代表作者观点,不代表本站立场,作者自负,本站资源仅供学习研究,请勿非法使用,否则后果自负!请下载后24小时内删除!
3、本文内容,包括但不限于源码、文字、图片等,仅供参考。本站不对其安全性,正确性等作出保证。但本站会尽量审核会员发表的内容。
4、如本帖侵犯到任何版权问题,请立即告知本站 ,本站将及时删除并致以最深的歉意!客服邮箱:admin@sybasebbs.com
chenzhuo

主题

0

回帖

214

积分

注册会员

积分
214
贡献
在线时间
小时
2013-11-8 14:02:11 | 显示全部楼层
unix---> linux

unix --> win
可以吗?
共享共进共赢Sharing And Win-win Results
lwh701

主题

0

回帖

1万

积分

注册会员

积分
13955
贡献
在线时间
小时
2015-10-7 09:52:49 | 显示全部楼层
学习了,谢谢楼主提供
共享共进共赢Sharing And Win-win Results
您需要登录后才可以回帖 登录 | 站点注册

本版积分规则

免责声明:
本站所发布的一切破解补丁、注册机和注册信息及软件的解密分析文章仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To:Admin@SybaseBbs.com

QQ|Archiver|PowerBuilder(PB)BBS社区 ( 鲁ICP备2021027222号-1 )

GMT+8, 2024-4-29 05:11 , Processed in 0.035162 second(s), 8 queries , MemCached On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表