Oracle資料庫建立 刪除使用者及使用者授權

2021-07-22 23:37:17 字數 1670 閱讀 7796

--建立使用者指定表空間並授權:

create user testuser identified by testuser

default tablespace tests_data;

alter user testuseraccount unlock;

grant connect,resource to testuser;--給使用者所有許可權

--查詢所有使用者

select * from dba_users;

select * from all_users;

select * from user_users;

--刪除使用者

drop user [username] cascade;

--乙個使用者的預設表空間只能有乙個,但是你可以試下用下面的語句為其授權在別的表空間中建立對像:

alter user username quota 0||unlimited on tablespace_name;

alter user username quota unlimited on tablespacea;

alter user username quota unlimited on tablespaceb;

--或者放開所有表空間

grant unlimited tablespace to username;

--或者索性給所有許可權

grant resource,connect,dba to username;

--關於使用者具體許可權授權

grant create session to username;--授予username使用者建立session的許可權,即登陸許可權

grant unlimited tablespace to username;--授予username使用者使用表空間的許可權

grant create table to username;--授予建立表的許可權

grante drop table to username;--授予刪除表的許可權

grant insert table to username;--插入表的許可權

grant update table to username;--修改表的許可權

grant all to public;--這條比較重要,授予所有許可權(all)給所有使用者(public)

--oralce對許可權管理比較嚴謹,普通使用者之間也是預設不能互相訪問的,需要互相授權

grant select on tablename to username;--授予username使用者檢視指定表的許可權

grant drop on tablename to username;--授予刪除表的許可權

grant insert on tablename to username;--授予插入的許可權

grant update on tablename to username;--授予修改表的許可權

grant insert(id) on tablename to username;

grant update(id) on tablename to username;--授予對指定表特定欄位的插入和修改許可權,注意,只能是insert和update

grant alert all table to username;--授予username使用者alert任意表的許可權

oracle資料庫匯出資料及建立刪除使用者

一 oracle資料庫匯出 1.開啟pl sql,登入scott賬戶 2.在object中找到當前專案,選中我的專案,找到表 3.選中全部表,右鍵export data 4.選擇sql insert,按下圖勾選 5.檢視檔案 匯出oracle資料庫scott賬戶下的表成功。二 建立使用者 1.在pl...

建立oracle資料庫使用者

查詢表空間 select tablespace name,file id,file name,round bytes 1024 1024 0 total space from dba data files order by tablespace name 1.建立表空間 create tablesp...

oracle資料庫建立 刪除使用者,給使用者附權

oracle資料庫的許可權系統分為系統許可權與物件許可權。系統許可權 database system privilege 可以讓使用者執行特定的命令集。例如,create table許可權允許使用者建立表,grant any privilege 許可權允許使用者授予任何系統許可權。物件許可權 dat...