Oracle 19c之RPM安装

19c的RPM包下载链接,

https://www.oracle.com/database/technologies/oracle19c-linux-downloads.html

可以看到,19c开始支持企业版本的RPM,容量是2.5GB,640?wx_fmt=png

使用手工方式,通过RPM安装19c数据库,只需要两步操作,

步骤1:安装oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

步骤2:安装oracle-database-ee-19c-1.0-1.x86_64.rpm

步骤1:安装oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

如果OEL平台,只需要执行,

yum -y install oracle-database-preinstall-19c

如果不是OEL平台,首先要下载对应平台的RPM,我用的是RedHat 7.4,下载链接地址,

https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/index.html

640?wx_fmt=png

搜索preinstall-19c,找到,

640?wx_fmt=png

第一次执行,未必就可以成功,在我的测试环境,从错误的提示看,少了一些依赖库,

[root@localhost software]# rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
warning: oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
    compat-libcap1 is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
    compat-libstdc++-33 is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
    glibc-devel is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
...

碰见这种情况,一个是可以从操作系统安装文件的Package中找到些库,另一个就是从网上检索安装库,在我的测试中,大部分少的库,都可以从Package中找到,但是compat-libstdc++-33这个并不在。

根据MOS(2254198.1)的提示,这个包是Oracle Text需要的,如果不用Oracle Text,可以忽略这个包,在RedHat 7的安装包中已经删除了。

如果不能容忍任何的错误,非得装上,可以到这个链接,下载下来安装,

http://www.rpmfind.net/linux/rpm2html/search.php?query=compat-libstdc%2B%2B-33(x86-64)

640?wx_fmt=png

再次安装,

[root@localhost software]# rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
warning: oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:oracle-database-preinstall-19c-1.################################# [100%]

如果缺少依赖也可以强制安装

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

步骤2:安装oracle-database-ee-19c-1.0-1.x86_64.rpm

此时,只需要执行oracle-database-ee-19c-1.0-1.x86_64.rpm的安装即可,但是我的第一次执行中,报了错,提示清楚,总计要6.9GB的空间,我还需要1.3GB的空间,所以安装前,准备出足够空间,是个前提,

[root@localhost software]# yum install -y oracle-database-ee-19c-1.0-1.x86_64.rpm
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-
              : manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Examining oracle-database-ee-19c-1.0-1.x86_64.rpm: oracle-database-ee-19c-1.0-1.x86_64
Marking oracle-database-ee-19c-1.0-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-ee-19c.x86_64 0:1.0-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                Arch   Version
                                     Repository                            Size
================================================================================
Installing:
 oracle-database-ee-19c x86_64 1.0-1 /oracle-database-ee-19c-1.0-1.x86_64 6.9 G

Transaction Summary
================================================================================
Install  1 Package

Total size: 6.9 G
Installed size: 6.9 G
Downloading packages:
Running transaction check
Running transaction test


Transaction check error:
  installing package oracle-database-ee-19c-1.0-1.x86_64 needs 1322MB on the / filesystem

Error Summary
-------------
Disk Requirements:
  At least 1322MB more space needed on the / filesystem.

再次安装,只需要几分钟,就可以完成Oracle 19c软件的安装,

[root@localhost software]# yum install oracle-database-ee-19c-1.0-1.x86_64.rpm
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-
              : manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Examining oracle-database-ee-19c-1.0-1.x86_64.rpm: oracle-database-ee-19c-1.0-1.x86_64
Marking oracle-database-ee-19c-1.0-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-ee-19c.x86_64 0:1.0-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                Arch   Version
                                     Repository                            Size
================================================================================
Installing:
 oracle-database-ee-19c x86_64 1.0-1 /oracle-database-ee-19c-1.0-1.x86_64 6.9 G

Transaction Summary
================================================================================
Install  1 Package

