惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
Netflix TechBlog - Medium
大猫的无限游戏
大猫的无限游戏
爱范儿
爱范儿
Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Register - Security
The Register - Security
IT之家
IT之家
博客园_首页
Microsoft Security Blog
Microsoft Security Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
I
InfoQ
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Jina AI
Jina AI
Apple Machine Learning Research
Apple Machine Learning Research
M
MIT News - Artificial intelligence
博客园 - Franky
C
Check Point Blog
T
The Blog of Author Tim Ferriss
V
Visual Studio Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Tailwind CSS Blog
Recent Announcements
Recent Announcements
云风的 BLOG
云风的 BLOG
美团技术团队
The Cloudflare Blog
Y
Y Combinator Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MyScale Blog
MyScale Blog
The GitHub Blog
The GitHub Blog
D
DataBreaches.Net
Google DeepMind News
Google DeepMind News
V
V2EX
aimingoo的专栏
aimingoo的专栏
GbyAI
GbyAI
G
Google Developers Blog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
U
Unit 42
罗磊的独立博客
量子位
MongoDB | Blog
MongoDB | Blog
Last Week in AI
Last Week in AI
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件
D
Docker
人人都是产品经理
人人都是产品经理

博客园 - 马森

Java IO测试样例-字节流-字符流 java中的io系统详解 MongoDB资料汇总 字符编码笔记:ASCII,Unicode和UTF-8 jQuery和ExtJS的timeOut超时设置和event事件处理 Sybase字符串函数-数学函数-系统函数 inux 设置系统时间和硬件时间 Sybase采用固定表+存储过程实现分页 Wordpress XML-RPC协议说明 struts2 action 配置方法 &&struts2的配置文件 理解 SET CHAINED command not allowed within multi-statement transaction. Java引用对象SoftReference WeakReference PhantomReference(二) [整理]centos下配置和安装 jstl字符串处理 [原]动态打jar包程序,可用于手机图片音乐游戏的动态打包 Java,Tomcat,Mysql乱码总结 [原]output parameters have not yet been processed源自返回了多个数据集 [转]MS SQL Server数据库事务锁机制分析 tomcat支持ssl时Keystore was tampered with, or password was incorrect
sybase性能优化 - 马森 - 博客园
马森 · 2011-02-18 · via 博客园 - 马森

sybase命令:去掉段:sp_dropsegment "logsegment", pay2, "dev01"

一. SYBASE 系统参数调整
1.内存
/sbin/sysctl -w kernel.shmmax=3416386150

shmmax是最大共享内存段,假如服务器上没有别的应用并且使用raw device可以将此参数调整到物理内存的90%,如果使用file system device 的话相应调小,因为file system buffer需要开销内存!修改后重新启动系统。

sp_configure "max memory",1500000 重启生效(设置为共享内存的75%)
sp_configure "allocate max shared mem",1 启动的时候自动分配max memory指定的最大内存
sp_cacheconfig "default data cache","1500m" 设置数据缓存(设置为max memory的一半)
sp_cacheconfig "default data cache","cache_partition=2" 是CPU数量的倍数,对数据缓冲区分区
sp_poolconfig "default data cache","64m","16k" 设置16K 数据缓存
sp_poolconfig "default data cache","128m","8k" 设置8K 数据缓存
sp_configure "procedure cache size",90000 存储过程数据缓存
sp_cacheconfig 'tempdb_cache','200m','mixed' 创建命名高速缓存
sp_bindcache 'tempdb_cache',tempdb 捆绑临时数据库到
tempdb_cache高速缓存

2.cpu
sp_configure "max online engines",2 设置使用的CPU数量
sp_configure "number of engines at startup",2 启动时使用CPU数量

3. 网络
sp_configure "default network packet size",2048 设置网络传送包的大小(重启动生效)
sp_configure "max network packet size",2048

4. 其他资源使用
sp_configure "number of locks",100000 锁使用数量
sp_configure "number of open indexes",5000 打开索引
sp_configure "number of open objects",5000 打开对象
sp_configure "number of user connections",1000 用户连接数
sp_configure "number of device",100 新建设备最大数量

数据设备与日志设备必须分开,添加临时数据库设备

