您的位置:首页 > 其它

sybase跨平台迁移数据步骤

2014-06-07 22:50 369 查看
ASE 12.5.3以上的版本可以进行跨平台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: Data base 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拷贝

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: