IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Query on image copy


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Guest







PostPosted: Mon Sep 26, 2011 11:07 am
Reply with quote

HI,
I have taken image copy using below commands in a test region.Now i have requirement to copy the same data in to different test region under same subsystem. Could you please advice if I can use the below recovery command or any other command to get it done?

Image copy
--------------
Code:


 COPY     TABLESPACE RST.*,
DSNUM    PART         
COPYDDN  SYSCOPY     
GROUP    YES         
FULL     YES         
SHRLEVEL REFERENCE   
RESETMOD NO           
QUIESCE  AFTER       
         WRITE      NO
PARALLEL 8           

Recovery
-----------
Code:

RECOVER TABLESPACE XYZ.ABC DSNUM ALL     
  TOCOPY TTXX.RST.w.G0002V00
REBUILD INDEX(ALL) TABLESPACE XYZ.ABC
NOWORKDDN                                         
                                                     
Back to top
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Mon Sep 26, 2011 12:50 pm
Reply with quote

This might not be possible as the image copy details are stored within the system tables for a recovery.
Why not unload and load data else use DSN1COPY to copy the image copy to normal dataset and use it for the other tablespace.
Back to top
View user's profile Send private message
Guest







PostPosted: Mon Sep 26, 2011 2:21 pm
Reply with quote

Hi ashimer, Thanks for the reply. The problem with unload is we have over 500 tables to take back ups and preparing jobs for all these tables are time consuming as its an urgent task. Could you please tell me steps for back up and load using the the alternative way you mentioned , ie using DSN1COPY on mage copy ?
Back to top
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Tue Sep 27, 2011 10:10 pm
Reply with quote

Hello devil13,

You can use cross-loader feature of load utility to get the job done,

Code:
EXEC SQL DECLARE C1 CURSOR FOR SELECT * FROM DSN8810.EMP ENDEXEC

LOAD DATA INCURSOR(C1) REPLACE INTO TABLE BOBT1.MYEMP STATISTICS


Since there are 500 tables, here is an idea for preparing the above utility statements,

Query not tested
Code:
SELECT 'EXEC SQL DECLARE C1 CURSOR FOR SELECT * FROM DSN8810.'||strip(name)||' ENDEXEC'
from sysibm.systables where creator ='DSN8810'


Prepare similar query for the load also.

Remember there should be 500 cursors.

God Bless,
Sushanth
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
Search our Forums:

Back to Top