一、管理员登录oracle
su - oracle;
sqlplus /nolog;
conn /as sysdba;
二、创建临时表空间
- 查出当前数据库临时表空间
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
/oracle/app/oradata/ekp/temp01.dbf
- 创建临时表空间:使用上面查询到的临时表空间路径
SQL> create temporary tablespace lxekp_temp tempfile '/oracle/app/oradata/ekp/lxekp_temp.dbf' size 1024m reuse autoextend on next 100m maxsize unlimited;
Tablespace created.
三、创建表空间
- 查询出当前数据库表空间
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/oracle/app/oradata/ekp/system01.dbf
/oracle/app/oradata/ekp/sysaux01.dbf
/oracle/app/oradata/ekp/undotbs01.dbf
/oracle/app/oradata/ekp/users01.dbf
/oracle/app/oradata/ekp/ekp01
/oracle/app/oradata/ekp/ekp02
/oracle/app/oradata/ekp/ekp03
/oracle/app/oradata/ekp/ekp04
/oracle/app/oradata/ekp/ekp05
/oracle/app/oradata/ekp/ekp06
/oracle/app/oradata/ekp/users02.dbf
11 rows selected.
- 创建表空间:使用上面查询到的表空间路径
SQL> create tablespace lxekp datafile '/oracle/app/oradata/ekp/lxekp.dbf' size 1024m reuse autoextend on next 100M maxsize unlimited default storage(initial 128k next 128k minextents 2 maxextents unlimited);
Tablespace created.
四、创建用户并指定空间
- 创建用户
SQL> create user lx_ekp identified by lx_ekp default tablespace lxekp temporary tablespace lxekp_temp;
User created.
五、赋予用户权限
- 赋予权限
SQL> grant connect, resource, dba to lx_ekp;
Grant succeeded.