Centos7上以RPM包方式安装Oracle 18c XE

安装阿里云 YUM 源

https://opsx.alibaba.com/mirror?lang=zh-CN

一、安装oracle数据库

  1. 安装Oracle预安装RPM

yum -y localinstall https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm

  1. 安装Oracle Database RPM

yum localinstall -y  oracle-database-xe-18c-1.0-1.x86_64.rpm

二、创建和配置Oracle数据库

1.查看配置

#根据需要修改

cat  /etc/sysconfig/oracle-xe-18c.conf

[root@localhost sysconfig]# cat oracle-xe-18c.conf

#This is a configuration file to setup the Oracle Database.

#It is used when running '/etc/init.d/oracle-xe-18c configure'.

# LISTENER PORT used Database listener, Leave empty for automatic port assignment

LISTENER_PORT=1521

# EM_EXPRESS_PORT Oracle EM Express URL port

EM_EXPRESS_PORT=5500

# Character set of the database

CHARSET=AL32UTF8

# Database file directory

# If not specified, database files are stored under Oracle base/oradata

DBFILE_DEST=

# SKIP Validations, memory, space

SKIP_VALIDATIONS=false

2.创建Oracle数据库实例

执行脚本

/etc/init.d/oracle-xe-18c configure

# 执行脚本之后将创建一个容器数据库(ROOTCDB)和一个可插拔数据库(XEPDB1),并且配置的默认监听端口是1521。

注意 /opt 目录剩余空间大小

[root@localhost home]# /etc/init.d/oracle-xe-18c configure

Specify a password to be used for database accounts. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts:

Confirm the password:

Configuring Oracle Listener.

Listener configuration succeeded.

Configuring Oracle Database XE.

Enter SYS user password:

**********

Enter SYSTEM user password:

**********

Enter PDBADMIN User Password:

**********

Prepare for db operation

7% complete

Copying database files

29% complete

Creating and starting Oracle instance

30% complete

31% complete

34% complete

38% complete

41% complete

43% complete

Completing Database Creation

47% complete

50% complete

Creating Pluggable Databases

54% complete

71% complete

Executing Post Configuration Actions

93% complete

Running Custom Scripts

100% complete

Database creation complete. For details check the logfiles at:

/opt/oracle/cfgtoollogs/dbca/XE.

Database Information:

Global Database Name:XE

System Identifier(SID):XE

Look at the log file "/opt/oracle/cfgtoollogs/dbca/XE/XE.log" for further details.

Connect to Oracle Database using one of the connect strings:

Pluggable database: localhost.localdomain/XEPDB1

Multitenant container database: localhost.localdomain

Use https://localhost:5500/em to access Oracle Enterprise Manager for Oracle Database XE

[root@localhost home]# echo $?

0

三、使用

#作用于/etc/profile 一样

vi /etc/profile.d/oracle.sh

#!/bin/bash

export ORACLE_SID=XE

export ORACLE_HOME=/opt/oracle/product/18c/dbhomeXE

export ORACLE_BASE=/opt/oracle

export PATH=$PATH:/opt/oracle/product/18c/dbhomeXE/bin

#刷新环境变量

source /etc/profile.d/oracle.sh

相关命令

#监听端口查看

netstat -tunlp | grep -E '1521|5500'

# 监听

lsnrctl start

lsnrctl stop

lsnrctl stat

# 数据库

dbstart $ORACLE_HOME

dbshut  $ORACLE_HOME

连接到oracle数据库

# 切换到 oracle 用户,root 用户下无法连接su - oracle

# 启动监听

lsnrctl start

# 以 sysdba 身份登录

sqlplus / as sysdba

修改数据库密码

-- 启动数据库

startup;

-- 配置 system 和 sys 账户的密码

alter user system identified by abc123456;

alter user sys identified by abc123456;

-- 版本查询

select banner from sys.v_$version;

-- 查看所有用户

select username from dba_users;

开放防火墙端口

firewall-cmd --permanent --add-port=1521/tcp

firewall-cmd --reload

firewall-cmd --list-ports

四、添加开机自启动

设置数据库自启动

vi /etc/oratab

XE:/opt/oracle/product/18c/dbhomeXE:Y

 

 

 

