Chapter 8 [ 315 ] Code Sample: alter database 'ESSCAR'.'ESSCAR' rename to 'ESSCARN'; These are some of the commands that you can perform using the ALTER database. Display database With MaxL you can display all of the pertinent information about a database in one easy command. Syntax: display database <all | Db-Name | on application App-name>; Code Sample: display database; display database all; display database 'ESSCAR'.'ESSCAR'; Drop database This command is used to delete Essbase databases and if a database has some of its objects locked, then also use the FORCE parameter to unlock those objects. Syntax: drop database <Db-Name>; Code Sample: drop database 'ESSCAR'.'ESSNEW'; drop database 'ESSCAR'.'ESSNEW' force; Working with data in MaxL With MaxL statements you can also import data into an Essbase database or export data from the Essbase database to a text le. These two statements are powerful statements and are very widely used. The import statement not only imports data into the Essbase cube, it is also used t o update dimensions in the outline. 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 [ 316 ] Syntax: import database <app-name>.<db-name> data | dimension: data is used when we are loading data into the cube. Use dimension for updating dimension in the outline. connect as <Database Username>: Since we are loading the data from a relational database, please specify the user name here. IDENTIFIED BY <Database password): Specify your relational database password. USING (Information about the Rules File) LOCAL | SERVER: Location of the rules le RULE_FILE RULE FILE NAME: Name of the rule le ON ERROR APPEND TO (error File information) WRITE | APPEND ERROR FILE NAME: Path for error le C:/book/dataload.err Code Sample: import database 'ESSCAR'.'ESSCAR' data connect as 'hypuser' identified by 'password' using server rules_file 'dSales' on error write to 'C:/book/dataload.err'; The export MaxL statement is used to export the level 0 data, all of the data, or just the input data from the Essbase cube into a text le. This function is mainly used for data retention as per company policy or backing up critical data. Syntax: export database <app-name>.<db-name>; all | level 0 | input : all indicates all levels of data, level 0 indicates only leaf node data which excludes the aggregated data, and input indicates only input data. data in columns to data_file <File-name>; Code Sample: export database 'ESSCAR'.'ESSCAR' all data to data_file 'C:/book/ export_data.txt'; 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 [ 317 ] Working with database calculations in MaxL Using MaxL you can also create database calculation les, display the list of calc les, drop calc les, and execute calc les. Create calculation MaxL statements let you create a new calc le or copy an existing calc le from another application on the server. Syntax: create calculation <Calc-name> <Calc-string | as calc-name> Code Sample: create calculation 'ESSCAR'.'ESSCAR'.'ESSCALC' 'CALC DIM(PRODUCTS, MARKETS)' Upon execution of the above code a new calc script named ESSCALC will be created within the ESSCAR application. Display calculation The display MaxL statement will display the calculation scripts on the analytic server. Syntax: display calculation <all | <Calc-name> | on application <App-name> | on database <Db-Name>>; Code Sample: display calculation all; display calculation on application 'ESSCAR'; Execute calculation The execute calculation MaxL statement will run the specied calc script. Syntax: execute calculation < Calc-name > | Calc-name on database Db-String | Calc – String on Db-Name | default.; 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 [ 318 ] Code Sample: execute calculation 'ESSBCAR'.'ESSCAR'.'ESSCALC'; execute calculation 'CALC DIM(PRODCTS,MARKET)' on 'ESSACAR'.'ESSCAR'; Drop calculation The drop calculation MaxL statement will delete the existing named calc script. Syntax drop calculation < Calc-name >; Code Sample: drop calculation 'ESSCAR'.'ESSCAR'.'ESSCALC'; Working with user privileges in MaxL Using MaxL statements, the database administrator can create, edit, display, drop, and grant privileges to user IDs. The basic accesses you can grant to a user ID are the same as dened in either the application properties or the database properties. 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 [ 319 ] Looking at the previous screenshot you can see the choices provided to you for default access to the Essbase applications or databases. The only difference is if you set the access at the application level, the user will have the selected level of access for all databases within the application. If you grant this same level of access at the database level the ID will have this level of access only at the database level for which it was given. Create user Using the MaxL statement, you can create a new user, assign a default password, and associate the user with a database access group. Syntax: create user <user-name> identified by <password> as <EXISTING USERNAME> | member of group <group-name>; Code Sample: create user essuser identified by essinit member of group esssales; Alter user The alter MaxL statement lets the administrator edit a user such as: change the group, remove the user from a group, enable the password, disable the password, and reset the user. Syntax: alter user <user-name> add to group <Group-name>; /* Adds an existing user to an access group */ alter user <user-name> remove from group <Group-name>; /* Removes an existing user from an access group */ alter user <user-name> rename to <new user-name>; /* Renames an existing user to a new user name */ alter user <user-name> enable; /* Reactivate the user's ID */ alter user <user-name> disable; /* Disable the user ID */ alter user <user-name> set_password <new-password>; /* Set a new password for a specified user ID */ alter user <user-name> set_password_reset_days <integer> days | none | immediate | exact; /* Set the password time to live in days */ alter user <user-name> reset; /* This statement resets the user ID. If the user ID is locked then it will be unlocked. Unsuccessful password attempts will set to 0 */ 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 . July 20 09 8601 ave. p #1, , lubbock, , 794 23 Download at Boykma.Com Chapter 8 [ 3 19 ] Looking at the previous screenshot you can see the choices provided to you for default access to the Essbase. 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 [ 318 ] Code Sample: execute calculation 'ESSBCAR'.'ESSCAR'.'ESSCALC'; execute. 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 [ 316 ] Syntax: import database <app-name>.<db-name> data