1.连接数据库
export ORACLE_SID=mydb
sqlplus /nolog
connect / as sysdba
2.创建表空间
create tablespace mydbtest datafile '/home/oracle/mydb.dbf' size 200m;
3.创建用户
create user mydbuser identified by mypassword default tablespace mydbtest;
4.用户授权
grant create session,create table,unlimited tablespace to mydbuser;
5.用户授权dba
grant dba to mydbuser;
6.导入导出数据库
exp mydbuser/mypassword file=/home/oracle/exp.dmp
imp mydbuser/mypassword file=/home/oracle/exp.dmp FULL=Y
expdp mydbmypassword dumpfile=mydb.dmp logfile=exp.log
impdp mydbuser/mypassword dumpfile=mydb.dmp REMAP_SCHEMA=mydb:mydbuser logfile=exp.log FULL=Y transform=OID:N