oracle 内存不足错误:在 toad 中执行非常大的脚本时

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25724503/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 02:30:04  来源:igfitidea点击:

Out of Memory Error : when executing Very Large Scripts in toad

oracleoracle10gsqlplustoad

提问by Wanna Coffee

I am using

我在用

  • Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod &
  • Toad for oracle 10.6.1.3
  • Oracle 数据库 10g 企业版 10.2.0.3.0 版 - 产品 &
  • 用于 Oracle 10.6.1.3 的蟾蜍

when i try to run insert statement which is having around 84,000 +records, it is showing Out of Memoryerror. Here is the error image.

当我尝试运行包含84,000 +记录的插入语句时,它显示Out of Memory错误。这是错误图像。

Out of Memory Error

内存不足错误

Any of you please suggest me, how i should execute this insert script in toad.

你们中的任何人都请建议我,我应该如何在蟾蜍中执行这个插入脚本。

P.S :since toad is connecting to remote machine I'm not able to run it with SQLPLUS. If any one knows option to do that, please let me know.

PS:由于 toad 连接到远程机器,我无法使用 SQLPLUS 运行它。如果有人知道这样做的选择,请告诉我。

If you need any more information, Please raise your hands in comment box i will provide you.

如果您需要更多信息,请在评论框中举手,我会为您提供。

采纳答案by Wanna Coffee

As bpgergosuggested copy the sql file into remote machine using FTP, then open your SQLPLUS.

按照bpgergo建议,使用 FTP 将 sql 文件复制到远程计算机,然后打开SQLPLUS.

Follow this steps in SQLPLUS.

在 SQLPLUS 中执行此步骤。

step 1 :change your current session using following query.

第 1 步:使用以下查询更改您当前的会话。

alter session set current_schema = Schema_Name; 

Here, SCHEMA_NAMEis schema name of your insert query table.

这里SCHEMA_NAME是插入查询表的模式名称。

step 2 :Execute the sql script file using following query.

第 2 步:使用以下查询执行 sql 脚本文件。

@{PATH}/FILE_NAME.SQL

Eg :@D:/oracle/script/FILE_NAME.SQL

例如:@D:/oracle/script/FILE_NAME.SQL

Here, D:/oracle/script/is the file available location and FILE_NAMEis your sql script file name.

在这里,D:/oracle/script/是文件可用位置,FILE_NAME是您的 sql 脚本文件名。

Now, It will work as expected.

现在,它将按预期工作。

回答by aemre

I got the same error when i want to execute sql script 70k rows.

当我想执行 sql 脚本70k 行时,我遇到了同样的错误。

But i solved it just like this.

但我就是这样解决的。

  • Firstly You should run it with sqlpluscommands. Log in the sqlplus and run this command

    @scriptName.sql

  • Secondly (this is alternative) You can use DBLINKin oracle.

  • 首先,您应该使用sqlplus命令运行它。登录sqlplus并运行此命令

    @脚本名称.sql

  • 其次(这是替代方案)您可以在 oracle 中使用DBLINK