oracle 建立 使用者

2021-06-15 05:08:34 字數 2842 閱讀 5529

檢視系統中的所有使用者:

select * from dba_users order by username

1、以sysdba身份登入pl;

2、右鍵「user」->「new」新建使用者;

3、彈出新建使用者視窗,在「general」選項卡中,填寫:

name:使用者名稱;

password:密碼;

4、切換到「role privileges」選項卡:

role選擇connect,勾選「default」

5、切換到「system privileges」選項卡:

system privilege中選擇「create any table」、「create any type」、「create any sequence」,右側不勾選

6、切換到「quotas」選項卡(表空間):

tablespace中選擇「users」表空間,勾選「unlimited」(無限許可權);

ora-01031: 許可權不足

grant all privileges  to xining

「動態執行表不可訪問,本會話的自動統計被禁止。在執行選單裡你可以禁止統計,或在v$session,v$sesstat和v$statname表獲得選擇許可權」

出現這個錯誤的提示.

是因為scott對這幾張表沒有許可權

grant select on v_$statname to scott;

grant select on v_$sesstat to scott;

grant select on v_$session to scott;

grant select on v_$mystat to scott;

要用有許可權的使用者登入賦許可權

-- 表空間使用情況檢視

select

a.a1 tab_name,

c.c2 tab_type,

c.c3 table_management,

b.b2/1024/1024 tab_space_m, 

a.a2/1024/1024 free_space_m,

(b.b2-a.a2)/1024/1024 used_space_m,

substr((b.b2-a.a2)/b.b2*100,1,5) use_ratio

from

(select tablespace_name a1,sum(nvl(bytes,0)) a2 from dba_free_space group by tablespace_name) a,

(select tablespace_name b1,sum(bytes) b2 from dba_data_files group by tablespace_name) b,

(select tablespace_name c1,contents c2,extent_management c3 from dba_tablespaces) c

where a.a1=b.b1 and c.c1=b.b1;

-- 表空間檔案所在位置

select name from v$datafile;

-- 建立表空間(這裡建立的表空間檔案盒上面查詢的檔案不是同乙個路徑哦)

create tablespace haizhu datafile 'haizhu.dbf' size 1024m;

--以下的**就不需要了,直接用plsql建立使用者就行了。

--建立使用者

create user platform identified by platform default tablespace haizhu;

grant dba, connect to platform;

--授予許可權

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

grant unlimited session to platform;--//授予zhangsan使用者使用表空間的許可權

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

grant drop table to platform;--//授予刪除表的許可權

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

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

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

create tablespace test_data

logging

datafile 'c:\oracle\product\10.1.0\oradata\orcl\test_data01.dbf'

size 32m

autoextend on

next 32m maxsize 2048m

extent management local;

grant

create session, create any table, create any view ,create any index, create any procedure,

alter any table, alter any procedure,

drop any table, drop any view, drop any index, drop any procedure,

select any table, insert any table, update any table, delete any table

to platform;

Oracle 使用者建立

執行 cmd 進入 dos視窗 c sqlplus sys password as sysdba 使用sys使用者登入 sql create user username identified by password 建立使用者名稱和密碼 sql create tablespace ts userna...

Oracle建立使用者

當你建立使用者時,應該定義它的表空間 default tablespace 否則,它會使用系統表空間 system tablespace 這是應該避免的。這是常用的建立使用者的乙個例子 create user xx identified by xx profile default default t...

oracle 建立使用者

oracle10g建立使用者 oracle10g 的建立使用者名稱 1 linux 下oracle 的啟動以 oracle 身份登入 啟動lsnrctl start 登入sqplus nolog 連線資料庫 connect assysdba 啟動資料庫 startup 關閉資料庫 shutdown ...