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. Moviepy音视频开发:开发视频转gif动画或jpg图片exe图形化工具的案例

    ☞ ░ 前往老猿Python博文目录 ░ 一.引言 老猿之所以学习和研究Moviepy的使用,是因为需要一个将视频转成动画的工具,当时在网上到处搜索查找免费使用工具,结果找了很多自称免费的工具,但转完 ...

  2. 第11.10节 Python正则表达式的非贪婪模式的重复匹配:'*?', '+?',和 '??'

    在<第11.9节 Pytho正则表达式的贪婪模式和非贪婪模式>老猿简单介绍了贪婪模式和非贪婪模式,并说明'', '+',和 '?' 修饰符都是 贪婪的:它们在字符串进行尽可能多的匹配.有时 ...

  3. 刷题记录:[GWCTF 2019]枯燥的抽奖

    目录 刷题记录:[GWCTF 2019]枯燥的抽奖 知识点 php伪随机性 刷题记录:[GWCTF 2019]枯燥的抽奖 题目复现链接:https://buuoj.cn/challenges 参考链接 ...

  4. 小程序editor篇-基本使用图片上传

    今天小程序项目内,要弄一个editor,富文本编辑功能,支持图文并茂,前几天刚好看了小程序的demo应用,刚好看到editor这个东东,那就安排! 官网示例git地址 大概看了下文档,拉下官方示例,看 ...

  5. 两种方式简单免杀ew

    1.资源操作法 使用工具: Restorator 2018 BeCyIconGrabber 首先我们从github下载ew使用360进行查杀 打开Restorator 将ew拖入,右键添加资源 选择图 ...

  6. 【APIO2018】选圆圈(平面分块 | CDQ分治 | KDT)

    Description 给定平面上的 \(n\) 个圆,用三个参数 \((x, y, R)\) 表示圆心坐标和半径. 每次选取最大的一个尚未被删除的圆删除,并同时删除所有与其相切或相交的圆. 最后输出 ...

  7. Power BI八年回望记

    本人从事BI,数据仓库领域相关工作15个年头,这15年目睹了这个方向从火爆到逐渐被大数据领域不断吞食.中间零散关注Power BI好长时间,也算目睹了它的成长. 那天在网络上搜索power bi,无意 ...

  8. 通过游戏学javascript系列第一节Canvas游戏开发基础

    本节教程通过一个简单的游戏小例子,讲解Canvas的基础知识. 最终效果: 点击移动的方块,方块上的分数会增加,方块的行进方向会改变,并且方块的速度会增加. 在线演示 源码 HTML5引入了canva ...

  9. 实验楼表关系建立 (课程模块&#183;5张表)

    实验楼表关系图 from utils.MyBaseModel import Base from django.db import models # # Create your models here. ...

  10. mysql数据库设置超时断开连接

    mysql数据库长时间未操作自动断开连接由参数:interactive_timeout和wait_timeout控制,默认都是8小时(28800分钟) mysql> show variables ...