Resource File Mode

Make these changes to the resource file mode:

  • data_copy_thread, create_index_thread, and work_thread attributes are recognized in the setup, migration, and validate sessions of sybmigrate. In the setup session, these values are recorded in the repository database, and used as default values during the migrate and validate sessions. During the migrate and validate sessions, you can override the default values by specifying a new value.

  • lock_account is a new login account management feature. lock_account tells sybmigrate to lock or unlock all accounts on the target SAP ASE server after copying the login information. Valid values are “Yes” and “No”, with “Yes” instructing sybmigrate to lock the target SAP ASE server accounts. To activate lock_account, you must set migrate_server_data to “Yes” in the setup session.

    If the lock_account attribute is not set, nothing is done to target login accounts.

  • login_password_file has been added to support changing the passwords on the target SAP ASE server. In the setup session, login_password_file takes the input password file or the value “<generate>”. “<generate>” is a special key used to tell sybmigrate to generate the passwords instead of reading them from the password file. If this attribute is not set in the resource file during the setup session, there is no change to the target SAP ASE server login passwords. To activate login_password_file, you must set migrate_server_data to “Yes” in the setup session.

  • The password file must be in plain text. The content of this file consists of two columns: the login name column and the password string column. The separator between the columns are tabs and or spaces. Any lines beginning with “#” are comments.

  • auto_select_dependent_objects is a new value that is available during the migrate and validate sessions. This attribute tells sybmigrate to automatically select the dependent objects for migration and validation. The valid values for this attribute are either “Yes” or “No”; “No” is the default.

  • If source_ase, source_ase_login, source_ase_password, target_ase, target_ase_login, and target_ase_password attributes are not in the resource file, sybmigrate prompts the user for these attributes.

  • In the database section of the resource file, if you do not specify any objects or SQL, all objects and types are selected.

    For example, in the following resource file all object types (default, rule, table, and so on) are migrated from pubs2 and pubs3 databases:

    [server}
    source_ase=tho:5002 
    source_ase_login=sa 
    source_ase_password= 
    
    target_ase=tho:6002 
    target_ase_login=sa 
    target_ase_password= 
    
    [database]
    source_database_name=pubs2 
    target_database_name=pubs2 
    
    [database]
    source_database_name=pubs3 
    target_database_name=pubs3

Resource file mode is a non-interactive mode. The resource file contains all the information required for migration. You can use the resource file mode if you do not have GUI support or if you need to run batch files.

If you do not specify any object type attributes to migrate in the resource file, sybmigrate migrates the entire database.

If you do not specify the source or target SAP ASE server login or password in the resource file, sybmigrate prompts the user for this information.

Following is the format for the resource file to run sybmigrate in noninteractive mode. To create a resource file, type all the values into a file:

#
# This is a sample Migration Tool resource file.
# This resource file will migrate objects in pubs2,
# pubs3, and foo databases.
#

######################################################
# Server wide information
######################################################
[server]
# "<host name>:<port number>" or just server name.
source_ase=tho:5002
source_ase_login=sa
source_ase_password=

# "<host name>:<port number>" or just server name.
target_ase=tho:6002
target_ase_login=sa
target_ase_password=

# Repository database setup attributes.  This is
required with "setup" mode.
# Repository database size in MB.
repository_database_size=7
# Device used to create the "sybmigrate" database.
repository_device=master

# Migrate server wide data - logins, roles, remote servers, etc...
# valid only with "setup" mode, default is yes
migrate_server_data=yes

# Tell sybmigrate to lock or unlock all login accounts on the
# target Adaptive Server.  Valid values are "yes" and "no":
# "yes" to lock and "no" to unlock.  This is only valid if
# "migrate_server_data" is set to "yes" and run in "setup" mode.
# If this attribute is not specified, target Adaptive Server login
# accounts are not change.
lock_account=no

# Change target Adaptive Server login passwords.  This is only valid
# if "migrate_server_data" is set to "yes" and run in "setup" mode.
# If this attribute is not specified, target Adaptive Server login
# accounts are not change. 
# The valid values are "<generate>" and password file.
# "<generate>" instructs sybmigrate to use random passwords.
# Password file instructs sybmigrate to use the passwords from
# this file.
# The content of the password file consists of two columns: 
# the login name column and the password string column.
# The separator between the columns are tabs and or spaces.
login_password_file=<generate>

######################################################
# Database information
######################################################
#
# Migrate the "pubs2" database objects
#
[database]
# Specify the source target database to migrate.
source_database_name=pubs2
target_database_name=pubs2