Centos7上以RPM包方式安装Oracle 18c XE的更多相关文章

  1. CentOS7 上以 RPM 包方式安装 Oracle 18c 单实例

    安装阿里云 YUM 源 https://opsx.alibaba.com/mirror?lang=zh-CN 一.安装Oracle数据库 1.安装 Oracle 预安装 RPM yum -y loca ...

  2. MySQL在linux上的rpm包方式安装方法

    1.下载上传mysql server和client rpm包: [root@faspdev mnt]# ls MySQL-client-5.5.53-1.el6.x86_64.rpm MySQL-se ...

  3. RPM包方式安装Oracle21c的方法

    RPM包方式安装Oracle21c的方法 前言 北京时间2021.8.14 Oracle发布了最新的数据库版本Oracle21c, Oracle规划不再发布Oracle20c和Oracle22c, 直 ...

  4. MySQL使用RPM包方式安装

        CentOS7安装MySQL的方法之RPM包方式        

  5. Gitlab环境快速部署(RPM包方式安装)

    之前梳理了一篇Gitlab的安装CI持续集成系统环境---部署Gitlab环境完整记录,但是这是bitnami一键安装的,版本比较老.下面介绍使用rpm包安装Gitlab,下载地址:https://m ...

  6. CentOS 6.5 RPM包方式安装 Mysql 5.6

    1. 下载MySQL 5.6 下载页面:http://dev.mysql.com/downloads/mysql/此处选择“Red Hat Enterprise Linux 6 / Oracle Li ...

  7. CentOS7 图形化方式安装 Oracle 18c 单实例

    下载 Oracle 数据库,zip 包 https://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.h ...

  8. CentOS7 图形化方式安装Oracle 18c 安装配置

    下载 Oracle 数据库,zip 包 https://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.h ...

  9. CentOS7下源码包方式安装rabbitmq

    1.先安装erlang http://www.cnblogs.com/justphp/p/6093880.html 2.下载rabbitmq rpm包: wget http://www.rabbitm ...

随机推荐

  1. 第8.16节 Python重写自定义类的__str__方法

    一. 引言 上节结合案例介绍了重写__repr__方法的关注点,重写__repr__方法的要点是要准确的输出开发人员关注的信息,并便于开发人员使用相关信息.而__str__方法是为最终用户返回类的相关 ...

  2. PyQt(Python+Qt)学习随笔:树型部件QTreeWidget的itemAbove、itemBelow方法作用探究

    老猿Python博文目录 专栏:使用PyQt开发图形界面Python应用 老猿Python博客地址 在QTreeWidget的方法中,对于itemBelow.itemAbove方法,官网文档介绍非常简 ...

  3. Python正则表达式re.match(r"(..)+", "a1b2c3")匹配结果为什么是”c3”?

    在才开始学习正则表达式处理时,老猿对正则表达式:re.match(r"(-)+", "a1b2c3") 返回的匹配结果为"c3"没有理解,学 ...

  4. PyQt(Python+Qt)学习随笔:窗口对象尺寸调整相关的函数resize、showMaximized、showNormal、showMinimized

    resize(width,height) resize可以直接调整窗口的尺寸,调整效果类似于鼠标直接拉伸或缩小窗口,但窗口大小的最大值.最小值受窗口的sizePolicy.sizeHint.minim ...

  5. PHP代码审计分段讲解(7)

    17 密码md5比较绕过 <?php if($_POST[user] && $_POST[pass]) { mysql_connect(SAE_MYSQL_HOST_M . ': ...

  6. hihocoder 1489(微软2017, 数学,模拟)

    题目链接:http://hihocoder.com/problemset/problem/1489?sid=1587434 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 ...

  7. 精品软件-OfficeBox办公神器

    办公文档office处理套件,非常齐全,小巧! 官方地址:http://www.wofficebox.com/

  8. 国际关注,Panda 交易所获悉美银监机构批准特许银行托管加密资产

    近期,Panda 交易所注意到,根据此前与Cointelegraph分享的一份声明,美国货币监理署(OCC)正在授予联邦特许银行托管加密货币的权限. 鉴于加密钱包与其他种类资产的托管要求不同,这一问题 ...

  9. Struts2 S2-061漏洞复现(CVE-2020-17530)

    0x01 漏洞描述 Struts2 会对某些标签属性(比如 `id`,其他属性有待寻找) 的属性值进行二次表达式解析,因此当这些标签属性中使用了 `%{x}` 且 `x` 的值用户可控时,用户再传入一 ...

  10. C++ 虚函数表与多态 —— 虚函数表的内存布局

       C++面试经常会被问的问题就是多态原理.如果对C++面向对象本质理解不是特别好,问到这里就会崩. 下面从基本到原理,详细说说多态的实现:虚函数 & 虚函数表.   1. 多态的本质: 形 ...