I have a bash script which connects HP Vertica DB and executes few sql files in sequential manner. One sql file has commands related to one table(stage , base schema tables)and contains 7-8 commands such as creating temp table, inserting data into tables etc.
For few tables, which have high volume of data, I'm facing a weird issue.
For those tables, the sql file execution happens partially and returns the below error :
"server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. connection to server was lost "
However, in database there are no errorful transactions. Even the query(during which error was returned) completed normally in database side.
Also, the next sql file in the sequence is picked up for the execution normally.
If i execute the same sql file directly inside DB, no issue comes.
Certainly not a script problem with the script.
Maybe there is a limit (e.g. max transfer size) exceeded in the DB server?
Check all its error logs.
Also there might be a bug (or a tunable limit) in the HP-UX.
Some quick things to ponder
-execute script with same user id as interactive execution?
-shell used in script; may be different
-limits on batch script execution
-When I execute in interactive db session, I dont get the error. The server from which shell script is invoked and the server where the vertica DB is installed are different.
shell used is ksh; but I have single shell script for 60 tables for an application, which returns error for those tables which have huge data and takes lot of time to execute sql commands. Smaller tables don't get this error.