If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > EXPORT IMPORT or Load From Cursor.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-08-09, 15:18
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
EXPORT IMPORT or Load From Cursor.

Hi Guys,

I need to extend one column of a table over page size of tablespace.

So I will create a new tablespace with bigger pagesize amd move the table to new one.

Exporting data and loading data will take about 1 hr an 20 minutes as I estimated. Which is not preffered by the company.

so I need to reduce time (downltime).

I never used LOAD FROM CURSOR, but I am sure it is double as faster.

Can some one advise me any better way to do it fast.

DB2 V8 fp 12 in WIN 2k3 --- Table size 28GB


Thanks in adv
DBFinder
Reply With Quote
  #2 (permalink)  
Old 05-08-09, 15:36
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
DECLARE MYCUR CURSOR FOR SELECT col1, col2 FROM tabschema.tabname WITH UR;

LOAD FROM MYCUR OF CURSOR MESSAGES message_file.msg INSERT INTO tabschema.tabname_new NONRECOVERABLE;

RUNSTATS ON TABLE tabschema.tabname_new WITH DISTRIBUTION AND DETAILED INDEXES ALL;
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #3 (permalink)  
Old 05-08-09, 15:45
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Is something possible for use as online. Without taking offtime.

I know I can create similar table and when data will be synchronized I can stop for a second and drop old table.


And . . . I donot know further. From here on.


Can I rename the table after dropping old one. ?? How ?? What about triggers and constarints ??


Thanks

DBFinder
Reply With Quote
  #4 (permalink)  
Old 05-08-09, 19:16
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by DBFinder
Is something possible for use as online. Without taking offtime.

I know I can create similar table and when data will be synchronized I can stop for a second and drop old table.


And . . . I donot know further. From here on.


Can I rename the table after dropping old one. ?? How ?? What about triggers and constarints ??
You cannot guarantee that the data in the old and new tables are identical, unless you lock the source table before starting the load, which will prevent any updates to the source.

To rename the target table you use, surprisingly, the RENAME statement. After dropping the original table you will have to re-create all indexes, constraints, and triggers to reference the new table.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On