Saturday 23 April 2016

FINDING THE PLAN FILE FROM ZIP FILE IN NETEZZA

In Short Explantion!

cd /nz/kit/log/planshist/current/

based on that TIMESTAMP you will be able to locate which tar file will contain the plan id that you are interested in collect.

syntax: tar -tvf zipfilename planid

tar -tvf 20151107103841.tgz 1335415

go to the directory location,you want keep the extracted plan file.
cd /nz/home/export/ABBAS

tar -xvzf /nz/kit/log/planshist/current/20160123103448.tgz 2341510

[nz@netezza201402-01 ABBAS]$ cd 2341510
[nz@netezza201402-01 2341510]$ ls -ltr
total 32
-rw-r--r-- 1 nz nz 26173 Jan 23 11:19 h2341510_500.cpp
-rw-r--r-- 1 nz nz  3050 Jan 23 11:19 2341510.pln

[nz@netezza201402-01 2341510]$ nz_plan  2341510.pln

***************************************************************

Let's use the example below:

I am interested on planid 4011 that it was already archived:

From dbos.log I will know when the plan id finish and based on that TIMESTAMP you will be able to locate which tar file will contain the plan id that you are interested in collect.

grep "planid 4011 " /nz/kit/log/dbos/dbos.2015-05-05.log
2015-05-05 06:50:07.803613 EDT Info: plan queued: planid 4011 tx 0x482fa cli 131 uid 4960 sid 26061 pid [20595] (run 0/0)
2015-05-05 06:50:07.807195 EDT Info: plan prep  : planid 4011 tx 0x482fa cli 131 uid 4960 sid 26061 pid [20595] (run 0/0)
2015-05-05 06:50:07.811578 EDT Info: plan in GRA: planid 4011 tx 0x482fa cli 131 uid 4960 sid 26061 pid [20595] (run 0/1)
2015-05-05 06:50:07.811643 EDT Info: plan start : planid 4011 tx 0x482fa cli 131 uid 4960 sid 26061 pid [20595] job new (run 0/1)
2015-05-05 06:50:07.860964 EDT Info: plan done  : planid 4011 tx 0x482fa cli 131 uid 4960 sid 26061 pid [20595] dur 0.073 queue 0.018 run 0.041 @ 92%  delay 0.000 res 0.015 (run 2/2)

ls -ltrh /nz/kit/log/planshist/current/
total 52M
-rw------- 1 nz nz  11M May  4 22:28 20150504142511.tgz
-rw------- 1 nz nz  11M May  5 06:47 20150504222822.tgz
-rw------- 1 nz nz  11M May  5 14:59 20150505064911.tgz
-rw------- 1 nz nz  11M May  5 23:13 20150505145906.tgz
-rw------- 1 nz nz 9.7M May  6 06:59 20150505231321.tgz


# As uzer nz go to archived plan files
cd /nz/kit/log/planshist/current/

# I will use the command to verify if my planid 4011 is on the archived tar file

# Below is the example in case the plan file is not available on that tar file

tar -tvf 20150504142511.tgz 4011
tar: 4011: Not found in archive
tar: Error exit delayed from previous errors

# Here is the tar file that contain our plan id.
tar -tvf 20150505064911.tgz 4011
-rw-r--r-- nz/nz          7020 2015-05-05 06:50:07 4011/s4011_1.cpp
-rw-r--r-- nz/nz          7150 2015-05-05 06:50:07 4011/h4011_501.cpp
-rw-r--r-- nz/nz          2594 2015-05-05 06:50:07 4011/4011.pln

# Soon you confirm that the plan id is located on the tar file you have to use the command below to extract only the plan file that you are interested:

tar -xvzf 20150505064911.tgz 4011
4011/s4011_1.cpp
4011/h4011_501.cpp
4011/4011.pln

# After that you will see that it will create the folder 4011 and it will contain the plan id that you looking for:

ls -ltrh /nz/kit/log/planshist/current/
total 52M
-rw------- 1 nz nz  11M May  4 22:28 20150504142511.tgz
-rw------- 1 nz nz  11M May  5 06:47 20150504222822.tgz
-rw------- 1 nz nz  11M May  5 14:59 20150505064911.tgz
-rw------- 1 nz nz  11M May  5 23:13 20150505145906.tgz
-rw------- 1 nz nz 9.7M May  6 06:59 20150505231321.tgz
drwxrwxr-x 2 nz nz     4096 May  6 07:10 4011

No comments:

Post a Comment