简体   繁体   English

可以传递给 SQL*Plus 的命令行参数的最大长度?

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

I am calling SQL*Plus from Linux C Shell:我从 Linux C Shell 调用 SQL*Plus:

sqlplus username/password @file.sql var1 var2 var3

If I pass a string as var1 , how long can this string be?如果我将一个字符串作为var1传递,这个字符串可以有多长?

Is it governed by the OS?它是由操作系统管理的吗? In this case:在这种情况下:

Linux version 2.6.9-100.ELsmp (mockbuild@x86-010.build.bos.redhat.com) (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." 5200 个字符的命令行参数给出了错误“Word 太长”。
  • 1300 characters then produced the SQL*Plus error, "string beginning "(000796384..." is too long. maximum size is 239 characters." 1300 个字符然后产生 SQL*Plus 错误,“字符串开头“(000796384...”太长。最大大小为 239 个字符。)
  • As soon as I got under 239 chars all was well.一旦我低于 239 个字符,一切都很好。

I think I'll use sqlldr to overcome this.我想我会使用sqlldr来克服这个问题。

Try with: xargs --show-limits </dev/null尝试使用: 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.在我的系统 (Fedora 15/zsh) 中,它更接近 2Mb。 (line 4). (第 4 行)。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM