GitHub地址
https://github.com/wnameless/docker-oracle-xe-11g
安装
Ubuntu 16.04环境:
docker pull wnameless/oracle-xe-11g:16.04
Ubuntu 18.04环境:
docker pull wnameless/oracle-xe-11g
启动
docker run -d -p 10022:22 -p 1521:1521 -e ORACLE_ALLOW_REMOTE=true wnameless/oracle-xe-11g:16.04
开放22和1521端口
查看启动日志
docker logs -f c154cf832b7a1c77092b2cbe47457153bf853d223d861d0f1cac6af4f73e3ea1
sqlplus测试
Oracle默认连接参数:
hostname: localhost
port: 1521
sid: xe
username: system
password: oracle
su - oracle
cd $ORACLE_HOME
bin/sqlplus / as sysdba
select * from dba_users;
SSH连接
ssh-copy-id -i -p10022 root@127.0.0.1 #admin
ssh root@127.0.0.1 -p 10022
docker exec连接
docker exec -it 5d9430198388 bash
挂载宿主磁盘
docker run -d -v /Users/bluexiii/extra/dump:/dump -p 10022:22 -p 1521:1521 -e ORACLE_ALLOW_REMOTE=true wnameless/oracle-xe-11g:16.04
之后就可以impdp了
保存变更
docker diff 5d9430198388
docker commit 5d9430198388 myoracle
参考文档
https://my.oschina.net/Cleverdada/blog/801124
https://hacpai.com/article/1492914187689
网友评论