- 论坛徽章:
- 0
|
Sybase混合设备上的日志分离
【1】、完整备份数据库
【2】、察看数据库
1〉use master
2〉go
1〉sp_helpdb jzzsj
2〉go
device_fragments size usage
free kbytes
------------------------------ ------------- --------------------
----------------
jzzsj_data 150.0 MB data only
10404
jzzsj_data 200.0 MB data only
183528
jzzsj_data 200.0 MB data only
204000
jzzsj_data 50.0 MB log only
not applicable
jzzsj_data 100.0 MB log only
not applicable
jzzsj_data 400.0 MB log only
not applicable
jzzsj_log 500.0 MB log only
not applicable
--------------------------------------------------------------
log only free kbytes = 1070500
(return status = 0)
【3】、在没有用户使用数据库的情况下,清除数据库日志
1〉dump tran jzzsj with truncate_only
2〉go
【4】、调整段的分配,清除在jzzsj_data上的日志
1〉use jzzsj
2〉go
1〉sp_dropsegment “logsegment“,jzzsj,jzzsj_data
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.
The last-chance threshold for database jzzsj is now 15016 pages.
Segment reference to device dropped.
WARNING: There are no longer any segments referencing device 'jzzsj_data'. This
device will no longer be used for space allocation.
(return status = 0)
【5】、将数据段和系统段扩到已释放的日志空间段上
1〉use jzzsj
2〉go
1〉checkpoint
2〉go
1〉sp_extendsegment “default“,jzzsj,jzzsj_data
2〉go
DBCC execution completed. If DBCC printed error messages, contact a user with
System Administrator (SA) role.
Segment extended.
(return status = 0)
1〉sp_extendsegment “system“,jzzsj,jzzsj_data
2〉go
DBCC execution completed. If DBCC printed error messages, contact a user with
System Administrator (SA) role.
Segment extended.
(return status = 0)
【6】、察看数据库
1〉use master
2〉go
1〉sp_helpdb jzzsj
2〉go
device_fragments size usage
free kbytes
------------------------------ ------------- --------------------
----------------
jzzsj_data 50.0 MB data only
51000
jzzsj_data 100.0 MB data only
102000
jzzsj_data 150.0 MB data only
10404
jzzsj_data 200.0 MB data only
183528
jzzsj_data 200.0 MB data only
204000
jzzsj_data 400.0 MB data only
408000
jzzsj_log 500.0 MB log only
not applicable
--------------------------------------------------------------
log only free kbytes = 1070998
(return status = 0)
1>;
更多精彩内容,请访问: http://www.yitax.com/bbs/index.asp |
|