《Oracle 19c之RPM安装》介绍了在Oracle Linux平台下安装Oracle 19c的过程,其实无论是19c,还是11g,用Oracle Linux会为你省不少的事情,毕竟同为Oracle产品,从推广角度看,肯定会相对其他平台提供更多的便利性,例如提前预安装了需要的Package,设置了信号量,创建了各种账号、路径和权限。
这次采用的19c rpm安装,下载地址是,
https://www.oracle.com/database/technologies/oracle19c-linux-downloads.html
首先关闭防火墙,
[root@bisal ~]# systemctl stop firewalld.service
[root@bisal ~]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
安装19c前,需要安装preinstall包,做些前提准备,但是在这之前,需要确认compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm、ksh、libaio-devel包,再执行,
[root@bisal ~]# rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
19c默认安装路径是/opt/oracle,需要设置权限,
[root@bisal ~]# chown -R oracle:oinstall /opt/oracle
[root@bisal ~]# chmod -R 755 /opt/oracle
安装19c软件,
[root@bisal ~]# rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm
warning: oracle-database-ee-19c-1.0-1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key
ID ec551f03: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:oracle-database-ee-19c-1.0-1 ################################# [100%]
[INFO] Executing post installation scripts...
[INFO] Oracle home installed successfully and ready to be configured.
To configure a sample Oracle Database you can execute the following service
configuration script as root: /etc/init.d/oracledb_ORCLCDB-19c configure
在创建数据库前,可以改些配置,先备份下配置,将ORCLCDB替换为bisal,将ORCLPDB1替换为bisal,
[root@bisal ~]# cp /etc/init.d/oracledb_ORCLCDB-19c /etc/init.d/oracledb_bisal-19c
[root@bisal ~]# vi /etc/init.d/oracledb_bisal-19c
export ORACLE_VERSION=19c
export ORACLE_SID=bisal
export TEMPLATE_NAME=General_Purpose.dbc
export CHARSET=AL32UTF8
export PDB_NAME=bisal
export LISTENER_NAME=LISTENER
export NUMBER_OF_PDBS=1
export CREATE_AS_CDB=false(从true改为false)
创建数据库,
[root@bisal ~]# ./oracledb_bisal-19c configure
Configuring Oracle Database bisal.
Prepare for db operation
10% complete
Copying database files
40% complete
Creating and starting Oracle instance
42% complete
46% complete
50% complete
54% complete
60% complete
Completing Database Creation
66% complete
70% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
/opt/oracle/cfgtoollogs/dbca/bisal.
Database Information:
Global Database Name:bisal
System Identifier(SID):bisal
Look at the log file "/opt/oracle/cfgtoollogs/dbca/bisal/bisal.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.
设置oracle用户的环境变量,
echo "export LANG=en_US" >> ~/.bash_profile
echo "export ORACLE_BASE=/opt/oracle" >> ~/.bash_profile
echo "export ORACLE_HOME=$ORACLE_BASE/product/19c/dbhome_1" >> ~/.bash_profile
echo "export ORACLE_SID=bisal" >> ~/.bash_profile
echo "export NLS_LANG=AMERICAN_AMERICA.AL32UTF8" >> ~/.bash_profile
echo "export PATH=$PATH:$ORACLE_HOME/bin" >> ~/.bash_profile
此时,就完成了19c的安装,确实较之前的版本有了很大的改进,但是我们说万变不离其宗,相关的配置和基本原理还是相同的,只是Oracle替我们封装了一些操作,这就是软件设计演进的过程。