標籤:
oracle中如何刪除使用者?
Oracle中使用DROP USER來刪除使用者,如果使用DROP USER CASCADE那麼使用者的對象也同時被刪除掉。為了達到刪除使用者的效果而又不影響對使用者下的對象的使用可以使用alter user username account lock將使用者鎖定。
用命令建立資料表空間、使用者,並為使用者授權、收回許可權。
Create tablespace tabllespacename
Datafile ‘f:\orcl\user001.dbf size 20m
Default storage(
Initial 512k
Next 512k
minextents 2
pctincrease 50%
maxExitnts 2048)
minimum extent 512k
logging
online
permanent
extent management dictionary;
回收許可權: revoke privilege from user;
create tablespace tablespace_name
Datafile ‘f:\orcl\user001.dbf size 20m
default storage(
initial xxxkb
next yykb
minextents 2
pctincrease nnnn
maxextents mmm)
logging
online
extent management dictionary/local[autoallocate/uniform size
xxxmb];
create user user_name
identified by passwore/
identified externally/
identified globally as ‘CN=user’
default tablespace tablespace_name
temporary tablespace tablespace_name
[account lock /unlock]
grant connect to user_name;
grant create table to suer_name;
grant update on table_name to user_name;
revoke create table from user_name;
revoke update on table_name from user_name;
在Oracle中查看目前使用者,通常有哪些方式?(提示:show user和
select * from user_users)show user;/select username from
user_users;
談談你對角色的理解,常用的角色有哪些?
角色就是一組許可權的資料庫實體,它不屬於任何模式或使用者但是可以被授予
任何使用者。常用的角色有CONNECT,DBA,RESOURCE,SELECT_CATALOG_ROLE
(查詢所有表視圖權),DELETE_CATALOG_ROLE(刪除許可權)等。
角色的建立和授權:和建立使用者為使用者授權差不多。Create role role_name identified …
grant 許可權to role_name。
oracle用命令建立資料表空間、使用者,並為使用者授權、收回許可權。