Run ferret commands "Compress" in batch via CNSRUN

Database
Teradata Employee

Run ferret commands "Compress" in batch via CNSRUN

Hi All,

 

I've a script created that contains many Compress command, i.e:

-----------------------------

Enable scriptmode

Output into /tmp/file.log

Compress /Y “dt.tablename1”;

Compress /Y “dt.tablename2”;

Compress /Y “dt.tablename3”;

Compress /Y “dt.tablename4”;

Quit;

-----------------------------

 

When I execute CNSRUN, i.e:

cnsrun -utility ferret -file file_name -ok -multi -debug 2 

 

I get an error: "Only one compression or uncompression can be run at a time. Wait for it to finish and then reissue the command"

How can I force CNSRUN to execute the script in batch mode? I have 260 tables and don't want to do this for each table. Also, I don't want to compress the database as it contains other tables that don't need to be compressed.

 

Thank you

 


Accepted Solutions
Teradata Employee

Re: Run ferret commands "Compress" in batch via CNSRUN

Hi Fred,

 

Many thanks for your reply. I've found the issue. I had to change my script

From:

Enable scriptmode

Output into /tmp/file.log

Compress /Y “dt.tablename1”;

Compress /Y “dt.tablename2”;

Compress /Y “dt.tablename3”;

Compress /Y “dt.tablename4”;

Quit;

 

To:

Enable scriptmode

Output into /tmp/file.log

Compress  “dt.tablename1”;

Y

Compress “dt.tablename2”;

Y

Compress “dt.tablename3”;

Y

Compress “dt.tablename4”;

Y

Quit;

 

Now the compress commands run in batch. 

 

 

1 ACCEPTED SOLUTION
2 REPLIES
Teradata Employee

Re: Run ferret commands "Compress" in batch via CNSRUN

Can you execute a single COMPRESS interactively, or do you get the same error? If you get the same error, and you are certain that there is no other COMPRESS running, you can issue the RESETBLCTSKCNT command to clear the internal counter. Then retry the COMPRESS. (Do not put the RESETBLCTSKCNT command in your script.)

 

If it works interactively but the script still fails, try adding the -prompt '==>' option to your cnsrun command line.

Teradata Employee

Re: Run ferret commands "Compress" in batch via CNSRUN

Hi Fred,

 

Many thanks for your reply. I've found the issue. I had to change my script

From:

Enable scriptmode

Output into /tmp/file.log

Compress /Y “dt.tablename1”;

Compress /Y “dt.tablename2”;

Compress /Y “dt.tablename3”;

Compress /Y “dt.tablename4”;

Quit;

 

To:

Enable scriptmode

Output into /tmp/file.log

Compress  “dt.tablename1”;

Y

Compress “dt.tablename2”;

Y

Compress “dt.tablename3”;

Y

Compress “dt.tablename4”;

Y

Quit;

 

Now the compress commands run in batch.