--首先创建临时表空间
create temporary tablespace test_temp
tempfile '路径'
size 32M
autoextend on
next 32M maxsize 2048M
extend management local;
--创建表空间
create tablespace test_data
logging
data '路径'
size 32M
autoextend on
next 32M maxsize 2048M
extend management local;
--创建用户,分配表空间
create tuser test identified by '123456'
default tablespace test_data
temporary table tablespace test_temp;
--用户授权
grant create view,resource,dba,connect to test;
---------------直接使用系统默认表空间创建用户-------------------
create user test identified by "123456"
default tablespace users temporary tablespace temp;
--常用命令
--导出数据库,注意在dos中最后不加";"
exp test/123456 file='路径/test.dmp' owner=test
--导入数据库
imp test/123456 file='路径' fromuser=test
--解锁用户
alter user test account unlock;
--修改密码
alter user test identified by '123456'
--删除当前连接用户
select username,sid,serial# from v$session where username = 'test'
alter system kill session '1156,37035'
转载于:https://blog.51cto.com/10484449/1673870