{"id":1256,"date":"2016-07-14T20:01:02","date_gmt":"2016-07-14T20:01:02","guid":{"rendered":"http:\/\/62.131.51.129\/?p=1256"},"modified":"2016-07-14T20:01:02","modified_gmt":"2016-07-14T20:01:02","slug":"connect-from-32-bit-environment-to-64-oracle-instance","status":"publish","type":"post","link":"http:\/\/archief.van-maanen.com\/?p=1256","title":{"rendered":"Connect from 32 bit environment to 64 Oracle instance"},"content":{"rendered":"<p>One may retrieve the version of Oracle with a simple command:  &#8220;select * from v$version;&#8221;. One may then see that the Oracle instance is a 64 bit version. In my case, the full version name is &#8220;Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 &#8211; 64bit Production&#8221;. Once this is known, one may ask whether it is possible to access this database from a 32 bit environment. Accessing an Oracle instance from a 32 bit environment is the subject of this small note.<br \/>\nWe have multiple ways to access an Oracle instance.<br \/>\nThe first method to access an Oracle instance is via SQL Developer. This works straightforward. Once installed, one may access from a 32 bit SQL Developer the 64 bit Oracle instance. No strings attached.<br \/>\nI then created a line in the tnsnames.ora. The entry is labeled as ORCL. I checked whether this worked with &#8220;tnsping ORCL&#8221;. This also worked without any issues. I then connected to the database with sqlplus. That also worked fine. I used a 11gR2 client. No issues were found to connect this to the Oracle version 12.<\/p>\n<p>So the standard tools worked fine. They were all 32 bits whereas the Oracle instance was 64 bits. <\/p>\n<p>Then I created a report. This can be done from the OBIEE environment. One connects to BI Publisher on an OBIEE server (something like http:\/\/van-maenen.com:7780\/xmlpserver). One may then create a report. Let us assume that the report is stored as Tom\\JaarAantal. The question is whether it is possible to access the report from a 32 bit tool. To this end, we start a 32 bit Word application that has a BI publisher add-in. It was straightforward to access the report. It was also possible to create a report from Word. See below the result from a 32 bit Word application using data from a 64 bit OBIEE server.<br \/>\n<a href=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2016\/07\/Naamloos.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2016\/07\/Naamloos.jpg\" alt=\"Naamloos\" width=\"1447\" height=\"648\" class=\"alignnone size-full wp-image-1262\" \/><\/a><\/p>\n<p>Then I tried to create a 32 bits ODBC connection to the 64 bits Oracle instance. I could directly use the Oracle client ODBC facilities to set up an ODBC connection. I could also use this ODBC connection to retrieve data into a 32 bits Excel sheet. I also used this 32 bit ODBC connection to connect from Qlikview to the 64 bit Oracle instance. No issue found there:<br \/>\n<a href=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2016\/07\/Untitled.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2016\/07\/Untitled.png\" alt=\"Untitled\" width=\"359\" height=\"241\" class=\"alignnone size-full wp-image-1265\" \/><\/a><\/p>\n<p>Subsequently, I tried to access the 64 bits Oracle database with a 32 bit OLE DB connection. I used the connectstring; &#8220;Provider=OraOLEDB.Oracle.1;Password=bonvegni;Persist Security Info=True;User ID=hr;Data Source=ORCL;&#8221;. This worked nicely. I checked the OLE DB connection from Excel. This allows a very intuitive interface to connect to a database (such as Oracle). One may choose how to connect, be it ODBC or OLE DB. <\/p>\n<p>I also tried to access the Oracle database from the squirrel client. This is a java client that uses java jar files to connect to an Oracle instance. Also there, no issue found when connecting to the Oracle database.<br \/>\n<a href=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2016\/07\/Untitled-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2016\/07\/Untitled-1.png\" alt=\"Untitled\" width=\"424\" height=\"418\" class=\"alignnone size-full wp-image-1270\" \/><\/a><\/p>\n<p>It is also possible to connect from Perl on the 32 bit environment to the Oracle 64 bit environment. I used:<\/p>\n<pre>\n#!\/usr\/bin\/perl \nuse DBI;\nuse DBD::Oracle; \nprint \"Hello World.\\n\"; \nprint $DBI::VERSION,\"\\n\";\nprint $DBD::Oracle::VERSION,\"\\n\";\n\nmy $db=DBI->connect(\"dbi:Oracle:orcl\", \"scott\", \"bunvegni\");\nmy $SEL = \"select * from scott.employees\";\nmy $sth = $db->prepare($SEL);\n$sth->execute();\nwhile ( my @row = $sth->fetchrow_array() ) {\n    foreach (@row) {\n        $_ = \"\\t\" if !defined($_);\n        print \"$_\\t\";\n    }\n    print \"\\n\";\n}END {\n    $db->disconnect if defined($db);\n    }\n<\/pre>\n<p>This also worked nicely. <\/p>\n<p>All in all, I had absolutely no issue connecting from a 11G 32 bit client to the Oracle 12 64 server instance. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>One may retrieve the version of Oracle with a simple command: &#8220;select * from v$version;&#8221;. One may then see that the Oracle instance is a 64 bit version. In my case, the full version name is &#8220;Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 &#8211; 64bit Production&#8221;. Once this is known, one may ask whether it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1257,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-1256","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nice-to-know"],"_links":{"self":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/1256","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1256"}],"version-history":[{"count":0,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/1256\/revisions"}],"wp:attachment":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1256"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}