一次耗时4天的oracle安装过程
服务端部署
平台环境
Linux系统:centos7.5 kernel:3.10.0-862.el7.x86_64
Oracle版本:oracle-database-ee-19c
因为oracle19对linux内核有版本要求,所以选择centos7.5
Oracle下载地址
oracle-database-ee-19c:https://www.oracle.com/database/technologies/oracle-database-software-downloads.html
oracle-database-preinstall-19c:
#curl -o oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
开始安装
1.
#yum -y localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
#yum -y localinstall oracle-database-ee-19c-1.0-1.x86_64.rpm
#/etc/init.d/oracledb_ORCLCDB-19c configure
安装完毕,开始进行配置
Oracle的安装目录为:/opt/oracle/
2.配置环境变量,切换到oracle用户下
#su - oracle
vim .bash_profile
export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export PATH=$PATH:/opt/oracle/product/19c/dbhome_1/bin
export ORACLE_SID=ORCLCDB
#source .bash_profile
3.登录oracle数据库
#sqlplus / as sysdba
4.创建用户,授权,参考网上
这里创建用户名时,其实不需要加c##的前缀。
5.登录之后,这里存在一个问题,需要改正
SQL> connect sys/sys as sysdba
Connected.
SQL> show parameter case
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
sec_case_sensitive_logon boolean FALSE
SQL> ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON=TRUE SCOPE=BOTH SID='*';
System altered.
SQL> connect C##TEST/test
Connected.
原因如下:
我在这之前创建了C##TEST这个用户,
1.
http://www.itpub.net/thread-2104715-1-1.html
- 我去查看了用户表,发现用户表中存放的用户名全部为大写,即使你创建的时候是小写的,所以,登录的时候要使用大写的用户名
6.用户登录之后,开启监听
SQL> startup
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.
Total System Global Area 1593832624 bytes
Fixed Size 9135280 bytes
Variable Size 956301312 bytes
Database Buffers 620756992 bytes
Redo Buffers 7639040 bytes
Database mounted.
Database opened.
Oracle用户下
#lsnrctl start
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 12-SEP-2019 04:05:07
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Starting /opt/oracle/product/19c/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/swarm-node-2/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=swarm-node-2)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=swarm-node-2)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 12-SEP-2019 04:05:07
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/swarm-node-2/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=swarm-node-2)(PORT=1521)))
The listener supports no services
The command completed successfully
监听服务没有启动,启动监听服务
#/opt/oracle/product/19c/dbhome_1/bin/tnslsnr
#lsnrctl start
#lsnrctl status
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 12-SEP-2019 04:06:17
Copyright (c) 1991, 2019, Oracle. All rights reserved.
TNS-01106: Listener using listener name LISTENER has already been started
[oracle@swarm-node-2 ~]$ lsnrctl status
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 12-SEP-2019 04:06:32
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=swarm-node-2)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 12-SEP-2019 04:05:07
Uptime 0 days 0 hr. 1 min. 24 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/swarm-node-2/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=swarm-node-2)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=swarm-node-2)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/entation=HTTP)(Session=RAW))
Services Summary...
Service "9242d55611c94751e0534501a8c04b71" has 1 instance(s).
Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
Service "ORCLCDB" has 1 instance(s).
Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
Service "ORCLCDBXDB" has 1 instance(s).
Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
Service "orclpdb1" has 1 instance(s).
Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
The command completed successfully
客户端连接
客户端连接工具使用官方提供的工具:https://www.oracle.com/tools/downloads/sqldev-v192-downloads.html
如果服务端设置正确,最后会在状态栏出现
表示可以连接。
转载:https://blog.csdn.net/bootleader/article/details/100852983