oracle 資料結構部署,

來源:互聯網
上載者:User

標籤:使用者表   res   _id   ada   quota   session   files   connect   sharp   

Oracle 資料結構部署

用例:

  • - 1、查詢DBF檔案位置
  select tablespace_name, file_id,file_name, round(bytes/(1024*1024),0) total_space from dba_data_files order by tablespace_name;  select * from dba_data_files;
  --/home/oracle/app/oracle/oradata/orcl/users01.dbf

 




  • - 2、刪除使用者資料表空間
  drop user ecom cascade;  drop tablespace ERPDATA including contents and datafiles;

 

  • - 3、建立資料表空間
  create tablespace ERPDATA datafile ‘D:/test/ecom_00.dbf‘ size 200M;

 

  • - 4、授權資料表空間大小自增長
  alter database datafile ‘D:/test/ecom_00.dbf‘ AUTOEXTEND ON NEXT 100M MAXSIZE 3000M;  alter tablespace ERPDATA add datafile ‘/data/oracle/data/orcl/ecom_01.dbf‘ size 200M;  alter database datafile ‘/data/oracle/data/orcl/ecom_01.dbf‘ AUTOEXTEND ON NEXT 100M MAXSIZE 3000M;

 

  • - 5、擴充空間,將資料檔案擴大至5000MB
  alter database datafile ‘/data/oracle/data/orcl/ecom_01.dbf‘ resize 5000m;

 

  • - 6、建立使用者
  create user ecom identified by "passwd111" account unlock default tablespace ERPDATA;

 

  • - 7、給使用者授權
  grant "CONNECT" TO ecom;  grant resource to ecom;  grant "JAVASYSPRIV" TO ecom;  grant "JAVAUSERPRIV" TO ecom;  grant create view to ecom;  grant create synonym to ecom;

 

 

 

操作點:

  • --目前使用者有多少張表

select count(table_name) from user_tables ;

  • --使用者在資料表空間所分配的空間沒有限制

alter user sourcedata quota unlimited on SRC_DATA;

 

  • /* 無法刪除當前串連使用者

select username ,sid,serial# from v$session
alter system kill session ‘687,4263‘;
alter system kill session ‘491,34491‘;

 

  • --查詢使用者權限

select * from dba_sys_privs d where d.GRANTEE = ‘ECOM‘;

  • --查詢使用者對錶的許可權

select ‘grant ‘||u.privilege||‘ on ‘||u.TABLE_NAME||‘ to ‘||u.GRANTEE||‘ with grant option;‘
from user_tab_privs u where u.table_name not like ‘%==%‘;
--撤銷授權不級聯
with admin option;
--撤銷授權級聯
with grant option;

oracle 資料結構部署,

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.