docker 安装 oracle
docker centos oracle
下载镜像
docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
启动镜像
docker run \
-d \
-it \
-p 1521:1521 \
--name oracle11g \
--restart=always registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
或则
docker run \
-d \
--restart unless-stopped \
--name oracle11g \
-p 1521:1521 \
-v /data/oracle/oradata:/home/oracle/app/oracle/oradata/helowin \
registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
进入镜像
docker exec -it oracle11g bash
修改配置信息
切换root账户
su root
输入密码 :helowin
添加oracle环境变量
复制如下代码,并复制到文件 /etc/profile 和 /home/oracle/.bashrc 的最后
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
export ORACLE_SID=helowin
export PATH=$ORACLE_HOME/bin:$PATH
刷新配置
source /etc/profile
source ~/.bashrc
切换回oracle账户
登录oracle 修改信息
登录
sqlplus /nolog
修改密码
CONNECT / AS SYSDBA;
alter user system identified by system ;
exit;(退出)
修改监听
cd /home/oracle/app/oracle/product/11.2.0/dbhome_2/network/admin
修改 文件 listener.ora 和 tnsnames.ora
重启docker容器
systemctl restart docker