Shell Scripts and Exports II

Today, I thought we’d do a followup post to this one where we initially started looking at shell scripts. Exports are by default, single-threaded, i.e., you get 1 file exported out and when it hits the maximum (2 GB in most cases), a separate file is spawned. But what if we wanted to do multi-threaded exports? MaxL allows you to do this and it reduces the time needed to export out large databases. To do this with our shell script structure, let’s make a simple update to our definition file, by adding one more column at the end.

29_1_File

The third column, is intended to act as a thread count. In other words, the “CUBE” database should export to 1 file, while “CUBE2” should export 2 files. Now I’ve also made a copy of the original MaxL file from earlier.

29_2_MaxL

The second one is identical except that it exports 2 threads:

We also need to change up the “while” loop in our shell script.

We’ve added a “THREADS” parameter which tells the script which MaxL file to call. Now if we run the script again, we get our desired output.

29_3_Exports

The script in it’s entirety looks like this:

And there you have it. A simple example of how to use shell effectively to keep our scripts lean. As you can imagine, this type of approach can be helpful in a number of scenarios. More parameters could be added to the definition file to control other aspects of your maintenance process.

Avatar

About Vijay Kurian

Known as the Clem Fandango of EPM consulting, Vijay Kurian has been developing enterprise solutions for companies for the last 12 years (increment years if reading post-2015). Having worked with Essbase, Planning, DRM and other assorted technologies during that time, he’s made the frankly, average decision, to write about them. He is, surprisingly, an Oracle ACE Associate. He hopes to contribute frequently to US Weekly, People and Sensible Chuckle magazines on improving reporting solutions, creating master data management systems and zzz…

Leave a Reply

Your email address will not be published. Required fields are marked *