docker 安装oracle

1、docker安装参考

       https://www.cnblogs.com/snailgirl/p/15503867.html
2、拉取镜像         

docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g

3、创建容器         

docker run -d -p 1521:1521 --name oracle11g registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
【docker run -d -p 1521:1521 -v /home/oracle/product/11.2.0/dbhome_2:/home/oracle/app/oracle/product/11.2.0/dbhome_2 \
-v /home/oracle/etc/profile:/etc/profile \
--restart=always --name oracle11g registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g】

4.查看oracle11g容器是否创建成功     

docker ps -a

5、进入镜像进行配置     

docker exec -it oracle11g bash

6.切换到root用户下进行配置

su root (密码:helowin)

7、编辑profile文件配置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

8、创建软连接

ln -s $ORACLE_HOME/bin/sqlplus /usr/bin

9、切换到oracle 用户

su - oracle

10、登录sqlplus并修改sys、system用户密码

sqlplus /nolog
conn /as sysdba

11、修改sys、system用户密码并刷新权限

alter user system identified by 123456;
alter user sys identified by 123456;
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
exit 退出

12、查看一下oracle实例状态

lsnrctl status
exit 退出

13、用nacivat连接oracle数据库

     服务名:helowin(一定要填写helowin)
     用户名:system
     密码:123456(第10步设置的密码)

 14、添加新的表空间:https://www.cnblogs.com/snailgirl/p/16602157.html

 

参考:https://www.jb51.net/article/208976.htm

 

posted on 2022-08-17 09:28  蜗牛也是妞  阅读(1757)  评论(0编辑  收藏  举报