ttImportFromOracle
ttImportFromOracle analyzes a set of tables in an Oracle database and generates various SQL script files to allow those tables and their data to be imported into TimesTen. Options are available to import associated objects, such as primary and foreign keys. A key feature is the ability to analyze the table schema and data content to recommend the optimal data type mapping and compression. The main features of ttImportFromOracle are:
-
Generates optimized scripts for importing objects from Oracle to TimesTen while minimizing the memory required to store those objects in TimesTen.
-
Supports Oracle databases configured with
MAX_STRING_SIZE=EXTENDEDand validates extended columns individually. -
Maps native Oracle
JSONcolumns to the TimesTenJSONdata type. The maximum supported TimesTenJSONsize is4,194,304bytes. -
Optional data type mapping helps conserve storage space by mapping Oracle
NUMBERcolumns to the most appropriate TimesTen native types or lower-precisionNUMBERtypes, and by mapping[N]VARCHAR2columns to smaller maximum lengths based on an analysis of the Oracle source data. -
Provides multiple options for mapping
RAW,LONG,LONG RAW, andLOBdata types to compatible TimesTen data types. -
Optional Compression Evaluation and Compression Clause Generation based on data analysis in Oracle.
-
Analyzes one or more Oracle tables in a single invocation.
-
Selectively include or exclude the import of primary keys, foreign keys, unique indexes, non-unique indexes, bitmap indexes, and materialized views.
-
The generated scripts invoke
ttLoadFromOracle()built-in that enables parallel data loading to minimize elapsed time and maximize hardware utilization. -
Handles tables containing columns with unsupported data types.
-
Provides detailed size estimates for tables and indexes.
-
Provides an extensive set of options for greater flexibility.
Note:
To use this utility, you must ensure that the following prerequisites are met:- The utility supports Oracle Database 19c, 23ai, and 26ai releases. Oracle Database 23ai and later releases support the
JSONdata type. Older versions are not supported. - Supports on a wide range of platforms:
- Linux ARM 64-bit
- Linux x86 64-bit
- The system on which you plan to run the utility must have a compatible Oracle Client installed (Oracle Instant Client is sufficient) and configured to connect to the Oracle database.
- Before running the utility, ensure that your shell environment is properly configured, including variables such as
PATHandLD_LIBRARY_PATH(or the equivalent on your platform).
Required Privilege
CREATE SESSIONSELECTprivilege on the source tables being imported- Access to the Oracle metadata views required by the utility, including
ALL_TABLES,ALL_TAB_COLUMNS,ALL_INDEXES, andALL_CONSTRAINTS. - When
consistency=2(see Detailed Description of Options) is specified forttImportFromOracle, the Oracle user must also be granted execute privileges onDBMS_FLASHBACK:GRANT EXECUTE ON DBMS_FLASHBACK TO oracle_user;
CREATE SESSIONto connect to the TimesTen databaseCREATE TABLEto runCreateTables.sqlCREATE INDEXto runCreateIndexes.sql, including the creation of primary and foreign keysINSERTprivilege on the target tables to runLoadData.sqlorttPDL.sh. This privilege is implicit when the account owns the tables.- Permission to update optimizer statistics for
UpdateStats.sql. - Ownership of the target tables and indexes, or equivalent privileges, to run
DropTables.sqlandDropIndexes.sql. - TimesTen instance administrator privileges are required only to run
CreateUsers.sql, which creates the TimesTen database user.
Syntax
ttImportFromOracle [-h | -help | -? [full] ]
ttImportFromOracle [-V | -version]
ttImportFromOracle -oraConn ouser[/opasswd][@oserver]
[-ttOwner ttuser]
[-tables tablespec [tablespec]...]...
[-tableFile filepath]...
[-importMviews { 0 | 1 }]
[-typeMap num[,var[,rawlong[,lob[,tstz[,padding[,stats]]]]]]]
[-compression level[,padding[,stats[,cfactor[,minrows]]]]]
[-inlineLimit n]
[-parallel dop]
[-dataLoadParallelism dlpspec]
[-indexes unique[,nonunique[,bitmap[,nodups]]]]
[-constraints pkey[,fkey]]
[-outputDir dirpath]
[-prefix fnprefix]
[-target { unix | windows }]
[-onBadType { 0 | 1 | 2 }]
[-verbosity { 0 | 1 }] Options
ttImportFromOracle has these options:
| Option | Description |
|---|---|
-h | -help | -? [full] |
Shows help (showing the above syntax). |
-V | -version |
Displays the release number. |
-oraConn ouser[/opasswd][@oserver] |
Specifies connection credentials for the source Oracle database.
|
-ttOwner ttuser |
Controls object ownership in TimesTen.
|
-tables tablespec [tablespec]... |
Specifies tables to be imported.
This option can be specified multiple times to build up a list of tables to be imported. |
-tableFile filepath |
Specify a file containing a list of table specifications.
|
-importMviews { 0 | 1 } |
Controls whether materialized views are imported.
|
-typeMap num | var | rawlong | lob | tstz | padding | stats |
Controls how source column data types are mapped to TimesTen types.
Example 1: Example 2: -typeMap 2,1The values are num=2, var=1, and the rest are default.
-typeMap 0,1,0,0,0,50 The values are |
-compression level[,padding[,stats[,cfactor[,minrows]]]] |
Controls compression evaluation and clause generation.
|
-inlineLimit n
|
Controls INLINE/NOT INLINE storage for variable length types.
The minimum allowed value is |
-parallel dop |
Specifies the degree of parallelism used when querying the source database in the analysis phase.
By default, the analysis uses the source database’s default degree of parallelism. This option does not affect parallel data loading. |
-dataLoadParallelism dlpspec |
Specifies values and defaults for parallel data loading into TimesTen. This is the advanced usage option. In most cases, the default settings provide good performance. You should only use this option if you have a good understanding of the way in which parallel data loading is implemented.
For details, see the full |
-indexes unique | nonunique | bitmap | nodups |
Controls how indexes on source tables are imported into TimesTen.
Example:
-indexes 0,1,1,1 The values are |
-constraints pkey[,fkey] |
Controls how constraints on source tables are imported into TimesTen.
Example:
-constraints 1,1 The values are |
-outputDir dirpath |
Specifies the location for the output files.
|
-prefix fnprefix |
Controls the naming of the output files.
|
-target unix | windows |
Specifies the target platform for the output files and scripts.
The default is the platform on which the utility runs. |
|
|
Specifies the action to take when the utility encounters an unsupported data type or finds an oversized JSON value during variable-length analysis. The utility validates JSON overflow only when you enable variable-length analysis by setting var=1 in the -typeMap option.
Native Oracle Example: JSON maximum-length validation is performed when the var component of -typeMap is set to 1. -typeMap 1,1 If analysis finds a
JSON value larger than 4,194,304 bytes, -onBadType determines the action:
If variable-length analysis is disabled, the utility does not detect oversized |
-verbosity 0 | 1 |
Controls the volume and type of output messages.
|
For example, see Usage Example.