多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
### 一,查看可用的oracle并下载镜像 ~~~ docker search oracle ~~~ ![](https://img.kancloud.cn/02/ac/02ac81ace7d09876c565052d4405e461_1608x752.png) ~~~ docker pull alexeiled/docker-oracle-xe-11g ~~~ ![](https://img.kancloud.cn/67/91/6791692e7167cb2592fe8ce35f70e59c_1324x474.png) ![](https://img.kancloud.cn/cc/29/cc29832068880668301be51457fa6b79_1186x237.png) ### 二,启动oracle并配置用户 创建备份数据存放目录 ~~~ mkdir /usr/local/oracle/data_temp && chmod 777 /usr/local/oracle/data_temp ~~~ ~~~ docker run --restart always -d -p 8080:8080 -p 1521:1521 -v /usr/local/oracle/data_temp:/home/oracle/data_temp -v /etc/localtime:/etc/localtime:ro --name orac truevoly/oracle-12c ~~~ ![](https://img.kancloud.cn/4e/31/4e3179813a32997cb26f2f161f0c89bc_1845x405.png) 查看oracle启动日志,*id从docker ps -a中获取* ~~~ docker logs -f a83190c5d830 ~~~ ![](https://img.kancloud.cn/62/b7/62b715406b6ec910f8fb0b898077986d_1803x984.png) 进入oracle镜像 ~~~ docker exec -it a83190c5d830 /bin/bash ~~~ 进入oracle ~~~ sqlplus system/oracle@//localhost:1521/xe ~~~ 进入dba用户 ~~~ connect sys as sysdba; #密码:oracle ~~~ 查看状态 ~~~ select status from v$instance; alter user system identified by oracle; ## 修改用户 system 的密码为 oracle ,可以自定义 ~~~ ![](https://img.kancloud.cn/e6/ed/e6ed483caf5323166e9564404f4b11a2_1132x672.png) 创建用户并授予权限 ~~~ create user hospital identified by hospital; GRANT CONNECT, RESOURCE, DBA TO hospital; alter user hospital account unlock; ~~~ ![](https://img.kancloud.cn/9c/39/9c398342216b43e9dae92942791105b1_1076x745.png) 使用以下命令获取安装的数据库的服务名称。 ~~~csharp select value from v$parameter where name='service_names'; ~~~ 至此数据库创建成功 ![](https://img.kancloud.cn/95/36/95368c6bbb7048e3714c573886597dbb_1100x308.png) ### 三,配置外部链接 dbeaver需要注意的是要配置ssh,如下图填入私钥 ![](https://img.kancloud.cn/f7/f2/f7f27ecadcd0638d19409c0393c825d5_1089x824.png) ![](https://img.kancloud.cn/c8/99/c8999eba1b0fbb8640d1deebbe350a19_1099x808.png)