Import and Export Operations

Use ttGridAdmin commands in this section to import and export databases, display the status of those operations, or delete an export.

Also see Migrating, Backing Up and Restoring Data in Oracle TimesTen In-Memory Database Scaleout User's Guide.

Export a Database (dbExport)

The dbExport command exports data from the specified database into a specified repository. The dbExport and dbImport commands are used, for example, to migrate a database between two grids or between versions of TimesTen that are not patch-compatible. See Migrating, Backing Up and Restoring Data in Oracle TimesTen In-Memory Database Scaleout User's Guide for additional information.

ttGridAdmin dbExport dbname 
                     -repository reponame 
                     [-name exportname]

An export is stored as a collection under a repository. You first must create the repository. See Repository Operations.

Options

The dbExport command has the options:

Option Description

dbname

Name of the database to export.

-repository reponame

Name of the repository where the export will be stored.

-name exportname

Specifies a name for the export. The default is the letter "M" followed by the date and time of the backup, in the format:

Myyyymmddhhmmss

Examples

% ttGridAdmin dbExport database1 -repository repo1 -name exp_db1
...
dbExport exp_db1 started

You can then use dbExportStatus to check progress, as shown in the example in Display the Status of a Database Export (dbExportStatus). The export is finished when each element and the database as a whole are indicated as complete.

Notes

  • The export is performed asynchronously. Use the dbExportStatus command to check progress.

  • Each replica set of the database is stored as a sub-collection.

  • The database must be in a closed state with all connections closed when you run dbExport.

  • Only one dbExport command can be run for a database at any given time, and dbExport cannot run concurrently with dbImport.

  • For disk space requirements, see Exporting and Importing a Database in Oracle TimesTen In-Memory Database Scaleout User's Guide.

Delete a Database Export (dbExportDelete)

The dbExportDelete command deletes the specified database export.

ttGridAdmin dbExportDelete -repository reponame
                           -name exportname

Options

The dbExportDelete command has the options:

Option Description

-repository reponame

Name of the repository where the export is stored.

-name exportname

Name of the export to delete.

Examples

This example deletes the export created in Export a Database (dbExport).

% ttGridAdmin dbExportDelete -repository repo1 -name exp_db1
Export exp_db1 deleted

Notes

This command is typically used to delete old or failed exports.

Display the Status of a Database Export (dbExportStatus)

The dbExportStatus command shows the status of a database export or exports previously started.

ttGridAdmin dbExportStatus dbname 
                           [-name exportname]

Options

The dbExportStatus command has the options:

Option Description

dbname

Name of the database being exported.

-name exportname

Name of the export to check. The default is all exports of the specified database.

Examples

This example shows status upon completion of the export from the example in Export a Database (dbExport). (That is the only export for database1 in the repository.)

% ttGridAdmin dbExportStatus database1
Database  Export  Repository Host  Instance  Elem State     Started
--------- ------- ---------- ----- --------- ---- --------- ------------------------
database1 exp_db1 repo1                           Completed 2017-03-02T14:42:24.000Z
                             host3 instance1    1 Complete
                             host4 instance1    2 Complete
                             host5 instance1    3 Complete

Notes

When you believe the export is complete, confirm that dbExportStatus shows Complete for the export as a whole and for every instance. If there were any failures, see Check the Status of a Database Export in Oracle TimesTen In-Memory Database Scaleout User's Guide.

Import a Database (dbImport)

The dbImport command imports data from a specified previous export into the specified database. The dbExport and dbImport commands are used, for example, to migrate a database between two grids or between releases of TimesTen that are not patch-compatible.

ttGridAdmin dbImport dbname 
                     -repository reponame 
                     -name exportname 
                     [-ckptFreq mb]
                     [-updateStats]
                     [-estimateStats pct]
                     [-numThreads num]
                     [-batchSize rows]
                     [-dbCacheCredentialCheck]
                     [-errorTolerance level]

Options

The dbImport command has the options:

Option Description

dbname

Name of the database where the data is to be imported.

-repository reponame

Name of the repository where the export is located.

-name exportname

Name of the export to use for the import.

-ckptFreq mb

Checkpoint frequency, in terms of how many megabytes have been imported. A checkpoint is written each time that many megabytes have been imported. The default is to write no checkpoints during the import.

