Linux-CentOS7.9系统rpm离线安装Oracle 19C

        1、环境准备

        oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

        oracle-database-ee-19c-1.0-1.x86_64.rpm

        可以通过官网下载,也可以私信我。

        2、安装preinstall

# groupadd oinstall

# groupadd dba

# useradd oracle -g oinstall -G dba

# chown -R oracle:oinstall /opt/oracle

# id oracle

# yum -y localinstall /opt/oracle/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

Linux-CentOS7.9系统rpm离线安装Oracle 19C_第1张图片

 # yum -y localinstall /opt/oracle/oracle-database-ee-19c-1.0-1.x86_64.rpm

Linux-CentOS7.9系统rpm离线安装Oracle 19C_第2张图片

 3、修改配置脚本

# vim /etc/init.d/oracledb_ORCLCDB-19c 修改编码方式 ZHS16GBK

Linux-CentOS7.9系统rpm离线安装Oracle 19C_第3张图片

4、初始化数据库

# /etc/init.d/oracledb_ORCLCDB-19c configure

Linux-CentOS7.9系统rpm离线安装Oracle 19C_第4张图片

5、添加环境变量

# vim /etc/profile.d/oracle19c.sh

# export  ORACLE_HOME=/opt/oracle/product/19c/dbhome_1

# export  PATH=$PATH:/opt/oracle/product/19c/dbhome_1/bin

# export  ORACLE_SID=ORCLCDB

Linux-CentOS7.9系统rpm离线安装Oracle 19C_第5张图片

6、修改oracle密码

# passwd oracle

7、切换到oracle用户,切换到pdb,创建表空间

# sqlplus / as sysdba

Linux-CentOS7.9系统rpm离线安装Oracle 19C_第6张图片

# show pdbs;

# show con_name

# alter session set container=ORCLPDB1;

# show con_name

# select * from v$tablespace;

# CREATE BIGFILE TABLESPACE "XRG" DATAFILE '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/xrg.dbf' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO; 

Linux-CentOS7.9系统rpm离线安装Oracle 19C_第7张图片

 8、新建用户和授权

# create user xrg identified by 123;

# alter user xrg default tablespace XRG;

# grant connect,resource,dba to xrg;

 9、配置监听

# vim /opt/oracle/product/19c/dbhome_1/network/admin/tnsnames.ora

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = ORCLCDB)
      (SID_NAME = ORCLCDB)
      (ORACLE_HOME = /opt/oracle/product/19c/dbhome_1)
    )
   (SID_DESC =
      (GLOBAL_DBNAME = ORCLPDB1)      
      (SID_NAME = ORCLCDB)
      (ORACLE_HOME = /opt/oracle/product/19c/dbhome_1)
    )
  )

Linux-CentOS7.9系统rpm离线安装Oracle 19C_第8张图片

 重启监听

# lsnrctl stop

# lsnrctl start

Linux-CentOS7.9系统rpm离线安装Oracle 19C_第9张图片

 10、PLSQL登录

配置客户端监听,打开本地客户端:

D:\xx\xx\PLSQL Developer 15\instantclient_19_10\NETWORK\ADMIN下的tnsnames.ora,增加如下配置(注意ip和port)

PDBORCL =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = xxx.xxx.xxx.xxx)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SERVICE_NAME = ORCLPDB1)

    )

  )

ORCL =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = xxx.xxx.xxx.xxx)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SERVICE_NAME = ORCLCDB)

    )

  )

 Linux-CentOS7.9系统rpm离线安装Oracle 19C_第10张图片

 附赠:

plsql中文乱码

# select userenv('language') from dual;

Linux-CentOS7.9系统rpm离线安装Oracle 19C_第11张图片

配置环境变量:

# NLS_LANG 

# AMERICAN_AMERICA.ZHS16GBK

******重新启动PLSQL,就可以不乱码了,但是之前已经写入的汉字,需要重新插入,否则还是识别不了 

你可能感兴趣的:(数据库,oracle,数据库)