Nickname creation & load data

This is continuation to following post: https://rk.guru/2016/07/29/db2-luw-federation-between-2-databases-within-same-instance/

The below example talks about

(1) Nickname creation, and

(2) Loading data using nickname created

****

db2 => connect to feddb2

Database Connection Information

Database server = DB2/LINUXX8664 11.1.0
SQL authorization ID = DB2INST1
Local database alias = FEDDB2

db2 => create table t1_fed2 (c1 char(30))
DB20000I The SQL command completed successfully.

db2 => create nickname db2inst1.t1_fed1_nick for server1.db2inst1.t1
DB20000I The SQL command completed successfully.

db2 => declare c cursor for select * from db2inst1.t1_fed1_nick
DB20000I The SQL command completed successfully.

db2 => load from c of cursor replace into db2inst1.t1_fed2 NONRECOVERABLE
SQL3501W The table space(s) in which the table resides will not be placed in
backup pending state since forward recovery is disabled for the database.

SQL1193I The utility is beginning to load data from the SQL statement ”
select * from db2inst1.t1_fed1_nick”.

SQL3500W The utility is beginning the “LOAD” phase at time “07/29/2016
06:01:48.276446”.

SQL3519W Begin Load Consistency Point. Input record count = “0”.

SQL3520W Load Consistency Point was successful.

SQL3110N The utility has completed processing. “2” rows were read from the
input file.

SQL3519W Begin Load Consistency Point. Input record count = “2”.

SQL3520W Load Consistency Point was successful.

SQL3515W The utility has finished the “LOAD” phase at time “07/29/2016
06:01:48.692010”.
Number of rows read = 2
Number of rows skipped = 0
Number of rows loaded = 2
Number of rows rejected = 0
Number of rows deleted = 0
Number of rows committed = 2

db2 => drop nickname db2inst1.t1_fed1_nick
DB20000I The SQL command completed successfully.

db2 => runstats on table db2inst1.t1_fed2 ON ALL COLUMNS WITH DISTRIBUTION ON ALL COLUMNS AND SAMPLED DETAILED INDEXES ALL
DB20000I The RUNSTATS command completed successfully.

db2 => commit work
DB20000I The SQL command completed successfully.
db2 => load query table db2inst1.t1_Fed2
Tablestate:
Normal

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: