查看用户的默认表空间
select username,account_status,default_tablespace,created from dba_users where account_status = 'OPEN' and username = 'BAOYW';
查看用户所属表空间
select file_name,tablespace_name,bytes,status,maxbytes,autoextensible from dba_data_files where tablespace_name = 'BAOYW';
查看用户的角色和权限
select * from dba_sys_privs where grantee = 'BAOYW';
select * from dba_role_privs where grantee = 'BAOYW';
创建和新增表空间
create tablespace BAOYW datafile '/oracle/app/oracle/oradata/t11gcs/baoyw01.dbf size 1g;
alter tablespace BAOYW add datafile '/oracle/app/oracle/oradata/t11gcs/baoyw02.dbf size 1g;
创建用户并指定默认表空间
create user BAOYW identified by baoyw default tablespace BAOYW;
授权用户角色
grant dba to baoyw;