docker安装Oracle 11g

环境: centos7.3                    docker --version: 17.12.0-ce

1. 操作系统切换到root用户:

        # su root

2. 启动docker
        # systemctl start docker

3. 拉取oracle镜像(oracle 11.0.2 64bit 企业版 实例名: helowin)
        # docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g

4. 创建并启动容器(映射本地端口1521)

        # docker run -d -p 1521:1521 --name oracle_11g registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g

5. 进入docker的oracle_11g 容器

        # docker exec -it 容器ID /bin/bash

6. 加载环境变量

        # source /home/oracle/.bash_profile

7. 登录sqlplus

        # sqlplus /nolog

       sql> connect /as sysdba

       到这里就可以进行您想要的任何操作了

       容器操作系统用户 root:helowin

8. 如需用plsql等工具连接 请设置用户和密码(oracle 11.0.2 64bit 企业版 实例名: helowin)。举例:

       sql> create user test identified by test;

       sql> grant connect,resource,dba to test;

9. 如需映射oracle的数据文件 把容器内对应的文件,拷贝到宿主机,映射即可(如下)

       /home/oracle/app/oracle/oradata/

       /home/oracle/app/oracle/flash_recovery_area/helowin/

       推荐使用docker-compose管理

参考:https://dev.aliyun.com/detail.html?spm=5176.1972343.2.2.jhKAjR&repoId=1969

猜你喜欢

转载自blog.csdn.net/mmingxiang/article/details/81980392