October 10th, 2013, 03:00 AM
Join Date: Oct 2013
Time spent in forums: 5 m 25 sec
Reputation Power: 0
Originally Posted by 333rupesh
I am using this shell script
db2look -d $dbname -l -z $schema - t $table|grep -ip $tbspace|sed 's/'$datatbsmon'/'$newmon'/' > tbs.ddl
(the tablespace names are like xxxxxx_201305 where 201305 denotes year and month)
after i execute this shell script (using sh script.sh sampledb EMPLOYEE EMP_DATA),...... tbs.ddl is empty file and it shows nothing.
But when I execute the below command in command prompt,
db2look -d sampledb -l -z Employee -t EMP_DATA|grep -ip EMP_201305|sed 's/201305/201306/g' > tbs.ddl
tbs.ddl has the ddl for the tablespace EMP_201306.
Please help me resolve this issue as i need to create the new tablespace based on the naming convention of the previous tablespace and I need to do it using shell script.
Just try to add option -e in your command, it should help