Oracle数据库创建表空间及用户并设置权限

前端之家收集整理的这篇文章主要介绍了Oracle数据库创建表空间及用户并设置权限前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
declare file_path varchar2(500); v_sql varchar2(500); begin select distinct substr(FILE_NAME,1,instr(FILE_NAME,'/','-1',1)) into file_path from dba_data_files t where t.tablespace_name = 'USERS'; dbms_output.put_line(file_path); ------ default tablespace space_test begin------ v_sql:= ' CREATE TABLESPACE space_test NOLOGGING DATAFILE ' ||''''||file_path||'space_test.dbf'||''''||' SIZE 200M ' || 'REUSE AUTOEXTEND ON NEXT 51200K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO'; execute immediate v_sql; ------default tablespace test end------ end ; / CREATE USER test IDENTIFIED BY "123" DEFAULT TABLESPACE "space_test" TEMPORARY TABLESPACE "TEMP"; commit; grant connect to test; grant unlimited tablespace,dba to test;
原文链接:https://www.f2er.com/oracle/206309.html

猜你在找的Oracle相关文章