1 2 Previous Next 18 Replies Latest reply: Aug 27, 2013 8:16 AM by Mkirtley-Oracle RSS

    UnixODBC - can't compile 64-bit library

    user609503

      I'm not sure about the OS architecture. I suppose it's 64-bit, and 32-bit applications run in 32-emulation mode.

       

      isainfo

       

      64-bit sparcv9 applications

              asi_blk_init vis2 vis popc

      32-bit sparc applications

              asi_blk_init vis2 vis popc v8plus div32 mul32

       

      But why then main OS modules are 32-bit?

       

      /bin/ls:    ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped

       

      uname -a

       

      SunOS ccbodbtst 5.10 Generic_142909-17 sun4v sparc SUNW,T5440

       

      I can't compile 64-bit UnixODBC library in this OS. Only 32-bit is compiled.

        • 2. Re: UnixODBC - can't compile 64-bit library
          Kgronau-Oracle

          Normally the latest driver manager version recognizes the OS and compiles the libs with the correct word size. If that does not work, make sure that you explicit set 2 flags CFLAGS and CXXFLAGS both with the option DBUILD_REAL_64_BIT_MODE (which you had set or was used during your compilation) and m64 to force a 64bit compilation:

           

          So an environment that compiles 64bit libs can be initialized as follows:

          PATH=/usr/ccs/bin:$PATH

          export PATH

          CFLAGS="-m64 -DBUILD_REAL_64_BIT_MODE"

          export CFLAGS

          CXXFLAGS="-m64 -DBUILD_REAL_64_BIT_MODE"

          export CXXFLAGS

           

          Now call unixODBC configure with the prefixes you want - I commonly specify my own odbc.ini/odbcinst.ini location:

          ./configure --prefix=/u01/odbc64/product/unixODBC --sysconfdir=/u01/odbc64/product/unixODBC --enable-gui=no --enable-drivers=no

           

          then run

          make

          and

          make install

           

          If that does not work, please contact unixODBC.

          - Klaus

          • 3. Re: UnixODBC - can't compile 64-bit library
            user609503

            Thanks, it worked.

            • 4. Re: UnixODBC - can't compile 64-bit library
              user609503

              64-bit library was compiled, but...

               

              What other reason can cause

               

                   Failed to load ODBC library symbol: /usr/local/lib/libodbc.so(SQLAllocHandle)

                   HS Gateway:  NULL connection context at exit

               

              ?

               

              Logs & configs: http://maslovd.no-ip.org/public/configure/1.txt

               

              I suppose that multiple library locations cause this. I've found ISQL and ODBC libraries in two places.

               

              Does it mean that I should explicitly define the path to the correct library?

               

              Note that when I run ISQL with the default PATH, it doesn't work. When I change PATH and LD_LIBRARY_PATH, it works. But HS returns an error.

               

              I've pointed to the desired library using ENVS variable in listener.ora, but problem still remains.

              • 5. Re: UnixODBC - can't compile 64-bit library
                Mkirtley-Oracle

                Hi,

                  I'll have a look at your files and logs and get back to you.

                 

                Regards,

                Mike

                • 6. Re: UnixODBC - can't compile 64-bit library
                  Mkirtley-Oracle

                  Hi,

                    The 'ENV' entry in the listener.ora for the gateway sid isn't correct.

                  You have -

                   

                  (SID_DESC =
                    (PROGRAM = dg4odbc)
                    (ORACLE_HOME = /opt/oracle/112)
                    (SID_NAME = REGION)
                    (ENVS='LD_LIBRARY_PATH=/usr/local/lib:/opt/oracle/112/lib PATH=/opt/oracle/112/bin:/usr/local/lib:/usr/bin:/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin:/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin')
                  )

                   

                  but it should be -

                   

                  (SID_DESC =
                    (PROGRAM = dg4odbc)
                    (ORACLE_HOME = /opt/oracle/112)
                    (SID_NAME = REGION)
                    (ENV="LD_LIBRARY_PATH=/usr/local/lib:/opt/oracle/112/lib")
                  )

                  Also, in initREGION.ora you have -

                   

                  HS_FDS_CONNECT_INFO=SQLDS1

                  HS_FDS_TRACE_LEVEL = 255

                  HS_FDS_SHAREABLE_NAME=/usr/local/lib/libodbc.so

                  HS_LANGUAGE=AMERICAN_AMERICA.UTF8

                   

                  but you should also add the location of the odbc.ini file being used -

                   

                  set ODBCINI=<directory_location>/odbc.ini

                   

                  Change the listener entry and stop and start the listener then try again.

                   

                  Regards,

                  Mike

                   

                  • 7. Re: UnixODBC - can't compile 64-bit library
                    Mkirtley-Oracle

                    Hi,

                      You should review this note in My Oracle Support -

                     


                    Regards,

                    Mike

                    • 8. Re: UnixODBC - can't compile 64-bit library
                      user609503

                      Currently I don't have Metalink account. If you have it, please send me this document.

                      • 9. Re: UnixODBC - can't compile 64-bit library
                        user609503

                        bash-3.00$ cat $ORACLE_HOME/hs/admin/initREGION.ora

                        set ODBCINI=/usr/local/etc/odbc.ini

                        HS_FDS_CONNECT_INFO=SQLDS1

                        HS_FDS_TRACE_LEVEL = 255

                        HS_FDS_SHAREABLE_NAME=/usr/local/lib/libodbc.so

                        HS_LANGUAGE=AMERICAN_AMERICA.UTF8

                         

                        bash-3.00$ cat $ORACLE_HOME/network/admin/listener.ora | grep ENVS

                              (ENVS="LD_LIBRARY_PATH=/usr/local/lib:/opt/oracle/112/lib")

                         

                         

                        What should I write in ENVS if I want to set more than one environment variable ?

                         

                        I need to change PATH and NLS_LANG also (only for this TNS name, not in the oracle user OS profile).

                        • 10. Re: UnixODBC - can't compile 64-bit library
                          user609503

                          > What should I write in ENVS if I want to set more than one environment variable ?

                           

                          This is the answer (it's from another server).

                           

                          [oracle@sv-182 admin]$ cat $ORACLE_HOME/network/admin/listener.ora | grep ENVS

                                (ENVS="LD_LIBRARY_PATH=/usr/lib64:/d01/oracle/db/11.2.0/lib")

                                (ENVS="NLS_LANG=AMERICAN_AMERICA.CL8MSWIN1251")

                          • 11. Re: UnixODBC - can't compile 64-bit library
                            user609503

                            And this server still has problem.

                             

                            -bash-3.00$ cat $ORACLE_HOME/network/admin/listener.ora

                             

                            SID_LIST_LISTENER =

                              (SID_LIST =

                            ...

                               (SID_DESC =

                                  (PROGRAM = dg4odbc)

                                  (ORACLE_HOME = /opt/oracle/112)

                                  (SID_NAME = REGION)

                                  (ENVS="PATH=/opt/oracle/112/bin:/usr/local/lib:/usr/bin:/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin:/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin")

                                  (ENVS="LD_LIBRARY_PATH=/opt/oracle/112/lib:/usr/local/lib/:/usr/sfw/lib/64")

                                  (ENVS="ODBCINI=/usr/local/etc/odbc.ini")

                                )

                            )

                             

                            ISQL works with these environment variables. But HS still says:

                             

                            Entered hgolofns at 2013/08/23-14:57:24

                            libname=/usr/local/lib/libodbc.so, funcname=SQLAllocHandle

                            peflerr=6520, libname=/usr/local/lib/libodbc.so, funcname=SQLAllocHandle

                            hoaerr:28500

                            Exiting hgolofns at 2013/08/23-14:57:24

                            Failed to load ODBC library symbol: /usr/local/lib/libodbc.so(SQLAllocHandle)

                            Exiting hgolofn, rc=28500 at 2013/08/23-14:57:24

                            Exiting hgoinit, rc=28500 with error ptr FILE:hgoinit.c LINE:417 ID:Loading ODBC aray of function ptrs

                            hostmstr:   65957888:   HOA After hoainit

                            RPC Calling nscontrol(0), rc=0

                            hostmstr:   65966080: RPC Before Exit Agent

                            hostmstr:   65974272:   HOA Before hoaexit

                            Entered hgoexit

                            HS Gateway:  NULL connection context at exit

                            Exiting hgoexit, rc=0 with error ptr FILE:hgoexit.c LINE:110 ID:Connection context

                            hostmstr:   65982464:   HOA After hoaexit

                            hostmstr:   65990656: RPC After Exit Agent

                            • 12. Re: UnixODBC - can't compile 64-bit library
                              Mkirtley-Oracle

                              Hi,

                                For the note I referred to we are not allowed to send them out from OTN. You will need to contact someone in your organisation who has access to MOS.

                              For the ENVS question, for the gateway listener.ora you do not need to set any other variables apart from the LD_LIBRARY_PATH so that the listener knows which are the corrct directories to find the files and libraries it needs to access.

                              If you need to set other ENV variables then thye should either be in the gateway init<sid>.ora or in the session where you are running SQLPLUS to use the gateway.

                              Perhap you could explain why you want to set other ENV variables in the listener.ora ?

                               

                              By the way, you should set the variable as -

                               

                              (ENV="LD_LIBRARY_PATH=/usr/lib64:/d01/oracle/db/11.2.0/lib")


                              or as -


                              (ENVS=LD_LIBRARY_PATH=/usr/lib64:/d01/oracle/db/11.2.0/lib)

                               

                              Regards,

                              Mike

                              • 13. Re: UnixODBC - can't compile 64-bit library
                                user609503

                                ------------------------------

                                 

                                This is the answer (it's from another server).

                                 

                                [oracle@sv-182 admin]$ cat $ORACLE_HOME/network/admin/listener.ora | grep ENVS

                                      (ENVS="LD_LIBRARY_PATH=/usr/lib64:/d01/oracle/db/11.2.0/lib")

                                      (ENVS="NLS_LANG=AMERICAN_AMERICA.CL8MSWIN1251")

                                 

                                ------------------------------

                                 

                                I was wrong.

                                 

                                This is correct:  Listener Parameters (listener.ora)

                                 

                                -bash-3.00$  cat $ORACLE_HOME/network/admin/listener.ora | grep ENVS

                                      (ENVS="PATH=/opt/oracle/112/bin:/usr/local/lib:/usr/bin:/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin,LD_LIBRARY_PATH=/opt/oracle/112/lib:/usr/local/lib/:/usr/sfw/lib/64,ODBCINI=/usr/local/etc/odbc.ini")

                                 

                                 

                                With this parameter library works.

                                 

                                > You will need to contact someone in your organisation who has access to MOS.

                                 

                                OK, I'll ask for it. But I suppose I've already done all things this document says, and many times .

                                • 14. Re: UnixODBC - can't compile 64-bit library
                                  user609503

                                  > If you need to set other ENV variables then they should either be in the gateway init<sid>.ora or in the session where you are running SQLPLUS to use the gateway.

                                   

                                  I'm using HS in two ways:

                                   

                                  1. Issue a query "merge into table .... select ... from table@dblink". DB link points to MS SQL server. For such usage setting NLS_LANG in the server OS environment (and lsnrctl stop/start) was enough.

                                  2. Use the same query in the package. Surprise for me, but this type of usage leads to wrong encoding in Oracle table. Only when a add (ENVS="NLS_LANG=AMERICAN_AMERICA.CL8MSWIN1251") to listener.ora, the encoding became right.

                                   

                                  > Perhap you could explain why you want to set other ENV variables in the listener.ora ?

                                   

                                  Because for other databases running on this server require other variable values, NLS_LANG, for example.

                                  1 2 Previous Next