Ubuntu的Docker中安装Oracle镜像使用Ubuntu系统Docker下安装Oracle

2021-11-02
0评论
/
435阅读
爱搜啊

一、软件环境:

1、OS:Ubuntu 18.04

2、已安装了Docker,参考:https://iqqoz.com/post-59.html

二、安装Oracle镜像的过程

1、切换到root账号下,如果是普通账号,下面操作指令前面加sudo

2.搜索Oracle镜像

docker search oracle

3.下载oracle镜像

docker pull registry.cn-hangzhou.aliyuncs.com/qida/oracle-xe-11g

4.查看镜像

docker images
docker images registry.cn-hangzhou.aliyuncs.com/qida/oracle-xe-11g

5.从下载的镜像创建并启动容器

docker run -d -p 1521:1521 --name oracle11 registry.cn-hangzhou.aliyuncs.com/qida/oracle-xe-11g

这里把新建的容器命名为oracle11

6.查看当前运行的容器

docker ps

7.进入已经启动的Oracle的容器

docker exec -it oracle11 bash

8.进入sqlplus

sqlplus /nolog

9.使用sysdba角色登录sqlplus

conn sys/oracle as sysdba

10.查看当前实例下的数据库

安装Oracle

11.查看有多少个数据表

安装Oracle

12.退出sqlplus

exit

13.退出容器

exit 或Ctrl+D

14.重新进入已经运行的oracle容器,重新执行下面指令

docker exec -it oracle11 bash

15.如果容器停用了,则重新启动, 用你实际的容器ID代替下面的container_ID

docker pull registry.cn-hangzhou.aliyuncs.com/qida/oracle-xe-11g0

16.停用正在运行的容器

docker pull registry.cn-hangzhou.aliyuncs.com/qida/oracle-xe-11g1

客户端工具使用:sqldeveloper

https://blog.csdn.net/baidu_37503452/article/details/109285098

oracle新建用户,增加权限

创建用户,操作表空间权限,创建表,删除表,插入表,更新表

grant create session to aaa;

grant unlimited tablespace to aaa;

grant create table to aaa;

grant drop any table to aaa;

grant insert any table to aaa;

grant update any table to aaa;


本站附件分享,如果附件失效,可以去找找看

诚通网盘附件百度网盘附件


于2021-11-02发布