💻予言者と5つめのラズベリーパイ
Pi 5 で vaultwarden を動かし始めていろいろみていたら、まだメモリやディスクに余裕があると思っているところにRaspberry Pi 5 なら Oracle DB もインストールできるんだねー https://medium.com/@oryza.triznyach/oracle-database-on-the-raspberry-pi-54201d68b431 うおお(やる気)
しかしこのまま実行してみたところ Oracle のリポジトリが消えているので、 Mac(M1)でOracleDBコンテナ(Oracle Database 19c Enterprise Edition)をビルドする https://zenn.dev/gentaro_23/articles/001-oracle-container を参照、コンテナビルド、インストールまで成功した。
コンテナ内部で sqlplus をつなぐことは出来たが、ローカルネットの osqledit で接続できんかった。IPアドレスだけまちがっていたw。
あとで使用リソースについて書き足すが、なんなら専用で1台必要そう。メモリのこり 500MB とか一気に可処分領域がなくなってしまった。勉強用にしちゃあ大食いだよな。処し方に悩む。
2024-06-29T01:54:30Z オラパイ
steveswinsburg/oracle19c-docker: A docker container for running Oracle 19c - now with ARM support https://github.com/steveswinsburg/oracle19c-docker
docker-images/OracleDatabase/SingleInstance at main · oracle/docker-images https://github.com/oracle/docker-images/tree/main/OracleDatabase/SingleInstance#running-oracle-database-11gr2-express-edition-in-a-container
Oracle Database on the Raspberry Pi | by Oryza Triznyach | Medium https://medium.com/@oryza.triznyach/oracle-database-on-the-raspberry-pi-54201d68b431
docker image からシコシコと
# git clone https://github.com/oracle/docker-images.git
$ cd /orcl/docker-images/OracleDatabase/SingleInstance/dockerfiles/19.3.0
# mv ~/LINUX.ARM64_1919000_db_home.zip ./
$ cd /orcl/docker-images/OracleDatabase/SingleInstance/dockerfiles
# ./buildContainerImage.sh -v 19.3.0 -t oracle-db:19.3.0 -e
Checking Docker version.
Dockerfile
Checking if required packages are present and valid...
LINUX.ARM64_1919000_db_home.zip: OK
==========================
Container runtime info:
Client: Docker Engine - Community
Version: 27.0.3
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.15.1
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.28.1
Path: /usr/libexec/docker/cli-plugins/docker-compose
Server:
Containers: 2
Running: 1
Paused: 0
Stopped: 1
Images: 1
Server Version: 27.0.3
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Swarm: inactive
Runtimes: runc io.containerd.runc.v2
Default Runtime: runc
Init Binary: docker-init
containerd version: ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
runc version: v1.1.13-0-g58aa920
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.8.0-1006-raspi
Operating System: Ubuntu 24.04 LTS
OSType: linux
Architecture: aarch64
CPUs: 4
Total Memory: 7.752GiB
Name: tmpi01
ID: 1d3c9ab2-5f08-4e91-85e4-8ca9a206fe4c
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
==========================
Building image 'oracle-db:19.3.0' ...
[+] Building 292.4s (15/15) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 5.06kB 0.0s
=> WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 25) 0.0s
=> [internal] load metadata for docker.io/library/oraclelinux:8 2.8s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [base 1/4] FROM docker.io/library/oraclelinux:8@sha256:5f8cbbe5793b8fe804c173e6a9855824136c42af38740932d9f478f2bb49c1e6 16.8s
=> => resolve docker.io/library/oraclelinux:8@sha256:5f8cbbe5793b8fe804c173e6a9855824136c42af38740932d9f478f2bb49c1e6 0.0s
=> => sha256:5f8cbbe5793b8fe804c173e6a9855824136c42af38740932d9f478f2bb49c1e6 547B / 547B 0.0s
=> => sha256:8f9485261ff506342912bcee042ecfdc854b76873e339667dc74f5d5d91e27ba 529B / 529B 0.0s
=> => sha256:b13512602456292ac02345c58b4022d76f1b88ee5eb23cfb79babba76949e653 1.49kB / 1.49kB 0.0s
=> => sha256:49b1237866c41540037b5c63a6124dd6f883dc794c5cfdd2fe3d89f92559c75a 99.54MB / 99.54MB 5.7s
=> => extracting sha256:49b1237866c41540037b5c63a6124dd6f883dc794c5cfdd2fe3d89f92559c75a 10.8s
=> [internal] load build context 16.7s
=> => transferring context: 2.42GB 16.6s
=> [base 2/4] COPY setupLinuxEnv.sh checkSpace.sh /opt/install/ 0.8s
=> [base 3/4] COPY runOracle.sh startDB.sh createDB.sh createObserver.sh dbca.rsp.tmpl setPassword.sh checkDBStatus.sh runUserScripts.sh relinkOracleBinary.sh configTcps.sh /opt/oracle/ 0.0s
=> [base 4/4] RUN chmod ug+x /opt/install/*.sh && sync && /opt/install/checkSpace.sh && /opt/install/setupLinuxEnv.sh && rm -rf /opt/install 100.3s
=> [builder 1/2] COPY --chown=oracle:dba LINUX.ARM64_1919000_db_home.zip db_inst.rsp installDBBinaries.sh /opt/install/ 4.7s
=> [builder 2/2] RUN chmod ug+x "/opt/install"/*.sh && sync && "/opt/install"/"installDBBinaries.sh" ee 132.6s
=> [stage-2 1/4] COPY --chown=oracle:dba --from=builder /opt/oracle /opt/oracle 12.0s
=> [stage-2 2/4] RUN "/opt/oracle"/oraInventory/orainstRoot.sh && "/opt/oracle/product/19c/dbhome_1"/root.sh 0.4s
=> [stage-2 3/4] WORKDIR /home/oracle 0.0s
=> [stage-2 4/4] RUN echo 'ORACLE_SID=${ORACLE_SID:-ORCLCDB}; export ORACLE_SID=${ORACLE_SID^^}' > .bashrc 0.2s
=> exporting to image 14.9s
=> => exporting layers 14.9s
=> => writing image sha256:bc927c0128c87992bb0b46316ff463ec6831ea3e37d7927734620c665c1e12f3 0.0s
=> => naming to docker.io/library/oracle-db:19.3.0 0.0s
1 warning found (use --debug to expand):
- FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 25)
Oracle Database container image for 'ee' version 19.3.0 is ready to be extended:
--> oracle-db:19.3.0
Build completed in 292 seconds.
サーバー起動
# docker run --name oracle-19-db -p 1521:1521 -p 5500:5500 -p 2484:2484 --ulimit nofile=1024:65536 --ulimit nproc=2047:16384 --ulimit stack=10485760:33554432 --ulimit memlock=3221225472 -e ORACLE_PWD=password1234 oracle-db:19.3.0
ORACLE EDITION: ENTERPRISE
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 01-JUL-2024 17:56:35
Copyright (c) 1991, 2023, Oracle. All rights reserved.
Starting /opt/oracle/product/19c/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/6f114b509815/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 01-JUL-2024 17:56:36
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/6f114b509815/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
The listener supports no services
The command completed successfully
[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
CAUSE:
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
CAUSE:
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
CAUSE:
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
/opt/oracle/cfgtoollogs/dbca/ORCLCDB.
Database Information:
Global Database Name:ORCLCDB
System Identifier(SID):ORCLCDB
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jul 1 18:05:59 2024
Version 19.19.0.0.0
Copyright (c) 1982, 2023, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0
SQL>
System altered.
SQL>
System altered.
SQL>
Pluggable database altered.
SQL>
PL/SQL procedure successfully completed.
SQL> SQL>
Session altered.
SQL>
User created.
SQL>
Grant succeeded.
SQL>
Grant succeeded.
SQL>
Grant succeeded.
SQL>
User altered.
SQL> SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0
The Oracle base remains unchanged with value /opt/oracle
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:
ORCLPDB1(3):CREATE SMALLFILE TABLESPACE "USERS" LOGGING DATAFILE '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf' SIZE 5M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO
ORCLPDB1(3):Completed: CREATE SMALLFILE TABLESPACE "USERS" LOGGING DATAFILE '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf' SIZE 5M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO
ORCLPDB1(3):ALTER DATABASE DEFAULT TABLESPACE "USERS"
ORCLPDB1(3):Completed: ALTER DATABASE DEFAULT TABLESPACE "USERS"
2024-07-01T18:05:59.872181+00:00
ALTER SYSTEM SET control_files='/opt/oracle/oradata/ORCLCDB/control01.ctl' SCOPE=SPFILE;
2024-07-01T18:05:59.877737+00:00
ALTER SYSTEM SET local_listener='' SCOPE=BOTH;
ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATE
Completed: ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATE
どない?
# docker system df
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 2 1 5.76GB 5.54GB (96%)
Containers 1 1 205B 0B (0%)
Local Volumes 0 0 0B 0B
Build Cache 8 0 0B 0B
たぶんだけど
いまはもう同じやりかたで動かないかも?
どっちにしても8月に ROCK 5B 届くのでそっちでもう一回チャレンジします。