{"id":880,"date":"2017-03-01T08:15:11","date_gmt":"2017-03-01T08:15:11","guid":{"rendered":"http:\/\/blog.tiran.info\/?p=880"},"modified":"2017-03-01T08:15:11","modified_gmt":"2017-03-01T08:15:11","slug":"oracle-r-enterprise-2","status":"publish","type":"post","link":"https:\/\/blog.tiran.stream\/?p=880","title":{"rendered":"Oracle R Enterprise (#2)"},"content":{"rendered":"<p style=\"text-align: justify;\">On a vu dans l&rsquo;<a href=\"http:\/\/blog.tiran.info\/oracle-r-enterprise-1\" target=\"_blank\">article pr\u00e9c\u00e9dent<\/a> que la version communautaire de R permettait difficilement de travailler avec de grands volumes. Pour cela, on lui pr\u00e9f\u00e9rera la distribution <a href=\"http:\/\/www.oracle.com\/technetwork\/database\/database-technologies\/r\/r-enterprise\/overview\/index.html\" target=\"_blank\">Oracle R Enterprise<\/a> qui fait partie de l&rsquo;option <a href=\"https:\/\/www.oracle.com\/database\/advanced-analytics\/index.html\" target=\"_blank\">Oracle Advanced Analytics<\/a>.<\/p>\n<p style=\"text-align: justify;\">La mise en oeuvre repose sur quatre\u00a0composants d\u00e9taill\u00e9s ci-apr\u00e8s:<\/p>\n<h3>1- Une base de donn\u00e9es Oracle Enterprise Edition<\/h3>\n<p style=\"text-align: justify;\">On utilisera une version 12.2 pour cet exemple, son installation n&rsquo;est pas d\u00e9crite ici\u00a0car elle ne pr\u00e9sente pas de sp\u00e9cificit\u00e9. On notera juste la n\u00e9cessit\u00e9 d&rsquo;installer le patch 20173897 pour les versions &lt;12.2.<\/p>\n<h3>2- Une distribution R sur le serveur de base de donn\u00e9es<\/h3>\n<p style=\"text-align: justify;\">Oracle R Distribution est utilis\u00e9 dans cet article mais on aurait tout aussi bien pu utiliser la version communautaire.<\/p>\n<p style=\"text-align: justify;\">L&rsquo;installation est r\u00e9alis\u00e9e sur un syst\u00e8me OEL 6.7 \u00e0 l&rsquo;aide d&rsquo;une commande yum (exploitant le repository public-yum.oracle.com):<\/p>\n<pre class=\"brush: js; ruler: true;\">\u00a0\n# cat \/etc\/oracle-release\nOracle Linux Server release 6.7\n#\n# yum install R.x86_64\n<\/pre>\n<p style=\"text-align: justify;\">N\u00e9anmoins, la documentation mentionne que le package libRmath-static devrait \u00eatre install\u00e9 mais il s&rsquo;est av\u00e9r\u00e9 que cela n&rsquo;\u00e9tait pas le cas lors d&rsquo;un d\u00e9ploiement avec yum.<\/p>\n<p style=\"text-align: justify;\">J&rsquo;ai donc t\u00e9l\u00e9charg\u00e9 directement le package (depuis <a href=\"http:\/\/public-yum.oracle.com\/repo\/OracleLinux\/OL6\/addons\/x86_64\/getPackage\/libRmath-static-3.2.0-2.el6.x86_64.rpm\" target=\"_blank\">ce lien<\/a>) qui a \u00e9t\u00e9 install\u00e9 avec la commande rpm:<\/p>\n<pre class=\"brush: js; ruler: true;\">\u00a0\n# rpm -Uvh libRmath-static-3.2.0-2.el6.x86_64.rpm\n<\/pre>\n<p>A l&rsquo;issue de l&rsquo;op\u00e9ration, les packages suivants devraient \u00eatre install\u00e9s:<\/p>\n<pre class=\"brush: js; ruler: true;\">\u00a0\n[oracle@psu888 ~]$ rpm -qa | grep -E &quot;R-|libR&quot;\nR-3.2.0-2.el6.x86_64\nlibRmath-devel-3.2.0-2.el6.x86_64\nR-devel-3.2.0-2.el6.x86_64\nlibRmath-static-3.2.0-2.el6.x86_64\nlibRmath-3.2.0-2.el6.x86_64\nR-core-3.2.0-2.el6.x86_64\n[oracle@psu888 ~]$\n<\/pre>\n<p>On peut alors lancer R et v\u00e9rifier qu&rsquo;il s&rsquo;agit bien de la distribution Oracle:<\/p>\n<pre class=\"brush: js; ruler: true;\">\u00a0\n[oracle@psu888 ~]$ R\n\nOracle Distribution of R version 3.2.0  (--) -- &quot;Full of Ingredients&quot;\nCopyright (C)  The R Foundation for Statistical Computing\nPlatform: x86_64-unknown-linux-gnu (64-bit)\n\nR is free software and comes with ABSOLUTELY NO WARRANTY.\nYou are welcome to redistribute it under certain conditions.\nType &#039;license()&#039; or &#039;licence()&#039; for distribution details.\n\n  Natural language support but running in an English locale\n\nR is a collaborative project with many contributors.\nType &#039;contributors()&#039; for more information and\n&#039;citation()&#039; on how to cite R or R packages in publications.\n\nType &#039;demo()&#039; for some demos, &#039;help()&#039; for on-line help, or\n&#039;help.start()&#039; for an HTML browser interface to help.\nType &#039;q()&#039; to quit R.\n\nYou are using Oracle&#039;s distribution of R. Please contact\nOracle Support for any problems you encounter with this\ndistribution.\n\n&gt; q()\nSave workspace image? [y\/n\/c]: n\n[oracle@psu888 ~]$\n<\/pre>\n<h3>3- Oracle R Enterprise Server<\/h3>\n<p>On t\u00e9l\u00e9charge ensuite les archives ore-server et ore-supporting \u00e0 partir de cette <a href=\"http:\/\/www.oracle.com\/technetwork\/database\/database-technologies\/r\/r-enterprise\/downloads\/index.html\" target=\"_blank\">page<\/a>.<\/p>\n<pre class=\"brush: js; ruler: true;\">\u00a0\n[oracle@psu888 ~]$ cd ORE\n[oracle@psu888 ORE]$ ll\ntotal 110296\n-rw-r--r-- 1 oracle dba 109435939 Feb 21 12:02 ore-server-linux-x86-64-1.5.zip\n-rw-r--r-- 1 oracle dba   3504064 Feb 21 12:02 ore-supporting-linux-x86-64-1.5.zip\n[oracle@psu888 ORE]$\n[oracle@psu888 ORE]$ unzip ore-server-linux-x86-64-1.5.zip\nArchive:  ore-server-linux-x86-64-1.5.zip\n  inflating: server.sh\n  inflating: server\/ORE_1.5_R_x86_64-unknown-linux-gnu.tar.gz\n...\n  inflating: server\/rquser.sql\n[oracle@psu888 ORE]$ unzip ore-supporting-linux-x86-64-1.5.zip\nArchive:  ore-supporting-linux-x86-64-1.5.zip\n  inflating: supporting\/Cairo_1.5-8_R_x86_64-unknown-linux-gnu.tar.gz\n...\n  inflating: supporting\/statmod_1.4.21_R_x86_64-unknown-linux-gnu.tar.gz\n[oracle@psu888 ORE]$\n<\/pre>\n<p>On peut alors lancer l&rsquo;installation via la script server.sh:<\/p>\n<pre class=\"brush: js; ruler: true;\">\u00a0\n[oracle@psu888 ORE]$ ll\ntotal 110360\n-rw-r--r-- 1 oracle dba      109435939 Feb 21 12:02 ore-server-linux-x86-64-1.5.zip\n-rw-r--r-- 1 oracle dba        3504064 Feb 21 12:02 ore-supporting-linux-x86-64-1.5.zip\ndrwxr-xr-x 3 oracle oinstall      4096 Feb 21 12:14 server\n-r-xr-xr-x 1 oracle oinstall     55193 Oct 22  2015 server.sh\ndrwxr-xr-x 2 oracle oinstall      4096 Feb 21 12:14 supporting\n[oracle@psu888 ORE]$ .\/server.sh\n\nOracle R Enterprise 1.5 Server.\n\nCopyright (c) 2012, 2015 Oracle and\/or its affiliates. All rights reserved.\n\nChecking platform .................. Pass\nChecking R ......................... Pass\nChecking R libraries ............... Pass\nChecking ORACLE_HOME ............... Pass\nChecking ORACLE_SID ................ Pass\nChecking sqlplus ................... Pass\nChecking ORACLE instance ........... Pass\nChecking CDB\/PDB ................... Fail\n  ERROR: cannot install ORE in a root container\n  PDB to use for ORE installation [list]: PDB_IOTST04\nChecking CDB\/PDB ................... Pass\nChecking ORE ....................... Pass\n\nChoosing RQSYS tablespaces\n  PERMANENT tablespace to use for RQSYS [list]: TBS01\n  TEMPORARY tablespace to use for RQSYS [list]: TEMP\nChoosing RQSYS password\n  Password to use for RQSYS:\n\nChoosing ORE user\n  ORE user to use [list]: C##RAF\n\nCurrent configuration\n  R Version ........................ Oracle Distribution of R version 3.2.0  (--)\n  R_HOME ........................... \/usr\/lib64\/R\n  R_LIBS_USER ...................... \/soft\/oracle\/product\/rdbms\/12.2.0.1\/R\/library\n  ORACLE_HOME ...................... \/soft\/oracle\/product\/rdbms\/12.2.0.1\n  ORACLE_SID ....................... IOSHR88D1_2\n  PDB .............................. PDB_IOTST04\n\n  Existing R Version ............... None\n  Existing R_HOME .................. None\n  Existing ORE data ................ None\n  Existing ORE code ................ None\n  Existing ORE libraries ........... None\n\n  RQSYS PERMANENT tablespace ....... TBS01\n  RQSYS TEMPORARY tablespace ....... TEMP\n\n  ORE user type .................... Existing\n  ORE user name .................... C##RAF\n  ORE user PERMANENT tablespace .... TBS01\n  ORE user TEMPORARY tablespace .... TEMP\n  Grant RQADMIN role ............... No\n\n  Operation ........................ Install\/Upgrade\/Setup\n\nProceed? [yes] yes\n\nRemoving R libraries ............... Pass\nInstalling R libraries ............. Pass\nInstalling ORE libraries ........... Pass\nInstalling RQSYS data .............. Pass\nConfiguring ORE .................... Pass\nInstalling RQSYS code .............. Pass\nInstalling ORE packages ............ Pass\nCreating ORE script ................ Pass\nInstalling migration scripts ....... Pass\nInstalling supporting packages ..... Pass\nGranting ORE privileges ............ Pass\n\nDone\n[oracle@psu888 ORE]$\n<\/pre>\n<p>On v\u00e9rifie que les logs ne contiennent pas d&rsquo;erreur:<\/p>\n<pre class=\"brush: js; ruler: true;\">\u00a0\n[oracle@psu888 ORE]$ ll *.log\n-rw-r--r-- 1 oracle oinstall    9 Feb 21 12:18 outcdb.log\n-rw-r--r-- 1 oracle oinstall  444 Feb 21 12:25 rqconfig.log\n-rw-r--r-- 1 oracle oinstall  388 Feb 21 12:26 rqgrant.log\n-rw-r--r-- 1 oracle oinstall 2787 Feb 21 12:25 rqinst.log\n-rw-r--r-- 1 oracle oinstall 7871 Feb 21 12:26 rqproc.log\n[oracle@psu888 ORE]$\n[oracle@psu888 ORE]$ grep ORA- *.log\n[oracle@psu888 ORE]$\n<\/pre>\n<h3>4- Oracle R Enterprise Client (&amp; librairie MKL)<\/h3>\n<p>On t\u00e9l\u00e9charge le client R Oracle \u00e0 partir de <a href=\"https:\/\/oss.oracle.com\/ORD\/\" target=\"_blank\">https:\/\/oss.oracle.com\/ORD\/<\/a>. Ici, il s&rsquo;agit de la distribution ORE 3.2.0 pour Windows.<\/p>\n<p>L&rsquo;installation ne pr\u00e9sente pas de difficult\u00e9 particuli\u00e8re:<\/p>\n<p><a href=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_cli.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-889 size-full\" src=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_cli.png\" width=\"503\" height=\"388\" \/><\/a>\u00a0<a href=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_cli_inst1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-888 size-full\" src=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_cli_inst1.png\" width=\"503\" height=\"388\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">A l&rsquo;issue de l&rsquo;installation, un \u00e9cran informe de la possibilit\u00e9 d&rsquo;appuyer R sur la librairie Intel MKL:<\/p>\n<p><a href=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_cli_inst2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-887 size-full\" src=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_cli_inst2.png\" width=\"503\" height=\"388\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Cette librairie sp\u00e9cialis\u00e9e doit \u00eatre t\u00e9l\u00e9charg\u00e9e depuis le <a href=\"https:\/\/software.intel.com\/en-us\/intel-mkl\" target=\"_blank\">site d&rsquo;Intel<\/a>\u00a0:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_mkl_inst.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-890\" src=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_mkl_inst.png\" width=\"500\" height=\"550\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">L&rsquo;installation s&rsquo;av\u00e8re la aussi tr\u00e8s simple:<\/p>\n<p><a href=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_mkl_inst2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-892\" src=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_mkl_inst2.png\" width=\"500\" height=\"354\" \/><\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-891\" src=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_mkl_inst3.png\" width=\"500\" height=\"354\" \/><\/p>\n<p style=\"text-align: justify;\">L&rsquo;interfa\u00e7age R\/MKL repose sur l&rsquo;ajout dans le PATH du syst\u00e8me des localisations des dll libOrdBlasLoader.dll et mkl_rt.dll:<\/p>\n<p><a href=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ora_config_mkl2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-894 size-full\" src=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ora_config_mkl2.png\" width=\"821\" height=\"126\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ora_config_mkl1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-895 size-full\" src=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ora_config_mkl1.png\" width=\"704\" height=\"132\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ora_config_mkl3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-893 size-full\" src=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ora_config_mkl3.png\" width=\"1278\" height=\"121\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Dans R, on peut alors v\u00e9rifier \u00e0 l&rsquo;aide de la commande Sys.BlasLapack() que la librairie est bien utilisable:<\/p>\n<p><a href=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_avec_mkl.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-897 size-full\" src=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_avec_mkl.png\" width=\"368\" height=\"67\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Pour finaliser la mise en place du client ORE, il faut ensuite installer quelques\u00a0packages additionnels (archives ore-client et ore-supporting) que l&rsquo;on r\u00e9cup\u00e8re auparavant\u00a0\u00e0 partir de cette <a href=\"http:\/\/www.oracle.com\/technetwork\/database\/database-technologies\/r\/r-enterprise\/downloads\/index.html\" target=\"_blank\">page<\/a>. Leur d\u00e9ploiement peut \u00eatre r\u00e9alis\u00e9 \u00e0 partir du GUI R via le menu\u00a0\u00ab\u00a0Packages &gt; Install package(s) from local zip files&#8230;\u00a0\u00bb:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_packages.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-898 size-full\" src=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_packages.png\" width=\"478\" height=\"212\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">A noter qu&rsquo;il m&rsquo;a fallu d\u00e9marrer le client R en tant qu&rsquo;administrateur pour que le d\u00e9ploiement des packages fonctionne correctement:\u00a0<a href=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_packages3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-899 size-full\" src=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_packages3.png\" width=\"536\" height=\"338\" \/><\/a><\/p>\n<h3 style=\"text-align: justify;\">Test d&rsquo;Oracle R Enterprise<\/h3>\n<p style=\"text-align: justify;\">Apr\u00e8s avoir charg\u00e9 le package ORE dans la session cliente, on v\u00e9rifie que les m\u00e9thodes ore.* fonctionnent correctement:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_test.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-900 size-full\" src=\"https:\/\/blog.tiran.stream\/wp-content\/uploads\/2017\/03\/ore_test.png\" width=\"1242\" height=\"504\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>On a vu dans l&rsquo;article pr\u00e9c\u00e9dent que la version communautaire de R permettait difficilement de travailler avec de grands volumes.<\/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":[9],"tags":[],"class_list":["post-880","post","type-post","status-publish","format-standard","hentry","category-oracle-r-enterprise"],"_links":{"self":[{"href":"https:\/\/blog.tiran.stream\/index.php?rest_route=\/wp\/v2\/posts\/880","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=880"}],"version-history":[{"count":0,"href":"https:\/\/blog.tiran.stream\/index.php?rest_route=\/wp\/v2\/posts\/880\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.tiran.stream\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=880"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.tiran.stream\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=880"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.tiran.stream\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=880"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}