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