docker oracle11g导入 . dmp文件

环境

  • CentnOS7
  • Docker version 20.10.18, build b40c2f6
  • registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g

1、使用XFTP工具将.dmp文件上传到CentOS7
在这里插入图片描述
2、将.dmp文件赋值到oracle11g容器中

[root@centos7 ruoyi]# docker cp /home/ruoyi/ssq.dmp oracle11g:/home/oracle/app/oracle/admin/helowin/dpdump/

###
#是oracle11g的DATA_PUMP_DIR目录的地址
#你也可以自己创建的目录,用自己的,我这里用他的了
/home/oracle/app/oracle/admin/helowin/dpdump/ 

在这里插入图片描述

3、启动docker中的oracle11g并进入Oracle11g容器中

[root@centos7 ruoyi]# docker start oracle11g  # 启动名称为oracle11g的容器
[root@centos7 ruoyi]# docker ps #查看正在运行的容器
CONTAINER ID   IMAGE                                                  COMMAND                  CREATED       STATUS       PORTS                                       NAMES
79a99e56edfd   registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g   "/bin/sh -c '/home/o…"   3 weeks ago   Up 2 hours   0.0.0.0:1521->1521/tcp, :::1521->1521/tcp   oracle11g
[root@centos7 ruoyi]# 
[root@centos7 ruoyi]# docker exec -it oracle11g /bin/bash #进入正在运行的oracle11g的容器内部

4、查看.dmp文件是否赋值进oracle11容器

[root@centos7 ~]# docker exec -it oracle11g /bin/bash #进入正在运行的oracle11g的容器内部
[oracle@79a99e56edfd /]$ su root #root 用户登录
Password: 
[root@79a99e56edfd /]# su - oracle  切换为oracle用户
[oracle@79a99e56edfd ~]$ cd /home/oracle/app/oracle/admin/helowin/dpdump/ #进入.dmp文件的目录
[oracle@79a99e56edfd dpdump]$ ll
total 1380
-rw-r-----. 1 oracle oinstall     116 Aug 23  2014 dp.log
-rw-r--r--. 1 root   root     1405516 Nov 14 14:40 ssq.dmp

5、导入.dmp文件

[oracle@79a99e56edfd ~]$ imp dxoms/tbird2020@helowin file=/home/oracle/app/oracle/admin/helowin/dpdump/ssq.dmp ignore=y FULL=Y

遇到的文件编码问题

Import: Release 11.2.0.1.0 - Production on Mon Nov 14 15:26:12 2022

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V10.02.01 via conventional path
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
export client uses ZHS16GBK character set (possible charset conversion)
IMP-00069: Could not convert to environment national character set's handle
IMP-00000: Import terminated unsuccessfully

查看该dmp文件的字符集

$ cat s201211.dmp |od -x|head -1|awk '{print $2 $3}'|cut -c 3-6
0354

然后用以下SQL查出它对应的字符集:

SQL> select nls_charset_name(to_number('0354','xxxx')) from dual;
NLS_CHARSET_NAME(TO_NUMBER('0354','XXXX'
----------------------------------------
ZHS16GBK

docker从容器里面拷文件到宿主机或从宿主机拷文件到docker容器里面

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值