Puppet Oracle主页设置

时间:2014-03-19 03:27:44

标签: oracle puppet cx-oracle

这是我安装cx_Oracle的代码。

  exec { 'build_cxoracle':
    command     => 'python2.7 setup.py build',
    path        => '/bin:/usr/bin',
    environment => 'ORACLE_HOME=/usr/lib/oracle/11.2/client64',
    cwd         => '/tmp/cx_Oracle-5.1.2',
    require     => Exec[untar_oracle],
  }

此操作失败,错误如下,

Exec[build_cxoracle]/returns: Traceback (most recent call last):
Exec[build_cxoracle]/returns:   File "setup.py", line 180, in <module>
Exec[build_cxoracle]/returns:     raise DistutilsSetupError("cannot locate Oracle include files")
Exec[build_cxoracle]/returns: distutils.errors.DistutilsSetupError: cannot locate Oracle include files

在阅读了其他人的博客后,我得出结论,这是ORACLE_HOME错误,但我认为 environment =&gt; 'ORACLE_HOME = / usr / lib / oracle / 11.2 / client64',会照顾它。显然情况并非如此。

有人可以告诉我如何解决它吗?谢谢。

1 个答案:

答案 0 :(得分:0)

是的,这就是我为此所做的。

file { '/etc/profile.d/oracle.sh': 
         ensure => present, 
         content => template('db/oracle.sh.erb'), 
} 

file {'/etc/ld.so.conf.d/oracle.conf': 
         ensure => present, mode => 0640, 
        content => '/usr/lib/oracle/11.2/client64/lib', 
} 

然后运行ldconfig。 oracle.sh.erb有导出

ORACLE_HOME=/usr/lib/oracle/11.2/client64 
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

在其中