一 常用命令:
1 查看所有用户:
select * from all_users;
select * from user_users;
2 查看用户或角色权限
select * from dba_sys_privs;
select * from user_sys_privs;
3 查看角色(登录用户)权限
select * from role_sys_privs;
4 查看所有角色
select * from dba_roles;
5 查看那些用户具有sysdba或sysoper系统权限
select * from v$pwfile_users
二 创建数据表
1 创建临时表空间
create temporary tablespace user_temp
tempfile 'D:\oracle\oradata\Oracle9i\user_temp.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
2 创建数据表空间
create tablespace user_data
logging
datafile 'D:\oracle\oradata\Oracle9i\user_data.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
3 创建用户并指向表空间
create user username identified by password
default tablespace user_data
temporary tablespace user_temp;
username为占位符,用实际用户名代替,例如testuser
4 给用户授予权限
grant connect,resource,dba to username;
username占位符
创建成功。