大家好,我是考100分的小小码 ,祝大家学习进步,加薪顺利呀。今天说一说ubuntu试用docker安装oracle11g,希望您对编程的造诣更进一步.
下载oracle11g安装包
下载oracle11g安装包
https://www.oracle.com/database/technologies/oracle-database-software-downloads.html#11g
解压oracle11g安装包
使用uzip解压到安装目录/opt/oracle下面
sun@sun-system:/opt/oracle$ pwd
/opt/oracle
sun@sun-system:/opt/oracle$ ls
database
代码100分
获取jaspeen/oracle-11g镜像
查找镜像
代码100分sun@sun-system:/opt/oracle$ sudo docker search oracle
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
oraclelinux Official Docker builds of Oracle Linux. 631 [OK]
jaspeen/oracle-11g Docker image for Oracle 11g database 148 [OK]
oracleinanutshell/oracle-xe-11g 83
oracle/openjdk Docker images containing OpenJDK Oracle Linux 60 [OK]
oracle/graalvm-ce GraalVM Community Edition Official Image 57 [OK]
获取镜像
sudo docker pull jaspeen/oracle-11g
代码100分sun@sun-system:/opt/oracle$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
jaspeen/oracle-11g latest 0c8711fe4f0f 4 years ago 281MB
安装oracle11g
sun@sun-system:/opt/oracle/database/install$ sudo docker run --privileged --name oracle11g -p 1521:1521 -v /opt/oracle:/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 410593 MB Passed
Checking swap space: must be greater than 150 MB. Actual 8170 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2020-02-21_03-53-10AM. Please wait ...You can find the log of this install session at:
sudo docker run --privileged --name oracle11g -p 1521:1521 -v /opt/oracle:/install jaspeen/oracle-11g
- run 启动容器
- privileged 给这个容器root特权
- name 容器名称
- p 主机端口映射容器端口(主机1521端口映射容器1521端口)
- v 主机目录挂载到容器目录(主机/opt/oracle挂载到容器/install目录)
- jaspeen/oracle-11g 代表镜像jaspeen/oracle-11g的容器
等待一段时间安装完成
sun@sun-system:/opt/oracle$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
194bc8439080 jaspeen/oracle-11g "/assets/entrypoint.…" 31 minutes ago Up 31 minutes 0.0.0.0:1521->1521/tcp, 8080/tcp oracle11g
进入oracle11g容器配置oracle
进入oracle11g容器
sun@sun-system:/opt/oracle$ sudo docker exec -it oracle11g /bin/bash
[root@194bc8439080 /]#
切换为oracle用户
[root@194bc8439080 /]# su - oracle
Last login: Fri Feb 21 04:00:47 UTC 2020
[oracle@194bc8439080 ~]$
登陆oracle数据库
[oracle@194bc8439080 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Fri Feb 21 04:25:59 2020
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
解锁演示用户scott
SQL> alter user scott account unlock;
User altered.
SQL> commit;
Commit complete.
SQL>
设置演示用户scott密码
SQL> conn scott/tiger
ERROR:
ORA-28001: the password has expired
Changing password for scott
New password:
Retype new password:
Password changed
Connected.
SQL>
使用Navicat登陆oracle
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
转载请注明出处: https://daima100.com/9868.html