本文共 3057 字,大约阅读时间需要 10 分钟。
Oracle官方已放出18c企业版的RPM安装包,但仅限于单机版。相对于之前的版本,省去了前期规划配置的繁琐步骤。
从官网选择rpm格式的安装包,下载即可。如下图:
我这里使用的为oracle linux,软件源用的是oracle软件源,安装如下:
[root@odb03 ~]# yum -y localinstall /u02/oracle-database-ee-18c-1.0-1.x86_64.rpmRPM安装默认的目录为/opt,安装前确保/opt拥有足够的空间。
安装完成后,会产生两个文件:一个是管理oracle服务的脚本(/etc/init.d/oracledb_ORCLCDB-18c),另一个是定义数据文件存放路径的文件(/etc/sysconfig/oracledb_ORCLCDB-18c.conf)。
根据实际情况修改以上两个文件,这里修改了数据文件存放的路径为/u03/oradata以及默认的实例名为testdb。如果更改了默认的实例名,则/etc/sysconfig/oracledb_ORCLCDB-18c.conf文件也该更改为对应的实例名,这里为/etc/sysconfig/oracledb_testdb-18c.conf。[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 listenerLISTENER_PORT=1521# ORACLE_DATA_LOCATION: Database oradata locationORACLE_DATA_LOCATION=/u03/oradata# EM_EXPRESS_PORT: Oracle EM Express listenerEM_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 setcase $PATH in "") PATH=/bin:/usr/bin:/sbin:/etc export PATH ;;esac# Check if the root user is running this scriptif [ $(id -u) != "0" ]then echo "You must be root user to run the configurations script. Login as root user and try again." exit 1fi# Setting the required environment variablesexport ORACLE_HOME=/opt/oracle/product/18c/dbhome_1export ORACLE_VERSION=18cexport ORACLE_SID=testdbexport TEMPLATE_NAME=General_Purpose.dbcexport CHARSET=AL32UTF8export PDB_NAME=kettelexport LISTENER_NAME=LISTENERexport NUMBER_OF_PDBS=1export CREATE_AS_CDB=true......
修改完成后,执行/etc/init.d/oracledb_ORCLCDB-18c configure命令创建数据库实例以及监听,如下:
[root@odb03 ~]# /etc/init.d/oracledb_ORCLCDB-18c configureConfiguring Oracle Database testdb.Prepare for db operation8% completeCopying database files31% completeCreating and starting Oracle instance32% complete36% complete40% complete43% complete46% completeCompleting Database Creation51% complete54% completeCreating Pluggable Databases58% complete77% completeExecuting Post Configuration Actions100% completeDatabase creation complete. For details check the logfiles at: /opt/oracle/cfgtoollogs/dbca/testdb.Database Information:Global Database Name:testdbSystem Identifier(SID):testdbLook 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的静默模式创建数据库实例。创建完成后,根据上面的提示修改系统用户的密码即可。
Oracle 18c默认会开启Enterprise Manager Database Express,修改完sys密码之后,就可以通过如下格式访问:。
转载地址:http://sznao.baihongyu.com/