2014-03-19 62 views
1

這裏是我安裝cx_Oracle的代碼。Puppet Oracle home setting

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的錯誤,但我認爲環境=>「ORACLE_HOME =/usr/lib目錄/oracle/11.2/client64',會照顧它。顯然情況並非如此。

有人能告訴我如何解決它?謝謝。

+0

你該路徑添加到'LD_LIBRARY_PATH'嗎?你是否安裝了SDK軟件包以及基本或基本lite? –

+0

是的,這就是我爲此所做的。 – user3330284

+0

是的,這是我正在做的.'file {'/etc/profile.d/oracle.sh': ensure => present, content => template('db/oracle.sh.erb') , } '' 文件{ '/etc/ld.so.conf.d/oracle.conf': 確保=>本, 模式=> 0640, 含量=>「/ 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'。 – user3330284

回答

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