create schema job

Creates a new schema job for comparing database object schemas.

Syntax

create schema job sc_job_name 
set max_concurrent_comparisons = 100
[and set desc [{to|=}] description]
  add comparison comparison_name
	   With source source_connection_name source_alias
   target target_connection_name target_alias
		   [and target target2_connection_name target2_connection_name_alias]…
[include all tables]
         [map tables
     source_connection_name_alias.source_schema.source_object_name=
     target_connection_name_alias.target_schema.target_object_name[=
     target2_connection_name_alias.target2_schema.target2_object_name]…]
	 [and source_connection_name_alias.source_object2_schema.source_object2_name=
     target_connection_name_alias.target_schema.target_object2_name[=
     target2_connection_name_alias.target2_schema.target2_object2_name]…]
     ]
          [exclude tables
     source_schema.source_object_name
     [and source_schema.source_object2_name]…]

Parameters

  • sc_job_name – the name of the schema comparison job.
  • comparison_name – the name of the schema comparison.
  • max_concurrent_comparisons – (Optional) the number of maximum concurrent comparisons. The default value is 5.
  • description – (Optional) description of the agent. Use double quotes if you are using a reserved word or blank spaces.
  • source_connection_name – the name of the source connection.
  • source_alias – the alias name of the source connection.
  • target_connection_name – the name of the target connection.
  • target_alias – the alias name of the target connection.
  • source_schema – the schema name of the source object.
  • source_object_name – the name of the source object.
  • target_schema – the schema name of the target object.
  • target_object_name – the name of the target object.

Examples

  • Example 1 – creates a schema comparison job “sc_job_test”:
    create schema job sc_job_test
      set max_concurrebt_comparisons = 100
      add comparison cmp1
    	with source s1_con  s1
               target t1_con t1
    		    and target t2_con t2
          include all tables 
    	  map tables
    			s1.tab_a = t1.tab_b
    			and s1.tab_b = t2.tab_c
          exclude tables 
    			s1.tab_a2
    The returned result is:
    Schema job “sc_job_test” was created successfully.

Usage

  • The include all tables clause specifies that all tables in the source database are in the schema comparison object lists, and use automatic name mapping between source database and target database to compare table schemas. The exclude table clause specifies the tables you want to exclude in the source database after you have set include all tables for a schema job.

  • The map tables clause specifies the object mapping. A source object cannot be in the map tables and exclude tables simultaneously; the object mapping overrides the map tables clause. Object mapping for the current release is limited to tables.