centos7使用docker安装oracle

  1. 安装docker

[root@localhost ~]# yum install -y docker

  1. 启动docker

[root@localhost ~]# systemctl start docker

  1. 拉取镜像

docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
镜像大概有6.8G

  1. 查看镜像信息:docker iamges
  2. 创建容器

docker run -d -p 1521:1521 –name oracle_11g registry.aliyuncs.com/helowin/oracle_11g

  1. 启动容器

docker start oracle_11g

  1. 进入控制台设置用户信息:

docker exec -it oracle_11g bash

  1. 切换成root进行操作:

su – root
输入密码helowin

  1. 设置oracle环境变量如下:

vi /etc/profile文件末尾添加:
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
export ORACLE_SID=helowin
export PATH=${ORACLE_HOME}/bin:$PATH

  1. 切换回oracle用户:

su – oracle

  1. 修改sys、system用户密码

sqlplus /nolog
conn /as sysdba
alter user system identified by oracle;
alter user sys identified by oracle;
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

  1. 接下来就可以使用system用户进行登录了

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理