CREATE_SBX

Creates a new sandbox.

The schema the sandbox uses and that needs to be provided when connecting as a sandbox master is visible in column SBX_OWNER in table SBX_REPO_STATUS and in view SBX_STATUS. The schema name consists of the value stored in table ADM_PARAMS, column VALUE_TEXT where column NAME=’sbx_schema_prefix’ and of the sandbox name. The default value for the prefix is ‘SBX _ ‘. This can be changed using procedure p_rep_admin.set_parm. In the example below, the sandbox named ‘MIGR’ is created in the schema ‘SBX_MIGR’.

A lifetime needs to be defined for the sandbox, but this lifetime may be set to infinite.

A tablespace and quota on this tablespace has to be provided for the sandbox. This tablespace needs to be marked as a SCURTY sandbox tablespace using procedure p_rep_admin.associate_sbx_ts before it can be used for creating a sandbox. If no tablespace name but quota is provided and exactly one tablespace is marked as a SCURTY sandbox tablespace, this tablespace will be used for the sandbox.

To use the new sandbox at least one sandbox master must be assigned using procedure p_sbx_admin.grant_master_access and the sandbox has to be enabled by executing procedure p_sbx_admin.enable_sbx. To view the settings of a sandbox after creation see table SBX_QUOTAS or view SBX_REPO_DETAILS. Tablespaces available for usage with sandboxes are shown in view SBX_TABLESPACE_DETAIL.

Parameter Name

Required

DefaultValue

Values

Description

p_sbx_name

yes

The name of the sandbox.

The name may contain letters, numbers, underscores and dollar signs. No other characters are allowed. The maximum length of the name is 20 characters.

The sandbox name is case sensitive.

p_lifetime

yes

The lifetime of the sandbox in days.

Possible values are 1 to 9999 and -1, which means unlimited lifetime.

There is no default value.

p_desc

no

A description of the sandbox.

p_requestor_name

no

The name of the sandbox requestor for documentary purposes.

The requestor name is not used by any SCURTY code.

p_requestor_mail

no

The email address of the sandbox requestor.

Email notifications will be sent to the sandbox requestor at the following events:

  • When the sandbox is ready for use

  • Before expiration

  • After expiration

  • After the sandbox is dropped

  • After the lifetime of a locked sandbox is changed to unlock it again

For details on expiration notifications, see SCURTY Concepts Guide, paragraph “Sandbox lifetime”.

p_restricted_master

no

TRUE

  • TRUE

  • FALSE

Should the sandbox masters be restricted?

Restricted means all sandbox masters will see only the intersection of their access rights. For details on restricted sandboxes see SCURTY Concepts Guide, paragraph “Restricted Sandboxes”.

Possible values:
  • TRUE to allow restricted masters only,

  • FALSE to allow unrestricted masters.

p_tablespace_name

no

The name of the tablespace to be used with the sandbox.

If no name is provided, a tablespace name is taken from view sbx_tablespace_details if this view contains exactly one entry. If p_tablespace_name is empty and there is no entry or more than one entry in view sbx_tablespace_details the database default permanent tablespace is chosen.

p_quota

no

The quota for the sandbox tablespace.

If no value is provided, quota is set to unlimited.

Example

Create a sandbox named ‘MIGR’ with a lifetime of 90 days and comment ‘Data migration tests’. The name of the person requesting the sandbox is ‘Wolfgang Klinger’, notification emails will be sent to ‘wklinger@sphinx.at’. Sandbox masters are restricted (TRUE) and tablespace ‘SBX’ is used with a quota of 20 GB:

EXEC p_sbx_admin.create_sbx
    ( 'MIGR'
    , 90
    , 'Data migration tests'
    , 'Wolfgang Klinger'
    , 'wklinger@sphinx.at'
    , TRUE
    , 'SBX'
    , 20 );