码迷,mamicode.com
首页 > 数据库 > 详细

Installing Oracle Database 18c Using RPM Packages

时间:2018-10-22 16:37:21      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:sys   detail   local   use   定义   orm   starting   nec   inux   

Oracle官方已放出18c企业版的RPM安装包,但仅限于单机版。相对于之前的版本,省去了前期规划配置的繁琐步骤。

1、下载Oracle RPM安装包

从官网选择rpm格式的安装包,下载即可。如下图:
技术分享图片

2、使用yum安装

我这里使用的为oracle linux,软件源用的是oracle软件源,安装如下:

[root@odb03 ~]# yum -y localinstall /u02/oracle-database-ee-18c-1.0-1.x86_64.rpm 

技术分享图片
RPM安装默认的目录为/opt,安装前确保/opt拥有足够的空间。

3、配置Oracle 18c数据库

安装完成后,会产生两个文件:一个是管理oracle服务的脚本(/etc/init.d/oracledb_ORCLCDB-18c),另一个是定义数据文件存放路径的文件(/etc/sysconfig/oracledb_ORCLCDB-18c.conf)。
根据实际情况修改以上两个文件,这里修改了数据文件存放的路径为/u03/oradata以及默认的实例名为testdb。

[root@odb03 ~]# vi /etc/sysconfig/oracledb_testdb-18c.conf 
#This is a configuration file to setup the Oracle Database.
#It is used when running ‘/etc/init.d/oracledb_ORCLCDB configure‘.
#Please use this file to modify the default listener port and the
#Oracle data location.

# LISTENER_PORT: Database listener
LISTENER_PORT=1521

# ORACLE_DATA_LOCATION: Database oradata location
ORACLE_DATA_LOCATION=/u03/oradata

# EM_EXPRESS_PORT: Oracle EM Express listener
EM_EXPRESS_PORT=5500
[root@odb03 ~]# vi /etc/init.d/oracledb_ORCLCDB-18c 
#!/bin/bash
#
# chkconfig: 2345 80 05
# Description: This script is responsible for taking care of configuring the Oracle Database and its associated services.
#
# processname: oracledb_ORCLCDB-18c
# Red Hat or SuSE config: /etc/sysconfig/oracledb_ORCLCDB-18c
#

# Set path if path not set
case $PATH in
        "") PATH=/bin:/usr/bin:/sbin:/etc
                 export PATH ;;
esac

# Check if the root user is running this script
if [ $(id -u) != "0" ]
then
        echo "You must be root user to run the configurations script. Login as root user and try again."
        exit 1
fi

# Setting the required environment variables
export ORACLE_HOME=/opt/oracle/product/18c/dbhome_1

export ORACLE_VERSION=18c
export ORACLE_SID=testdb
export TEMPLATE_NAME=General_Purpose.dbc
export CHARSET=AL32UTF8
export PDB_NAME=kettel
export LISTENER_NAME=LISTENER
export NUMBER_OF_PDBS=1
export CREATE_AS_CDB=true
......

修改完成后,执行/etc/init.d/oracledb_ORCLCDB-18c configure命令创建数据库实例以及监听,如下:

[root@odb03 ~]# /etc/init.d/oracledb_ORCLCDB-18c configure
Configuring Oracle Database testdb.
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/testdb.
Database Information:
Global Database Name:testdb
System Identifier(SID):testdb
Look at the log file "/opt/oracle/cfgtoollogs/dbca/testdb/testdb.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.

其实,这个configure就是调用dbca的静默模式创建数据库实例。创建完成后,根据上面的提示修改系统用户的密码即可。

Installing Oracle Database 18c Using RPM Packages

标签:sys   detail   local   use   定义   orm   starting   nec   inux   

原文地址:http://blog.51cto.com/candon123/2307413

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!