创建的目录都是在安装时要用到的:
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0.3/db_1
export ORACLE_SID=masc
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
yum install xterm
yum install xclock
安装上面的两个服务
Oracle Base: /u01/app/oracle
Software Location(Oracle Home) /u01/app/oracle/product/11.2.0.3/db_1
数据库管理员:dba
操作库操作员oper
安装检测:
This is a prerequisite condition to test whether sufficient total swap space is available on the system. (more details)
Expected Value
: 2.67GB (2794548.0KB)
Actual Value
: 2GB (2097148.0KB)
要求有swap,之前安装k8s时要求的是没有swap,被我清空了。
恢复swap:
[root@ol7-19 ~]# blkid
/dev/sr0: UUID="2020-11-04-11-36-43-00" LABEL="CentOS 7 x86_64" TYPE="iso9660" PTTYPE="dos"
/dev/sda1: UUID="80716fe6-0ce4-496a-89af-3ab2628088d0" TYPE="xfs"
/dev/sda2: UUID="OvK5gh-UcPD-VtQs-TRug-HWOH-gyus-xsVmoL" TYPE="LVM2_member"
/dev/mapper/centos-root: UUID="9fdb389b-808a-4508-bc2d-3a7e942a6a02" TYPE="xfs"
/dev/mapper/centos-swap: UUID="8a96aacc-cd48-49e7-a07c-079a318ec1bc" TYPE="swap"
[root@ol7-19 ~]# swapon /dev/mapper/centos-swap
[root@ol7-19 ~]# free -m
total used free shared buff/cache available
Mem: 1819 657 15 55 1146 1078
Swap: 2047 0 2047
[root@ol7-19 ~]#
要求至少有2.67GB,上面的swap是2GB还不够,增加swap大小 3G到5G
mkdir /usr/swap &&cd /usr/swap
dd if=/dev/zero of=swapfile bs=1G count=3
[root@ol7-19 swap]# mkswap /usr/swap/swapfile
Setting up swapspace version 1, size = 3145724 KiB
no label, UUID=812099b2-4f48-4c90-8c14-0b19d0cb67be
[root@ol7-19 swap]# swapon /usr/swap/swapfile
swapon: /usr/swap/swapfile: insecure permissions 0644, 0600 suggested.
[root@ol7-19 swap]# free -m
total used free shared buff/cache available
Mem: 1819 434 995 29 389 1326
Swap: 5119 248 4871
调整了swap大小后再次检测通过。
This is a prerequisite condition to test whether the OS kernel parameter "semmni" is properly set. (more details)
Expected Value
: 128
Actual Value
: 0
这个忽略,其他32位包也忽略,直接安装缺少的64位包
unixODBC-2.2.11 (x86_64)
wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.9.tar.gz
ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.9.tar.gz
compat-libstdc 解决:
[root@ol7-19 ~]# rpm -ivh compat-libstdc++-33-3.2.3-72.el7.i686.rpm
Preparing... ################################# [100%]
Updating / installing...
1:compat-libstdc++-33-3.2.3-72.el7 ################################# [100%]
[root@ol7-19 ~]# rpm -q "compat-libstdc++-33-3.2.3-72.*"
compat-libstdc++-33-3.2.3-72.el7.x86_64
compat-libstdc++-33-3.2.3-72.el7.i686
[root@ol7-19 ~]#
unixODBC-devel-2.2.11 (i386)
http://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/unixODBC-devel-2.3.1-14.el7.i686.rpm
[root@ol7-19 ~]# rpm -ivh unixODBC-devel-2.3.1-14.el7.x86_64.rpm
error: Failed dependencies:
libesoobS.so.2()(64bit) is needed by unixODBC-devel-2.3.1-14.el7.x86_64
libmimerS.so.2()(64bit) is needed by unixODBC-devel-2.3.1-14.el7.x86_64
libnn.so.2()(64bit) is needed by unixODBC-devel-2.3.1-14.el7.x86_64
libodbccr.so.2()(64bit) is needed by unixODBC-devel-2.3.1-14.el7.x86_64
libodbcdrvcfg1S.so.2()(64bit) is needed by unixODBC-devel-2.3.1-14.el7.x86_64
libodbcdrvcfg2S.so.2()(64bit) is needed by unixODBC-devel-2.3.1-14.el7.x86_64
libodbcminiS.so.2()(64bit) is needed by unixODBC-devel-2.3.1-14.el7.x86_64
libodbcnnS.so.2()(64bit) is needed by unixODBC-devel-2.3.1-14.el7.x86_64
libodbctxtS.so.2()(64bit) is needed by unixODBC-devel-2.3.1-14.el7.x86_64
liboplodbcS.so.2()(64bit) is needed by unixODBC-devel-2.3.1-14.el7.x86_64
liboraodbcS.so.2()(64bit) is needed by unixODBC-devel-2.3.1-14.el7.x86_64
libsapdbS.so.2()(64bit) is needed by unixODBC-devel-2.3.1-14.el7.x86_64
libtdsS.so.2()(64bit) is needed by unixODBC-devel-2.3.1-14.el7.x86_64
libtemplate.so.2()(64bit) is needed by unixODBC-devel-2.3.1-14.el7.x86_64
unixODBC(x86-64) = 2.3.1-14.el7 is needed by unixODBC-devel-2.3.1-14.el7.x86_64
[root@ol7-19 ~]#
选择finish开始安装
查看日志/opt/oracle/oraInventory/logs/installActions2021-02-27_02-41-06PM.log'
[root@ol7-19 lib]# rpm --all --query --queryformat "%{NAME}-%{VERSION}-%{RELEASE}-(%{ARCH})\n" | grep glibc
glibc-2.17-322.el7_9-(x86_64)
glibc-devel-2.17-322.el7_9-(x86_64)
glibc-devel-2.17-322.el7_9-(i686)
glibc-common-2.17-322.el7_9-(x86_64)
glibc-headers-2.17-322.el7_9-(x86_64)
glibc-2.17-322.el7_9-(i686)
[root@ol7-19 lib]# yum install glibc-devel.i686
yum install glibc-devel.i686
[root@ol7-19 lib]# rpm --all --query --queryformat "%{NAME}-%{VERSION}-%{RELEASE}-(%{ARCH})\n" | grep glibc
glibc-common-2.17-323.el7_9-(x86_64)
glibc-2.17-323.el7_9-(i686)
glibc-2.17-323.el7_9-(x86_64)
glibc-devel-2.17-323.el7_9-(i686)
glibc-devel-2.17-323.el7_9-(x86_64)
glibc-headers-2.17-323.el7_9-(x86_64)
[root@ol7-19 lib]#
查看错误
vim /opt/oracle/oraInventory/logs/installActions2021-02-27_02-41-06PM.log
INFO: 1/app/oracle/product/11.2.0.3/db_1/lib/sysliblist`
INFO: //usr/lib64/libstdc++.so.5: undefined reference to `memcpy@GLIBC_2.14'
INFO: collect2: error: ld returned 1 exit status
解决:
wget http://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/libstdc++-4.8.5-44.el7.x86_64.rpm
[root@ol7-19 ~]# rpm -ivh libstdc++-4.8.5-44.el7.x86_64.rpm
Preparing... ################################# [100%]
package libstdc++-4.8.5-44.el7.x86_64 is already installed
烦烦烦。。。。。。。。。。。。。。这些包太烦人了,换成oracle的11.2.0.4,有七个压缩文件,只要用1和2就可以安装了。
p102025301120——Linux-x86-64_1of7.zip database安装介质
p102025301120——Linux-x86-64_2of7.zip database安装介质
p102025301120——Linux-x86-64_3of7.zip grid安装介质
p102025301120——Linux-x86-64_4of7.zip client安装介质
p102025301120——Linux-x86-64_5of7.zip gateways安装介质
p102025301120——Linux-x86-64_6of7.zip example
p102025301120——Linux-x86-64_7of7.zip deinstall
只有Swap Size,shmmax和pdksh-5.2.14的问题,shmmax可以修复后忽略。pdksh也可以忽略后安装试试
vim /opt/oracle/oraInventory/logs/installActions2021-02-27_10-36-28PM.log
INFO: /usr/bin/ld: warning: -z lazyload ignored.
/usr/bin/ld: warning: -z nolazyload ignored.
/u01/app/oracle/product/11.2.0.4/db_1/sysman/lib//libnmectl.a(nmectlt.o): In function `nmectlt_genSudoProps':
nmectlt.c:(.text+0x76): undefined reference to `B_DestroyKeyObject'
nmectlt.c:(.text+0x7f): undefined reference to `B_DestroyKeyObject'
nmectlt.c:(.text+0x88): undefined reference to `B_DestroyKeyObject'
nmectlt.c:(.text+0x91): undefined reference to `B_DestroyKeyObject'
INFO: collect2: error: ld returned 1 exit status
INFO: make[1]: *** [/u01/app/oracle/product/11.2.0.4/db_1/sysman/lib/emdctl] Error 1
INFO: make[1]: Leaving directory `/u01/app/oracle/product/11.2.0.4/db_1/sysman/lib'
INFO: make: *** [emdctl] Error 2
INFO: End output from spawned process.
解决方法:
a. 错误日志: nmectlt.c:(.text+0x7f): undefined reference to `B_DestroyKeyObject'
解决办法:
修改“emdctl”的编译参数,编辑“/u01/app/oracle/product/11.2.0.4/db_1/sysman/lib/ins_emagent.mk”文件,将
171 #===========================
172 # emdctl
173 #===========================
175 $(SYSMANBIN)emdctl:
176 $(MK_EMAGENT_NMECTL)
改为
171 #===========================
172 # emdctl
173 #===========================
175 $(SYSMANBIN)emdctl:
176 $(MK_EMAGENT_NMECTL) -lnnz11
[root@ol7-19 db_1]# sh root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0.4/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying coraenv to /usr/local/bin ...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
[root@ol7-19 db_1]#
配置好oracle用户的配置文件vim .bash_profile后面增加
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0.4/db_1
export ORACLE_SID=masc
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
以root执行完脚本后就在图形页面按ok完成安装。
从root切换到oracle
su - oracle #这横杠不能少。
或者直接以oracle用户登陆shell都可以正常执行oracle命令:
启动监听:
[oracle@ol7-19 ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 27-2▒▒ -2021 23:41:56
Copyright (c) 1991, 2013, Oracle. All rights reserved.
[oracle@ol7-19 ~]$ ss -antp|grep 1521
SYN-SENT 0 1 192.168.248.133:46443 192.168.246.133:1521 users:(("lsnrctl",pid=20397,fd=6))
LISTEN 0 128 [::]:1521 [::]:* users:(("tnslsnr",pid=20431,fd=8))
[oracle@ol7-19 ~]$
[oracle@ol7-19 ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on чǚ¹ 2Ղ 27 23:43:57 2021
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup #启动数据库,我没有安装
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0.4/db_1/dbs/initmasc.ora'
SQL>
再次在xshell里执行sh runInstaller脚本,安装数据库
password:Abcd123321
提示1,和ORACLE_HOME冲突,
提示2,空间不足