标签 oracle 下的文章

安装Grid时,执行root.sh之前,在两个节点都打上补丁,再运行root.sh
补丁:18370031 (补丁要mos管方账号才能下)
$ /u01/app/11.2.0/grid/OPatch/opatch apply -local

现象:
Grid 11.2.0.4 Install fails when running root.sh on OL7, this affects both Oracle Clusterware and Oracle Restart Installation.

rootcrs.log/roothas.log confirms that ohasd/crsd failed to start

原因:

There is a known issue where OL7 expects to use systemd rather than initd for running processes and restarting them and root.sh does not handle this currently.

This was reported in the following Unpublished Bug

  Bug 18370031  - RC SCRIPTS (/ETC/RC.D/RC.* , /ETC/INIT.D/* ) ON OL7 FOR LUSTERWARE

解决办法:

Because Oracle Linux 7 (and Redhat 7) use systemd rather than initd for starting/restarting processes and runs them as a service the current software install of both 11.2.0.4 & 12.1.0.1 will not succeed because the ohasd process does not start properly.
In OL7 it needs to be set up as a service and patch fix for Bug 18370031 needs to be applied for this , BEFORE you run root.sh when prompted .

Need to apply the patch 18370031 for 11.2.0.4 .
And also its mentioned in 11gR2 Release Notes:https://docs.oracle.com/cd/E11882_01/relnotes.112/e23558/toc.htm#CJAJEBGG
During the Oracle Grid Infrastructure installation, you must apply patch 18370031 before configuring the software that is installed.
The timing of applying the patch is important and is described in detail in the Note 1951613.1 on My Oracle Support. This patch ensures that
the clusterware stack is configured to use systemd for clusterware processes, as Oracle Linux 7 uses systemd for all services.

下载DBD-Oracle-1.80.tar.gz,地址如下:

https://metacpan.org/pod/DBD::Oracle

解压DBD-Oracle-1.80.tar.gz到/tmp下

在root用户添加如下环境变量:

 export ORACLE_BASE=/home/db/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0
export GRID_HOME=/home/db/grid/product/11.2.0
export LD_LIBRARY_PATH=:$ORACLE_HOME/lib:$ORACLE_HOME/lib32
export LIBPATH=$LD_LIBRARY_PATH
export   PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$GRID_HOME/bin:/usr/bin:/etc:/usr/sbin:

安装:

cd /tmp/DBD-Oracle-1.80
perl Makefile.PL
make
make install

测试perl访问oracle:

  #!/usr/bin/perl  
use DBI;  
$dbh = DBI->connect("dbi:Oracle:testdb", "system", "oracle") or die("DB connect error!\n");  
$sql = "select * from dual";  
$sth = $dbh->prepare($sql);  
$sth->execute() or die("error!");  
while(@rows = $sth->fetchrow_array)  
{  
        foreach(@rows)  
        {  
                print "$_\t";  
        }  
        print "\n";  
}  
$sth->finish;  

显示'x'说明ok