Linux 使用 Docker 安装 oracle 并使用 navicat 实现外部连接

1,拉取 docker 镜像:docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g

1.1 , 该镜像由阿里云提供,比较大,可能需要下载一会

1.2,所有者用户 root 密码 helowin

1.3,oracle 所有者用户 oracle

1.4,oracle 安装路径 /home/oracle/app/oracle 

1.5,oracle 版本 oracle_11g

2,创建并运行一个容器

2.1,查询镜像是否下载成功 :docker images

2.2,运行该镜像:docker run -d -p 1521:1521 --name oracle registry.aliyuncs.com/helowin/oracle_11g

3,进入容器修改账号密码

3.1,检查容器是否运行成功

3.2,进入容器:docker exec -it oracle bash

3.3,进入 root 账:su root 

3.4,输入密码:helowin

3.5,编辑环境变量 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

3.6,使得修改失效: source /etc/profile

3.7,切换到 oracle 用户: su oracle

3.8,使用 sqlplus 连接到 oracle: sqlplus /nolog  => conn /as sysdba

3.9,修改 sys 和 system 的密码并且修改密码的有效时间为无限

alter user system identified by oracle;

alter user sys identified by oracle;

ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

4,外部连接,连接的几个参数吐下

IP: 本机 ip

端口: 1521

SID:helowin

账号:system

密码:oracle

原文地址:原文

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值