Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum length of command line argument that can be passed to SQL*Plus?

I am calling SQL*Plus from Linux C Shell:

sqlplus username/password @file.sql var1 var2 var3

If I pass a string as var1, how long can this string be?

Is it governed by the OS? In this case:

Linux version 2.6.9-100.ELsmp ([email protected]) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-11)) #1 SMP Tue Feb 1 12:17:32 EST 2011

Update: Empirical testing yielded the following results:

  • A command line argument of 5200 characters gave the error, "Word too long."
  • 1300 characters then produced the SQL*Plus error, "string beginning "(000796384..." is too long. maximum size is 239 characters."
  • As soon as I got under 239 chars all was well.

I think I'll use sqlldr to overcome this.

like image 849
Umber Ferrule Avatar asked Jul 27 '11 14:07

Umber Ferrule


People also ask

What is the maximum length of characters in the command line arguments?

The maximum length of the string that you can use at the command prompt is 8191 characters. This limitation applies to: the command line.

What is the maximum combined length of command line arguments?

The maximum combined length of the command-line arguments including the spaces between adjacent arguments is: 128 characters.


2 Answers

Try with: xargs --show-limits </dev/null

Your environment variables take up 2446 bytes
POSIX upper limit on argument length (this system): 2092658
POSIX smallest allowable upper limit on argument length (all systems): 4096
Maximum length of command we could actually use: 2090212
Size of command buffer we are actually using: 131072

There is no limit per argument, but a total for the whole command line length. In my system (Fedora 15/zsh) its closer to 2Mb. (line 4).

like image 141
Pablo Castellazzi Avatar answered Sep 29 '22 09:09

Pablo Castellazzi


I came across "How long an argument list your kernel can take on the command line before it chokes?":

getconf ARG_MAX

which gives the following on my system:

131072
like image 35
Umber Ferrule Avatar answered Sep 29 '22 08:09

Umber Ferrule