sybase資料庫優化中各引數分別表示什麼?如何修改

2021-12-22 21:29:09 字數 3151 閱讀 4283

1樓:匿名使用者

sp_configure "max memory",800000 ///共享記憶體1.6g

sybase 能夠用到的最大實體記憶體,單位2k,通常配置成主機實體記憶體的70%~80%

sp_configure 「number of user connections」,180 ///180個使用者連線數

通常根據實際併發呼叫來配,一般配置80~200

sp_configure 「lock scheme」, allpages ///使用預設:頁鎖

但有些併發操作多的表需使用行鎖,如cc_telebill表等

sp_configure 「number of locks」,50000 /鎖的數目5萬

可以根據實際應用,一般10000~50000

sp_configure 「max online engines」,2 ///cpu個數為2

單cpu使用預設值,多cpu(4~8個)配成n-1個

number of engines at startup

sp_configure 「number of worker processes」,2 //啟用的工作程序數

單cpu使用預設值,多cpu(4~8個)配成n-1個

sp_configure 「number of open indexes 」,1000 ///開啟的索引個數

sp_configure 「number of open objects 」,1000 ///開啟的事務個數

sp_configure "user log cache size",4096

日誌快取通常配成2048或4096

sp_configure "procedure cache size",50000 /// 100m

儲存過程快取(執行儲存過程),單位2k,通常根據需要配置50~200m

sp_cacheconfig "default data cache","1.2g"

設定資料快取1.2g(所有cache值累加不能超過max memory)

sp_cacheconfig "default data cache", "cache_partition=2"

資料快取分割槽(減少鎖競爭)

重啟sybase服務令所有引數生效

2樓:匿名使用者

電腦優化你可以和我聯絡呀

sybase資料庫的組合主鍵怎樣設定

3樓:

比如表test有(id int not null,name varchar(50) not null,location varchar(200) null)

如想對前2列設定組合主鍵,那麼執行類似下面的語句:

alter table test add constraint pk_test primary key (id,name)

go或者

create unique clustered index pk_test on test(id,name)

go對應的刪除主鍵:

使用 alter table test drop contraint pk_test

如何設定sybase資料庫的使用者許可權

4樓:匿名使用者

sybase資料庫的使用者,包含兩個層面:一個是登陸號,另一個是具體db的使用者,我們登陸時,使用的是登入號,但是這個登入號可以操作哪些db及操作許可權則取決於資料庫使用者。一般情況下,我們可以採取相同的名字來表示登入號和資料庫使用者。

首先建立一個登陸號:

sp_addlogin loginame, passwd

loginame 登入名

passwd 密碼

全部語法(一般不用到)為:

sp_addlogin loginame, passwd [, defdb]

[, deflanguage ] [, fullname ] [, passwdexp ]

[, minpwdlen ] [, maxfailedlogins ]

然後建立使用者:

sp_adduser loginame

這樣建立當前資料庫的使用者,且使用者名稱和登陸名是一樣的。

全部語法為:

[dbname..]sp_adduser loginame [, username[, grpname]]

最後分配許可權:

grant all | select,insert,delete,update

on table_name | view_name | stored_procedure_name

to username

或grant all | create database,create

default,create procedure,create rule,create table,create view,set proxy,set session authorization

to username

例,假如當前db為:db001:

sp_addlogin 'test001','password001'

gosp_adduser 'test001', 'user001'

gogrant create table to user001

go建立了一個test001的登入名,之後為之建立一個當前資料庫的使用者,使這個登入名可以操作當前資料庫。之後分配了建立表的許可權給user001。

這個時候你就可以使用使用者名稱'test001'和密碼'password001'登陸了,並且可以在db001中建立表了。同時由於sp_adduser 的時候沒有指定grpname引數,那麼預設是public使用者組,這個組裡的使用者預設即開通了select/delete/update/insert的許可權。

如果你希望去掉一些許可權,請使用revoke命令,其語法了grant完全相同,你只需要將grant換成revoke即可,例:

revoke select on address to user001

禁止user001檢視address表。

5樓:

grant

on to

如:grant insert, update, deleteon authors

to mary, john, tom

sybase資料庫 如何使用sql語句查詢,資料庫容量大小和

sybase公司是世界著名的資料庫廠家,其關聯式資料庫產品sybase sql server在中國大中型企事業單位中擁有大量的使用者。針對獲取資料庫相關資訊也提供了對應的api,以便管理進行維護。一 sp spaceused 可看到資料庫空間包括日誌 對應資料庫 開啟sql advantage 對話...

資料庫中關係的性質是什麼,簡述資料庫關係的性質?

1.資料庫的基本概念 資料庫,資料庫管理系統,資料庫系統。2.資料模型,實體聯絡模型及e r圖,從e r圖匯出關係資料模型。3.關係代數運算,包括集合運算及選擇 投影 連線運算,資料庫規範化理 論。4.資料庫設計方法和步驟 需求分析 概念設計 邏輯設計和物理設計的相關策略。你說指的關係性質是什麼?麻...

phpmyadmin的mysql資料庫中主鍵索引唯一各

主鍵 是唯一標示當前表裡的那一列,用主鍵可以代替表裡一條實體的內容,如 你有一個名字,有你的住址,號碼,籍貫,學位,政治面貌,等屬性,但唯一能夠標示你的還是你的身份證號,因為別人有可能有跟你同樣的名字,或者同樣的住址,或者同樣的的學位。但身份證是唯一的。通過身份證,我完全知道你本人。索引 就相當於你...