数据库

学习数据迁移之imp

2020-12-29 09:08:40 阅读数 8313 收藏 0


查询数据库语言及字符集

select userenv('language') from dual;

select * from nls_database_parameters #服务器

select * from nls_instance_parameters #客户端

select * from nls_session_parameters #会话

查看dump文件导出信息

strings bak20190315.dmp |head -10

strings bak20190315.dmp | grep "CREATE TABLE" | awk '{print $3}'| sed 's/"//g'   #表

cat exp.dmp |od -x|head -1|awk '{print $2 $3}'|cut -c 3-6 #查看字符集代码

select nls_charset_name(to_number('0354','xxxx')) from dual; #代码转换成名称


create user note identified by luoluo; #建用户授权

grant connect,resource to note;

select name from v$datafile; #查询数据文件路径

create tablespace note datafile='/u01/app/oracle/oradata/orcl/note01.dbf' size 31G;  #新建表空间

alter tablespace note add datafile='/u01/app/oracle/oradata/orcl/note02.dbf' size 31G;

alter tablespace note add datafile='/u01/app/oracle/oradata/orcl/note03.dbf' size 31G;

alter tablespace note add datafile='/u01/app/oracle/oradata/orcl/note04.dbf' size 31G;

alter user note default tabspace note; #修改用户默认表空间

imp system/ORACLE12C  file=/mnt/data/bak20190315.dmp FROMUSER=NOTE



参考链接

https://www.cnblogs.com/lipera/p/6201434.html

https://www.cnblogs.com/lhrbest/p/6832707.html

https://www.cnblogs.com/rootq/articles/2049324.html