当前位置: 首页 > news >正文

如何获得一个Oracle 23ai数据库(docker容器)

准确的说,是Oracle 23ai Free Developer版,因为企业版目前只在云上(OCI和Azure)和ECC上提供。

方法包括3种,本文介绍第3种:

  1. Virtual Appliance
  2. RPM安装
  3. Docker

我已经有了一台Oracle Linux 8的虚机,他在云上,这样下载docker image会很快。。

在Oracle Linux 8 上安装Docker,参见这里。以下为命令:

yum install epel-release
dnf install -y dnf-utils zip unzip
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
dnf remove -y runc
dnf install -y docker-ce --nobest
systemctl enable docker.service
systemctl start docker.service

安装完成后,看下状态:

[root@instance-20231220-1113-19c-iaas ~]# docker version
Client: Docker Engine - CommunityVersion:           26.1.1API version:       1.45Go version:        go1.21.9Git commit:        4cf5afaBuilt:             Tue Apr 30 11:49:04 2024OS/Arch:           linux/amd64Context:           defaultServer: Docker Engine - CommunityEngine:Version:          26.1.1API version:      1.45 (minimum version 1.24)Go version:       go1.21.9Git commit:       ac2de55Built:            Tue Apr 30 11:47:58 2024OS/Arch:          linux/amd64Experimental:     falsecontainerd:Version:          1.6.31GitCommit:        e377cd56a71523140ca6ae87e30244719194a521runc:Version:          1.1.12GitCommit:        v1.1.12-0-g51d5e94docker-init:Version:          0.19.0GitCommit:        de40ad0
[root@instance-20231220-1113-19c-iaas ~]# docker info
Client: Docker Engine - CommunityVersion:    26.1.1Context:    defaultDebug Mode: falsePlugins:buildx: Docker Buildx (Docker Inc.)Version:  v0.14.0Path:     /usr/libexec/docker/cli-plugins/docker-buildxcompose: Docker Compose (Docker Inc.)Version:  v2.27.0Path:     /usr/libexec/docker/cli-plugins/docker-composeServer:Containers: 0Running: 0Paused: 0Stopped: 0Images: 1Server Version: 26.1.1Storage Driver: overlay2Backing Filesystem: xfsSupports d_type: trueUsing metacopy: falseNative Overlay Diff: falseuserxattr: falseLogging Driver: json-fileCgroup Driver: cgroupfsCgroup Version: 1Plugins:Volume: localNetwork: bridge host ipvlan macvlan null overlayLog: awslogs fluentd gcplogs gelf journald json-file local splunk syslogSwarm: inactiveRuntimes: io.containerd.runc.v2 runcDefault Runtime: runcInit Binary: docker-initcontainerd version: e377cd56a71523140ca6ae87e30244719194a521runc version: v1.1.12-0-g51d5e94init version: de40ad0Security Options:seccompProfile: builtinKernel Version: 5.4.17-2136.310.7.1.el8uek.x86_64Operating System: Oracle Linux Server 8.6OSType: linuxArchitecture: x86_64CPUs: 2Total Memory: 30.95GiBName: instance-20231220-1113-19c-iaasID: ecee8bb5-b939-46f2-a2a0-4fb5251ff342Docker Root Dir: /var/lib/dockerDebug Mode: falseExperimental: falseInsecure Registries:127.0.0.0/8Live Restore Enabled: false

接下来,下载docker镜像,耗时2分,大小8.7G。速度74MB/s,还行:

$ docker pull container-registry.oracle.com/database/free:latest
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.45/images/create?fromImage=container-registry.oracle.com%2Fdatabase%2Ffree&tag=latest": dial unix /var/run/docker.sock: connect: permission denied
[oracle@instance-20231220-1113-19c-iaas ~]$ time sudo docker pull container-registry.oracle.com/database/free:latest
latest: Pulling from database/free
6d6e36f7c9fb: Pull complete
21def9023b6f: Pull complete
5e7b2cfeb7fa: Pull complete
b4a24759beff: Pull complete
78bba54e9814: Pull complete
716b489ad5ad: Pull complete
c23fd8c6cbee: Pull complete
79dea26b3a5a: Pull complete
5dfbcf799df3: Pull complete
154719a62576: Pull complete
Digest: sha256:83edd0756fda0e5faecc0fdf047814f0177d4224d7bf037e4900123ee3e08718
Status: Downloaded newer image for container-registry.oracle.com/database/free:latest
container-registry.oracle.com/database/free:latestreal    2m0.898s
user    0m0.106s
sys     0m0.070s$ sudo docker images
REPOSITORY                                    TAG       IMAGE ID       CREATED       SIZE
container-registry.oracle.com/database/free   latest    7510f8869b04   2 weeks ago   8.7GB

