Initialize Mobile Database
Overview
The Initialize Mobile Database process is executed on the source server to create a copy, i.e. a Mobile mirror package of the deployment. The process creates an empty, detached database structure, and select dataset information. Copies of the system resources, i.e. reports, tables, and so on are also copied. In addition, general and selected module parameters and tables for given years are created. This process is executed at the initial setup of the Mobile device, or when changes occur in the source database. Changes include database structure, e.g. tables and fields, product resources, i.e. Views, Forms, tables, reports, and so on.
NOTE: Running this process on a database that is being used will result in the destination database being overwritten by the source. In addition, the size of some of the tables being processed can be a factor in the processing time. |
What’s New!
Exclude Database Objects during Initialization (Manual process)
The Database Objects exclusion feature is an enhancement intended for the Govern Mobile application. This enhancement will allow users to manage the initialization of database objects, i.e. tables, functions, or views. In order to implement this enhancement, the (Table: SY_MOBILE_DB_OBJ_EXCLUSION) has been added to Govern Reference. This table will contain all object names that should be excluded during the GNA Initialize Mobile Database process. Refer to Mobile Configuration Editor for object exclusion through Govern UI.
GNA User Interface Changes
As a result of the added functionality and enhancements to the Govern Mobile application, changes have been made to the Govern New Administration (GNA) user interface. Changes are as follows; the Initialize Mobile Database process icon has been moved from the Database Utilities group. A new Mobile group is now present on the right hand side of the Import / Export Tools group. It is under this new Mobile group that mobile related functions will be found. Currently there are two mobile related options, the new Mobile Configuration, and the new location for the Initialize Mobile Database process.
NOTE: The functions within the Mobile group can be found using the expander arrowhead beside the Mobile Tools icon label. |
Functionality
NEW! This new feature targets the Govern Mobile application in that it provides users with the ability to exclude database objects, i.e. a Table, a View, or a Function. It is not necessary to specify which of these three objects is contained in the table as the names of the content of the table are unique.
, and update user tables, during the Initialize Mobile Database, and the Get Latest process. For this implementation two (2) new tables have been added to the Govern reference; SY_MOBILE_TABLE and SY_MOBILE_COLUMN
This table has only one column called NAME. This column contains the name of the database object that is to be excluded.
WARNING: Administrators using this feature should take care when manually populating their source database. |
Table Details
The (Table: SY_MOBILE_DB_OBJ_EXCLUSION) is a table with only one column. The column name is NAME. Refer to the Mobile – Database Objects Exclusion Technical Documentation for technical descriptions of this table.
Requirements
Prior to using this feature, run the verify database process Database Verification from the GNA ribbon to ensure that the source database has been updated with required tables.
The Process
1 – Populate the Table Manually
In order for the synchronization process to occur, users must populate the SY_MOBILE_DB_OBJ_EXCLUSION table manually. A recommended method is through Microsoft SQL Server Management Studio (MSQL MS). To populate the table through SQL Management Studio, use a Copy and Paste process to manually copy the information to the table.
(Table: SY_MOBILE_DB_OBJ_EXCLUSION).
2 – Verify the Content of the Database
After the table has been populated, finalize the changes. Verify that the copied tables are the ones that are to be excluded. All records that now appear in the table will be excluded, i.e. not copied to during the Initialize Mobile Database process.
SELECT*
FROM SY_MOBILE_DB_OBJ_EXCLUSION;
3 – Run the Initialize Mobile Database Process
Once the Source database table has been populated with the database objects that are required for exclusion, run the Initialize Mobile Database process in GNA.
NOTE: Read the confirmation that appears prior to the process being run. |
TIP: Upon completion, as this is a manual process, always perform a random verification to ensure that the objects in the list of excluded objects table (Table: SY_MOBILE_DB_OBJ_EXCLUSION), do not appear in the destination table. |
Tables
The following is the table, or list of tables, that were modified or created to implement this feature.
- SY_MOBILE_DB_OBJ_EXCLUSION
Add and Update User tables during Initialization and Get Latest
NEW! The new feature in the Govern Mobile application is the ability to add, and update user tables, during the Initialize Mobile Database, and the Get Latest process. For this implementation two (2) new tables have been added to the Govern reference; SY_MOBILE_TABLE and SY_MOBILE_COLUMN
NOTE: The system still maintains a fixed list of system tables through the MobileTables.xml XML file, only user defined custom tables are added to the new SY_MOBILE_TABLE, and SY_MOBILE_COLUMN tables.
WARNING: Administrators using this feature should take care when manually populating their Source database |
Table Details
Below are the columns within the data tables. Refer to the Technical Documentation for further descriptions of the tables.
SY_MOBILE_TABLE – Contains custom tables that can be used in data extraction
COLUMN_NAME | DATA_TYPE | TYPE_NAME | PRECISION | LENGTH | NULLABLE | COLUMN_DEF | SQL_DATA_TYPE |
NAME | 12 | varchar | 30 | 30 | 0 | NULL | 12 |
READ_ONLY | 5 | smallint | 5 | 2 | 0 | (‘0’) | 5 |
DOWNLOAD_ALL | 5 | smallint | 5 | 2 | 0 | (‘0’) | 5 |
KEY_MASTER | 12 | varchar | 30 | 30 | 1 | NULL | 12 |
IS_KEY_DYNAMIC | 5 | smallint | 5 | 2 | 0 | (‘0’) | 5 |
KEY_COLUMN | 12 | varchar | 30 | 30 | 1 | NULL | 12 |
OPTIONAL | 5 | smallint | 5 | 2 | 0 | (‘0’) | 5 |
UPLOAD_ONLY | 5 | smallint | 5 | 2 | 0 | (‘0’) | 5 |
SY_MOBILE_COLUMN – Contains custom columns that can be used in data extraction
COLUMN_NAME | DATA_TYPE | TYPE_NAME | PRECISION | LENGTH | NULLABLE | COLUMN_DEF | SQL_DATA_TYPE |
TABLE_NAME | 12 | varchar | 30 | 30 | 0 | NULL | 12 |
NAME | 12 | varchar | 30 | 30 | 0 | NULL | 12 |
REFERENCES | 12 | varchar | 61 | 61 | 0 | NULL | 12 |
CONDITION | -1 | text | 2147483647 | 2147483647 | 1 | NULL | -1 |
ONE_TO_MANY | 5 | smallint | 5 | 2 | 0 | (‘0’) | 5 |
IGNORE | 5 | smallint | 5 | 2 | 0 | (‘0’) | 5 |
READ_ONLY | 5 | smallint | 5 | 2 | 0 | (‘0’) | 5 |
Requirements
Prior to using this feature, run the database verification process to ensure that the source database has been updated with the latest tables.
NOTE: In the current implementation of this feature, any required user tables must be specified manually. |
Populating the Tables Manually
As indicated, in order for the synchronization process to occur with user defined tables, users must populate the SY_MOBILE_TABLE manually. A recommended method is through Microsoft SQL Server Management Studio (MS SQL MS). To populate the table through SQL Management Studio, use an INSERT statement to copy the required tables into (Table: SY_MOBILE_TABLE).
1 – Determine the Structure of the Tables
exec sp_columns SY_MOBILE_TABLE;
exec sp_columns SY_MOBILE_COLUMN;
The results will display the table columns that help when designing the action query to populate the tables. For example, an INSERT statement can be as follows…
2 – Design and run the INSERT Query
INSERTINTO SY_MOBILE_TABLE
VALUES (‘USR_MYTABLENAME01′,”,”,’USR_MYTABLENAME_COL1’,”,”,”,”);
Where USR_MYTABLENAME01 is the value entered in the NAME column, and so on. Insert all user tables that are required in both SY_MOBILE tables.
3 – Verify the INSERT Query
The INSERT action can be verified with a SELECT statement. As an example, the result of the following SELECT query will help to confirm that data has been inserted into the table.
SELECT*
FROM SY_MOBILE_TABLE;
…repeat for the SY_MOBILE_COLUMN table.
3 – Run Initialize Mobile Database Process
Once the Source database tables have been populated with required user tables, run the Initialize Mobile Database process in GNA when creating a new mobile deployment.
OR
3 – Synchronize on the Mobile Application
When the mobile application is running, and the Status indicates Connected, it will verify that a change has been made to the source database; the Get Latest icon will be active. Click Get Latest on the Mobile ribbon. During the Get Latest process, the Source and Mobile database will synchronize with any values found in the tables that are listed (Table: SY_MOBILE_TABLE).
For additional information on the process, refer to the Mobile Initialization section of the 202-[tech]-Mobile page on the Govern Wiki.
TIP: Upon completion, as this is a manual process, always perform a random verification to ensure that the requested user tables appearing in (Table: SY_MOBILE_TABLE, SY_MOBILE_COLUMN), appear in the destination table. |
Tables
The following is the table, or list of tables, that were modified or created to implement this feature.
- SY_MOBILE_COLUMN
- SY_MOBILE_TABLE
See Also
*
103-ut-006