m6米乐安卓版下载-米乐app官网下载
暂无图片
13

openeuler21.09安装oracle 19c的几种方式及遇到的坑 -m6米乐安卓版下载

原创 吴明 2023-07-19
2008

一、系统环境

序号 主机名 ip地址 系统版本
1 openeuler2109 192.168.110.77 openeuler21.09

最近闲来无事,看到有客户将业务从centos迁移到openeuler,部署的都是nginx、tomcat、mysql之类,突发奇想,是否能安装上oracle呢?先是试着安装了oracle 11g,结果很惨,在此就不多说了。经过多番折腾,终于是用rpm的方式安装上了oracle 19c,但是仍遗留一些问题未解决,无法更新补丁,sqlplus无法使用。将过程发出来给新人参考,也请大佬点拨一下。
安装方法共分为:

  • 静默安装
  • 图形化安装
  • rpm包安装

安装介质已上传到/soft目录

[root@openeuler2109 soft]# ll
total 21g
-rw-r--r--. 1 root   root      19k jul 11 16:15 compat-libcap1-1.10-7.el7.x86_64.rpm
-rw-r--r--. 1 root   root     191k jul 11 16:12 compat-libstdc  -33-3.2.3-72.el7.x86_64.rpm
-rwxr-xr-x. 1 oracle oinstall 2.9g jul 10 17:35 linux.x64_193000_db_home.zip
-rw-r--r--  1 root   root      16g jul 17 23:56 openeuler-21.09-everything-x86_64-dvd.iso
-rw-r--r--. 1 root   root     2.6g jul 10 17:33 oracle-database-ee-19c-1.0-1.x86_64.rpm
-rw-r--r--. 1 root   root      18k jul 11 16:08 oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
-rwxr-xr-x. 1 root   root     2.2k jul 11 11:46 system-configure_rpm.sh
-rwxr-xr-x  1 root   root     3.4k jul 18 00:12 system-configure.sh

二、系统环境参数调整

