5 Replies Latest reply: May 20, 2010 11:50 AM by gdarling - oracle RSS

    SQL-Statement with OO4O

    745247
      Hello together,

      I have here following Problem:

      Everthime I make a connection to my database with this code

      Set oSess = Server.CreateObject("OracleInProcServer.XOraSession")
      Set oDB = oSess.DbOpenDatabase(tnsname, user/PWD, 4)

      I get always this Statement in the DB-queue

      SELECT parameter, VALUE
      FROM SYS.nls_database_parameters
      WHERE parameter IN ('NLS_CHARACTERSET', 'NLS_NCHAR_CHARACTERSET')

      Can me anyone tell me why I get this statement and how I can disable it?

      Best Regards
      Andy
        • 1. Re: SQL-Statement with OO4O
          gdarling - oracle
          Hi,

          The statement is issued internally by the Oracle client software to determine the characterset of database in order to know if characterset translation needs to occur before sending data across the wire. You can't disable it.

          Hope it helps,
          Greg
          • 2. Re: SQL-Statement with OO4O
            745247
            Hi Greg,

            thank you for this a important Answer, which I don´t know.

            Now I have an another Question:

            I got a lot of open Cursor from this SQL-Statement, which will not close
            in the Database, why it is so? (eg. 200 from 1000 will not close)

            Have you therefor a answer?

            Best Regards
            Andy
            • 3. Re: SQL-Statement with OO4O
              gdarling - oracle
              I'm not sure what to tell you about that. Are you getting cursor related errors (ora-1000 for example)? Or is it simply their presence in v$open_cursor for example that concerns you? Generally v$open_cursor also includes recently used cursors cached by the database.

              Anyway, I just tried the following vbscript, and was unable to reproduce your complaint. I simply queried count(*) from v$open_cursor while it ran.
              I'm using 11.1.0.7.20 oo4o and 11.2 db, for the record.

              Cheers,
              Greg
              For mI = 1 To 5000
              Set pSession = CreateObject("OracleInProcServer.XOraSession")
              Set pDatabase = pSession.OpenDatabase("orcl", "scott/tiger", 4)
              wscript.echo mI 
              pDatabase.close
              set pDatabase=nothing  
              set pSession=nothing        
              Next
              wscript.echo "done, no errors"
              • 4. Re: SQL-Statement with OO4O
                745247
                Hi GReg,

                their presence in v$open_cursor concerns me.

                I have close all Connection correctly, but I have still open cursor. But why?

                Is it possible to see from which script this statement/connection comes?

                Best Regards
                Andy
                • 5. Re: SQL-Statement with OO4O
                  gdarling - oracle
                  You'd probably be better off posting that question in one of the database forums, as the DBA types can probably answer that better for you. However, I suspect they'll also answer that you don't need to concern yourself with it. As I understand it v$open_cursor also includes "recently used" cursors as well.

                  Greg