1. 数据设备
sp_deviceattr devname,"dsync",true
2. 日志设备
sp_deviceattr devname,"dsync",false
3. 临时数据库设备
sp_deviceattr devname,"dsync",false

tempdb数据和日志分离:
USE master
Go

DISK INIT name = 'tempdbdev01', physname = '/opt/sybase/data/tempdbdev01.dat' , size = '1G',dsync = 'false'
Go

DISK INIT name = 'tempdblogdev01', physname = '/opt/sybase/data/tempdblogdev01.dat', size = '1G',dsync = 'false'
Go

ALTER DATABASE tempdb ON tempdbdev01 = '1G' LOG ON tempdblogdev01 = '1G'
Go

USE tempdb
Go

删除tempdb上使用的master段:

EXEC sp_dropsegment 'logsegment', 'tempdb', 'master'
go

EXEC sp_dropsegment 'system', 'tempdb', 'master'
go

EXEC sp_dropsegment 'default', 'tempdb', 'master'
Go

如果已针对 tempdb 建立了设备,则只需禁用 dsyncio,但需要重新启动 Adaptive Server:

EXEC sp_deviceattr 'tempdbdev01', 'dsync', 'false'
Go

EXEC sp_deviceattr 'tempdblogdev01', 'dsync','false'
Go

数据库设备最好设置Direct IO,获得的性能相信会让你满意

1. 数据库对象表、索引。。
(1)对表新建合理的索引,定期分析表
update statistics tabname (不锁表)
(2)整理数据库空间 (锁表,剩余空间必须为最大表的1.2倍)
reorg rebuild tabname
recreate clustered index
(3)重新编译存储过程与触发器
sp_recompile usertable (与表相关联的存储过程和触发器)

1. 数据库死进程
select * from master.syslogshold

-T3607 master
-T3608 其他数据
-m 单

===========================================================
SYBASE 移动日志文件到其他的设备
===========================================================
Moving the transaction log to another device
1> alter database dbname log on device19 = 101> sp_logdevice dbname, device19The last-chance threshold for database dbname is now 1232 pages. ... sql inserts, to fill old log segment ...1> dump tran dbname with truncate_only1> sp_helplog dbname2> goIn database 'dbname', the log starts on device 'device19'.(return status = 0)1>

feimei 发表于:2006.04.20 21:29 ::分类: ( SYBASE ) ::阅读:(63次) :: 评论 (0) :: 引用 (0)
===========================================================
SYBASE 序列异常跳转解决方法
===========================================================
identity burning set factor的问题
每次异常断电跳转的数目是:identity burning set factor*10的负7次方*表中identity列定义的长度,例如identity burning set factor=5000,identity列定义的长度numeric(10,0),则该数等于:5000*10的负7次方*1010的10次方,该数比较大

另外可以在建表时设置跳转的值,语法是 create table (...) with identity_gap = value. 修改当前表步长

EXEC sp_chgattribute 't_61e_tolltype','identity_gap',50

feimei 发表于:2006.04.19 21:50 ::分类: ( SYBASE ) ::阅读:(91次) :: 评论 (0) :: 引用 (0)
===========================================================
SYBASE 如何创建代理表
===========================================================
如何创建代理表
在interfaces文件中加入远程服务器条目
sp_addserver dblocal,local
sp_addserver dbremote,null,dbremote
sp_configure "enable cis",1
sp_addexternlogin dbremote,sa,sa,password
创建代理表
create existing table zz_proxy (id int not null,name varchar(10) not null)
at "sybase.master..zz"
或者
create proxy_table zz1
at "sybase.master..zz"

建代理表时,远程表的结构数据已经存储在了本地,并且不会检测该表的结构是否发生改变,因此远程表的结构发生改变时,本地是不知道的,需要重新创建代理表,相当于重新刷新本地的存储的结构.

feimei 发表于:2006.04.19 21:49 ::分类: ( SYBASE ) ::阅读:(108次) :: 评论 (0) :: 引用 (0)
===========================================================
SYBASE 远程备份
===========================================================
在interfaces中加入远程备份服务器的条目(ip地址或者是远程服务器的物理名称)
要注意加入的名称与远程备份服务器的名称要一致!!!

dump database to ... at bs_server_name