CentOS部署Oracle19c(rpm方式)

软件包下载地址

一共需要两个软件包

# oracle数据库企业版
oracle-database-ee-19c-1.0-1.x86_64.rpm

# Oracle Database 19c的预安装RPM包,它主要用于在正式安装Oracle数据库之前准备系统环境
oracle-database-preinstall-19c-1.0-3.el7.x86_64.rpm
https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/index.html
https://www.oracle.com/database/technologies/oracle19c-linux-downloads.html

安装Oracle

hostnamectl set-hostname oracle
echo '192.168.207.131 oralce' >> /etc/hosts
yum -y localinstall oracle-database-preinstall-19c-1.0-3.el7.x86_64.rpm 
yum -y localinstall oracle-database-ee-19c-1.0-1.x86_64.rpm

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


[root@oracle ~]# /etc/init.d/oracledb_ORCLCDB-19c configure
Configuring Oracle Database ORCLCDB.
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /opt/oracle/cfgtoollogs/dbca/ORCLCDB.
Database Information:
Global Database Name:ORCLCDB
System Identifier(SID):ORCLCDB
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB1.log" for further details.

Database configuration completed successfully. The passwords were auto generated, you must change them by connecting to the database using 'sqlplus / as sysdba' as the oracle user.

常用命令 

/etc/init.d/oracledb_oradb-19c start 开启db

/etc/init.d/oracledb_oradb-19c stop 停止db

/etc/init.d/oracledb_oradb-19c restart 重启db

/etc/init.d/oracledb_oradb-19c delete 删除

/etc/init.d/oracledb_oradb-19c configure 配置创建db

/etc/sysconfig/oracledb_ORCLCDB-19c.conf 配置文件

lsnrctl start  启动监听器命令
 
lsnrctl stop  停止监听器命令
 
lsnrctl status  查看监听器命令

配置环境变量

cat >> /etc/profile << 'EOF'
export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export PATH=$PATH:/opt/oracle/product/19c/dbhome_1/bin
export ORACLE_SID=ORCLCDB
EOF

source /etc/profile

登录数据库

本地登录

# 切换用户
su - oracle

# 登录数据库
sqlplus / as sysdba
[root@oracle ~]# su - oracle
Last login: Sat Aug 10 02:26:14 EDT 2024 on pts/2
[oracle@oracle ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Aug 10 02:44:04 2024
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oracle ~]$ 

远程登录

// 修改system用户的密码为system
alter user system identified by system;
[oracle@oracle ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Aug 10 02:46:21 2024
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> alter user system identified by system;

User altered.

SQL> 

设置开机自启动

chkconfig --add oracledb_ORCLCDB-19c
systemctl enable oracledb_ORCLCDB-19c

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值