Reputation: 31
There are a lot of inactive connection in my oracle server. I retrieve SQL text from those inactive. The SQL test is
SELECT PARAMETER, VALUE FROM SYS.NLS_DATABASE_PARAMETERS WHERE PARAMETER IN ('NLS_CHARACTERSET', 'NLS_NCHAR_CHARACTERSET')
but I never use the SQL statement in my system, and do not know why the statement run automatically without closing automatically.
Upvotes: 2
Views: 1359
Reputation: 231651
Is there a problem? In most systems, most sessions are inactive the vast majority of the time. An inactive session merely indicates that at the instant you queried the data dictionary, a SQL statement was not being executed. Whether you are talking about a client-server application or a three tier application where the middle tier has a pool of connections, most of the time, you're waiting either for the application to process some data or for the user to make a decision. During that time, the database session will be inactive.
As for the query you're seeing, I would strongly wager that this is simply a query that whatever database driver/ framework you are using (your ODBC driver, OLE DB driver, ODP.Net provider, etc.) executes either when a connection is opened or when it is returned to a middle tier connection pool.
Upvotes: 3