Oracle导库

来源:互联网 发布:怎么清除小米云端数据 编辑:程序博客网 时间:2024/06/06 09:23

登陆Oracle

su - oraclesqlplus '/ as sysdba'

退出sqlplus

quit或者exit

导出

exp userid=[user]/[pwd]@[sid] file=/path/of/dmp/file buffer=80000000 STATISTICS=none COMPRESS=y

创建表空间

create tablespace [tablespaceName] datafile '/opt/oradata/[tablespaceName].dbf' size 100m autoextend on;

创建用户

create user [userName] identified by [password] default tablespace [tablespaceName] account unlock;

赋权限

grant unlimited tablespace,connect,resource,create any table,create any trigger,create any type,create any view to [userName];

修改dmp文件的表空间

sed -i 's/TABLESPACE "[tablespaceName]"/TABLESPACE "[newTablespaceName]"/g' /path/of/dmp/file

导入

imp [user]/[pwd] file=/path/of/dmp/file touser=[touser]

imp命令后面的用户是具有执行权限的用户
先不写fromuser,报错后知道fromuser

imp [user]/[pwd] file=/path/of/dmp/file fromuser=[fromuser] touser=[touser]
原创粉丝点击