堕落不振功业废,勤耕不辍日月新

oracle 19c学习(1)—CentOS7 rpm包安装oracle19c

C/C++ hailen 45℃

oracle19c相当于10g、11g后的12号版本的长期支持版,并且提供了rpm包安装,大大简化了安装过程

1、下载预安装包
wget http://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

2、下载oracle 19c
https://www.oracle.com/database/technologies/oracle-database-software-downloads.html#19c

3、安装预安装包
yum -y localinstall /root/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
会自动安装oracle的依赖包

4、安装oracle
yum -y localinstall /root/oracle-database-ee-19c-1.0-1.x86_64.rpm

安装完成提示:
[INFO] Oracle home installed successfully and ready to be configured.
To configure a sample Oracle Database you can execute the following service configuration script as root: /etc/init.d/oracledb_ORCLCDB-19c configure

5、配置文件
1)/etc/sysconfig/oracledb_ORCLCDB-19c.conf
默认监听端口和数据文件位置:
LISTENER_PORT=1521
ORACLE_DATA_LOCATION=/opt/oracle/oradata

2)/etc/init.d/oracledb_ORCLCDB-19c
默认oracle的家目录和SID:
export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export ORACLE_VERSION=19c
export ORACLE_SID=ORCLCDB
export TEMPLATE_NAME=General_Purpose.dbc
export CHARSET=AL32UTF8
export PDB_NAME=ORCLPDB1
export LISTENER_NAME=LISTENER
export NUMBER_OF_PDBS=1
export CREATE_AS_CDB=true

6、建立实例
/etc/init.d/oracledb_ORCLCDB-19c configure
Configuring Oracle Database ORCLCDB.
[FATAL] [DBT-06604] The location specified for 'Data Files Location' has insufficient free space.
CAUSE: Only (1,912MB) free space is available on the location (/opt/oracle/oradata/ORCLCDB/).
ACTION: Choose a 'Data Files Location' that has enough space (minimum of (4,244MB)) or free up space on the specified location.

建立实例最少要4.2G空间,再次执行:
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/ORCLCDB.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.

7、配置
1)增加环境变量:
vi /home/oracle/.bash_profile
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export ORACLE_SID=ORCLCDB
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/.local/bin:$HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export NLS_LANG=AMERICAN_AMERICA.UTF8

2)使设置生效:
source /home/oracle/.bash_profile
3)修改oracle用户密码:
passwd oracle

8、修改system、sys用户密码
system默认:manager(不能登录?)
sys默认:change_on_install
使用sqlplus登录,如果是sys用户,密码必须加上as sysdba,即完整密码为:sqlplus sys/change_on_install as sysdba

参考资料:
https://blog.csdn.net/weixin_43885834/article/details/104418387
https://docs.oracle.com/en/database/oracle/oracle-database/19/ladbi/running-rpm-packages-to-install-oracle-database.html

转载请注明:我是IT » oracle 19c学习(1)—CentOS7 rpm包安装oracle19c

喜欢 (0)or分享 (0)