dba_usersdba_tablespacesuser_users;user_tablespaces;
使用sqlplus 登录
### 登录和基本操作connect sysdba/manager### 查看当前用户show user;### 查看数据字典(表)的结构desc dba_tablespaces; # 系统管理员desc user_tablespaces; #普通用户### 查看用户字典desc dba_users; #系统管理员desc user_users; #普通用户###查询数据字典select * from dba_users; #系统管理员才能查询,注意 非管理员用户登录查询该字典会提示,表或者视图不存在,因为没有权限select * from user_users; #普通用户查询### 解锁scott用户select account_status from dba_users where username='SCOTT'; # 查看scott用户的状态alter user scott account unlock; #将scott用户解锁,默认是锁状态alter user scott identified by tiger; #修改scott 用户密码
### 查询select * from dba_tablespaces; # 查看dba用户表空间select * from dba_tablespaces; # 查看dba用户表空间select default_tablespace from user_users where username='SCOTT';#查看SCOTT用户的默认表空间### 设置用户的默认或者临时表空间alter user username default/temporary tablespace tablespacename; #语法alter user scott default tablespace SYSTEM; #设置SCOTT用户默认表空间是system,注意需要dba用户来修改,普通用户权限不足#修改之后使用scott 用户登录,查询数据字典select * from user_users; #可以看到默认的用户表空间已经变更### 创建表空间