简介
我一直认为,最靠谱的文档就是原厂官网的文档,阅读再次加工的文档都有可能把你带偏。
oracle官网提供了大量的文档,一个好的oracle使用者,应该首先是好的oracle官网阅读者。
oracle数据库作为收费颇贵的商业数据库软件,其功能和支持却也是无可挑剔。新推出的oracle 23c,其配套推出的 oracle 23c free 免费版数据库,着实方便了oracle爱好者的学习和提高。而其安装之简便,也是让人啧啧称赞。
1. 下载oracle free相关rpm及安装手册
oracle 的下载地址如下:Software Download | Oracle
而 最新推出的oracle database 23C free的安装手册如下:Oracle Database Free Installation Guide, 23c for Linux x86-64
根据该官方的安装文档,针对centos x86_64版,下载如下两个文件
-
oracle-database-preinstall-23c-1.0-1.el8.x86_64.rpm
Oracle Linux 8 (x86_64) Development | Oracle, Software. Hardware. Complete.
-
oracle-database-free-23c-1.0-1.el8.x86_64.rpm
Get Started with Oracle Database 23c | Oracle
这里两个rpm都可以下载
下载的文件,我把它们放到了root 的home目录下
2. 用dnf 本地安装preinstall
[root@centos8 ~]# ls
anaconda-ks.cfg oracle-database-free-23c-1.0-1.el8.x86_64.rpm
initial-setup-ks.cfg oracle-database-preinstall-23c-1.0-1.el8.x86_64.rpm
[root@centos8 ~]# dnf -y install oracle-database-preinstall-23c-1.0-1.el8.x86_64.rpm
Last metadata expiration check: 0:03:10 ago on Wed 24 Apr 2024 08:36:27 PM CST.
Dependencies resolved.
=============================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================
Installing:
oracle-database-preinstall-23c x86_64 1.0-1.el8 @commandline 30 k
Installing dependencies:
compat-openssl10 x86_64 1:1.0.2o-3.el8 AppStream 1.1 M
glibc-devel x86_64 2.28-164.el8 base 1.0 M
glibc-headers x86_64 2.28-164.el8 base 480 k
kernel-headers x86_64 4.18.0-348.7.1.el8_5 base 8.3 M
ksh x86_64 20120801-254.el8 AppStream 926 k
libxcrypt-devel x86_64 4.1.1-6.el8 base 25 k
make x86_64 1:4.2.1-10.el8 base 498 k
Transaction Summary
=============================================================================================================================
Install 8 Packages
Total size: 12 M
Total download size: 12 M
Installed size: 16 M
Downloading Packages:
(1/7): glibc-headers-2.28-164.el8.x86_64.rpm 3.1 MB/s | 480 kB 00:00
(2/7): glibc-devel-2.28-164.el8.x86_64.rpm 5.8 MB/s | 1.0 MB 00:00
(3/7): libxcrypt-devel-4.1.1-6.el8.x86_64.rpm 344 kB/s | 25 kB 00:00
(4/7): make-4.2.1-10.el8.x86_64.rpm 3.9 MB/s | 498 kB 00:00
(5/7): compat-openssl10-1.0.2o-3.el8.x86_64.rpm 5.4 MB/s | 1.1 MB 00:00
(6/7): ksh-20120801-254.el8.x86_64.rpm 3.7 MB/s | 926 kB 00:00
(7/7): kernel-headers-4.18.0-348.7.1.el8_5.x86_64.rpm 12 MB/s | 8.3 MB 00:00
-----------------------------------------------------------------------------------------------------------------------------
Total 17 MB/s | 12 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : make-1:4.2.1-10.el8.x86_64 1/8
Running scriptlet: make-1:4.2.1-10.el8.x86_64 1/8
Installing : compat-openssl10-1:1.0.2o-3.el8.x86_64 2/8
Running scriptlet: compat-openssl10-1:1.0.2o-3.el8.x86_64 2/8
Installing : ksh-20120801-254.el8.x86_64 3/8
Running scriptlet: ksh-20120801-254.el8.x86_64 3/8
Installing : kernel-headers-4.18.0-348.7.1.el8_5.x86_64 4/8
Running scriptlet: glibc-headers-2.28-164.el8.x86_64 5/8
Installing : glibc-headers-2.28-164.el8.x86_64 5/8
Installing : libxcrypt-devel-4.1.1-6.el8.x86_64 6/8
Installing : glibc-devel-2.28-164.el8.x86_64 7/8
Running scriptlet: glibc-devel-2.28-164.el8.x86_64 7/8
Installing : oracle-database-preinstall-23c-1.0-1.el8.x86_64 8/8
Running scriptlet: oracle-database-preinstall-23c-1.0-1.el8.x86_64 8/8
Verifying : glibc-devel-2.28-164.el8.x86_64 1/8
Verifying : glibc-headers-2.28-164.el8.x86_64 2/8
Verifying : kernel-headers-4.18.0-348.7.1.el8_5.x86_64 3/8
Verifying : libxcrypt-devel-4.1.1-6.el8.x86_64 4/8
Verifying : make-1:4.2.1-10.el8.x86_64 5/8
Verifying : compat-openssl10-1:1.0.2o-3.el8.x86_64 6/8
Verifying : ksh-20120801-254.el8.x86_64 7/8
Verifying : oracle-database-preinstall-23c-1.0-1.el8.x86_64 8/8
Installed:
compat-openssl10-1:1.0.2o-3.el8.x86_64 glibc-devel-2.28-164.el8.x86_64
glibc-headers-2.28-164.el8.x86_64 kernel-headers-4.18.0-348.7.1.el8_5.x86_64
ksh-20120801-254.el8.x86_64 libxcrypt-devel-4.1.1-6.el8.x86_64
make-1:4.2.1-10.el8.x86_64 oracle-database-preinstall-23c-1.0-1.el8.x86_64
Complete!
3.用dnf 本地安装Oracle_free
[root@centos8 ~]# dnf -y localinstall oracle-database-free-23c-1.0-1.el8.x86_64.rpm
Last metadata expiration check: 0:11:22 ago on Wed 24 Apr 2024 08:36:27 PM CST.
Dependencies resolved.
=============================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================
Installing:
oracle-database-free-23c x86_64 1.0-1 @commandline 1.6 G
Transaction Summary
=============================================================================================================================
Install 1 Package
Total size: 1.6 G
Installed size: 4.0 G
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: oracle-database-free-23c-1.0-1.x86_64 1/1
Installing : oracle-database-free-23c-1.0-1.x86_64 1/1
Running scriptlet: oracle-database-free-23c-1.0-1.x86_64 1/1
[INFO] Executing post installation scripts...
[INFO] Oracle home installed successfully and ready to be configured.
To configure Oracle Database Free, optionally modify the parameters in '/etc/sysconfig/oracle-free-23c.conf' and then run '/etc/init.d/oracle-free-23c configure' as root.
Verifying : oracle-database-free-23c-1.0-1.x86_64 1/1
Installed:
oracle-database-free-23c-1.0-1.x86_64
Complete!
4. 执行config 完成配置
[root@centos8 sysconfig]# /etc/init.d/oracle-free-23c configure
Specify a password to be used for database accounts. 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]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts:
Confirm the password:
Configuring Oracle Listener.
Listener configuration succeeded.
Configuring Oracle Database FREE.
Enter SYS user password:
*******
Enter SYSTEM user password:
*********
Enter PDBADMIN User Password:
********
Prepare for db operation
7% complete
Copying database files
29% complete
Creating and starting Oracle instance
30% complete
33% complete
36% complete
39% complete
43% complete
Completing Database Creation
47% complete
49% complete
50% complete
Creating Pluggable Databases
54% complete
71% complete
Executing Post Configuration Actions
93% complete
Running Custom Scripts
100% complete
Database creation complete. For details check the logfiles at:
/opt/oracle/cfgtoollogs/dbca/FREE.
Database Information:
Global Database Name:FREE
System Identifier(SID):FREE
Look at the log file "/opt/oracle/cfgtoollogs/dbca/FREE/FREE.log" for further details.
Connect to Oracle Database using one of the connect strings:
Pluggable database: centos8/FREEPDB1
Multitenant container database: centos8
5.以oracle用户登录,运行环境设置
[root@centos8 sysconfig]# su - oracle
[oracle@centos8 ~]$ pwd
/home/oracle
[oracle@centos8 ~]$ export ORACLE_SID=FREE
[oracle@centos8 ~]$ export ORAENV_ASK=NO
[oracle@centos8 ~]$ . /opt/oracle/product/23c/dbhomeFree/bin/oraenv
The Oracle base has been set to /opt/oracle
为方便起见,可以将oraenv拷贝到oralce的home 目录,以后每次运行sqlplus ,都需要 运行oraenv以设置oracle用户的运行环境
6. 用sqlplus 验证 oracle free安装成功并正常启动
[oracle@centos8 bin]$ ./sqlplus / as sysdba
SQL*Plus: Release 23.0.0.0.0 - Production on Wed Apr 24 21:34:23 2024
Version 23.3.0.23.09
Copyright (c) 1982, 2023, Oracle. All rights reserved.
Connected to:
Oracle Database 23c Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.3.0.23.09
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
FREE OPEN
7. 设置 oracle free instance随操作系统启停
[root@centos8 ~]#systemctl daemon-reload
[root@centos8 ~]#
systemctl enable oracle-free-23c
[root@centos8 ~]#systemctl start oracle-free-23c
[root@centos8 ~]#systemctl stop oracle-free-23c
oracle 23C的 free 数据库,为oracle 的爱好者学习23C 的new feature 提供了极大的便利。