Skip to Main Content

SQLcl: MCP Server & SQL Prompt

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Connect sequentially to multiple schemas

user13117585Apr 16 2020 — edited Apr 20 2020

Hello everyone,

I have a question about sqlcl. I'm testing and comparing to SQL plus. And I was wondering if it is possible to loop through multiple schemas and execute a command? Something like

sql /nolog

FOR s IN (urls)

LOOP

  connect to url

  execute a command

END LOOP;

Usually, I do this using bash scripts... But I'm thinking Since I see sqlcl allows scripting, maybe it has a solution for this?

Regards,

Comments

sb92075
Does Java application utilize connection pooling?
I suspect it does not.
Is process high water count at or near PROCESSES limit?
758670
Yes - the app uses connection pooling. It is very multithreaded, so there may be 50+ threads inserting to the database at once.

Here are some statistics, let me know if there is more that would be useful.
SQL> select name, value from v$sysstat where name like '%logon%';

NAME                                                                  VALUE
---------------------------------------------------------------- ----------
logons cumulative                                                       919
logons current                                                           31

SQL> select sessions_current, sessions_highwater from v$license;

SESSIONS_CURRENT SESSIONS_HIGHWATER
----------------   ------------------
               8                 80

SQL> show parameter sessions

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
java_max_sessionspace_size           integer     0
java_soft_sessionspace_limit         integer     0
license_max_sessions                 integer     0
license_sessions_warning             integer     0
sessions                             integer     328
shared_server_sessions               integer
SQL> show parameter processes;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
aq_tm_processes                      integer     0
db_writer_processes                  integer     1
gcs_server_processes                 integer     0
global_txn_processes                 integer     1
job_queue_processes                  integer     1000
log_archive_max_processes            integer     4
processes                            integer     200
Thank you for the help.
932095
In our application also we are facing the same issue.

We are using the DBCP datasource for the connection pool. It is not happening all the times. randomly seeing this error.

===========
Caused by: oracle.net.ns.NetException: Socket read timed out
at oracle.net.ns.Packet.receive(Packet.java:321)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:287)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1054)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:308)
========


Can i know what is the solution for this issue.

Edited by: 929092 on 20-Apr-2012 08:54
I would assume it may be a OS IP layer or firewall or some "smart" network device that detects connections inactive more than specific time and force closes them.

So either to configure your connection pool to close idle connections before that network layer does it, or configure "keep alive" in it.
1 - 4

Post Details

Added on Apr 16 2020
1 comment
201 views