Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > IBM DB2 > Re: how to arch...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 8 Topic 8796 of 9366
Post > Topic >>

Re: how to archive lots of records

by "Dave Hughes" <dave@[EMAIL PROTECTED] > Apr 18, 2008 at 07:05 AM

John Hopfield wrote:

> On 17 Apr, 13:02, Lew <seth...@[EMAIL PROTECTED]
> wrote:
> > You might want to use the load from cursor functionality.
> > 
> > declare cursor mycur as select * from stockmovements where date <
> > xxxxxxx
> > load from mycur of cur insert into stockmovements_history
> > ...
> 
> very interesting...thank you
> 
> but...i don't know if i can launch this kind of "script" from SQL or
> from a SQL-Stored Procedure.

Unfortunately not - both are CLP commands, not SQL statements.

> or using ADMIN_CMD( script )?

In version 8, no (8's ADMIN_CMD can only call DESCRIBE, EX****T, PRUNE,
REORG, RUNSTATS, and UPDATE DB CFG). In version 9, sort of - you
couldn't do DECLARE CURSOR, but you could call ADMIN_CMD('EX****T...')
followed by ADMIN_CMD('LOAD...'). The file used for the data would be
sat on the server by virtue of ADMIN_CMD (i.e. there wouldn't be lots
of network traffic involved).

Going back to your original post: are you unable to increase the log
size for some reason? (or possibly increase LOGSECOND to allow for
sufficient secondary logs to be allocated if/when necessary).

As for EX****T+LOAD - you can use them both when others are connected to
the database - EX****T in particular, which is effectively no different
to a normal query. However, LOAD does make the target table
inaccessible at least for the duration of the load (and possibly
afterward in the case of things like Check Pending states).


Cheers,

Dave.
 




 8 Posts in Topic:
how to archive lots of records
John Hopfield <Hopfiel  2008-04-16 03:31:25 
Re: how to archive lots of records
Lennart <Erik.Lennart.  2008-04-16 05:41:48 
Re: how to archive lots of records
John Hopfield <Hopfiel  2008-04-16 06:09:08 
Re: how to archive lots of records
Larry <larry@[EMAIL PR  2008-04-16 10:43:11 
Re: how to archive lots of records
jefftyzzer <jefftyzzer  2008-04-16 10:52:23 
Re: how to archive lots of records
Lew <sethwai@[EMAIL PR  2008-04-17 04:02:58 
Re: how to archive lots of records
John Hopfield <Hopfiel  2008-04-17 06:41:06 
Re: how to archive lots of records
"Dave Hughes" &  2008-04-18 07:05:21 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 8:39:25 CDT 2008.