SQL*Plus Scheduled Task Hangs After Connect timeout - scheduled-tasks

I have a scheduled task that executes a sqlplus command, with username and password supplied.
Intermittently there is a ORA-12170: TNS:Connect timeout occurred that occurs. After these happen, SQL*Plus asks for a username, which never times out, pausing my task indefinitely.
How can I guard against this? Is there any command line option that can prevent this?
Task batch file
...
sqlplus user/\"password\"#database#script.sql >> "script.log"
script.sql
START TRANSACTION;
call schema.sync_task();
COMMIT;
quit;
successful log
SQL*Plus: Release 12.1.0.2.0 Production on Mon Sep 10 22:15:00 2018
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Last Successful login time: Mon Sep 10 2018 22:10:00 -04:00
Connected to:
Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production
With the Automatic Storage Management option
SP2-0310: unable to open file "TRANSACTION.sql"
Call completed.
Commit complete.
Disconnected from Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production
With the Automatic Storage Management option
failed log
SQL*Plus: Release 12.1.0.2.0 Production on Mon Sep 10 22:20:00 2018
Copyright (c) 1982, 2014, Oracle. All rights reserved.
ERROR:
ORA-12170: TNS:Connect timeout occurred
Enter user-name:

I didn't find a clean solution, but I did find the simple one.
I've modified the settings of the scheduled task to stop if running longer than an hour. 10 minutes would have been better, but that wasn't an option in the task scheduler.

Related

Can the timezone of a hosted agent in azure devops be changed?

I'm moving ancient code from an existing test infrastructure to ADO. Some of this code relies on the fact that it's never been run outside of PST (questionable date math). Is there some way to configure or reset the timezone in a windows hosted agent in devops? I tried just executing tzutil, but it wasn't found.
You can run the following sample bash script using Microsoft hosted agent to configure the timezone.
echo "checking date"
date
echo "setting date to Asia/Kolkata"
sudo timedatectl set-timezone "Asia/Kolkata"
date
The results in the log:
2019-07-05T20:26:48.5992486Z checking date
2019-07-05T20:26:48.5992954Z Fri Jul 5 20:26:48 UTC 2019
2019-07-05T20:26:48.5993264Z setting date to Asia/Kolkata
2019-07-05T20:26:48.9107025Z Sat Jul 6 01:56:48 IST 2019
You can refer to this ticket for details.

Azure pipeline Docker `all pipe instances are busy`

When running a build pipeline with maven and docker-maven-plugin sometimes(more than 50% of the time) it throws following error and pipeline fails.
Jun 18, 2019 1:57:12 AM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.io.FileNotFoundException) caught when processing request to {}->npipe://127.0.0.1:1: \\.\pipe\docker_engine (All pipe instances are busy)
Jun 18, 2019 1:57:12 AM org.apache.http.impl.execchain.RetryExec execute
I can see in the log that multiple retry attempts, but all fails. Is there any way that I can overcome this?
I just solved this problem:
I added the right version of docker-maven-plugin 1.4.10
dockerfile-maven-plugin

Timeout when executing MERGE-statement in SQL Server 2016 in simple recovery model

After migrating from SQL Server 2014 to SQL Server 2016, we have been experiencing query timeouts using MERGE-statements on some datasets.
Tested versions:
WORKING: SQL Server 2014 Enterprise (64-bit) (12.0.5532.0)
TIMEOUTS: SQL Server 2016 Enterprise (64-bit) (13.0.4001.0) and SQL Server 2016 Enterprise (64-bit) (13.0.1601.5)
Code to reproduce the timeout error: enter link description here

Orientdb fails to shut down

This fails:
$ sudo service orientdb stop
This fails as well:
$ sudo /data/db/orientdb/bin/shutdown.sh
Sending shutdown command to remote OrientDB Server instance...
Dec 19, 2015 6:50:09 PM com.orientechnologies.common.log.OLogManager log
INFO: OrientDB auto-config DISKCACHE=991MB (heap=869MB os=3,909MB disk=175,894MB)
Dec 19, 2015 6:50:09 PM com.orientechnologies.common.log.OLogManager log
INFO: Loading configuration from: /data/db/orientdb/config/orientdb-server-config.xml...
Error: Read timed out
The file permissions are correct:
12K -rwxrwx--- 1 orientdb orientdb 9.6K Dec 19 18:05 orientdb-server-config.xml
If have tried commenting out script that refers to "orientdb-server-config.xml" in the the shutdown.sh file and it makes no difference.
The System:
Ubuntu v14.04
OrientDB v2.1.8 (I upgraded from v2.1.6 to see if it would fix this problem)
Java v1.8
You may want to try this command. This worked for me when shutting down normally.
sh shutdown.sh localhost 2424
To stop a running server, press Ctrl+C in the open shell that runs the server instance, or soft kill the process to be sure that the opened databases close softly. Soft killing on Windows can be done by closing the window. On Unix-like systems, a simple kill is enough (do not use kill -9 unless you want to force a hard shutdown).

Not able to connect Oracle 10g XE to Eclipse [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Eclipse cannot connect oracle 10g XE on windows 7
I am getting this error when i try to test the connection..
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection"
What to do now? I have downloaded the ojdbc14.jar from site also but still i am getting this error.
Do this Steps as below Check First with Sql plus :
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jul 29 08:51:27 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn system
Enter password:
Connected.
SQL> select instance_name from V$instance;
INSTANCE_NAME
----------------
xe
SQL>
Here is the listener status and services
C:\>lsnrctl services
LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-JUL-2008 08:46:43
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Services Summary...
Service "XEXDB" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1002 state:ready
DISPATCHER <machine: KIRANKUMAR-PC, pid: 3632>
(ADDRESS=(PROTOCOL=tcp)(HOST=KiranKumar-PC)(PORT=49160))
Service "XE_XPT" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "xe" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
The command completed successfully
C:\>lsnrctl status
LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-JUL-2008 08:46:56
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
Start Date 29-JUL-2008 08:39:27
Uptime 0 days 0 hr. 7 min. 29 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\listener.ora
Listener Log File C:\oraclexe\app\oracle\product\10.2.0\server\network\log\listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=KiranKumar-PC)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=KiranKumar-PC)(PORT=8080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "XEXDB" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Service "XE_XPT" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Service "xe" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
The command completed successfully
C:\>TNSPING xe
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-JUL-2008 08:49:28
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = KiranKumar-PC)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))
OK (250 msec)
C:\>tnsping localhost-pc<hostname>
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-JUL-2008 08:49:42
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\sqlnet.ora
Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
OK (170 msec)
Please check this... Let me know the solution.. Hope this helps!