[root@openeuler2109 soft]# vi system-configure.sh
#!/bin/bash
#1.关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
#2.关闭selinux
sed -i 's/selinux=enforcing/selinux=disabled/g' /etc/selinux/config
setenforce 0
#3.配置yum源
mount -t iso9660 /soft/openeuler-21.09-everything-x86_64-dvd.iso /mnt/
cd /etc/yum.repos.d/
rm -rf ./*
echo '
[base]
name=base
baseurl=file:///mnt/
enable=1
gpgcheck=0' >> openeuler.repo
yum clean all
yum makecache
#4.安装依赖包
yum install -y libnsl* bc compat-libcap1* compat-libcap* binutils  compat-libstdc  -33  elfutils-libelf  elfutils-libelf-devel  gcc  gcc-c    glibc-2.5  glibc-common  glibc-devel  glibc-headers  ksh libaio  libaio-devel  libgcc  libstdc    libstdc  -devel  make  sysstat  unixodbc  unixodbc-devel binutils* compat-libstdc* elfutils-libelf* gcc* glibc* ksh* libaio* libgcc* libstdc* make* sysstat* libxp* glibc-kernheaders net-tools-* unzip 
#5.修改linux内核文件
echo '
kernel.shmmax = 7730941132
kernel.shmall = 1887436
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
fs.file-max = 6815744
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 1
#net.core.somaxconn = 262144
net.core.netdev_max_backlog = 262144
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_keepalive_time = 30
net.ipv4.tcp_keepalive_probes = 6
net.ipv4.tcp_keepalive_intvl = 5
net.ipv4.tcp_timestamps = 0
fs.aio-max-nr = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2' >> /etc/sysctl.conf
sysctl -p
#6.修改linux限制文件
echo '
oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    16384
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768
oracle   hard   memlock    134217728
oracle   soft   memlock    134217728' >> /etc/security/limits.conf
#7.修改/etc/pam.d/login文件
echo '
session required pam_limits.so' >> /etc/pam.d/login
#8.修改环境变量
echo '
if [ $user = "oracle" ]; then
   if [ $shell = "/bin/ksh" ]; then
      ulimit -p 16384
      ulimit -n 65536
      else
      ulimit -u 16384 -n 65536
   fi
fi' >> /etc/profile
source /etc/profile
#9.创建文件目录和用户
groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -g dba,oper oracle
mkdir -p /u01/app/oracle
mkdir -p /u01/orainventory
chown -r oracle:oinstall /u01
chown -r oracle:oinstall /u01/app/oracle
chmod -r 775 /u01/app/oracle
mkdir -p /u01/app/oracle/product/19c/db_1   #oracle的home目录
chown -r oracle:oinstall /u01/app/oracle/product/
#10.修改oracle用户密码
echo "oracle"|passwd --stdin oracle
#11.配置oracle用户环境变量
echo '
export editor=vi
export tmp=/tmp
export tmpdir=$tmp
export oracle_sid=orcl
export oracle_base=/u01/app/oracle
export oracle_home=$oracle_base/product/19c/db_1
export inventory_location=/u01/orainventory
export tns_admin=$oracle_home/network/admin
export ld_library_path=$oracle_home/lib
export nls_lang="american_america.al32utf8"
export nls_date_format="yyyy-mm-dd hh24:mi:ss"
export path=$oracle_home/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/x11r6/bin:$path:$home/bin
umask 022'>>/home/oracle/.bash_profile
source /home/oracle/.bash_profile
#12.配置hosts文件
echo "192.168.110.77  openeuler2109" >> /etc/hosts
#13.使用oracle用户手动解压文件
chmod 755 /soft/linux.x64_193000_db_home.zip
chown oracle:oinstall /soft/linux.x64_193000_db_home.zip
cd /u01/app/oracle/product/19c/db_1
cp /soft/linux.x64_193000_db_home.zip /u01/app/oracle/product/19c/db_1
su - oracle <

三、静默安装数据库

1,编辑响应文件

[oracle@openeuler2109 ~]$ cd $oracle_home
[oracle@openeuler2109 db_1]$ pwd
/u01/app/oracle/product/19c/db_1
[oracle@openeuler2109 db_1]$ cd install/response/
[oracle@openeuler2109 response]$ mv db_install.rsp db_install.rsp.bak
[oracle@openeuler2109 response]$ vi db_install.rsp 
oracle.install.option=install_db_swonly
unix_group_name=oinstall
inventory_location=/u01/orainventory
oracle_home=/u01/app/oracle/product/19c/db_1
oracle_base=/u01/app/oracle
oracle.install.db.installedition=ee
oracle.install.db.osdba_group=dba
oracle.install.db.osoper_group=dba
oracle.install.db.osbackupdba_group=dba
oracle.install.db.osdgdba_group=dba
oracle.install.db.oskmdba_group=dba
oracle.install.db.osracdba_group=dba
oracle.install.db.rootconfig.executerootscript=false

2,开始静默安装

[oracle@openeuler2109 db_1]$ ./runinstaller -silent -noconfig -responsefile /u01/app/oracle/product/19c/db_1/install/response/db_install.rsp
出现以下报错:
/u01/app/oracle/product/19.3.0/db_1/perl/bin/perl: error while loading shared libraries: libnsl.so.1: cannot open shared object file: no such file or directory
解决方法:找到libnsl.so.1的文件复制到系统路径
[root@openeuler2109 db_1]# find / -name libnsl.so.1
/u01/app/oracle/product/19c/db_1/lib/stubs/libnsl.so.1
[root@openeuler2109 db_1]# ldd /u01/app/oracle/product/19.3.0/db_1/perl/bin/perl
        linux-vdso.so.1 (0x00007ffe80bb8000)
        libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007f1c2a0d1000)
        libnsl.so.1 => not found
        libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007f1c2a0cc000)
        libm.so.6 => /usr/lib64/libm.so.6 (0x00007f1c29ff0000)
        libcrypt.so.1 => /usr/lib64/libcrypt.so.1 (0x00007f1c29fb5000)
        libutil.so.1 => /usr/lib64/libutil.so.1 (0x00007f1c29fb0000)
        libc.so.6 => /usr/lib64/libc.so.6 (0x00007f1c29dae000)
        libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007f1c29d94000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f1c2a0e4000)
[root@openeuler2109 db_1]# cp /u01/app/oracle/product/19c/db_1/lib/stubs/libnsl.so.1 /usr/lib64/
再次开始静默安装,出现以下报错:
[oracle@openeuler2109 db_1]$ ./runinstaller -silent -noconfig -responsefile /u01/app/oracle/product/19.3.0/db_1/install/response/db_install.rsp
launching oracle database setup wizard...
[fatal] an internal error occurred within cluster verification framework
an error occurred in creating a taskfactory object or in generating a task list
prvg-0282 : failed to retrieve the operating system distribution id
提示无法获取操作系统发行id,解决方法:在cvu_config文件增加本系统id
[oracle@openeuler2109 db_1]$ cd $oracle_home
[oracle@openeuler2109 db_1]$ cd cv/admin/
[oracle@openeuler2109 admin]$ vi cvu_config增加
cv_assume_distid=openeuler 21.09
然后继续安装
[oracle@openeuler2109 db_1]$ ./runinstaller -silent -noconfig -responsefile /u01/app/oracle/product/19c/db_1/install/response/db_install.rsp
然后开始报错:
[fatal] error in invoking target 'libasmclntsh19.ohso libasmperl19.ohso client_sharedlib' of makefile '/u01/app/oracle/product/19c/db_1/rdbms/lib/ins_rdbms.mk'. see '/tmp/installactions2023-07-11_12-14-15pm/installactions2023-07-11_12-14-15pm.log' for details.

3,遗留问题一
参考了oracle19c rac grid安装报错的快速处理libasmclntsh19.ohso libasmperl19.ohso client_sharedlib’ of makefile进行处理,但还是报上面这个错误,不知道是不是我的操作不对,也只好终止静默安装。

四、图形化安装数据库

1,安装图形化桌面

[root@openeuler2109 ~]# yum install gnome-shell gdm gnome-session gnome-terminal -y
#设置gdm自启,并设置启动级别为图形化界面
[root@openeuler2109 ~]# systemctl enable gdm.service
[root@openeuler2109 ~]# systemctl set-default graphical.target
removed /etc/systemd/system/default.target.
created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/graphical.target.
#下载xsession,并代替原来的xsession
[root@openeuler2109 ~]# wget https://gitee.com/name1e5s/xsession/raw/master/xsession
[root@openeuler2109 ~]# mv /etc/gdm/xsession /etc/gdm/xsession.bak
[root@openeuler2109 ~]# mv xsession /etc/gdm
[root@openeuler2109 ~]# chmod 777 /etc/gdm/xsession
重启系统
[root@openeuler2109 ~]# reboot

2,图形化安装

[root@openeuler2109 ~]# su - oracle
[oracle@openeuler2109 ~]$ cd $oracle_home
[oracle@openeuler2109 db_1]$ ./runinstaller 

打开终端.png
安装第一步.png
安装第二步.png
安装第三步.png
安装第四步.png
安装第五步.png
安装第六步.png
安装第七步.png
安装第八步.png
安装第九步.png

3,遗留问题二

报错.png
报错提示和静默安装的报错一样,暂无好的解决方法,只好终止

五、rpm方式安装

1,系统环境参数配置

[root@openeuler2109 soft]# vi system-configure_rpm.sh 
#!/bin/bash
#1.关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
#2.关闭selinux
sed -i 's/selinux=enforcing/selinux=disabled/g' /etc/selinux/config
setenforce 0
#3.编辑yum源
mount -t iso9660 /soft/openeuler-21.09-x86_64-dvd.iso /mnt/
cd /etc/yum.repos.d/
rm -rf ./*
echo '
[base]
name=base
baseurl=file:///mnt/
enable=1
gpgcheck=0' >> openeuler.repo
yum clean all
#4.安装包
yum -y install libaio-devel sysstat xorg-x11-utils xorg-x11-xauth /soft/compat-libcap1-1.10-7.el7.x86_64.rpm /soft/compat-libstdc  -33-3.2.3-72.el7.x86_64.rpm
#5.编辑hosts文件
echo "192.168.110.77 openeuler2109" >> /etc/hosts
#6.修改linux内核文件
echo '
kernel.shmmax = 7730941132
kernel.shmall = 1887436
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
fs.file-max = 6815744
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 1
#net.core.somaxconn = 262144
net.core.netdev_max_backlog = 262144
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_keepalive_time = 30
net.ipv4.tcp_keepalive_probes = 6
net.ipv4.tcp_keepalive_intvl = 5
net.ipv4.tcp_timestamps = 0
fs.aio-max-nr = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2' >> /etc/sysctl.conf
sysctl -p
#7.修改linux限制文件
echo '
oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    16384
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768
oracle   hard   memlock    134217728
oracle   soft   memlock    134217728' >> /etc/security/limits.conf
#8.修改/etc/pam.d/login文件
echo '
session required pam_limits.so' >> /etc/pam.d/login
#9.修改环境变量
echo '
if [ $user = "oracle" ]; then
   if [ $shell = "/bin/ksh" ]; then
      ulimit -p 16384
      ulimit -n 65536
      else
      ulimit -u 16384 -n 65536
   fi
fi' >> /etc/profile
source /etc/profile
[root@openeuler2109 soft]# chmod  x system-configure_rpm.sh 
[root@openeuler2109 soft]# ./system-configure_rpm.sh 

2,安装preinstall.rpm

[root@openeuler2109 soft]# rpm -ivh --nodeps 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
verifying...                          ################################# [100%]
preparing...                          ################################# [100%]
updating / installing...
   1:oracle-database-preinstall-19c-1.################################# [100%]

3,安装oracle 19c

[root@openeuler2109 soft]# rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm
遇到如下报错
exception java.lang.unsatisfiedlinkerror: /opt/oracle/product/19c/dbhome_1/oui/lib/linux64/liborainstaller.so: libnsl.so.1: cannot open shared object file: no such file or directory occurred..
java.lang.unsatisfiedlinkerror: /opt/oracle/product/19c/dbhome_1/oui/lib/linux64/liborainstaller.so: libnsl.so.1: cannot open shared object file: no such file or directory
解决方法如下
[root@openeuler2109 soft]# find / -name libnsl.so.1
/opt/oracle/product/19c/dbhome_1/lib/stubs/libnsl.so.1
[root@openeuler2109 soft]# cp /opt/oracle/product/19c/dbhome_1/lib/stubs/libnsl.so.1 /usr/lib64
然后删除安装目录,卸载rpm包重新安装
[root@openeuler2109 soft]# rm -rf /opt/oracle/*
[root@openeuler2109 soft]# yum -y remove oracle-database-ee-19c-1.0-1.x86_64
[root@openeuler2109 soft]# rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm
安装完成,修改初始化配置文件
[root@openeuler2109 soft]# vi /etc/init.d/oracledb_orclcdb-19c 
export oracle_home=/opt/oracle/product/19c/dbhome_1
export oracle_version=19c
export oracle_sid=rundb
export template_name=general_purpose.dbc
export charset=zhs16gbk
export pdb_name=orcl
export listener_name=listener
export number_of_pdbs=1
export create_as_cdb=false
[root@openeuler2109 soft]# vi /etc/sysconfig/oracledb_orclcdb-19c.conf
listener_port=13899
oracle_data_location=/oradata 
[root@openeuler2109 soft]# mkdir /archivelog
[root@openeuler2109 soft]# chown -r oracle:oinstall /archivelog/
[root@openeuler2109 soft]# mkdir /oradata
[root@openeuler2109 soft]# chown -r oracle:oinstall /oradata/
[root@openeuler2109 soft]# chmod -r 755 /oradata/

4,初始化实例

[root@openeuler2109 soft]# /etc/init.d/oracledb_orclcdb-19c configure
the oracle database is not configured. unable to read the configuration file '/etc/sysconfig/oracledb_rundb-19c.conf'
因为上面在/etc/init.d/oracledb_orclcdb-19c修改了sid为rundb,所以在初始化的时候需要去读取rundb的配置文件
[root@openeuler2109 soft]# cp /etc/sysconfig/oracledb_orclcdb-19c.conf /etc/sysconfig/oracledb_rundb-19c.conf 
[root@openeuler2109 soft]# /etc/init.d/oracledb_orclcdb-19c configure
configuring oracle database orclcdb.
prepare for db operation
10% complete
copying database files
40% complete
creating and starting oracle instance
42% complete
46% complete
50% complete
54% complete
60% complete
completing database creation
66% complete
70% 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:rundb
system identifier(sid):rundb
look at the log file "/opt/oracle/cfgtoollogs/dbca/rundb/rundb.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.

5,测试数据库连接

(1),修改oracle用户环境变量

用rpm方式安装的时候会创建oracle用户和组,oracle用户的环境变量配置为空
[oracle@openeuler2109 ~]$ vi .bash_profile
# source /root/.bashrc if user has one
[ -f ~/.bashrc ] && . ~/.bashrc
export tmp=/tmp
export tmpdir=$tmp
export oracle_sid=rundb
export oracle_base=/opt/oracle
export oracle_home=$oracle_base/product/19c/dbhome_1
export inventory_location=/opt/oracle/orainventory
export tns_admin=$oracle_home/network/admin
export ld_library_path=$oracle_home/lib
#export nls_lang="simplified chinese_china.zhs16gbk"
export nls_date_format="yyyy-mm-dd hh24:mi:ss"
export path=$oracle_home/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/x11r6/bin:$path:$home/bin
umask 022

(2),查看监听状态

[oracle@openeuler2109 ~]$ lsnrctl status
lsnrctl for linux: version 19.0.0.0.0 - production on 11-jul-2023 12:51:06
米乐app官网下载 copyright (c) 1991, 2019, oracle.  all rights reserved.
connecting to (description=(address=(protocol=tcp)(host=openeuler2109)(port=13899)))
status of the listener
------------------------
alias                     listener
version                   tnslsnr for linux: version 19.0.0.0.0 - production
start date                11-jul-2023 12:35:49
uptime                    0 days 0 hr. 15 min. 17 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/openeuler2109/listener/alert/log.xml
listening endpoints summary...
  (description=(address=(protocol=tcp)(host=openeuler2109)(port=13899)))
  (description=(address=(protocol=ipc)(key=extproc13899)))
  (description=(address=(protocol=tcps)(host=openeuler2109)(port=5500))(security=(my_wallet_directory=/opt/oracle/admin/orclcdb/xdb_wallet))(presentation=http)(session=raw))
services summary...
service "rundb" has 1 instance(s).
  instance "rundb", status ready, has 1 handler(s) for this service...
service "rundbxdb" has 1 instance(s).
  instance "rundb", status ready, has 1 handler(s) for this service...
the command completed successfully

(3),连接数据库,开启归档

[oracle@openeuler2109 ~]$ sqlplus / as sysdba
sql> show pdbs;
sql> select instance_name from v$instance;
instance_name
----------------
rundb
sql> select userenv('language') from dual;
userenv('language')
----------------------------------------------------
simplified chinese_china.zhs16gbk
sql> select name from v$datafile;
name
--------------------------------------------------------------------------------
/oradata/rundb/system01.dbf
/oradata/rundb/sysaux01.dbf
/oradata/rundb/undotbs01.dbf
/oradata/rundb/users01.dbf
sql> show parameter control
name                                 type        value
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      /oradata/rundb/control01.ctl
                                                 , /oradata/rundb/control02.c
                                                 tl
control_management_pack_access       string      diagnostic tuning
sql> alter system set log_archive_dest_1='location=/archivelog';
sql> shutdown immediate
sql> alter database archivelog;
sql> alter database open;
sql> alter system switch logfile;
[root@openeuler2109 packages]# cd /archivelog/
[root@openeuler2109 archivelog]# ll
-rw-r-----. 1 oracle oinstall 176m jul 11 18:43 1_5_1141907379.dbf

(4)最佳实践参数

建库后,备份一下当前spfile
sql> create pfile='/home/oracle/pspfile.ora' from spfile
建库之后,执行以下优化参数
alter system set "_b_tree_bitmap_plans"=false            sid='*'      scope=spfile;
alter system set "_bloom_filter_enabled"=false        sid='*'         scope=spfile;
alter system set "_cleanup_rollback_entries"=5000        sid='*'      scope=spfile;
alter system set "_datafile_open_errors_crash_instance"=false sid='*' scope=spfile;
alter system set "_datafile_write_errors_crash_instance"=false sid='*' scope=spfile;
alter system set "_cursor_obsolete_threshold" =100   sid='*'          scope=spfile;
alter system set "_db_block_numa"=1       sid='*'    scope=spfile;
alter system set "_drop_stat_segment"=1    sid='*'     scope=spfile;
alter system set "_enable_pdb_close_abort"=true    sid='*'  scope=spfile;
alter system set "_enable_pdb_close_noarchivelog"=false  sid='*'  scope=spfile;
alter system set "_fix_control"='8611462:off'  sid='*'  scope=spfile;
alter system set "_gc_policy_time"=0   sid='*'   scope=spfile;
alter system set "_ges_direct_free_res_type"=ctarahdxbb  sid='*'  scope=spfile;
alter system set "_index_partition_large_extents"=false sid='*' scope=spfile;
alter system set "_keep_remote_column_size"=true sid='*' scope=spfile;
alter system set "_ktb_debug_flags"=8   sid='*'  scope=spfile;
alter system set "_library_cache_advice"=false   sid='*'  scope=spfile;
alter system set "_memory_imm_mode_without_autosga"=false  sid='*' scope=spfile;
alter system set "_optimizer_ads_use_result_cache" = false sid='*' scope=spfile;
alter system set "_optimizer_aggr_groupby_elim"=false  sid='*' scope=spfile;
alter system set "_optimizer_dsdir_usage_control"=0  sid='*' scope=spfile;
alter system set "_optimizer_adaptive_cursor_sharing"=false sid='*' scope=spfile;
alter system set "_optimizer_extended_cursor_sharing"=none sid='*' scope=spfile;
alter system set "_optimizer_extended_cursor_sharing_rel"=none sid='*' scope=spfile;
alter system set "_optimizer_mjc_enabled"=false  sid='*' scope=spfile;
alter system set "_optimizer_null_accepting_semijoin"=false sid='*' scope=spfile;
alter system set "_optimizer_null_aware_antijoin"=false  sid='*' scope=spfile;
alter system set "_optimizer_reduce_groupby_key"=false  sid='*' scope=spfile;
alter system set "_optimizer_unnest_scalar_sq"=false sid='*' scope=spfile;
alter system set "_optimizer_use_feedback"=false  sid='*' scope=spfile;
alter system set "_part_access_version_by_number"=false sid='*' scope=spfile;
alter system set "_partition_large_extents"=false sid='*' scope=spfile;
alter system set "_partition_large_extents"=false sid='*'  scope=spfile;
alter system set "_px_use_large_pool"=true  sid='*'  scope=spfile;
alter system set "_report_capture_cycle_time"=0  sid='*' scope=spfile;
alter system set "_rollback_segment_count"=2000 sid='*' scope=spfile;
alter system set "_serial_direct_read"=never sid='*' scope=spfile;
alter system set "_sort_elimination_cost_ratio"=1 sid='*' scope=spfile;
alter system set "_sql_plan_directive_mgmt_control"=0  sid='*' scope=spfile;
alter system set "_sys_logon_delay"=0  sid='*' scope=spfile;
alter system set "_undo_autotune"=false sid='*'  scope=spfile;
alter system set "_use_adaptive_log_file_sync"=false sid='*'  scope=spfile;
alter system set "_use_single_log_writer"=true  sid='*' scope=spfile;
alter system set "_ksxp_ipclw_enabled"=true  sid='*' scope=spfile;
alter system set "_shared_pool_reserved_pct"=20  sid='*' scope=spfile;
alter system set audit_trail=none   sid='*'  scope=spfile;
alter system set autotask_max_active_pdbs=10  sid='*' scope=spfile;
alter system set cell_offload_processing=false  sid='*'  scope=spfile;
alter system set control_file_record_keep_time=31 sid='*' scope=spfile;
alter system set db_cache_advice=off  sid='*'  scope=spfile;
alter system set db_files=5000   sid='*'  scope=spfile;
alter system set deferred_segment_creation=false  sid='*'  scope=spfile;
alter system set enable_ddl_logging=true  sid='*' scope=spfile;
alter   system   set   event='28401   trace   name   context   forever,level   1','60025   trace   name   contextforever','10943   trace   name   context   forever,level   2097152','10949   trace   name   context   forever,level1','10262 trace name context forever, level 90000' sid='*' scope=spfile;
alter system set filesystemio_options=setall  sid='*' scope=spfile;
alter system set max_shared_servers=0  sid='*'  scope=spfile;
alter system set memory_target=0  sid='*'  scope=spfile;alter system set open_cursors=3000  sid='*'  scope=spfile;
alter system set open_links =40   sid='*'  scope=spfile;alter system set open_links_per_instance =40   sid='*'  scope=spfile;
alter system set optimizer_adaptive_plans=false   sid='*'  scope=spfile;
alter system set parallel_force_local=true sid='*'  scope=spfile;
alter system set pga_aggregate_limit=0 sid='*'  scope=spfile;
alter system set resource_manager_plan='force:' sid='*'  scope=spfile;
alter system set result_cache_max_size=0  sid='*'  scope=spfile;
alter system set sec_max_failed_login_attempts=100  sid='*'  scope=spfile;
alter system set session_cached_cursors=300 sid='*' scope=spfile;
alter system set shared_servers=0    sid='*' scope=spfile;
alter system set temp_undo_enabled=false sid='*'  scope=spfile;
alter system set undo_retention=10800  sid='*' scope=spfile;

6,更新补丁

(1)更新opatch

[oracle@openeuler2109 ~]$ cd $oracle_home
[oracle@openeuler2109 dbhome_1]$ mv opatch/ opatch.bak
[oracle@openeuler2109 dbhome_1]$ unzip /soft/p6880880_190000_linux-x86-64.zip -d /opt/oracle/product/19c/dbhome_1/
[oracle@openeuler2109 dbhome_1]$ opatch/opatch version
opatch version: 12.2.0.1.37
opatch succeeded.

(2)补丁检测

[oracle@openeuler2109 dbhome_1]$ cd /soft/
[oracle@openeuler2109 soft]$ cp p35042068_190000_linux-x86-64.zip /home/oracle/
[oracle@openeuler2109 soft]$ cd /home/oracle/
[oracle@openeuler2109 ~]$ unzip p35042068_190000_linux-x86-64.zip
[oracle@openeuler2109 ~]$ cd 35042068/
[oracle@openeuler2109 35042068]$ $oracle_home/opatch/opatch prereq checkconflictagainstohwithdetail -ph ./
oracle interim patch installer version 12.2.0.1.37
米乐app官网下载 copyright (c) 2023, oracle corporation.  all rights reserved.
prereq session
oracle home       : /opt/oracle/product/19c/dbhome_1
central inventory : /opt/oracle/orainventory
   from           : /opt/oracle/product/19c/dbhome_1/orainst.loc
opatch version    : 12.2.0.1.37
oui version       : 12.2.0.7.0
log file location : /opt/oracle/product/19c/dbhome_1/cfgtoollogs/opatch/opatch2023-07-12_12-00-19pm_1.log
invoking prereq "checkconflictagainstohwithdetail"
prereq "checkconflictagainstohwithdetail" passed.
opatch succeeded.

(3)更新补丁

[oracle@openeuler2109 35042068]$ lsnrctl stop
[oracle@openeuler2109 35042068]$ sqlplus / as sysdba
sql> shutdown immediate
[oracle@openeuler2109 35042068]$ $oracle_home/opatch/opatch apply
oracle interim patch installer version 12.2.0.1.37
米乐app官网下载 copyright (c) 2023, oracle corporation.  all rights reserved.
oracle home       : /opt/oracle/product/19c/dbhome_1
central inventory : /opt/oracle/orainventory
   from           : /opt/oracle/product/19c/dbhome_1/orainst.loc
opatch version    : 12.2.0.1.37
oui version       : 12.2.0.7.0
log file location : /opt/oracle/product/19c/dbhome_1/cfgtoollogs/opatch/opatch2023-07-12_12-04-26pm_1.log
verifying environment and performing prerequisite checks...
--------------------------------------------------------------------------------
start oop by prereq process.
launch oop...
oracle interim patch installer version 12.2.0.1.37
米乐app官网下载 copyright (c) 2023, oracle corporation.  all rights reserved.
oracle home       : /opt/oracle/product/19c/dbhome_1
central inventory : /opt/oracle/orainventory
   from           : /opt/oracle/product/19c/dbhome_1/orainst.loc
opatch version    : 12.2.0.1.37
oui version       : 12.2.0.7.0
log file location : /opt/oracle/product/19c/dbhome_1/cfgtoollogs/opatch/opatch2023-07-12_12-05-44pm_1.log
verifying environment and performing prerequisite checks...
opatch continues with these patches:   35042068  
do you want to proceed? [y|n]
y
user responded with: y
all checks passed.
please shutdown oracle instances running out of this oracle_home on the local system.
(oracle home = '/opt/oracle/product/19c/dbhome_1')
is the local system ready for patching? [y|n]
y
user responded with: y
backing up files...
applying interim patch '35042068' to oh '/opt/oracle/product/19c/dbhome_1'
applysession: optional component(s) [ oracle.network.gsm, 19.0.0.0.0 ] , [ oracle.rdbms.ic, 19.0.0.0.0 ] , [ oracle.rdbms.tg4db2, 19.0.0.0.0 ] , [ oracle.tfa, 19.0.0.0.0 ] , [ oracle.ons.cclient, 19.0.0.0.0 ] , [ oracle.network.cman, 19.0.0.0.0 ] , [ oracle.rdbms.tg4sybs, 19.0.0.0.0 ] , [ oracle.sdo.companion, 19.0.0.0.0 ] , [ oracle.rdbms.tg4ifmx, 19.0.0.0.0 ] , [ oracle.options.olap.api, 19.0.0.0.0 ] , [ oracle.rdbms.tg4tera, 19.0.0.0.0 ] , [ oracle.oid.client, 19.0.0.0.0 ] , [ oracle.options.olap, 19.0.0.0.0 ] , [ oracle.ons.eons.bwcompat, 19.0.0.0.0 ] , [ oracle.rdbms.tg4msql, 19.0.0.0.0 ] , [ oracle.net.cman, 19.0.0.0.0 ] , [ oracle.xdk.companion, 19.0.0.0.0 ] , [ oracle.jdk, 1.8.0.191.0 ]  not present in the oracle home or a higher version is found.
然后有报错
patching component oracle.jdk, 1.8.0.201.0...
make failed to invoke "/usr/bin/make -f ins_net_client.mk client_sharedlib oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=apply"....'/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
genclntsh: failed to link libclntshcore.so.19.1
make: *** [ins_net_client.mk:143: client_sharedlib] error 1
'
make failed to invoke "/usr/bin/make -f ins_rdbms.mk itkprof oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=apply"....'/usr/bin/ld: cannot find -lclntshcore
/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
make: *** [ins_rdbms.mk:959: /opt/oracle/product/19c/dbhome_1/rdbms/lib/tkprof] error 1
'
make failed to invoke "/usr/bin/make -f ins_rdbms.mk iexp oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=apply"....'/usr/bin/ld: cannot find -lclntshcore
/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
make: *** [ins_rdbms.mk:863: /opt/oracle/product/19c/dbhome_1/rdbms/lib/exp] error 1
'
make failed to invoke "/usr/bin/make -f ins_rdbms.mk iimpdp oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=apply"....'/usr/bin/ld: cannot find -lclntshcore
/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
make: *** [ins_rdbms.mk:881: /opt/oracle/product/19c/dbhome_1/rdbms/lib/impdp] error 1
'
make failed to invoke "/usr/bin/make -f ins_rdbms.mk isqlldr oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=apply"....'/usr/bin/ld: cannot find -lclntshcore
/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
make: *** [ins_rdbms.mk:887: /opt/oracle/product/19c/dbhome_1/rdbms/lib/sqlldr] error 1
'
make failed to invoke "/usr/bin/make -f ins_rdbms.mk idg4pwd oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=apply"....'/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
make: *** [ins_rdbms.mk:1089: /opt/oracle/product/19c/dbhome_1/rdbms/lib/dg4pwd] error 1
'
make failed to invoke "/usr/bin/make -f ins_rdbms.mk iplshprof oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=apply"....'/usr/bin/ld: cannot find -lclntshcore
/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
make: *** [ins_rdbms.mk:971: /opt/oracle/product/19c/dbhome_1/rdbms/lib/plshprof] error 1
'
make failed to invoke "/usr/bin/make -f ins_rdbms.mk iexpdp oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=apply"....'/usr/bin/ld: cannot find -lclntshcore
/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
make: *** [ins_rdbms.mk:869: /opt/oracle/product/19c/dbhome_1/rdbms/lib/expdp] error 1
'
make failed to invoke "/usr/bin/make -f ins_rdbms.mk ioratop oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=apply"....'/usr/bin/ld: cannot find -lclntshcore
/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
make: *** [ins_rdbms.mk:1503: /opt/oracle/product/19c/dbhome_1/rdbms/lib/oratop] error 1
'
make failed to invoke "/usr/bin/make -f ins_rdbms.mk igenezi oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=apply"....'/usr/bin/ld: cannot find -lclntshcore
/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
make: *** [ins_rdbms.mk:1230: /opt/oracle/product/19c/dbhome_1/rdbms/lib/genezi] error 1
'
make failed to invoke "/usr/bin/make -f ins_rdbms.mk iextjobo oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=apply"....'/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
make: *** [ins_rdbms.mk:1218: /opt/oracle/product/19c/dbhome_1/rdbms/lib/extjobo] error 1
'
opatch found the word "error" in the stderr of the make command.
please look at this stderr. you can re-run this make command.
stderr output:
/opt/oracle/product/19c/dbhome_1/bin/skgxpinfo: error while loading shared libraries: libclntshcore.so.19.1: cannot open shared object file: no such file or directory
make failed to invoke "/usr/bin/make -f ins_rdbms.mk idgmgrl oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=apply"....'/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
make: *** [ins_rdbms.mk:1137: /opt/oracle/product/19c/dbhome_1/rdbms/lib/dgmgrl] error 1
'
make failed to invoke "/usr/bin/make -f ins_rdbms.mk iorion oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=apply"....'/usr/bin/ld: cannot find -lclntshcore
/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
make: *** [ins_rdbms.mk:923: /opt/oracle/product/19c/dbhome_1/rdbms/lib/orion] error 1
'
make failed to invoke "/usr/bin/make -f ins_rdbms.mk iextjob oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=apply"....'/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
make: *** [ins_rdbms.mk:1212: /opt/oracle/product/19c/dbhome_1/rdbms/lib/extjob] error 1
'
make failed to invoke "/usr/bin/make -f ins_rdbms.mk ikgmgr oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=apply"....'/usr/bin/ld: cannot find -lclntshcore
/usr/bin/ld: cannot find -lclntshcore
/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
make: *** [ins_rdbms.mk:1127: /opt/oracle/product/19c/dbhome_1/rdbms/lib/kgmgr] error 1
patch 35042068 successfully applied.
sub-set patch [29517242] has become inactive due to the application of a super-set patch [35042068].
please refer to doc id 2161861.1 for any possible further required actions.
opatch session completed with warnings.
log file location: /opt/oracle/product/19c/dbhome_1/cfgtoollogs/opatch/opatch2023-07-12_12-05-44pm_1.log
opatch completed with warnings.
补丁安装失败。。。
接着,sqlplus就不好用了
[oracle@openeuler2109 35042068]$ sqlplus / as sysdba
sqlplus: error while loading shared libraries: libclntshcore.so.19.1: cannot open shared object file: no such file or directory
回退补丁
[oracle@openeuler2109 35042068]$ $oracle_home/opatch/opatch rollback -id 35042068
同样的报错:
rollbacksession removing interim patch '35042068' from inventory
make failed to invoke "/usr/bin/make -f ins_net_client.mk client_sharedlib oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=rollback"....'/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
genclntsh: failed to link libclntshcore.so.19.1
make: *** [ins_net_client.mk:143: client_sharedlib] error 1
'
make failed to invoke "/usr/bin/make -f ins_rdbms.mk itkprof oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=rollback"....'/usr/bin/ld: cannot find -lclntshcore
/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
make: *** [ins_rdbms.mk:959: /opt/oracle/product/19c/dbhome_1/rdbms/lib/tkprof] error 1
'
make failed to invoke "/usr/bin/make -f ins_rdbms.mk iexp oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=rollback"....'/usr/bin/ld: cannot find -lclntshcore
/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
make: *** [ins_rdbms.mk:863: /opt/oracle/product/19c/dbhome_1/rdbms/lib/exp] error 1
'
make failed to invoke "/usr/bin/make -f ins_rdbms.mk iimpdp oracle_home=/opt/oracle/product/19c/dbhome_1 opatch_session=rollback"....'/usr/bin/ld: cannot find -lclntshcore
/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
make: *** [ins_rdbms.mk:881: /opt/oracle/product/19c/dbhome_1/rdbms/lib/impdp] error 1
'

针对以上遗留问题,接下来准备用这种方法:用一台centos8安装oracle 19c,然后将安装好的几个lib文件复制到openeuler系统试试看。

最后修改时间:2023-07-20 13:11:29
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
2人已赞赏
【米乐app官网下载的版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

网站地图