麒麟kylin-server-v10-sp2安装oracle11g

env

  • kylin-server-v10-sp2 4.19.90-24.4.v2101.ky10.x86_64 2c4g
  • oracle11g-2.0.4

tools

  • p13390677_112040_Linux-x86-64_1of7.zip
  • p13390677_112040_Linux-x86-64_2of7.zip

安装oracle11g涉及管理软件包及文件
https://pan.baidu.com/s/1BIbgL_1UsuXoe3IW-xDICg?pwd=tqdh

Kylin-Server-10-SP2-x86-Release-Build09-20210524.iso

kylin-sever mirror

主要是根据发行版本进入特定的目录

01、selinux/firewalld/hosts

/etc/sysconfig/selinux
SELINUX=disabed

[root@lab-250 db]# systemctl disable firewalld
[root@lab-250 db]# systemctl stop  firewalld

[root@lab-250 db]# hostname
lab-250
[root@lab-250 db]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
172.24.0.250  lab-250

02、kernel-turn

###/etc/sysctl.conf
kernel.shmmax = 4294967296         //4g 单位b  单个共享内存段的最大值
kernel.shmmni = 4096               //页大小  4kb
kernel.shmall = 1048576         //共享内存段4g 页数量


tee > /etc/sysctl.d/oracle.conf <<EOF
kernel.shmmax = 4294967296
kernel.shmmni = 4096
kernel.shmall = 1048576
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
EOF

sysctl --system


###limits.conf
vim  /etc/security/limits.conf
oracle soft nproc 102400
oracle hard nproc 102400
oracle soft nofile 102400
oracle hard nofile 102400

tee >>/etc/security/limits.conf <<EOF
# oracle
oracle soft nproc 102400
oracle hard nproc 102400
oracle soft nofile 102400
oracle hard nofile 102400
EOF

03、add user && group && dirs && env

groupadd -g 600 oinstall
groupadd -g 700 dba
useradd -g oinstall -G dba  oracle

[root@lab-250 sysctl.d]# id oracle
uid=1000(oracle) gid=600(oinstall) groups=600(oinstall),700(dba)

mkdir -p /u01/{oracle}
chown -R oracle: /u01

//建议关闭登录终端在次登录,先关限制参数生效
su - oracle

[oracle@kylin-server ~]$ ulimit -a |grep open
open files                      (-n) 102400

tee >> ~/.bash_profile <<'EOF'
## oracle11g-env
export ORACLE_SID=kylin
export ORACLE_BASE=/u01/oracle
export ORACLE_HOME=/u01/oracle/product/11.2.0/db1
export NLS_LANG=American_America.AL32UTF8
export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH:/usr/local/lib/libaio/lib
EOF

source ~/.bash_profile

vi /etc/ld.so.conf.d/dyninst-x86_64.conf
/usr/local/lib/libaio/lib

04、requirements

yum install -y binutils*
yum install -y compat-libstdc*
yum install -y elfutils-libelf*
yum install -y gcc*
yum install -y glibc*
yum install -y ksh*
yum install -y libgcc*
yum install -y libstdc*
yum install -y sysstat*
yum install libXp* -y
yum install -y glibc-kernheaders

yum install -y binutils* compat-libstdc*  elfutils-libelf*  gcc*  glibc*  ksh*    libgcc*  libstdc*  sysstat*  libXp* glibc-kernheaders

//解决包缺失
No match for argument: compat-libstdc*

https://developer.aliyun.com/packageSearch?word=compat-libstdc

https://mirrors.aliyun.com/centos/7.9.2009/os/x86_64/Packages/compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm?spm=a2c6h.13651111.0.0.70202f70DYLIu7&file=compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm

[root@kylin-server ~]# rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm

//uninstall libaio(默认是存在则需要卸载掉)
yum erase -y  libaio   libaio-devel

//libnsl(这个要版本匹配)
rpm -ivh libnsl-2.28-49.p02.ky10.x86_64.rpm

