事务日志已满和存储过程 [英] Transaction Log Full and Stored Procedure

查看:86
本文介绍了事务日志已满和存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个存储过程,可以执行很多INSERT / UDATE到3

表。当我调用存储过程时,我得到一个事务日志

完全错误。当我想要做的是关闭存储过程正在使用的那3个表的事务日志

现在,因为我在命令行上调用存储过程(CLI),

我在哪里运行ALTER TABLE ...激活未记录的初始声明

?我是否必须将它们放在存储过程中?或者,在拨打SP之前,我是否运行

命令?我在Linux上,DB2 8.2

我们不想配置日志以使其更大,因为这个

只是一次运行来填充表格。我们必须使用

程序来迁移这些数据。


感谢任何输入/建议

N.

Hi,
I have a stored procedure that does a lot of INSERT/UDATE to 3
tables. And When I call the stored procedure, I get a Transaction Log
Full error. When I want to do is turning off the transaction log on
those 3 tables that the stored procedure is using.
Now, since I call the stored procedure on the command line (CLI),
where do I run ALTER TABLE ... ACTIVATE NOT LOGGED INITIALLY statement
? Do I have to put them inside the stored procedure ? Or Do I run the
command before I call the SP ? I am on Linux, DB2 8.2
We don''t want to configure the logs to make it bigger because this
is just a one time run to populate the tables. And we have to use the
procedure to migrate those data.

Thanks for any inputs/advices
N.

推荐答案

也很简单

db2 -c- alter table

db2 -c- call sp

db2 commit

from command line is also simple
db2 -c- alter table
db2 -c- call sp
db2 commit


大家好,

我只想要添加有关该主题的更多信息。基本上

我的存储过程如下所示:

CREATE PROCEDURE DB.PWC(V_ID CHAR(6),OUT RETURN_VAL INT)

LANGUAGE SQL


BEGIN

DECLARE ..

DECLARE ..


插入表A ..

更新表A ..
Hi All,
I just want to add some more information on the subject. Basically
my Stored Procedure looks like this :

CREATE PROCEDURE DB.PWC (V_ID CHAR(6), OUT RETURN_VAL INT)
LANGUAGE SQL

BEGIN
DECLARE..
DECLARE..

INSERT INTO TABLE A..
UPDATE TABLE A..


ha ********* @ gmail.com 写道:

我有一个存储过程,它做了一个很多INSERT / UDATE到3
表。当我调用存储过程时,我收到一个事务日志
完全错误。我想要做的是关闭存储过程正在使用的那3个表上的事务日志。
现在,因为我在命令行(CLI)上调用存储过程,
我在哪里运行ALTER TABLE ...激活未记录的初始声明
?我是否必须将它们放在存储过程中?或者在拨打SP之前我是否运行
命令?我在Linux上,DB2 8.2
我们不想配置日志以使其更大,因为这只是一次运行来填充表格。我们必须使用
过程来迁移这些数据。
Hi,
I have a stored procedure that does a lot of INSERT/UDATE to 3
tables. And When I call the stored procedure, I get a Transaction Log
Full error. When I want to do is turning off the transaction log on
those 3 tables that the stored procedure is using.
Now, since I call the stored procedure on the command line (CLI),
where do I run ALTER TABLE ... ACTIVATE NOT LOGGED INITIALLY statement
? Do I have to put them inside the stored procedure ? Or Do I run the
command before I call the SP ? I am on Linux, DB2 8.2
We don''t want to configure the logs to make it bigger because this
is just a one time run to populate the tables. And we have to use the
procedure to migrate those data.




你可以在你的存储过程中添加提交吗?

否则,


db2 + calter table ...激活最初未记录

db2 + c" call ..."

db2 commit

+ c选项将禁用自动提交。



Can you add commits into your stored procedure?
Otherwise,

db2 +c "alter table ... activate not logged initially"
db2 +c "call ..."
db2 commit
The +c option turns disables auto-commit.


这篇关于事务日志已满和存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