启动数据库:

$ sudo docker run -d -it --name ora23ai container-registry.oracle.com/database/free
9b019091af82510d4862e45d4fd5e1112ecf3896fda251f9f7bd1b5cb861e7ff$ sudo docker ps
CONTAINER ID   IMAGE                                         COMMAND                  CREATED         STATUS                            PORTS      NAMES
9b019091af82   container-registry.oracle.com/database/free   "/bin/bash -c $ORACL…"   7 seconds ago   Up 7 seconds (health: starting)   1521/tcp   ora23ai$ sudo docker logs -f 9b019091af82
Starting Oracle Net Listener.
Oracle Net Listener started.
Starting Oracle Database instance FREE.
Oracle Database instance FREE started.The Oracle base remains unchanged with value /opt/oracle
#########################
DATABASE IS READY TO USE!
#########################
The following output is now a tail of the alert.log:
2024-05-09T10:20:27.724737+00:00
FREEPDB1(3):Opening pdb with Resource Manager plan: DEFAULT_PLAN
Completed: Pluggable database FREEPDB1 opened read write
Completed: ALTER DATABASE OPEN
2024-05-09T10:20:28.938466+00:00
===========================================================
Dumping current patch information
===========================================================
No patches have been applied
===========================================================

登录数据库:

$ sudo docker ps
CONTAINER ID   IMAGE                                         COMMAND                  CREATED         STATUS                   PORTS      NAMES
9b019091af82   container-registry.oracle.com/database/free   "/bin/bash -c $ORACL…"   3 minutes ago   Up 3 minutes (healthy)   1521/tcp   ora23ai$ sudo docker exec -it ora23ai bash
bash-4.4$ id
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba)bash-4.4$ sqlplus / as sysdbaSQL*Plus: Release 23.0.0.0.0 - Production on Thu May 9 10:24:13 2024
Version 23.4.0.24.05Copyright (c) 1982, 2024, Oracle.  All rights reserved.Connected to:
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.4.0.24.05SQL> select 'Hello World';'HELLOWORLD
-----------
Hello WorldSQL> exit
Disconnected from Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.4.0.24.05bash-4.4$ exit
exit

关机下班:

$ sudo docker stop ora23ai
ora23ai$ sudo docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
http://www.lryc.cn/news/348626.html

相关文章:

  • 想跨境出海?云手机提供了一种可能性
  • 制药行业新突破:CANOpen转PROFINET网关配置案例解析
  • vue前端时间段选择控件
  • 用wordpress建外贸独立站的是主流的外贸建站方式
  • 差异基因散点图绘制教程
  • Windows安装多版本MySQL
  • Redis7降级到Redis6如何AOF备份恢复(错的)
  • 通过EXCEL控制PLC启停电机的一种方法
  • 【GPT4O 开启多模态新时代!】
  • HTTP协议及Python实现
  • 【机器学习】逻辑化讲清PCA主成分分析
  • Vue常见的指令
  • 【Ansible】ansible-playbook剧本
  • Linux的命令
  • No known conditions for “./lib/locale/lang/zh-cn“ entry in “element-plus“ pa
  • 实验名称:TCP 连接管理
  • go语言map底层及扩容机制原理详解(上)
  • 互联网职场说 | “领导找我谈话,原来是给我涨薪,但却只涨了200,还偷偷叮嘱我保密,这次只给我涨了薪”
  • Android 如何启用user版本的adb源码分析
  • linux phpstudy 重启命令
  • 台式电脑屏幕亮度怎么调节?让你的眼睛更舒适!
  • 打造安全的 Linux 环境:实用配置指南
  • 神经网络有哪些算法
  • 计算机网络期末试题
  • Unity学习笔记---图层
  • 【简单探索微软Edge】
  • YOLOv5独家改进:backbone改进 | 微软新作StarNet:超强轻量级Backbone | CVPR 2024
  • 概率密度函数pdf的某种解释与洞察
  • 【OceanBase诊断调优】—— 转储错误(错误代码 4138/ORA-01555)
  • Python面试题【数据结构和算法部分101-130】