原 在Docker中快速体验Oracle 23ai版
简介
2024.05.03, Oracle Database 23ai 发布,现在Oracle 23c 正式更名为 Oracle 23ai。
之前的介绍可以参考:https://www.dbaup.com/oracle-23aijieshao.html
docker环境下载
1 2 3 4 5 6 7 8 | docker rm -f lhrora23ai docker run -itd --name lhrora23ai -h lhrora23ai \ -p 1531:1521 -p 31389:3389 \ -v /sys/fs/cgroup:/sys/fs/cgroup \ --privileged=true lhrbest/oracle23ai:1.0 \ /usr/sbin/init docker exec -it lhrora23ai bash |
启动数据库和监听
1 2 | /etc/init.d/oracle-free-23ai status /etc/init.d/oracle-free-23ai start |
示例:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | [root@lhrora23ai /]# /etc/init.d/oracle-free-23ai status Status of the Oracle FREE 23ai service: LISTENER status: STOPPED FREE Database status: STOPPED [root@lhrora23ai /]# [root@lhrora23ai /]# /etc/init.d/oracle-free-23ai start Starting Oracle Net Listener. Oracle Net Listener started. Starting Oracle Database instance FREE. Oracle Database instance FREE started. [root@lhrora23ai /]# su - oracle Last login: Wed May 8 10:27:01 CST 2024 on pts/1 [oracle@lhrora23ai ~]$ |
测试新特性
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | [oracle@lhrora23ai ~]$ sas SQL*Plus: Release 23.0.0.0.0 - Production on Wed May 8 10:27:32 2024 Version 23.4.0.24.05 Copyright (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.05 SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 FREEPDB1 READ WRITE NO SQL> select 1; 1 ---------- 1 SQL> SELECT SYSDATE; SYSDATE --------- 08-MAY-24 SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'; Session altered. SQL> SELECT SYSDATE; SYSDATE ------------------- 2024-05-08 10:28:08 SQL> |
客户端使用
使用sqlplus远程连接:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | C:\Users\lhr>sqlplus sys/lhr@192.16.7.162:1531/FREE as sysdba SQL*Plus: Release 21.0.0.0.0 - Production on Wed May 8 10:29:37 2024 Version 21.3.0.0.0 Copyright (c) 1982, 2021, 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.05 SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 FREEPDB1 READ WRITE NO SQL> exit Disconnected from Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free Version 23.4.0.24.05 C:\Users\lhr>sqlplus sys/lhr@192.16.7.162:1531/freepdb1 as sysdba SQL*Plus: Release 21.0.0.0.0 - Production on Wed May 8 10:30:04 2024 Version 21.3.0.0.0 Copyright (c) 1982, 2021, 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.05 SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 3 FREEPDB1 READ WRITE NO SQL> |
使用PL/SQL Developer连接: