mac终端,如何在docker中导入oracle的dump文件
docker的安装,在此就不细说了(oracle的安装也不说了)
oracle的安装地址(从别处借来的):https://blog.csdn.net/xgc0215/article/details/104134241?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2.control
进入正题
1.docker ps
查看容器,复制oracle容器id
2.docker cp /Users/xxx/Desktop/xxx.dmp 容器id:/home/oracle
复制dmp文件到指定目录中
3.docker exec -it 容器id /bin/sh
进入oracle容器目录
4.cd /home/oracle
进入目录(看看dmp进去没)
5.(重新开一个终端)docker ps 找到names(前题将oracle服务开启)
6.用户切换:docker exec -it 镜像名(就是上面说的names) bash
例 : docker exec -it oracle bash
7.开始导入: imp 用户名/密码@//localhost:1521/helowin fromuser=用户名 touser=用户名 commit=y buffer=409600 file=dmp文件地址
例:imp pm_finally/pm_finally@//localhost:1521/helowin fromuser=pm_finally touser=pm_finally commit=y buffer=409600 file=/home/oracle/pmfinally.dmp
8.(顺带讲一下)导出:exp 用户名/密码@10.32.3.4:1521/orcl buffer=409600 owner=用户名 file=dmp文件地址
例:imp pm_finally/pm_finally@//localhost:1521/helowin fromuser=pm_finally touser=pm_finally commit=y buffer=409600 file=/home/oracle/pmfinally.dmp