欢迎来到天天文库
浏览记录
ID:38698161
大小:59.00 KB
页数:6页
时间:2019-06-17
《实验二:用户权限和基本SQL语言》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、实验二:用户权限和基本SQL语言1.实验目的:(1)熟悉用户管理、权限管理等数据库安全管理机制;(2)熟悉用户外部表、普通表、视图创建方式,基本SQL语句如简单SELECT查询和统计功能的实用。2.实验内容(1)创建faculty,phd,postgraduate,undergraduate四个用户,并相应的创建四个角色facultyRole,phdRole,postgraduateRole,undergraduateRole,并给各用户赋予相应的角色和权限,使得各数据库用户至少具有连接数据库、创建表、创建目录等权限
2、。创建用户:--CreatetheusercreateuserFACULTYidentifiedexternallydefaulttablespaceUSERStemporarytablespaceTEMPprofileDEFAULT;--Grant/RevokeroleprivilegesgrantfacultyroletoFACULTYwithadminoption;--Grant/RevokesystemprivilegesgrantalteranyclustertoFACULTYwithadminoption
3、;grantalteranytabletoFACULTYwithadminoption;grantalterdatabasetoFACULTYwithadminoption;--CreatetheusercreateuserPHDidentifiedexternallydefaulttablespaceUSERStemporarytablespaceTEMPprofileDEFAULT;--Grant/RevokeroleprivilegesgrantphdroletoPHDwithadminoption;--Gra
4、nt/RevokesystemprivilegesgrantalteranyclustertoPHD;grantalteranytabletoPHDwithadminoption;grantalterdatabasetoPHDwithadminoption;--CreatetheusercreateuserPOSTGRADUATEidentifiedexternallydefaulttablespaceUSERStemporarytablespaceTEMPprofileDEFAULT;--Grant/Revoker
5、oleprivilegesgrantpostgraduateroletoPOSTGRADUATEwithadminoption;--Grant/RevokesystemprivilegesgrantalteranytabletoPOSTGRADUATEwithadminoption;grantalterdatabasetoPOSTGRADUATEwithadminoption;--CreatetheusercreateuserUNDERGRADUATEidentifiedexternallydefaulttables
6、paceUSERStemporarytablespaceTEMPprofileDEFAULT;--Grant/RevokeroleprivilegesgrantundergraduateroletoUNDERGRADUATEwithadminoption;--Grant/RevokesystemprivilegesgrantalteranyclustertoUNDERGRADUATEwithadminoption;grantalteranytabletoUNDERGRADUATEwithadminoption;gra
7、ntalterdatabasetoUNDERGRADUATEwithadminoption;创建角色:--CreatetherolecreateroleFACULTYROLEidentifiedexternally;--Grant/RevokesystemprivilegesgrantalteranytabletoFACULTYROLE;grantalterdatabasetoFACULTYROLE;--CreatetherolecreaterolePHDROLEidentifiedexternally;--Gran
8、t/RevokesystemprivilegesgrantalteranyproceduretoPHDROLEwithadminoption;grantalteranytabletoPHDROLEwithadminoption;grantalterprofiletoPHDROLEwithadminoption;--Createtherolecr
此文档下载收益归作者所有