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
# yum -y localinstall /opt/oracle/oracle-database-ee-19c-1.0-1.x86_64.rpm
3、修改配置脚本
# vim /etc/init.d/oracledb_ORCLCDB-19c 修改编码方式 ZHS16GBK
4、初始化数据库
# /etc/init.d/oracledb_ORCLCDB-19c configure
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
6、修改oracle密码
# passwd oracle
7、切换到oracle用户,切换到pdb,创建表空间
# sqlplus / as sysdba
# 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;
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)
)
)
重启监听
# lsnrctl stop
# lsnrctl start
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)
)
)
附赠:
plsql中文乱码
# select userenv(‘language’) from dual;
配置环境变量:
# NLS_LANG
# AMERICAN_AMERICA.ZHS16GBK
******重新启动PLSQL,就可以不乱码了,但是之前已经写入的汉字,需要重新插入,否则还是识别不了
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/101723.html