generate_subset

Generates a subset using the specified subset definition and target database.

Format

emcli generate_subset
      -subset_name=<subset_definition_name>
      -target_name=<target_name>      -target_type=<target_type>
      [-in_place_delete]
      [-db_pref_cred_name=<DBCredsNormal | DBCredsSYSDBA>]
      [-db_cred_name=<database_credential_name>]
      [-host_cred_name=<host_credential_name>]
      [-rule_parameters=<rule_parameters>]
      [-subset_directory=<database_directory_object_name>]
      [-custom_directory_path=<custom_directory_path> ]
      [-use_external_directory]
      [-external_directory=<external_directory_object_name>]
      [-export_file_name=<export_file_name>]
      [-max_file_size=<maximum_file_size>]
      [-max_threads=<maximum_number_of_threads>]
      [-compress_dump_file=<compress_dump>]
      [-encrypt_dump_file]
      [-encryption_password=<encryption_password>
      [-confirm_encryption_password=<encryption_password_confirmation>]
      [-seed_flag]
      [-seed_password=<seed_password>]
      [-log_file_name=<log_file_name>]
      [-job_name=<job_name>]
      [-job_description=<job_description>]
      [-is_non_prod_env]

[ ]  indicates that the parameter is optional

Options

  • subset_name

    Name of the existing subset definition to generate the subset.

  • target_name

    Database target name.

  • target_type

    Type of target. The possible values for target type are 'oracle_database', 'rac_database', and 'oracle_pdb'.

  • in_place_delete

    Determines whether to generate a subset operation. The default operation is exporting data into a dump file. Set this flag to delete data from the specified target.

  • db_pref_cred_name

    Name of preferred credentials stored in the Enterprise Manager repository. You must provide a value for either db_pref_cred_name_or db_cred_name. The valid values for this option are:

    • DBCredsNormal — Default normal credential set for an oracle_database target.

    • DBCredsSYSDBA — SYSDBA credential set for an oracle_database target.

  • db_cred_name

    Name of existing credentials stored in the Enterprise Manager repository to connect a selected target database.

  • host_cred_name

    Name of existing host credentials stored in the Enterprise Manager repository to access the target host. If you do not specify a value, the preferred host credentials set for this target are used to access the target host.

  • rule_parameters

    Maps values to rule parameter names.You must specify the value for this option if any of the rule parameters have missing values. However, you can also override the specified values using this option.

    For example:

    -rule_parameters="department_id_param:80;order_id_param:2400"
    
  • subset_directory

    Directory location object name to save dump and log files. For example:

    DATA_PUMP_DIR
    
  • custom_directory_path

    User-specified directory location on the target host to save dump and log files. You must provide a value for either subset_directory or custom_directory_path. For example:

    /scratch/user/subset_dir
    
  • use_external_directory

    Enables the external directory (clustered/shared file system or ASM) for a faster export dump. If this option is set, you need to provide a value for external_directory.

  • external_directory

    External directory (clustered/shared file system or ASM) for a faster export dump. For example:

    DATA_PUMP_DIR
    
  • export_file_name

    File name to save the dump file. If not specified, the default value is EXPDAT%U.DMP. You can wildcard a set of dump files using '%U' in the file name.

  • max_file_size

    Maximum file size in MB. If not specified, the default value is 100.

  • max_threads

    Maximum number of threads created for export operation. If not specified, the default value is 1.

  • compress_dump_file

    Enables data compression during the export operation.

  • encrypt_dump_file

    Enables data encryption during the export operation.

  • encryption_password

    Password key to encrypt data during export operation. If encrypt_dump_file is set and a value for this option is not specified, you are prompted for the encryption password. For a secure operation, it is recommended that passwords should not be stored in the scripts, but specified instead when prompted for them.

  • confirm_encryption_password

    The value for this option should be the same as encryption_password. If encrypt_dump_file is set and the value for this option is not specified, you are prompted for confirmation of the encryption password. For a secure operation, it is recommended that passwords should not be stored in the scripts, but specified instead when prompted for the them.

  • seed_flag

    Indicates that the subset definition contains one or more masking definitions, and any of the masking definitions contains a substitute or encrypt format.

  • seed_password

    Seed string to be used if the subset definition contains one or more masking definitions and any of the masking definitions contains a substitute or encrypt format. If seed_flag is set and a value for this option is not specified, you are prompted for the seed password. The seed can be any text string. For a secure operation, it is recommended that passwords should not be stored in the scripts, but specified instead when prompted for them.

  • log_file_name

    File name to save the log file. The default value is EXPDAT.LOG.

  • is_non_prod_env

    Confirmation that the specified database is not a production database. This option is mandatory for the in-place delete option.

  • job_name

    Generates the subset job name.

  • job_description

    Job description.

Output

Success or error messages as well as the job name if applicable.

Examples

Example 1

This example exports data into a dump file using rule parameters.

emcli generate_subset 
      -subset_name=hr_subset 
      -target_name=sample_database  
      -target_type=oracle_database 
      -export_file_name=EXPDAT.DMP 
      -db_cred_name=db_cred 
      -host_cred_name=host_cred  
      -subset_directory=DATA_PUMP_DIR 
      -rule_parameters="department_id:80;order_id:2400"

Example 2

This example exports data into a dump file with encryption enabled. You are prompted for encryption_password and confirm_encryption_password.

emcli generate_subset 
      -subset_name=hr_subset 
      -target_name=sample_database 
      -encryption_password  
      -target_type=oracle_database 
      -export_file_name=EXPDAT.DMP 
      -db_cred_name=db_cred 
      -host_cred_name=host_cred  
      -subset_directory=DATA_PUMP_DIR