【文章內(nèi)容簡介】
lter Login語句修改登錄賬號(hào) Alter Login login_name { status_option | With set_option [ , ... ] | cryptographic_credential_option } status_option ::=Enable | Disable set_option ::= Password = 39。password39。 [ Old_Password = 39。oldpassword39。 | password_option [password_option ] ] | Default_Database = database | Default_Language = language | Name = login_name | Check_Policy = { On | Off } | Check_Expiration = { On | Off } | Credential= credential_name | No Credential password_option ::= Must_Change | Unlock cryptographic_credentials_option ::= Add Credential credential_name | Drop Credential credential_name An Introduction to Database Systems 17/43 3.刪除登錄賬號(hào) 在“對(duì)象資源管理器”中,展開“安全性”節(jié)點(diǎn)下面的“登錄名”節(jié)點(diǎn),然后右擊要?jiǎng)h除的登錄名,在彈出的快捷菜單中選擇“刪除”菜單,在出現(xiàn)的“刪除登錄”對(duì)話框中單擊“確定”按鈕即可刪除該登錄賬號(hào)。 利用 Drop Login語句刪除登錄賬號(hào) DROP Login login_name 【 例題 113】 刪除登錄名 UserLogin。 DROP Login UserLogin 登錄賬號(hào)管理 An Introduction to Database Systems 18/43 數(shù)據(jù)庫用戶管理 數(shù)據(jù)庫角色 1.固定數(shù)據(jù)庫角色 SQL Server在每個(gè)數(shù)據(jù)庫中都提供了 10個(gè)固定的數(shù)據(jù)庫角色。與服務(wù)器角色不同的是,數(shù)據(jù)庫角色權(quán)限的作用域僅限在特定的數(shù)據(jù)庫內(nèi)。在對(duì)象資源管理器中展開“教學(xué)管理數(shù)據(jù)庫”下的“安全性”節(jié)點(diǎn),然后再單擊“角色” /“數(shù)據(jù)庫角色”,即可看到這 10個(gè)數(shù)據(jù)庫角色,如圖1115所示。 An Introduction to Database Systems 19/43 圖 1115 選擇“數(shù)據(jù)庫角色” 數(shù)據(jù)庫用戶管理 An Introduction to Database Systems 20/43 2.新建數(shù)據(jù)庫角色 數(shù)據(jù)庫角色是針對(duì)具體的數(shù)據(jù)庫而言的,作用域?yàn)閿?shù)據(jù)庫范圍,因此數(shù)據(jù)庫角色的創(chuàng)建需要在特定的數(shù)據(jù)庫下。具體的步驟為: ( 1)打開“對(duì)象資源管理器”,展開“教學(xué)管理數(shù)據(jù)庫”,找到“安全性”節(jié)點(diǎn)并展開。 ( 2)展開“角色”節(jié)點(diǎn),在“數(shù)據(jù)庫角色”節(jié)點(diǎn)上右擊鼠標(biāo),在彈出的快捷菜單上單擊“新建數(shù)據(jù)庫角色”命令。如圖 1117所示。 數(shù)據(jù)庫用戶管理 An Introduction to Database Systems 21/43 圖 1117 新建數(shù)據(jù)庫角色 數(shù)據(jù)庫用戶管理 An Introduction to Database Systems 22/43 ( 3)打開“數(shù)據(jù)庫角色 新建”對(duì)話框,如圖 1118所示。主要有以下幾個(gè)選項(xiàng): 數(shù)據(jù)庫用戶管理 An Introduction to Database Systems 23/43 ① 角色名稱:輸入要?jiǎng)?chuàng)建的數(shù)據(jù)庫角色名稱。 ② 所有者:輸入該數(shù)據(jù)庫角色的所有者,也可以通過右邊的按鈕打開對(duì)話框進(jìn)行選擇。 ③ 此角色擁有的架構(gòu):在列表中選擇此角色擁有的架構(gòu)。 ④“添加”按鈕:可以向該數(shù)據(jù)庫角色中添加成員,添加的成員將自動(dòng)獲得該數(shù)據(jù)庫角色的權(quán)限。 ⑤“刪除”按鈕:可以從該數(shù)據(jù)庫角色中刪除成員。 ⑥ 如果有必要,可以對(duì)“安全對(duì)象”和“擴(kuò)展屬性”頁中的相關(guān)選項(xiàng)進(jìn)行設(shè)置。 ( 4)單擊“確定”按鈕,即可創(chuàng)建新的數(shù)據(jù)庫角色。 數(shù)據(jù)庫用戶管理 An Introduction to Database Systems 24/43 用戶管理 1.利