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. Python中文文件处理中涉及的字符编码及字符集

    在现在的互联网,字符编码是互联网信息交互的一个重要基础,各种语言都有支持信息编码的机制,Python也不例外.Python除了字符编码之外,对于字节码和字符串两种类型有严格区分,字符串是本地可以读取的 ...

  2. PyQt(Python+Qt)学习随笔:Qt Designer中Action的信号

    Action与菜单和工具栏挂接后,只是实现了相关的关联关系,但并不能执行响应操作,真正的响应操作是通过Action的信号与对应槽函数连接实现的. Action提供了4种信号: changed()信号: ...

  3. PyQt(Python+Qt)帮助文档官网及文档下载

    一.帮助文档下载 老猿在网上找到一个Qt 5.9的帮助文档,没有找到最新版的,并且这个文档官网上没有下载,不知道源头在哪里可以下载. 文档存放在百度网盘: 链接:https://pan.baidu.c ...

  4. 关于RequestParam在不同的Spring版本上,接口在controller重载时注解可能失效的踩坑记录

    先抛背景: 我项目中的Spring版本是2.0.3.RELEASE. api-demo负责暴露接口,service-demo负责实现功能.接口参数的@RequestParam和@RequestBody ...

  5. GYCTF Web区部分WP

    目录: Blacklist Easyphp Ezsqli FlaskApp EasyThinking 前言: 这次比赛从第二天开始打的,因为快开学了所以就没怎么看题目(主要还是自己太菜)就只做出一道题 ...

  6. 使用XPath爬取西刺代理

    因为在Scrapy的使用过程中,提取页面信息使用XPath比较方便,遂成此文. 在b站上看了介绍XPath的:https://www.bilibili.com/video/av30320885?fro ...

  7. 项目测试环境自动化部署[jenkins前后端配置、Nginx配置]

    持续部署:关注点在于项目功能部署到服务器后可以正常运行,为下一步测试环节或最终用户正式使用做准备.(问题点:一个环节有问题,其他环节跟着有问题) 持续集成:关注点是在于尽早发现项目整体运行问题,尽早解 ...

  8. clion2020最新安装破解版教程 内含激活码、破解补丁、无限重置时间插件

    clion是一款开发C.C++等相关程序的利器,到目前为止已经更新到2020.3版本啦!还没有升级的小伙伴们赶紧升级啦,本文教大家如何安装clion2020.3版本并且破解,此方法亲测100%可以永久 ...

  9. 如何写好商用PPT,计算机行业PPT模板

    如何写好商用PPT,这个问题如果从0开始写那确实需要花费一番功夫,今天我不是来教你如何做PPT,而是教你如何从一个小白如何快速能套用模板,从而做出一个自己行业相关的模板,比如计算机行业PPT模板,奶茶 ...

  10. 在Qt中配置海康工业相机SDK及遇到的问题(报错)

    1.在项目的.pro文件里导入海康工业相机的SDK路径 INCLUDEPATH += \ D:\HKVersion\MVS_3.1.0\MVS\Development\Includes #这时到入Op ...