联网在liunx环境用docker安装oralce11g


环境

环境配置:Centos7.5+docker-18.03.1-ce+oracle11g

磁盘空间:虚拟机自动分配40g

一、docker安装oracle11g

因为手动在liunxi上部署oracle11g比较繁琐容易出现问题,在这里使用docke进行部署

docker的部署就不在这里赘述,下面是部署链接:

https://blog.csdn.net/weixin_40703882/article/details/119515967

二、安装步骤

1.拉取镜像

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

2.运行容器

docker run -d -p 1521:1521 --name oracle11g registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
[root@oracle ~]# docker ps -a
CONTAINER ID        IMAGE                                                  COMMAND                  CREATED             STATUS              PORTS                    NAMES
1f3de9eb7403        registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g   "/bin/sh -c '/home/o…"   27 minutes ago      Up 27 minutes       0.0.0.0:1521->1521/tcp   oracle11g

3. 进入镜像

[root@oracle ~]# docker exec -it oracle11g bash
[oracle@1f3de9eb7403 /]$ 

4. 创建软链接

[oracle@1f3de9eb7403 /]$ su root
Password: 
输入密码:helowin

编辑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
[root@1f3de9eb7403 /]# source /etc/profile
ln -s $ORACLE_HOME/bin/sqlplus /usr/bin

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

[root@1f3de9eb7403 /]# su - oracle
[oracle@1f3de9eb7403 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Mon Aug 23 16:24:42 2021

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

SQL> 
SQL> conn /as sysdba
SQL> alter user system identified by system;
SQL> alter user sys identified by system;
SQL> create user test identified by test;
SQL> grant connect,resource,dba to test;
SQL>ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
SQL>alter system set processes=1000 scope=spfile;
SQL>shutdown immediate;


[oracle@1f3de9eb7403 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Mon Aug 23 16:24:42 2021

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

SQL> conn /as sysdba
SQL> startup;

总结

有问题可以相互探讨

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值