Chapter 8 [ 305 ] • Calculation • Data • Filter • Location Alias • Aggregate Build • Aggregate Process • Calculation • Outline • Partitions • Tablespace • Session The following screenshot shows you the list of all of the available MaxL statements: Let's walk through some of the MaxL statements which will be used in the day-to-day life of an Essbase administrator. Logging on to the Essbase server Obviously, the rst step that is required to use MaxL is to log on to the Essbase server. Here is a step-by-step demonstration of how to log on to an Essbase analytic server using MaxL statements. This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Download at Boykma.Com Automating your Essbase Cube [ 306 ] Syntax: Login <USERNAME> /* enter your user name or batch id */ Identied by <PASSWORD> /* enter your password or batch password */ On <HOSTNAME> /*enter the server name */ Code Sample: login <USERNAME> identified by <PASSWORD> on <HOSTNAME>; Guess what? You have just written your rst MaxL statement. Did we say something new here? Well, we have learned a little bit about a few MaxL statements in earlier chapters of this book, but here we are discussing MaxL for the sole purpose of learning how to use the MaxL scripting language and all of the benets these commands can bring to the Essbase administrator. Working with an Essbase application in MaxL As a part of your weekly or monthly maintenance, you may have routine tasks to perform on the application level. Guess what? You can easily execute repetitive tasks using the MaxL scripting language. A word of caution, the user who performs these MaxL actions should have System Designer access or higher. At the application level you can do some very important actions with MaxL. You can create a new application on the analytic server or you can create a copy of an existing application. You can also alter an application, display an application, and nally even drop an application. Let us see how we can use each of these actions in a MaxL script. Creating an application Using the MaxL scripting language you can either create a new application or copy an existing application. You may wonder why we would need to create an application by using a MaxL script. Well we may need to create a yearly MaxL job which requires you to copy an existing application to a new application as a backup, but also you will need to create a new application to replace the old application for the new year's cycle. Both of these tasks, creating a new application and copying an existing application can be done using the MaxL Create statement as shown in the syntax and code sample as follows: This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Download at Boykma.Com Chapter 8 [ 307 ] Syntax: create application 'Application_Name' type 'Mode' as 'Application_ Name ' comment 'Comment-String'; 'Application_Name': Name of the new application should be upto 8 characters long as with all Essbase database objects. type: Indicates whether this application is to be Unicode or not with the default being is non-Unicode mode. Unicode is a system of assigning a unique number to each character regardless of the language or platform. When a database is created using the Unicode convention, users from all parts of the globe, using all different character sets can use your Essbase system without worry of data corruption. As 'Application_name' [optional]: Name of the existing application which will be copied to the new application. comment 'Comment-String' [optional: This is a comment which is given to the application and can be viewed in the application properties screen. Example 1: In the following example, we are creating a new application. Since we did not mention the Unicode mode, by default, it will be created as a non-Unicode application. Create application ESSCARNW comment 'New Esscar Application'; Example 2: In the next example, we are creating a new application which is same as the existing application and will be for the purpose of an application backup. Create application ESSCARBK as ESSCAR comment 'Back up of Esscar Application'; Now that you have seen how we can create an application using a MaxL statement, let us see how we can use the alter application statement in MaxL. Altering the application With the alter statement, you can set the properties for an application, add, modify, or drop a substitution variable, load or unload an application, enable or disable application start up commands, add an application comment, or clear an application log le. This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Download at Boykma.Com Automating your Essbase Cube [ 308 ] Keep the following screenshot in mind when you are looking at the MaxL alter application command examples that follow. For reference, whatever that is performed in the script can also be performed through the Application Properties screen accessed through the EAS tool. Let's look at a few more commonly used alter statements. Using the SET properties statement You can set an application's properties using the alter and set statements. Some of the set commands are: • set minimum permission: Grants all authorized users a minimum application permissions level which is valid for all of the databases under this application. This command directly corresponds to the Minimum access level setting in the Application Properties screen on the General tab. Syntax: alter application <App-Name> set minimum permission <READ | WRITE | CALCULATE | DATABASE DESIGNER>; Code Sample: alter application 'ESSCAR' set minimum permission read; This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Download at Boykma.Com Chapter 8 [ 309 ] • set lock_timeout after: This is the maximum time a user can maintain a database lock if idle. The default lock time out is 60 minutes. Syntax: alter application <App-Name> set lock_timeout after integer <MINUTES | SECONDS>; Code Sample: alter application 'ESSCAR' set lock_timeout after 75 minutes; • set max_lro_file_size: You can set a maximum le size of an LRO. This can be either unlimited, or you can specify a le size. Syntax: alter application <App-Name> set max_lro_file_size <UNLIMITED | LRO SIZE>; Code Sample: alter application 'ESSCAR' set max_lro_file_size 32768b; This code sets the maximum LRO le size to 32KB. • set type unicode_mode: You can convert a non-Unicode into a Unicode mode. Remember, you cannot convert a Unicode application to a non-Unicode application. However, you can convert a non-Unicode application to Unicode. Syntax: alter application <App-Name> set type unicode_mode; Code Sample: alter application 'ESSCAR' set type unicode_mode; Using load/unload database These commands will load and unload the databases into or out of system memory. Syntax: alter application <App-Name> load database <Db-Name>; alter application <App-Name> unload database <Db-Name>; Code Sample: alter application 'ESSCAR' load database 'ESSCAR'; alter application 'ESSCAR' unload database 'ESSCAR'; This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Download at Boykma.Com . in the day-to-day life of an Essbase administrator. Logging on to the Essbase server Obviously, the rst step that is required to use MaxL is to log on to the Essbase server. Here is a step-by-step. on to an Essbase analytic server using MaxL statements. This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 20 09 8601 ave. p #1, , lubbock, , 794 23 Download. licensed for the sole use by Paul Corcorran on 5th July 20 09 8601 ave. p #1, , lubbock, , 794 23 Download at Boykma.Com Automating your Essbase Cube [ 308 ] Keep the following screenshot in mind