1. Manage Sandboxes¶
This guide covers project-related sandboxes, which several users (the sandbox masters) can use together for a project. Private sandboxes of individual users are created with the user account.
1.1. Create a Sandbox¶
Create a project-related sandbox with API_SCURTY.CREATE_SBX:
- p_lifetime
Lifetime in days (default sbx_def_lifetime, 30 days; negative means unlimited). When it has expired, the sandbox is locked.
- p_quota
Maximum storage in GB (default sbx_def_quota, 10 GB; negative means unlimited).
- p_requestor_name and p_requestor_mail
The person who requested the sandbox. It is strongly recommended to provide the mail address: the requestor is notified when the sandbox is ready and warned before it expires (by default 10 and 3 days before).
The sandbox <name> is created as the schema SBX_<name> by the next sandbox refresh (see When Do Changes Take Effect?).
In the following example the sandbox ‘TEST_SBX’ is created with a lifetime of 7 days and a quota of 2 GB. No mails are sent, as no mail address is given.
Example: Create the Sandbox ‘TEST_SBX’
1EXECUTE SCRIPT API_SCURTY.CREATE_SBX(
2 'TEST_SBX' -- p_sbx_name
3 ,'Test-SBX for testing purposes' -- p_description
4 ,7 -- p_lifetime
5 ,2 -- p_quota
6 ,null -- p_requestor_name
7 ,null -- p_requestor_mail
8 ,null -- p_sbx_comment
9);
The sandbox is stored in SCURTY.SBX_REPO:
SBX_NAME |
DESCRIPTION |
LIFETIME |
QUOTA |
REQUESTOR_NAME |
REQUESTOR_MAIL |
SBX_COMMENT |
|---|---|---|---|---|---|---|
TEST_SBX |
Test-SBX for testing purposes |
7 |
2 |
(null) |
(null) |
(null) |
The schema name and the status of the sandbox are shown in SCURTY.SBX_REPO_STATUS.
1.2. Change a Sandbox¶
Change the settings of a sandbox with API_SCURTY.MANAGE_SBX. NULL leaves a parameter unchanged, while a blank (’ ‘) restores its default value. If the lifetime of a locked sandbox is extended, it is unlocked again and can be used as if it had never been locked.
In the following example the lifetime is reduced to 5 days and the quota to 1 GB.
Example: Change Lifetime and Quota
1EXECUTE SCRIPT API_SCURTY.MANAGE_SBX(
2 'TEST_SBX' -- p_sbx_name
3 ,null -- p_description
4 ,5 -- p_lifetime
5 ,1 -- p_quota
6 ,null -- p_requestor_name
7 ,null -- p_requestor_mail
8 ,null -- p_sbx_comment
9);
The entry in SCURTY.SBX_REPO has changed:
SBX_NAME |
DESCRIPTION |
LIFETIME |
QUOTA |
REQUESTOR_NAME |
REQUESTOR_MAIL |
SBX_COMMENT |
|---|---|---|---|---|---|---|
TEST_SBX |
Test-SBX for testing purposes |
5 |
1 |
(null) |
(null) |
(null) |
1.3. Drop a Sandbox¶
To drop a sandbox, use API_SCURTY.DROP_SBX.
Warning
All data in the sandbox schema is lost.
Example: Drop the Sandbox ‘TEST_SBX’
1EXECUTE SCRIPT API_SCURTY.DROP_SBX(
2 'TEST_SBX' -- p_sbx_name
3);
The sandbox is removed from SCURTY.SBX_REPO, and the schema SBX_TEST_SBX is dropped.