Total size: 6.9 G
Installed size: 6.9 G
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : oracle-database-ee-19c-1.0-1.x86_64                          1/1
[INFO] Executing post installation scripts...
[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
  Verifying  : oracle-database-ee-19c-1.0-1.x86_64                          1/1

Installed:
  oracle-database-ee-19c.x86_64 0:1.0-1                                         

Complete!

完成了软件安装,下一步就是创建数据库,指令是

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

但是首次执行,还是出错了,要求使用root执行,

[oracle@localhost init.d]$ /etc/init.d/oracledb_ORCLCDB-19c configure
You must be root user to run the configurations script. Login as root user and try again.

再执行,这次的错误,提示数据文件空间满了,从提示可以看出,RPM安装默认的数据文件路径是/opt/oracle/oradata,

[root@localhost ~]# /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 (4,174MB) 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.

Database configuration failed.   

这个执行过程,就是11g很像了,需要十几分钟,才可以执行完成,

[root@localhost ~]# /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/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.

从路径中,可以看到,相关的控制文件、日志文件、数据文件,

[oracle@localhost ORCLCDB]$ pwd
/opt/oracle/oradata/ORCLCDB
[oracle@localhost ORCLCDB]$ ls
control01.ctl  ORCLPDB1  redo01.log  redo03.log    system01.dbf  undotbs01.dbf
control02.ctl  pdbseed   redo02.log  sysaux01.dbf  temp01.dbf    users01.dbf

和11g相同,oracle用户的profile,需要做些配置,增加环境变量,

vim ~/.bashrc
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
source  ~/.bashrc

正常访问,

我们先连接数据库
sqlplus / as sysdba
然后查看当前使用的数据库类型
select sys_context('USERENV','CON_NAME') from dual;
若是CDB,则需要切换,先查看当前PDB数据库名称
show pdbs;
注意名称大小写,复制,使用语句进行启动,开启PDB数据库,ORCLPDB1 是我自己的PDB数据库名,自行替换哈
alter pluggable database ORCLPDB1 open;
再切换到PDB数据库
alter session set container=ORCLPDB1;
再查看当前使用容器
select sys_context('USERENV','CON_NAME') from dual;
若是已更换为PDB,则说明操作成功。
接下来就要进行PDB数据库自启动了,Oracle不会给你启动的,这里要给他加一个触发器

create or replace trigger open_pluggable_db
after startup 
on database
begin
   execute immediate 'alter pluggable database all open';
end open_pluggable_db;
/


create tablespace db_fcjys datafile '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/db_fcjys.dbf' size 100M reuse autoextend on next 40M maxsize unlimited;

create user db_fcjy identified by 123456 default tablespace db_fcjys;

grant connect,resource,dba to db_fcjy;
conn db_fcjy/db_fcjy_qz@localhost/ORCLPDB1

赋予权限:
chown -R oracle /home/dmp_dir 
chmod 777 /home/dmp_dir

imp db_fcjy/123456@127.0.0.1:1521/ORCLPDB1 file=/home/dmp_dir/fcjy.dmp log =/home/dmp_dir/fcjy.log full=y;
  • 2
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
安装Oracle 19c需要准备以下条件: 1. 操作系统为Linux x86-64位版本 2. 需要至少16GB的RAM和4核CPU 3. Linux内核版本为3.10.0-693及以上 4. 需要安装以下软件包:binutils, compat-libcap1, compat-libstdc++-33, gcc, gcc-c++, glibc, glibc-devel, ksh, libaio, libaio-devel, libgcc, libstdc++, libstdc++-devel, libXext, libXtst, libX11, libXau, libxcb, libXi, make, net-tools, nfs-utils, smartmontools, sysstat, unixODBC, psmisc 以下是安装步骤: 1. 下载Oracle数据库19c安装文件,将其上传到Linux服务器上。 2. 安装必要软件包: ``` yum install binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXext libXtst libX11 libXau libxcb libXi make net-tools nfs-utils smartmontools sysstat unixODBC psmisc ``` 3. 创建一个用户组和用户来管理Oracle数据库,例如: ``` groupadd oinstall groupadd dba useradd -g oinstall -G dba oracle ``` 4. 编辑/etc/security/limits.conf文件,添加以下内容: ``` oracle soft nofile 1024 oracle hard nofile 65536 oracle soft nproc 2047 oracle hard nproc 16384 oracle soft stack 10240 oracle hard stack 32768 ``` 5. 编辑/etc/sysctl.conf文件,添加以下内容: ``` fs.file-max = 6815744 kernel.sem = 250 32000 100 128 kernel.shmmni = 4096 kernel.shmall = 1073741824 kernel.shmmax = 4398046511104 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576 fs.aio-max-nr = 1048576 ``` 6. 使以上改动生效: ``` sysctl -p ``` 7. 解压安装文件: ``` unzip LINUX.X64_193000_db_home.zip -d /opt/oracle/ ``` 8. 修改安装文件夹的权限: ``` chown -R oracle:oinstall /opt/oracle chmod -R 775 /opt/oracle ``` 9. 切换到oracle用户,运行安装程序: ``` su - oracle cd /opt/oracle/database ./runInstaller ``` 10. 按照安装程序的提示进行安装,完成后会提示运行/root/oracle19c/root.sh脚本,运行该脚本: ``` /root/oracle19c/root.sh ``` 11. 安装完成后,可以通过以下命令查看Oracle数据库的状态: ``` systemctl status oracle ``` 12. 如果需要开机自动启动Oracle数据库,可以使用以下命令启用systemd服务: ``` systemctl enable oracle ``` 以上就是在Linux上安装Oracle 19c的步骤。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值