To create a user-managed application mart the script API_SCURTY.CREATE_APU is used. The only variable that has to be provided is a name for the application mart. The rest of the parameters are optional and can be used to add a description or a comment or to provide a name and e-mail address of the person who requested the application mart. As neither the name nor the e-mail address of the one requesting the application mart is necessary for this example, these two parameters as well as the optional comment will be set to 'null'.
EXECUTE SCRIPT API_SCURTY.CREATE_APU (
'TEST_APU' -- p_sbx_name
,'Test-APU for testing purposes' -- p_description
,null -- p_requestor_name
,null -- p_requestor_mail
,null -- p_sbx_comment
);
After issuing the command above an entry is added to the table SCURTY.SBX_REPO with the SBX_TYPE set to 'APU'. For an application mart the quota of GB available is always set to 0 as no tables can be added to an application mart, while the lifetime is always set to infinite, by setting a negative number.
SBX_NAME | SBX_TYPE | DESCRIPTION | LIFETIME | QUOTA | REQUESTOR_ NAME | REQUESTOR_ MAIL | SBX_COMMENT |
---|---|---|---|---|---|---|---|
TEST_APU | APU | Test_APU for testing purposes | -1 | 0 | (null) | (null) | (null) |
To modify any of the parameters of a user-manged application mart the script API_SCURTY.MANAGE_APU is used. The exact name of the application mart which should be modified has to be provided to the script. All of the other parameters can be kept the same by entering a 'null' value for all parameters which should not be changed. By providing any other value the old value will be overwritten.
In the example below all variables stay the same for the application mart 'TEST_APU' except for the requestor name. Here the 'Testuser' account is provided as the new requestor name.
EXECUTE SCRIPT API_SCURTY.MANAGE_APU (
'TEST_APU' -- p_sbx_name
,null -- p_description
,'Testuser' -- p_requestor_name
,null -- p_requestor_mail
,null -- p_sbx_comment
);
After a successful compilation of the script above, the entry in the table SCURTY.SBX_REPO will have changed, as can be seen in the table below.
SBX_NAME | SBX_TYPE | DESCRIPTION | LIFETIME | QUOTA | REQUESTOR_ NAME | REQUESTOR_ MAIL | SBX_COMMENT |
---|---|---|---|---|---|---|---|
TEST_APU | APU | Test_APU for testing purposes | -1 | 0 | Testuser | (null) | (null) |
To drop a user-managed application mart, the script API_SCURTY.DROP_APU can be used. Only the exact name of the application mart that should be dropped, needs to be provided to that script.
EXECUTE SCRIPT API_SCURTY.DROP_APU(
'TEST_APU' -- p_sbx_name
);
No entry with the name 'TEST_APU' can be found anymore in the table SCURTY.SBX_REPO after issuing the command above.