栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

linux通过docker部署Oracle 11g

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

linux通过docker部署Oracle 11g

一、安装docker
yum install -y yum-utils
#配置阿里源
yum-config-manager 
>     --add-repo 
>     https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
#更新源
[root@localhost ~]# yum makecache fast -q
#安装docker
[root@localhost ~]# yum install docker-ce docker-ce-cli containerd.io -y -q
#启动docker并开机自启
[root@localhost ~]# systemctl start docker
[root@localhost ~]# systemctl enable docker
二、获取docker的Oracle镜像
docker pull jaspeen/oracle-11g
三、上传Oracle11g安装包

/install目录是默认安装目录,不然安装时会报错(Installation files not found. Unzip installation files into mounted(/install) folder)

#创建Oracle安装目录,
mkdir /install
#将两个Oracle安装目录上传到/install目录下
-rw-r--r--. 1 root root 1239269270 4月  29 15:52 linux.x64_11gR2_database_1of2.zip
-rw-r--r--. 1 root root 1111416131 4月  29 15:54 linux.x64_11gR2_database_2of2.zip
#解压
[root@localhost install]unzip linux.x64_11gR2_database_1of2.zip
[root@localhost install]unzip linux.x64_11gR2_database_2of2.zip

[root@localhost install]# ll
总用量 2295592
drwxr-xr-x. 8 root root        128 8月  21 2009 database
-rw-r--r--. 1 root root 1239269270 4月  29 15:52 linux.x64_11gR2_database_1of2.zip
-rw-r--r--. 1 root root 1111416131 4月  29 15:54 linux.x64_11gR2_database_2of2.zip
四、安装Oracle11g
[root@localhost install]# docker run --privileged --name oracle11g -p 1521:1521 -v /install/:/install jaspeen/oracle-11g
Database is not installed. Installing...
Installing Oracle Database 11g
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 29054 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 2045 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2022-04-29_08-36-50AM. Please wait ...You can find the log of this install session at:
 /opt/oracle/oraInventory/logs/installActions2022-04-29_08-36-50AM.log
The following configuration scripts need to be executed as the "root" user.
 #!/bin/sh
 #Root scripts to run

/opt/oracle/oraInventory/orainstRoot.sh
/opt/oracle/app/product/11.2.0/dbhome_1/root.sh
To execute the configuration scripts:
         1. Open a terminal window
         2. Log in as "root"
         3. Run the scripts
         4. Return to this window and hit "Enter" key to continue

Successfully Setup Software.
Changing permissions of /opt/oracle/oraInventory.
····································
······················
等它慢慢安装
五,初始化数据库

5.1,连接到容器,

docker exec -it oracle11g /bin/bash

3.2,切换到oracle用户,然后连接到sql控制台

su - oracle
sqlplus / as sysdba
#默认scott用户是被锁定的,需要解锁
SQL>
3.3,解锁账户
SQL> alter user scott account unlock;
User altered.
SQL> commit;
Commit complete.
SQL> conn scott/tiger
ERROR:
ORA-28001: the password has expired
Changing password for scott
New password:
Retype new password:
Password changed
Connected.
SQL>
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/844830.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号