Detailed Description of Options
oserver using the supplied credentials, then examines tables specified in one of three ways.
By using the:
-
-tablesoption -
-tableFileoption - If neither the
-tablesnor-tableFileoption is specified, the utility examines all tables owned byouser.
-tables and -tableFile options can be used separately or together, and each can appear multiple times on the command line.
tablespec has the following format: [owner.]name[:attribute]...
Owner and/or attributes are optional. A table name of * (which may need to be quoted if used on the command line) is expanded to represent all tables belonging to the owner. Any database identifier, such as a schema owner, table name, or user name, must be properly quoted if it does not conform to standard database-identifier rules.
Attributes are colon-separated key or value pairs. Most control aspects of parallel data loading; see the Parallel Data Loading section for details. The supported attributes are:
| Attributes | Description |
|---|---|
rows=n
|
Specifies the row count for the table. n must be an integer from 0 through 9223372036854775807. The utility determines a table’s row count during analysis. Specify a row count to avoid a table scan when determining the row count is the only reason to analyze the table. A table’s row count is required for compression evaluation, table-size estimation, and parallel data loading. There is no default value.
|
ttwriters=w
|
Specifies the maximum number of TimesTen threads, per reader, to be used when performing intra-table parallel load for this table. w is an integer value between 1 and 16. The default value is determined by the ttthreads value (minus 1) specified in the -dataLoadParallelism option.
|
oradop=n
|
Specifies the degree of parallelism to be used for each Oracle reader in the Oracle database. n is an integer value between 0 and 16. 0 or 1 means no parallel query in Oracle. The default value is determined by the oradop value specified in the -dataLoadParallelism option.
Note that whether the value specified is honoured or not depends on the configuration of the Oracle database. |
orapar={none|auto(n)|hash(n,colexpr)| partition(n)}
|
Specifies how intra-table parallel data load is executed for tables matching this specification. The meaning of the different values is as follows:
The default is |
The -dataLoadParallelism option lets you override built-in limits and defaults that control parallel data loading. You should rarely need to change these values, but if necessary, use the following syntax: -dataLoadParallelism disabled.
Parallel data load is disabled. Tables are loaded sequentially with no parallelism. Any parallel data load attributes specified in table specifications are ignored.
You can set parameters to control parallel data loading defaults:
minrows
|
Specifies the minimum number of rows a table must contain before the system considers it for intra-table parallel loading. A value of 0 means all tables are considered. The default is 500,000.
|
ttthreads
|
The maximum number of concurrent threads allowed in TimesTen during parallel data loading. Each reader and each writer runs as a separate thread. It must be greater than or equal to 0. A value of 0 means no limit. The default is 36.
|
tttabwriters
|
The default maximum number of writers per reader when performing an intra-table parallel load on a TimesTen table. It must be between 1 and 16. The default is 3.
|
orareaders
|
The maximum number of concurrent readers allowed in the Oracle database during parallel data loading. It must be greater than or equal to 0. A value of 0, the default, means no limit.
Both |
consistency
|
Specifies what data consistency is required when loading data. Allowed values are:
|
oradop
|
The default degree of parallelism used for each reader in the Oracle database during parallel data loading. It must be between 0 and 16. 0 and 1 both mean no parallel query. The default is 1.
|
orapar
|
Specifies the default mechanism for intra-table parallel load. Allowed values are none, auto[(n)], partition[(n)] or hash[(n)].
The default is For details, see the table above. |
Parallel data loading is not supported on Windows. When you run the utility on Windows, you can generate a parallel data load script for Unix or Linux by specifying -target unix. If the target platform is Windows, the utility behaves as if you specified -dataLoadParallelism disabled.
- For each table with intra-table parallel loading enabled, the utility assigns Oracle Database readers based on the explicit configuration or applicable defaults. Each reader processes a subset of the table’s rows using one of the mechanisms partitioning or hashing.
- When querying the Oracle database to retrieve rows, each reader uses parallel query with the specified
dopvalue. Adopvalue of0or1uses a nonparallel query. Each reader has a set of writers that inserts data into the TimesTen table. - The number of writers per reader is specified by the
ttwritersattribute or thetttabwritersdefault. When loading a table, the utility always check the limits for total Oracle readers and total TimesTen threads specified by the-dataLoadParallelismoption.
For inter-table parallelism, the utility groups tables into sets to load together based on their intra-table parallelism settings and the overall limits for Oracle Database readers and TimesTen threads specified by the -dataLoadParallelism option.
Some examples of valid table specifications are:
sometable - table ouser.sometable
scott.tab2 - table scott.tab2
customer:rows=125000 - table ouser.customer with row count 125,000
* - all tables owned by ouser
scott.* - all tables owned by scott
scott.*:rows=1000 - all tables owned by scott applying a row count of 1000 to all of them
For examination and analysis purposes, materialized views are treated as tables. You can control this behavior with the -importMviews option. Regular views are not imported.
For each table examined, the utility generates a TimesTen compatible definition. This definition includes some or all primary key and foreign key definitions, unique and nonunique indexes, bitmap indexes, recommended data type mappings, and compression clauses. Use the available options to control what the utility includes in the generated DDL.
-
Numeric: Standard mapping convertsNUMBERcolumns with a scale of zero to an appropriate TimesTen native integer type. This safe mapping does not risk data truncation and does not require source data analysis. Aggressive mapping analyzes the source tables to identifyNUMBERcolumns whose stored values use less precision or scale than the column definition allows. For those columns, the generated TimesTen definition uses a smaller precision or scale. Aggressive mapping is safe only for the data present when the analysis runs. Later inserts or updates can exceed the mapped precision or scale and may no longer meet the criteria used for the mapping. -
Varlen: The utility analyzes source tables to identifyVARCHAR2andNVARCHAR2columns whose stored data is shorter than the column’s defined size. It then defines smaller columns in TimesTen to reduce space usage. This mapping is safe only for the data present when the analysis runs. Later inserts or updates can exceed the mapped column size and may no longer meet the mapping criteria. -
JSON: A native OracleJSONcolumn is mapped directly to a TimesTenJSONcolumn, and the generatedCreateTables.sqlfile defines the target column asJSON. No conversion to a character or binary data type is performed.The
varfield of the-typeMapoption controlsJSONmaximum-length analysis. Whenvar=1, the utility analyzes nativeJSONvalues and verifies that they fit within the TimesTenJSONlimit. Values that exceed the limit are handled according to the-onBadTypeoption. Whenvar=0, the utility does not perform this validation during analysis. As a result, an oversized value can cause data loading to fail later. -
RAW/LONG/LONG RAW: TimesTen does not support theRAW,LONG, orLONG RAWdata types. This mapping converts source columns of these types to the following compatible TimesTen data types:-
RAW(n)->VARBINARY(n) -
LONG->VARCHAR2(4194304) -
LONG RAW->VARBINARY(4194304)
Oracle Database allows
LONGandLONG RAWvalues up to2GB, but TimesTen limitsVARCHAR2andVARBINARYvalues to4MB. Therefore, some source values cannot fit in TimesTen. After this mapping, the utility also appliesvarlenmapping to anyVARBINARYcolumns resulting fromRAW(n)columns if you specifyvarlenin the type-mapping options. -
-
LOB: TimesTen supportsCLOB,NCLOB, andBLOBdata types. However, thettLoadFromOracle()built-in cannot currently load data intoLOBcolumns. MapLOBs to the following compatible TimesTen types to enable data loading:-
CLOB->VARCHAR2(4194304) -
NCLOB->NVARCHAR2(2097152) -
BLOB->VARBINARY(4194304)
Oracle Database
LOBs can be very large, while TimesTen variable-length types have much smaller maximum sizes. As a result, some values may be too large to fit. WhenLOBcolumns are mapped toVARCHAR2orVARBINARY, the utility also appliesvarlenmapping if you specify it in the type-mapping options. -
Aggressive type mappings (num=2, var=1) and compression evaluation require a full scan of the source tables to analyze their data.
-compression option parameters control:
- The
minrowsparameter specifies the minimum number of rows a table must contain before the utility considers compressing it. Tables with fewer rows are never compressed. You can specify a value from1to9223372036854775807. A value of1considers every table for compression. The default value is1024. - The padding factor (
paddingoption). Once the number of distinct values in a column is determined by data analysis, it is increased bypaddingpercent to allow for future changes in the source data. - The
cfactorparameter specifies the minimum required compression factor. The utility first estimates how much storage is saved by compressing each table column. If the estimated compression factor (estimated compressed size divided by the estimated uncompressed size) is lower thancfactor(lower values mean higher compression), then the column is a candidate for compression. After evaluating all candidate columns, the utility estimates the compression savings for the entire table if it compresses those columns. The utility compresses the table when the estimated compression factor is less than or equal tocfactor. You can specifycfactorfrom1%(100xcompression) to100%(no compression). The default is70%.
Consider the following information about source data analysis and error handling:
- If the utility scans a table for multiple purposes, such as row counts, type mapping, or compression evaluation, it performs all required analysis in a single scan. It does not scan the same table multiple times.
- The utility scans any tables without specified row counts to determine their row counts. It writes the results to the generated
tableList.txtfile. - By default, the utility uses parallel query at the source database’s default degree of parallelism when it analyzes data. Specify
-parallel 0to disable parallel query, or specify-parallelwith a value from2through128to request an explicit degree of parallelism.The source database configuration determines whether it can use the requested degree of parallelism. The
-paralleloption affects only data analysis. The-dataLoadParallelismoption and table specification attributes separately control parallel query during data loading. - Scanning and analyzing source data can be resource-intensive and time-consuming. The required time depends on factors such as the number of rows, the number and data types of analyzed columns, and source database performance. In general, determining row counts and optimizing
VARCHAR2/NVARCHAR2storage (-typeMap x,1) are faster and less expensive than evaluating compression (-compression 1or2) and optimizingNUMBERdata types (-typeMap 2).TimesTen supports only certain source data types. If the utility encounters a column with an unsupported or unrecognized data type, it reports the issue, skips the column, and continues processing by default. Use the-onBadTypeoption to change this behavior:-
0: Stop processing -
1: Skip the table -
2: Skip the column (default)
-
-
[fnprefix]TableList.txt- lists all tables evaluated during the run in a format suitable for use with the-tableFileoption. -
[fnprefix]CreateUsers.sql- creates the TimesTen database user. -
[fnprefix]DropTables.sql- drops all the tables. -
[fnprefix]CreateTables.sql- creates all the tables. -
[fnprefix]DropIndexes.sql- drops all the indexes and foreign keys. -
[fnprefix]CreateIndexes.sql- creates all the indexes, primary keys and foreign keys. -
[fnprefix]UpdateStats.sql- updates TimesTen optimizer statistics for each table. -
[fnprefix]LoadData.sql- loads data into TimesTen tables from the source tables; tables with LOB columns are not included in this script. -
[fnprefix]ttPDL.sh- loads table data in parallel. Use it instead of theLoadData.sqlscript to take advantage of parallel data loading. This script is not generated when the target platform is Windows.
ttIsql command prompt as follows: Command> @CreateUsers;
Alternatively, you can run the scripts in batch mode from the operating system command line as follows:
$ ttIsql -f CreateUsers.sql MyDSN
Run the SQL scripts as the TimesTen instance administrator (the user who installed TimesTen) or as a user with appropriate permissions on all the tables. Before creating tables, create the users in the TimesTen database. You can use the CreateUsers.sql script to create users. Only the TimesTen instance administrator can create users.
Run the UpdateStats.sql script as the instance administrator or as the user who owns the affected tables. To run the script as any other user, grant that user the ALTER ANY TABLE system privilege.
LoadData.sql script as a TimesTen database user who also exists in the backend Oracle Database. You must specify the TimesTen and Oracle user credentials in the connection string. For example: ttIsql -f LoadData.sql "DSN=MyDSN;UID=scott;PWD=test;OraclePWD=test"
In addition, configure the TimesTen DSN to connect to the source Oracle Database. You must specify an appropriate value for the OracleNetServiceName attribute either in the DSN definition or as part of the connection string.
ttPDL.sh script with a TimesTen connection string that includes a DSN and UID. If you omit PWD and OraclePWD, the script prompts you for their values, which is more secure than specifying them on the command line. For example:ttPDL.sh "DSN=MyDSN;UID=scott"