--創(chuàng)建用戶 test,密碼123456
創(chuàng)新互聯(lián)是專業(yè)的涵江網(wǎng)站建設(shè)公司,涵江接單;提供做網(wǎng)站、網(wǎng)站建設(shè),網(wǎng)頁(yè)設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行涵江網(wǎng)站開(kāi)發(fā)網(wǎng)頁(yè)制作和功能擴(kuò)展;專業(yè)做搜索引擎喜愛(ài)的網(wǎng)站,專業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來(lái)合作!
create user test identified by 123456;
--授權(quán)登錄
grant connect to test;
--授權(quán)同義詞
grant create synonym to test;
--授權(quán)會(huì)話
grant create session to test;
--授權(quán)視圖
grant create view to test;
--授權(quán)讀取權(quán)限
(1)select 'grant select on '||owner||'.'||object_name||' to test;'
from dba_objects
where owner in ('USER1','USER2')
and object_type='TABLE';
---當(dāng)(1)無(wú)效時(shí)使用(2)
select 'Grant all on '||table_name||'to 創(chuàng)建的用戶 ;' from all_tables
where owner = upper('當(dāng)前用戶');
grant Connect to [用戶名]
如果只對(duì)單個(gè)表做限制
grant select on [表名] to [用戶名]
mount下alter
database
open
read
only;
補(bǔ)充:數(shù)據(jù)庫(kù)open之后肯定不好改為read
only了,一定要在mount下改才行
但是非關(guān)鍵表空間還是可以切換到read
only的,比如users
alter
tablespace
users
read
only;切換回來(lái)就是read
write
system,sysaux跟undo無(wú)法切換為只讀,因?yàn)檎pen之后為了維護(hù)庫(kù)的正常運(yùn)行這3個(gè)表空間肯定要讀寫(xiě)信息的
MOUNT下alter database open read only;
補(bǔ)充:數(shù)據(jù)庫(kù)OPEN之后肯定不好改為READ ONLY了,一定要在MOUNT下改才行
但是非關(guān)鍵表空間還是可以切換到READ ONLY的,比如USERS
ALTER TABLESPACE USERS READ ONLY;切換回來(lái)就是READ WRITE
SYSTEM,SYSAUX跟UNDO無(wú)法切換為只讀,因?yàn)檎PEN之后為了維護(hù)庫(kù)的正常運(yùn)行這3個(gè)表空間肯定要讀寫(xiě)信息的