服务器操作系统:银河麒麟V10 SP2(Kylin Linux Advanced Server V10 (Sword))
数据库版本:Oracle 19C(19.3.0.0.0)
SSH工具:secureCRT8.0
一、上传安装包
[root]
[root@database ~]# ll *.rpm
-rw-r--r-- 1 root root 19112 Jun 20 00:54 compat-libcap1-1.10-7.el7.x86_64.rpm
-rw-r--r-- 1 root root 195388 Sep 5 2022 compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
-rw-r--r-- 1 root root 2694664264 Jun 19 19:55 oracle-database-ee-19c-1.0-1.x86_64.rpm
-rw-r--r-- 1 root root 18204 Jun 20 00:28 oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
银河麒麟V10上使用el7版本的包也是可以安装的
二 、安装依赖包
[root]
rpm -ivh compat-libcap1-1.10-7.el7.x86_64.rpm
rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
yum -y install /lib64/libnsl.so.1
三、安装oracle预准备包
[root]
[root@db1 data]# rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
warning: oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
/etc/redhat-release is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
ksh is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
libstdc++-devel is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
对于缺少的包,安装即可
[root]
[root@db1 data]# yum -y install libstdc*
[root@db1 data]# yum -y install ksh*
对于版本依赖,我们跳过即可
[root]
[root@db1 data]# rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm --nodeps
warning: oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:oracle-database-preinstall-19c-1.################################# [100%]
四、安装数据库软件
使用root直接安装数据库软件
[root]
[root@db1 data]# rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
warning: oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
/etc/redhat-release is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
[root@db1 data]# cat etc/redhat-release
cat: etc/redhat-release: No such file or directory
[root@db1 data]# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.0 (Ootpa)
[root@db1 data]# rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm --nodeps
warning: oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:oracle-database-preinstall-19c-1.################################# [100%]
五、初始化数据库
[root]
[root@db1 data]# /etc/init.d/oracledb_ORCLCDB-19c configure
Configuring Oracle Database ORCLCDB.
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.
Database configuration completed successfully. The passwords were auto generated, you must change them by connecting to the database using 'sqlplus / as sysdba' as the oracle user.
六、使用
6.1 配置环境变量
[oracle]
cat >> /home/oracle/.bash_profile << "EOF"
umask 022
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19c/dbhome_1
export ORACLE_SID=ORCLCDB
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
EOF
source /home/oracle/.bash_profile
6.2 检查数据库运行状态
[oracle@db1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Jul 13 03:28:02 2024
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ WRITE
七、总结
本文将详细指导如何通过RPM包在Kylin Server V10上完成Oracle Database 19c的安装,包括前期准备、环境配置、安装步骤,让新手DBA快速在国产操作系统上使用Oracle数据库。