# Migrate database data, valid only if "migrate_server_data"
# was set to "yes" in "setup" mode. This is default to yes.
migrate_database_data=yes

# Work database setup attributes.  This is required with "setup" mode.
# Work database size in MB.
work_database_size=5
# Device used to create the work database.
work_database_device=master

# Number of threads use to do user table data copy
data_copy_thread=5

# Number of thread use to create indexes.
create_index_thread=1

# Number of thread use to do ddl migration/validation 
work_thread=10

# Automatically select the depedent objects for migration and
# validation.  Valid values are "yes" or "no".
auto_select_dependent_objects=yes

#
## Migrate objects
#
# These attributes specify the list of DDL object to
# migrate or validate. User can directly specify the
# list of DDL object or ask Migration tool to query the
# list. Directly specifying the list has the higher 
# precedence. The SQL command will ignore if the list 
# is given.
#
# Note:
# * The SQL command for the "*_list_from_sql" attributes
# must return column <object name> or columns <user 
# name> and <object name>
# * Index type must also specify the table name. For
# example, "<table>.<index name>" for
# "index_create_list" attribute or columns <table>, 
# <index name> for "index_create_list_from_sql"
# attribute.
# * Value "<ALL_OBJECTS>" can be used on any of the
# attributes to specify all objects for the type.
# * If none of these attributes are given, all objects
# and data are migrated.
#
user_defined_type_create_list=
id
dbo.tid

default_create_list_from_sql=
select user_name(uid), name from sysobjects
where type = 'D'

rule_create_list=
pub_idrule, title_idrule

table_create_list=
publishers
titles
dbo.authors
dbo.titleauthor
dbo.roysched
stores
dbo.sales
dbo.salesdetail
dbo.discounts
dbo.au_pix
blurbs

table_migrate_list=
dbo.publishers titles dbo.authors dbo.titleauthor
dbo.roysched
stores dbo.sales dbo.salesdetail dbo.discounts au_pix
dbo.blurbs

index_create_list=
dbo.authors.auidind 
dbo.authors.aunmind 
publishers.pubind 
roysched.titleidind 
sales.salesind 
salesdetail.titleidind 
salesdetail.salesdetailind 
titleauthor.taind 
titleauthor.auidind 
titleauthor.titleidind 
titles.titleidind 
titles.titleind 

trigger_create_list=
deltitle
totalsales_trig

store_procedure_create_list_from_sql=
select name from sysobjects where type = 'P'

view_create_list_from_sql=<ALL_OBJECTS>

referential_constraint_create_list_from_sql=<ALL_OBJECTS>

logical_key_create_list_from_sql=<ALL_OBJECTS>

#####################################################

#
# Migrate the "pubs3" database objects
#
[database]
source_database_name=pubs3
target_database_name=pubs3

# Migrate database data - user, etc.
migrate_database_data=yes

# These two attributes valid only with "setup" mode
work_database_size=5
work_database_device=master

# Number of threads use to do user table data copy
data_copy_thread=5

# Number of thread use to create indexes.
create_index_thread=1

# Number of thread use to do ddl migration/validation 
work_thread=10

# Migrate objects
user_defined_type_create_list=<ALL_OBJECTS>

default_create_list=<ALL_OBJECTS>

rule_create_list=<ALL_OBJECTS>

table_create_list=
dbo.authors
publishers
dbo.titles
dbo.roysched
stores
dbo.sales
dbo.store_employees
salesdetail
dbo.titleauthor
dbo.discounts
blurbs

table_migrate_list_from_sql=<ALL_OBJECTS>

index_create_list=<ALL_OBJECTS>

trigger_create_list=<ALL_OBJECTS>

store_procedure_create_list=<ALL_OBJECTS>

view_create_list=<ALL_OBJECTS>

referential_constraint_create_list_from_sql=<ALL_OBJECTS>

logical_key_create_list_from_sql=<ALL_OBJECTS>

#####################################################

#
# Migrate all the "foo" database objects with default settings.
#
[database]
source_database_name=foo
target_database_name=foo

# Migrate database data - user, etc.
migrate_database_data=yes

# These two attributes valid only with "setup" mode
work_database_size=5
work_database_device=master

# Number of threads use to do user table data copy
data_copy_thread=5

# Number of thread use to create indexes.
create_index_thread=1

# Number of thread use to do ddl migration/validation
work_thread=10