Oracle通过sql语句创建表空间和用户

--新建表空间 datafile 可以从select t.*  from sys.dba_data_files t where t.tablespace_name ='OA0422'中查找
create tablespace YSQ datafile '/home/oracle/oracle/product/10.2.0/oradata/orcl/YSQ' size 1024M reuse; 
--新建用户
create user OADEV_YSQ
  identified by "OADEV_YSQ"
  default tablespace YSQ 
  profile DEFAULT
  ACCOUNT UNLOCK;
--用户授DBA权
grant dba to OADEV_YSQ;
grant unlimited tablespace to OADEV_YSQ;

你可能感兴趣的:(SQL)