-updateStats

Updates statistics on each table as it is imported.

Also see Notes below.

-estimateStats pct

Estimates statistics on each table as it is imported, by reading the specified percentage of rows of each table.

Also see Notes below.

-numThreads num

Restores database objects in parallel using the specified number of threads. Valid values are 1 through 32. The default value is 4.

-batchSize rows

Specifies the number of rows processed simultaneously per thread. The default value is 256.

-dbCacheCredentialCheck

Verifies that the cache admin credentials have been set for the specified database before starting the import operation.

-errorTolerance level

Specifies the level of error tolerance. Valid values are 0 or 3. The default values is 0.

If you specify 0, there is no error tolerance. The command terminates the import operation after encountering an error. If the operation encountered an error, the operation is marked as Import_Phase_Failed upon termination, where Phase represents the last phase of the operation that the command attempted to complete.

If you specify 3, the command ignores any errors and completes the import operation. If the operation encountered an error, the operation is marked as Import_Complete_With_Errors upon completion.

Also see Notes below.

Examples

This example imports the export created in the example in Export a Database (dbExport), into a database imp_db1.

% ttGridAdmin dbImport imp_db1 -repository repo1 -name exp_db1
dbImport exp_db1 started

You can then use dbImportStatus to check progress, as shown in the example in Display the Status of a Database Import (dbImportStatus). The import is finished when each element and the database as a whole are indicated as complete.

Notes

  • The database must already be created and loaded and must have a distribution map, but must be closed, with all connections closed, when you run dbImport.

  • The import is performed asynchronously. Use the dbImportStatus command to check progress.

  • Only one dbImport command can run for a database at any given time, and dbImport cannot run concurrently with dbExport.

  • For disk space requirements, see Exporting and Importing a Database in Oracle TimesTen In-Memory Database Scaleout User's Guide .

  • If you specify both -estimateStats and -updateStats, statistics on imported tables are updated, not estimated.

  • Functionality of the -ckptFreq, -updateStats, and -estimateStats options is the same as for equivalent options of the ttMigrate utility. See ttMigrate.

  • If the export contains cache groups and the cache admin credentials have not been set for the database, the dbImport command prompts for the cache administration user id and password used for connecting to the Oracle database.

  • If you specify the -dbCacheCredentialCheck option and the cache admin credentials have not been set for the database, TimesTen returns an error. See Register the Cache Administration User Name and Password in the TimesTen Database in Oracle TimesTen In-Memory Database Scaleout User's Guide.

  • The import sets the autorefresh state to OFF and imports no data to cache groups. Once the import is complete, you will need to set the autorefresh state to PAUSED and load the cache groups. See Managing the Autorefresh State and Manually Load the Cache Group in the Oracle TimesTen In-Memory Database Scaleout User's Guide.

  • An export from a newer TimesTen release may contain unsupported features or SQL objects. Generally, any unsupported feature generates a warning and terminates the import operation. Use -errorTolerance 3 to have dbImport ignore the warning, skip the unsupported feature, and complete the import.

Display the Status of a Database Import (dbImportStatus)

The dbImportStatus command shows the status of a database import previously started.

ttGridAdmin dbImportStatus dbname
                           [-name exportname]

Options

The dbImportStatus command has the options:

Option Description

dbname

Name of the database where the import is being checked.

-name exportname

Name of the export from which the data is being imported. You can use this option in the atypical scenario where there are multiple imports into the same database (otherwise, the status of all the imports would be shown).

Examples

This example shows status upon completion of the import from the example in Import a Database (dbImport).

% ttGridAdmin dbImportStatus imp_db1 -name exp_db1
Database Import  Repository Host  Instance  Elem State                  Started
-------- ------- ---------- ----- --------- ---- ---------------------- ------------------------
imp_db1  exp_db1 repo1                           Import_Finale_Complete 2016-07-25T17:53:27.000Z
                            host1 instance1    1 Import_Rows_Complete
                            host3 instance1    3 Import_Rows_Complete

Note:

When you believe the import is complete, confirm that dbImportStatus shows Complete for the import as a whole and for every instance. If there were any failures, see Check the Status of a Database Import in Oracle TimesTen In-Memory Database Scaleout User's Guide.