//libpthread_nonshared.a (从glibc-devel-2.17-317.el7.x86_64.rpm提取)
cp libpthread_nonshared.a /usr/lib64/

#提取文件libpthread_nonshared.a
yum install -y rpm cpio
rpm2cpio glibc-devel-2.17-317.el7.x86_64.rpm |cpio -id

//libaio
对于oracle11g的安装,libaio1库版本不能大于0.3.109
https://pagure.io/libaio/releases
# libaio-0.3.108
https://pagure.io/libaio/tree/e5cb94be1f8fb0d2e4ce080ffb5bc76efd25df7a

make -s -j 2  prefix=/usr/local/lib/libaio install

ldconfig -v |grep libaio  //root执行

05、unzip && setup-gui

ls *.zip |xargs -n1 unzip

chown -R oracle: database

su - oracle
cd database

//mv unzip(在sp2没发现有错误,可以不执行)
cd database/install
mv unzip unzip.bak
ln -s /usr/bin/unzip

06、reponse require files

db-config.rsp

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
###仅仅安装oracle软件
oracle.install.option=INSTALL_DB_AND_CONFIG
###linux主机名
ORACLE_HOSTNAME=
###oracle属组
UNIX_GROUP_NAME=oinstall
###清单目录
INVENTORY_LOCATION=/u01/oracle/inventory
###支持语言
SELECTED_LANGUAGES=en,zh_CN 
ORACLE_HOME=/u01/oracle/product/11.2.0/db1
ORACLE_BASE=/u01/oracle
###企业版
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=false
oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.4.0,oracle.oraolap:11.2.0.4.0,oracle.rdbms.dm:11.2.0.4.0,oracle.rdbms.dv:11.2.0.4.0,oracle.rdbms.lbac:11.2.0.4.0,oracle.rdbms.rat:11.2.0.4.0
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
oracle.install.db.CLUSTER_NODES=
oracle.install.db.isRACOneInstall=
oracle.install.db.racOneServiceName=
###事务型数据库
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=kylin
oracle.install.db.config.starterdb.SID=kylin
###数据库语言
oracle.install.db.config.starterdb.characterSet=AL32UTF8
###自动内存管理
oracle.install.db.config.starterdb.memoryOption=true
###可分配给数据的内存大小
oracle.install.db.config.starterdb.memoryLimit=2048
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
###账户密码
oracle.install.db.config.starterdb.password.ALL=321321
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
###本地存储数据
oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
###数据文件位置
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/u01/oracle/oradata
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
###不支持安全跟新(在线)
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
###取消安全更新
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
COLLECTOR_SUPPORTHUB_URL=
oracle.installer.autoupdates.option=
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=

07 install

./runInstaller -silent -ignoreSysPrereqs -showProgress  -responseFile /opt/database/db-config.rsp

//error
[oracle@kylin-server database]$ ./runInstaller -silent -ignoreSysPrereqs -showProgress  -responseFile /opt/database/db-config.rsp
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 2337 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 3071 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2023-03-01_02-21-17PM. Please wait ...[oracle@kylin-server database]$ There was an error trying to initialize the HPI library.
Please check your installation, HotSpot does not work correctly
when installed in the JDK 1.2 Linux Production Release, or
with any JDK 1.1.x release.
Could not create the Java virtual machine.

dnf install libnsl //解决上述错误

//安装日志
/u01/oracle/inventory/logs/silentInstall2023-03-01_07-31-03PM.log
cd /u01/oracle/inventory/logs

解决$ORACLE_HOME/bin/xxx 为0字节的问题

su - oracle
cd $ORACLE_HOME/bin
[oracle@cbskf1 bin]$ ./relink all  //全部重新编译,前提是解决相关报错
writing relink log to: /home/oracle/app/oracle/product/11.2.0.4/db_1//install/relink.log
posted @ 2023-03-03 14:11  mvpbang  阅读(3823)  评论(0编辑  收藏  举报