使用RPM安装Oracl Database18c

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/stevensxiao/article/details/88232190

只能安装单实例,不能利用RPM升级。

  1. 准备一台Linux机器
    可以利用Oracle在Github上的Vagrant Box,Vagrantfile如下:
Vagrant.configure("2") do |config|
  config.vm.box = "https://yum.oracle.com/boxes/oraclelinux/ol76/ol76.box"
  config.vm.hostname = "ol7-183.localdomain"
  config.vm.provider :virtualbox do |vb|
       	vb.name = "ol7-183"
	vb.memory = 4096
  end
end
  1. 主机名解析
    由于使用的是NAT网卡,因此IP地址为10.0.2.15,相应的修改主机名文件如下:
[vagrant@ol7-183 ~]$ cat /etc/hosts
10.0.2.15       ol7-183.localdomain     ol7-183
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
  1. 安装18c数据库先决条件包,会建立oracle用户,及设置系统参数
[root@ol7-183 vagrant]# yum -y install oracle-database-preinstall-18c
[vagrant@ol7-183 ~]$ rpm -qa|grep preinstall
oracle-database-preinstall-18c-1.0-1.el7.x86_64
[vagrant@ol7-183 ~]$ id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba)
[vagrant@ol7-183 ~]$ echo ~oracle
/home/oracle
  1. 安装数据库软件
[root@ol7-183 vagrant]# time yum -y localinstall oracle-database-ee-18c-1.0-1.x86_64.rpm
Examining oracle-database-ee-18c-1.0-1.x86_64.rpm: oracle-database-ee-18c-1.0-1.x86_64
Marking oracle-database-ee-18c-1.0-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-ee-18c.x86_64 0:1.0-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================
 Package                                           Arch                              Version                           Repository                                                       Size
=============================================================================================================================================================================================
Installing:
 oracle-database-ee-18c                            x86_64                            1.0-1                             /oracle-database-ee-18c-1.0-1.x86_64                            7.8 G

Transaction Summary
=============================================================================================================================================================================================
Install  1 Package

Total size: 7.8 G
Installed size: 7.8 G
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : oracle-database-ee-18c-1.0-1.x86_64                                                                                                                                       1/1
[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-18c configure
  Verifying  : oracle-database-ee-18c-1.0-1.x86_64                                                                                                                                       1/1

Installed:
  oracle-database-ee-18c.x86_64 0:1.0-1

Complete!

real    9m56.181s
user    5m44.830s
sys     1m9.922s
  1. 创建示例数据库
[root@ol7-183 vagrant]# time /etc/init.d/oracledb_ORCLCDB-18c 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.

real    26m12.881s
user    0m37.166s
sys     0m4.722s
  1. 连接示例数据库
[root@ol7-183 vagrant]# su - oracle
Last login: Wed Mar  6 06:08:19 UTC 2019 on pts/0
[oracle@ol7-183 ~]$ . oraenv
ORACLE_SID = [oracle] ? ORCLCDB
The Oracle base has been set to /opt/oracle
[oracle@ol7-183 ~]$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Wed Mar 6 06:08:39 2019
Version 18.3.0.0.0

Copyright (c) 1982, 2018, Oracle.  All rights reserved.


Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0

SQL> exit
Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0

参考

  1. https://docs.oracle.com/en/database/oracle/oracle-database/18/ladbi/running-rpm-packages-to-install-oracle-database.html#GUID-BB7C11E3-D385-4A2F-9EAF-75F4F0AACF02

猜你喜欢

转载自blog.csdn.net/stevensxiao/article/details/88232190