存档
祝大家新春快乐,心想事成!
初始化数据设备1
disk init
name='pmdb_dat1',
physname='/export/home/sybdata/HUAWEIU2000/pmdb_dat1.dat',
size='8000m'
go
初始化日志设备1
disk init
name='pmdb_log1',
physname='/export/home/sybdata/HUAWEIU2000/pmdb_log1.dat',
size='8000m'
go
初始化数据设备2
disk init
name='pmdb_dat2',
physname='/export/home/sybdata/HUAWEIU2000/pmdb_dat2.dat',
size='16000m'
go
创建数据库pmdb
create database pmdb on pmdb_dat1='8000m',pmdb_dat2='16000m' log on pmdb_log1='8000m'
go
添加job
use sybmgmtdb
go
sp_sjobcreate @name='jname=job_clear_log_of_pmdb',@option='jdesc=truncate the log of database pmdb every hour,jproperties=shared'
go
use sybmgmtdb
go
sp_sjobcmd @name='jname=job_clear_log_of_pmdb',@option='add',@text='
use pmdb
dump tran pmdb with no_log
go'
go
添加调度
use sybmgmtdb
go
sp_sjobcreate @name='sname=sche_clear_log_of_pmdb',@option='repeats=1hours,starttime=00:00,endtime=23:59'
go
添加预定作业
在为数据库配置自动扩展时,提示需要增加参数:stack size的大小。
执行下面的SQL语句,使得用户数据库pmdb的default段的阈值为:1000m
sp_dbextend 'set','threshold',pmdb,'default','1000m'
go
但是返回下面的错误:
Msg 3626, Level 17, State 4:
Server 'syb1503', Procedure 'sp_exec_SQL', Line 49:
The transaction was aborted because it used too much stack space. Either use
sp_configure to increase the stack size, or break the query into smaller pieces.
spid: 27, suid: 1, hostname: LIUZHENFU, application name: isql
Msg 19206, Level 16, State 1:
Server 'syb1503', Procedure 'sp_exec_SQL', Line 53:
sp_dbxt_ins_db_seginfo: Execute immediate SQL failed. SQL statement is: insert
#syssegments(dbname, inserted_by, segment, name, status) select
'pmdb','sp_dbxt_set_extend_db', segment, name, status from pmdb.dbo.syssegments
(return status = 1)
那就按照提示做吧。 将stack size参数的大小配置为:130KB
sp_configure "stack size",130000
go
此参数:stack size是静态参数,需要重启ASE服务器。