Oracle 建用戶、 表空間腳本


--建表空間
create tablespace <用戶> 
datafile 'D:\oradatadev\<用戶>.dbf' size 200m
autoextend on  
next 50m maxsize 4096m  
extent management local;

create temporary tablespace <用戶>_temp 
tempfile 'D:\oradatadev\<用戶>_temp.dbf' size 100M
autoextend on  
next 50m maxsize 20480m  
extent management local;

--建用戶

create user <用戶> identified by 
itouch123 default tablespace <用戶> temporary tablespace <用戶>_temp;

grant connect,resource to <用戶>;
grant create any view to <用戶>;
grant debug any procedure to <用戶> ;
grant dba to <用戶>;
grant select on sys.dba_pending_transactions to <用戶>;
grant select on sys.pending_trans$ to <用戶>;
grant select on sys.dba_2pc_pending to <用戶>;
grant execute on sys.dbms_system to <用戶>;

SELECT username,SID,serial# FROM v$session;

--刪除用戶
drop user <用戶> cascade;
--刪除表空間
DROP TABLESPACE <用戶> INCLUDING CONTENTS AND DATAFILES;
DROP TABLESPACE <用戶>_temp INCLUDING CONTENTS AND DATAFILES;

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM