欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

联网在liunx环境用docker安装oralce11g

程序员文章站 2022-05-25 22:57:35
...


环境

环境配置: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
[[email protected] ~]# 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. 进入镜像

[[email protected] ~]# docker exec -it oracle11g bash
[[email protected] /]$ 

4. 创建软链接

[[email protected] /]$ 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
[[email protected] /]# source /etc/profile
ln -s $ORACLE_HOME/bin/sqlplus /usr/bin

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

[[email protected] /]# su - oracle
[[email protected] ~]$ 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;


[[email protected] ~]$ 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;

总结

有问题可以相互探讨