Linux 上 docker 安装 oracle-xe-11g 记录

环境

2G 内存,60G 硬盘阿里云一台(带宽 1M), 配置如下图:
16d6203aa6aa40909b1491d3b312c2c5-2017042309.30.38.png

软件:docker

官方文档 https://docs.docker.com/engine/installation/linux/docker-ce/centos/

$ sudo yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2
$ sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
$ sudo yum-config-manager --enable docker-ce-edge
$ sudo yum-config-manager --enable docker-ce-test
$ sudo yum-config-manager --disable docker-ce-edge
$ sudo yum install docker-ce
$ sudo systemctl start docker

配置镜像加速

$ curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://3e722983.m.daocloud.io
$ systemctl restart docker

相关 link

docker 镜像站:https://store.docker.com
视频教程:https://asciinema.org/a/45878(oracle 12c)

步骤

1: 在镜像站搜索 oracle, 第一页有两个(12c 和 11g) ,12c 太大了,要 3 个 G 且下载时间太长,我下载的是 11g

shell:docker pull wnameless/oracle-xe-11g
7842df3511684d1186a99aa368769cfd-2017042309.42.01.png
可以下载旧版:docker pull wnameless/oracle-xe-11g:14.04.4

2: 运行镜像文件

shell:docker run -d -p 49160:22 -p 49161:1521 wnameless/oracle-xe-11g
映射了两个端口出来。
eec2c2c8fa6e46a5aff84b488a6334c5-2017042309.52.51.png
镜像网站上说:Run this, if you want the database to be connected remotely:(远程连接)
得加-e ORACLE_ALLOW_REMOTE=true

3: 查看这个镜像运行 log

shell:docker logs -f b97da5ba40541b28b05c4b799761f77aa6284f842ef696c16926bbc14a0d2627
6d5f6454a888493cb9a5e7e457c45704-2017042309.55.57.png

4: 进入容器

Login by SSH : ssh root@localhost -p 49160
密码: admin
aac6c15ca87644aea9fdb80cfc1d3c66-2017042310.11.57.png

5: 切换用户, 连接 oracle

shell: su oracle
shell: cd $ORACLE_HOME
shell: bin/sqlplus / as sysdba
84f824986a6247cf8c4b4d2f5f440ed6-2017042310.18.13.png

6: 测试 sql

51e237ab8cf54faca6eacc50c3b54ff5-2017042310.22.14.png

7: 新建用户

shell:create user test identified by 123456
shell: grant dba to test;

2ed2c9db544c4feeb18d509d6581ec39.png

(如果报错网络错误,关闭防火墙即可systemctl stop firewalld.service)

 

8: 新建表空间

shell:create tablespace TEST datafile '/u01/app/oracle/test/test.dbf' size 100M;
shell:create user TEST identified by TEST123 default tablespace TEST;
如果这个 TEST 用户在其他表空间已存请先删除
shell:drop user TEST cascade
然后给连接,dba 权限
shell:grant connect,resource to TEST;
shell:grant dba to TEST;


参考:https://hacpai.com/article/1492914187689

转载于:https://www.cnblogs.com/killall007/p/8794432.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值