{"id":413,"date":"2015-11-20T07:30:10","date_gmt":"2015-11-20T07:30:10","guid":{"rendered":"http:\/\/blog.tiran.info\/?p=413"},"modified":"2015-11-20T07:30:10","modified_gmt":"2015-11-20T07:30:10","slug":"roracle-sur-linux-x86-64-avec-un-client-12c","status":"publish","type":"post","link":"https:\/\/blog.tiran.stream\/?p=413","title":{"rendered":"ROracle sur Linux x86-64 avec un client 12c"},"content":{"rendered":"<p>J&rsquo;ai r\u00e9cemment rencontr\u00e9 un probl\u00e8me lors de l&rsquo;installation de ROracle 1.2-1 sur une machine Ubuntu avec un client 12c:<\/p>\n<pre class=\"brush: plain; ruler: true;\">raphael@raphael-Alienware-14:~$ lsb_release -a\nNo LSB modules are available.\nDistributor ID: Ubuntu\nDescription: Ubuntu 14.04.3 LTS\nRelease: 14.04\nCodename: trusty\nraphael@raphael-Alienware-14:~$ \nraphael@raphael-Alienware-14:~$ uname -a\nLinux raphael-Alienware-14 3.13.0-66-generic #108-Ubuntu SMP Wed Oct 7 15:20:27 UTC 2015 x86_64 x86_64 x86_64 GNU\/Linux\nraphael@raphael-Alienware-14:~$<\/pre>\n<h3>Mise en place du client Oracle<\/h3>\n<p>Un <a href=\"http:\/\/www.oracle.com\/technetwork\/topics\/linuxx86-64soft-092277.html\" target=\"_blank\">Instant Client<\/a>\u00a0a \u00e9t\u00e9 pr\u00e9alablement mis en place.\u00a0Pour cela, les packages suivants ont \u00e9t\u00e9 t\u00e9l\u00e9charg\u00e9s:<\/p>\n<ul>\n<li>Instant Client Package &#8211; Basic<\/li>\n<li>Instant Client Package &#8211; SDK<\/li>\n<\/ul>\n<p>Ils ont \u00e9t\u00e9 d\u00e9compress\u00e9s dans le r\u00e9pertoire \u00ab\u00a0\/home\/raphael\/Oracle\/instantclient_12_1\u00a0\u00bb.\u00a0Les variables ORACLE_HOME, LD_LIBRARY_PATH et OCI_LIB ont ensuite \u00e9t\u00e9 valoris\u00e9es:<\/p>\n<pre class=\"brush: plain; ruler: true;\">raphael@raphael-Alienware-14:~$ echo $ORACLE_HOME\n\/home\/raphael\/Oracle\/instantclient_12_1\nraphael@raphael-Alienware-14:~$ echo $OCI_LIB\n\/home\/raphael\/Oracle\/instantclient_12_1\nraphael@raphael-Alienware-14:~$ echo $LD_LIBRARY_PATH \n\/home\/raphael\/Oracle\/instantclient_12_1\nraphael@raphael-Alienware-14:~$<\/pre>\n<h2><\/h2>\n<h3>Installation du package DBI<\/h3>\n<pre class=\"brush: plain; ruler: true;\">raphael@raphael-Alienware-14:~$ wget https:\/\/cran.r-project.org\/src\/contrib\/DBI_0.3.1.tar.gz\n--2015-10-24 22:45:39-- https:\/\/cran.r-project.org\/src\/contrib\/DBI_0.3.1.tar.gz\nR\u00e9solution de cran.r-project.org (cran.r-project.org)... 137.208.57.37\nConnexion vers cran.r-project.org (cran.r-project.org)|137.208.57.37|:443... connect\u00e9.\nrequ\u00eate HTTP transmise, en attente de la r\u00e9ponse... 200 OK\nTaille\u00a0: 30106 (29K) [application\/x-gzip]\nEnregistre : \u00abDBI_0.3.1.tar.gz.1\u00bb\n\n100%[===================================================================================&gt;] 30 106 --.-K\/s ds 0,1s \n\n2015-10-24 22:45:39 (235 KB\/s) - \u00abDBI_0.3.1.tar.gz.1\u00bb enregistr\u00e9 [30106\/30106]\n\nraphael@raphael-Alienware-14:~$ R CMD INSTALL DBI_0.3.1.tar.gz \n* installing to library \u2018\/home\/raphael\/R\/x86_64-pc-linux-gnu-library\/3.0\u2019\n* installing *source* package \u2018DBI\u2019 ...\n** package \u2018DBI\u2019 correctement d\u00e9compress\u00e9 et sommes MD5 v\u00e9rifi\u00e9es\n** R\n** preparing package for lazy loading\n** help\n*** installing help indices\n** building package indices\n** testing if installed package can be loaded\n* DONE (DBI)\nraphael@raphael-Alienware-14:~$<\/pre>\n<h2><\/h2>\n<h3>Installation de ROracle<\/h3>\n<p>L&rsquo;installation \u00e9choue en raison de l&rsquo;absence d&rsquo;un r\u00e9pertoire:<\/p>\n<pre class=\"brush: plain; ruler: true; highlight: [17];\">raphael@raphael-Alienware-14:~$ wget https:\/\/cran.r-project.org\/src\/contrib\/ROracle_1.2-1.tar.gz\n--2015-10-24 22:46:22-- https:\/\/cran.r-project.org\/src\/contrib\/ROracle_1.2-1.tar.gz\nR\u00e9solution de cran.r-project.org (cran.r-project.org)... 137.208.57.37\nConnexion vers cran.r-project.org (cran.r-project.org)|137.208.57.37|:443... connect\u00e9.\nrequ\u00eate HTTP transmise, en attente de la r\u00e9ponse... 200 OK\nTaille\u00a0: 299072 (292K) [application\/x-gzip]\nEnregistre : \u00abROracle_1.2-1.tar.gz\u00bb\n\n100%[===================================================================================&gt;] 299 072 178KB\/s ds 1,6s \n\n2015-10-24 22:46:24 (178 KB\/s) - \u00abROracle_1.2-1.tar.gz\u00bb enregistr\u00e9 [299072\/299072]\n\nraphael@raphael-Alienware-14:~$ R CMD INSTALL ROracle_1.2-1.tar.gz \n* installing to library \u2018\/home\/raphael\/R\/x86_64-pc-linux-gnu-library\/3.0\u2019\n* installing *source* package \u2018ROracle\u2019 ...\n** package \u2018ROracle\u2019 correctement d\u00e9compress\u00e9 et sommes MD5 v\u00e9rifi\u00e9es\nconfigure: error: &quot;\/home\/raphael\/Oracle\/instantclient_12_1\/rdbms\/public&quot; directory does not exist\nERROR: configuration failed for package \u2018ROracle\u2019\n* removing \u2018\/home\/raphael\/R\/x86_64-pc-linux-gnu-library\/3.0\/ROracle\u2019\nraphael@raphael-Alienware-14:~$<\/pre>\n<p>Il appara\u00eet que la valorisation de la variable d&rsquo;environnement <strong>OCI_INC<\/strong> permet de solutionner le probl\u00e8me:<\/p>\n<pre class=\"brush: plain; ruler: true;\">raphael@raphael-Alienware-14:~$ \nraphael@raphael-Alienware-14:~$ export OCI_INC=\/home\/raphael\/Oracle\/instantclient_12_1\/sdk\/include\nraphael@raphael-Alienware-14:~$ \nraphael@raphael-Alienware-14:~$ R CMD INSTALL ROracle_1.2-1.tar.gz \n* installing to library \u2018\/home\/raphael\/R\/x86_64-pc-linux-gnu-library\/3.0\u2019\n* installing *source* package \u2018ROracle\u2019 ...\n** package \u2018ROracle\u2019 correctement d\u00e9compress\u00e9 et sommes MD5 v\u00e9rifi\u00e9es\nconfigure: creating .\/config.status\nconfig.status: creating src\/Makevars\n** libs\ngcc -std=gnu99 -I\/usr\/share\/R\/include -DNDEBUG -I\/home\/raphael\/Oracle\/instantclient_12_1\/sdk\/include -fpic -O3 -pipe -g -c rodbi.c -o rodbi.o\nrodbi.c: In function \u2018rodbiResBind\u2019:\nrodbi.c:2293:11: warning: format \u2018%lld\u2019 expects argument of type \u2018long long int\u2019, but argument 3 has type \u2018sb8\u2019 [-Wformat=]\n sprintf(err_buf, RODBI_ERR_BIND_VAL_TOOBIG, bndsz);\n ^\nrodbi.c:2336:9: warning: format \u2018%lld\u2019 expects argument of type \u2018long long int\u2019, but argument 3 has type \u2018sb8\u2019 [-Wformat=]\n sprintf(err_buf, RODBI_ERR_BIND_VAL_TOOBIG, bndsz);\n ^\ngcc -std=gnu99 -I\/usr\/share\/R\/include -DNDEBUG -I\/home\/raphael\/Oracle\/instantclient_12_1\/sdk\/include -fpic -O3 -pipe -g -c rooci.c -o rooci.o\ngcc -std=gnu99 -shared -o ROracle.so rodbi.o rooci.o -L\/home\/raphael\/Oracle\/instantclient_12_1 -lclntsh -L\/usr\/lib\/R\/lib -lR\ninstalling to \/home\/raphael\/R\/x86_64-pc-linux-gnu-library\/3.0\/ROracle\/libs\n** R\n** inst\n** preparing package for lazy loading\nCreating a generic function for \u2018summary\u2019 from package \u2018base\u2019 in package \u2018ROracle\u2019\n** help\n*** installing help indices\n** building package indices\n** installing vignettes\n** testing if installed package can be loaded\n* DONE (ROracle)\nraphael@raphael-Alienware-14:~$<\/pre>\n<p>N\u00e9anmoins selon le <a href=\"https:\/\/cran.r-project.org\/web\/packages\/ROracle\/INSTALL\" target=\"_blank\">guide d&rsquo;installation<\/a>, le positionnement de cette variable ne devrait pas \u00eatre n\u00e9cessaire dans la mesure ou les headers du clients sont stock\u00e9s dans leur localisation par d\u00e9faut:<\/p>\n<p style=\"padding-left: 30px;\"><em>\u00ab\u00a0Both methods assume that Basic and SDK packages were unzipped into the same\u00a0directory and Oracle Client headers are located under $OCI_LIB\/sdk\/include. If this is not the case, then set either the OCI_INC environment variable or\u00a0the &#8211;with-oci-inc configure option appropriately.\u00a0\u00bb<\/em><\/p>\n<h2><\/h2>\n<h3>Test de connectivit\u00e9<\/h3>\n<pre class=\"brush: plain; ruler: true;\">raphael@raphael-Alienware-14:~$ R\n\nR version 3.0.2 (2013-09-25) -- &quot;Frisbee Sailing&quot;\nCopyright (C) 2013 The R Foundation for Statistical Computing\nPlatform: x86_64-pc-linux-gnu (64-bit)\n\nR est un logiciel libre livr\u00e9 sans AUCUNE GARANTIE.\nVous pouvez le redistribuer sous certaines conditions.\nTapez &#039;license()&#039; ou &#039;licence()&#039; pour plus de d\u00e9tails.\n\nR est un projet collaboratif avec de nombreux contributeurs.\nTapez &#039;contributors()&#039; pour plus d&#039;information et\n&#039;citation()&#039; pour la fa\u00e7on de le citer dans les publications.\n\nTapez &#039;demo()&#039; pour des d\u00e9monstrations, &#039;help()&#039; pour l&#039;aide\nen ligne ou &#039;help.start()&#039; pour obtenir l&#039;aide au format HTML.\nTapez &#039;q()&#039; pour quitter R.\n\n&gt; library(ROracle)\nLe chargement a n\u00e9cessit\u00e9 le package : DBI\n&gt; ora = Oracle()\n&gt; cnx = dbConnect(ora, username=&quot;rafa&quot;, password=&quot;rafa&quot;, dbname=&quot;192.168.1.22:1521\/PDB_ODM&quot;)\n&gt; summary(cnx)\nUser name: rafa \nConnect string: 192.168.1.22:1521\/PDB_ODM \nServer version: 12.1.0.2.0 \nServer type: Oracle RDBMS \nResults processed: 0 \nOCI prefetch: FALSE \nBulk read: 1000 \nBulk write: 1000 \nStatement cache size: 0 \nOpen results: 0 \n&gt; dbDisconnect(cnx)\n[1] TRUE\n&gt;<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>J&rsquo;ai r\u00e9cemment rencontr\u00e9 un probl\u00e8me lors de l&rsquo;installation de ROracle 1.2-1 sur une machine Ubuntu avec un client 12c: raphael@raphael-Alienware-14:~$<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[6,12],"tags":[],"class_list":["post-413","post","type-post","status-publish","format-standard","hentry","category-oracle","category-r"],"_links":{"self":[{"href":"https:\/\/blog.tiran.stream\/index.php?rest_route=\/wp\/v2\/posts\/413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.tiran.stream\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.tiran.stream\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.tiran.stream\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.tiran.stream\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=413"}],"version-history":[{"count":0,"href":"https:\/\/blog.tiran.stream\/index.php?rest_route=\/wp\/v2\/posts\/413\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.tiran.stream\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.tiran.stream\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.tiran.stream\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}