当前位置:Gxlcms > 数据库问题 > oracle2c-r2(12.2.0.1) 的镜像

oracle2c-r2(12.2.0.1) 的镜像

时间:2021-07-01 10:21:17 帮助过:28人阅读

 

 

完成构建

完成构建之后,我们可以看到oracle12c-r2的docker image 已经存在于本地:

技术分享

 

运行镜像

# docker run -it --name ora12c-r2 -p 1521:1521 -p 5500:5500 -e ORACLE_SID=xxx -e ORACLE_PDB=xxx -e ORACLE_PWD=xxx -e ORACLE_CHARACTERSET=AL32UTF8 -v /DATA/oracle_12c/sharedData:/opt/oracle/oradata oracle/database:12.2.0.1-se2

这里贴出命令行参数:

技术分享
Parameters:
   --name:        The name of the container (default: auto generated)
   -p:            The port mapping of the host port to the container port. 
                  Two ports are exposed: 1521 (Oracle Listener), 5500 (OEM Express)
   -e ORACLE_SID: The Oracle Database SID that should be used (default: ORCLCDB)
   -e ORACLE_PDB: The Oracle Database PDB name that should be used (default: ORCLPDB1)
   -e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDB_ADMIN password (default: auto generated)
   -e ORACLE_CHARACTERSET:
                  The character set to use when creating the database (default: AL32UTF8)
   -v             The data volume to use for the database.
                  Has to be owned by the Unix user "oracle" or set appropriately.
                  If omitted the database will not be persisted over container recreation.
技术分享

 

第一次运行容器是,会根据我们的指令进行初始化操作,例如安装oracle instance, 启动服务等等。。。直到我们看到

 

#########################
DATABASE IS READY TO USE!
########################

我们的oracle12c-r2数据库就创建完成。

进入运行的container,连接数据库:

# docker exec -it ora12c-r2 /bin/bash
# sqlplus sys/<your password>@//localhost:1521/<your SID> as sysdba

 

OK, 我们的工作已经完成了,现在我们就可以在本地使用oracle12c-r2啦 :)  最后,感谢大家的观看,欢迎留言交流。。。

 

参考资料:

https://blogs.oracle.com/developer/creating-an-oracle-database-docker-image

http://www.projectatomic.io/blog/2016/03/daemon_option_basedevicesize/

https://bobcares.com/blog/docker-container-size/

oracle2c-r2(12.2.0.1) 的镜像

标签:docker   修改   sqlplus   default   迁移   gen   ada   url   express   

人气教程排行