Oracle新建使用者和建立表空間

2021-10-17 05:26:09 字數 1030 閱讀 1577

--檢視表空間利用率

select a.tablespace_name "表空間名",

round(total / 1024 / 1024 / 1024, 2) "表空間大小",

round(free / 1024 / 1024 / 1024, 2) "表空間剩餘大小",

round((total - free) / 1024 / 1024 / 1024, 2) "表空間使用大小",

round((total - free) / total, 4) * 100 "使用率 %"

from (select tablespace_name, sum(bytes) free

from dba_free_space

group by tablespace_name) a,

(select tablespace_name, sum(bytes) total

from dba_data_files

group by tablespace_name) b

where a.tablespace_name = b.tablespace_name

order by 5 desc;

--給系統表空間擴容

--新建新的表空間

create tablespace tbs_xyzx datafile '/data/oracle/oradata/dtc/xyzx01.dbf' size 20480m;

--給表空間擴大大小

alter tablespace tbs_xyzx add datafile '/data/oracle/oradata/dtc/xyzx02.dbf' size 20480m;

--建立新使用者

create user xyzx identified by "pass$123" default tablespace tbs_xyzx;

--授權

grant connect,resource to xyzx;

grant select on xyzx.nce_gr_grjbxx_js to username;

oracle建立表空間和新建使用者

建立表空間 create tablespace zhdj datafile f installed devinstall oracle11 oradata orcl zhdj.dbf size 1024m autoextend on next 10m maxsize unlimited 建立臨時表空...

oracle 使用pl sql建立使用者和表空間

分為四步,複製全部並儲存為.sql格式的文件,在pl sql中間操作區右鍵 開啟 sql指令碼進行執行即可建立 第1步 建立臨時表空間nhdj temp create temporary tablespace nhdj temp size 50m autoextend on next 50m max...

oracle新建使用者匯入表

oracle建立表空間和使用者 sql view plain copy 建立表空間和使用者的步驟 使用者 建立 create user 使用者名稱 identified by 密碼 授權 grant create session to使用者名稱 grant create table to使用者名稱 ...