To extract a remote SQL Anywhere database from a consolidated SQL Anywhere database.
dbxtract [ options ] [ directory ] subscriber
Option | Description | ||
---|---|---|---|
@data |
Read in options from a configuration file. See @data server option. Use this option to read in options from the specified environment variable or configuration file. If both exist with the same name, the environment variable is used. See Using configuration files. If you want to protect passwords or other information in the configuration file, you can use the File Hiding utility to obfuscate the contents of the configuration file. See File Hiding utility (dbfhide). |
||
-ac "keyword=value; ..." |
Connect to the database specified in the connect string to do the reload. You can combine the operation of unloading a database and reloading the results into an existing database using this option. For example, the following command (entered all on one line) loads a copy of the data for the field_user subscriber into an existing database file named c:\newdata.db:
If you use this option, no copy of the data is created on disk, so you do not specify an unload directory in the command. This provides greater security for your data, but at some cost for performance. |
||
-al filename | Specify the log file name for the new database. | ||
-an database |
Create a database file with the same settings as the database being extracted and automatically reload it. You can combine the operations of unloading a database, creating a new database, and loading the data using this option. For example, the following command (entered all on one line) creates a new database file named c:\mydatacopy.db and copies the schema and data for the field_user subscriber of c:\mydata.db into it:
If you use this option, no copy of the data is created on disk, so you do not specify an unload directory in the command. This provides greater security for your data, but at some cost for performance. |
||
-ap size |
Set the page size of the new database. This option is ignored unless -an is used. The page size for a database can be (in bytes) 2048, 4096, 8192, 16384, or 32768, with the default being the page size of the original database. If there are already databases running on the database server, the server's page size (set with the -gp option) must be large enough to handle the new page size. See -gp server option. |
||
-b |
Do not start subscriptions. If this option is specified, subscriptions at the consolidated database (for the remote database) and at the remote database (for the consolidated database) must be started explicitly using the START SUBSCRIPTION statement for replication to begin. See START SUBSCRIPTION statement [SQL Remote]. |
||
-c "keyword=value; ..." |
Supply database connection parameters, in a string:
|
||
-d |
Extract data only. If this option is specified, the schema definition is not unloaded, and publications and subscriptions are not created at the remote database. This option is used when a remote database already exists with the proper schema, and only needs to be filled with data. |
||
-ea alg |
Specify the encryption algorithm for the new database. This option allows you to choose a strong encryption algorithm to encrypt your new database. You can choose either AES (the default) or AES_FIPS for the FIPS-approved algorithm. AES_FIPS uses a separate library and is not compatible with AES. For greater security, specify AES or AES256 for 128-bit or 256-bit strong encryption, respectively. Specify AES_FIPS or AES256_FIPS for 128-bit or 256-bit FIPS-approved encryption, respectively. For strong encryption, you must also specify the -ek or -ep option. For more information about strong encryption, see Strong encryption. To create a database that is not encrypted, specify -ea none, or do not include the -ea option (and do not specify -e, -et, -ep, or -et). If you do not specify the -ea option, the default behavior is as follows:
Algorithm names are case insensitive. Separately licensed component requiredECC encryption and FIPS-certified encryption require a separate license. All strong encryption technologies are subject to export regulations. |
||
-ek key |
Specify the encryption key for the new database. This option allows you to create a strongly encrypted database by specifying an encryption key directly in the command. The algorithm used to encrypt the database is AES or AES_FIPS as specified by the -ea option. If you specify the -ek option without specifying -ea, the AES algorithm is used. CautionFor strongly encrypted databases, be sure to store a copy of the key in a safe location. If you lose the encryption key there is no way to access the data, even with the assistance of technical support. The database must be discarded and you must create a new database. |
||
-ep |
Prompt for the encryption key for the new database. This option specifies that you want to create a strongly encrypted database by typing the encryption key in a window. This provides an extra measure of security by never allowing the encryption key to be seen in clear text. You must input the encryption key twice to confirm that it was entered correctly. If the keys don't match, the initialization fails. See Strong encryption. |
||
-er |
Remove encryption from encrypted tables during an unload procedure. When extracting from a database that has table encryption enabled, you must specify either -er or -et to indicate whether the new database has table encryption enabled, otherwise you get an error when attempting to load the data into the new database. The following command extracts a database (mydata.db) that has encrypted tables, into a new database (mydatacopy.db) that does not have table encryption enabled, removing encryption from any encrypted tables:
|
||
-et |
Enable database table encryption in the new database (-an or -ar must also be specified). If you specify the -et option without the -ea option, the AES algorithm is used. If you specify the -et option, you must also specify -ep or -ek. You can change the table encryption settings for the new database to be different than those of the database you are unloading. When rebuilding a database that has table encryption enabled, you must specify either -er or -et to indicate whether the new database has table encryption enabled, otherwise you get an error when attempting to load the data into the new database. The following example unloads a database (mydata.db) that has tables encrypted with the simple encryption algorithm, into a new database (mydatacopy.db) that has table encryption enabled, and uses AES_FIPS encryption with the key 34jh:
|
||
-f |
Extract fully qualified publications. In most cases, you do not need to extract fully qualified publication definitions for the remote database, since it typically replicates all rows back to the consolidated database. However, you may want fully qualified publications for multi-tier setups or for setups where the remote database has rows that are not in the consolidated database. |
||
-ii |
Perform internal unload and internal reload. Using this option forces the reload script to use the internal UNLOAD and LOAD TABLE statements rather than the Interactive SQL OUTPUT and INPUT statements to unload and load data, respectively. This combination of operations is the default behavior. External operations take the path of the data files relative to the current working directory of dbxtract, while internal statements take the path relative to the server. |
||
-ix |
Perform internal unload and external reload. Using this option forces the reload script to use the internal UNLOAD statement to unload data, and the Interactive SQL INPUT statement to load the data into the new database. External operations take the path of the data files relative to the current working directory of dbxtract, while internal statements take the path relative to the server. |
||
-l level |
Perform all extraction operations at specified isolation level. The default setting is an isolation level of zero. If you are extracting a database from an active server, you should run it at isolation level 3 to ensure that data in the extracted database is consistent with data on the server. Increasing the isolation level may result in large numbers of locks being used by the Extraction utility, and may restrict database use by other users. See Extraction utility. |
||
-n |
Extract the schema definition only. With this definition, none of the data is unloaded. The reload file contains SQL statements to build the database structure only. You can use the SYNCHRONIZE SUBSCRIPTION statement to load the data over the messaging system. Publications, subscriptions, PUBLISH, and SUBSCRIBE permissions are part of the schema. |
||
-nl |
Extract the structure (the same behavior as the -n option), but the resulting reload.sql file also includes LOAD TABLE or INPUT statements for each table. No user data is extracted when this option is used. When
you specify -nl, you must also include a data directory so that the LOAD/INPUT statements can be generated, even though no
files are written to the directory. This option allows you to generate a reload script without unloading data. You can extract
the data by specifying -d. If a database contains a table whose data should not be unloaded, unloading of the data for that
table can be skipped using |
||
-o file |
Output messages to a file. |
||
-p character |
Specify an escape character. The default escape character (\) can be replaced by another character using this option. |
||
-q |
Operate quietly: do not display messages or show windows. When this option is specified, -y must also be specified or the operation fails. This option is available only for the command line utility. |
||
-r file |
Specify the name of the generated reload Interactive SQL command file. The default name for the reload command file is reload.sql in the current directory. You can specify a different file name with this option. |
||
-u |
Do not order data during the unload. By default the data in each table is ordered by primary key. Unloads are faster with the -u option, but loading the data into the remote database is slower. |
||
-v |
Display verbose messages. The name of the table being unloaded and the number of rows unloaded appear, as well as the SELECT statement used. |
||
-xf |
Exclude foreign keys. You can use this option if the remote database contains a subset of the consolidated database schema, and some foreign key references are not present in the remote database. |
||
-xh | Exclude procedure hooks. | ||
-xi |
Perform an external unload and internal reload. The default behavior for unloading the database is to use the UNLOAD statement, which is executed by the database server. If you choose an external unload, dbxtract uses the OUTPUT statement instead. The OUTPUT statement is executed on the client. External operations take the path of the data files relative to the current working directory of dbxtract, while internal statements take the path relative to the server. |
||
-xp |
Do not extract stored procedures from the database. |
||
-xt |
Do not extract triggers from the database. |
||
-xv |
Do not extract views from the database. |
||
-xx |
Perform an external unload and an external load. Use the OUTPUT statement to unload the data, and the INPUT statement to load the data into the new database. The default unload behavior is to use the UNLOAD statement, and the default loading behavior is to use the LOAD TABLE statement. The internal UNLOAD and LOAD TABLE statements are faster than OUTPUT and INPUT. External operations take the path of the data files relative to the current working directory of dbxtract, while internal statements take the path relative to the server. |
||
-y |
Overwrite the command file without confirmation. Without specifying this option, you are prompted to confirm the replacement of an existing command file. |
||
directory | Specify the directory the files are written to. This is not needed if you specify -an or -ac . | ||
subscriber | Specify the subscriber for whom the database is being extracted. |
The Extraction utility creates a command file and a set of associated data files. The command file can be run against a newly-initialized database to create the database objects and load the data for the remote database.
By default, the command file is named reload.sql.
If the remote user is a group, then all the user IDs that are members of that group are extracted. This allows multiple users on a remote database with different user IDs, without requiring a custom extraction process.
When using dbxtract with a version 10.0.0 or later database, the version of dbxtract used must match the version of the database server used to access the database. If an older version of dbxtract is used with a newer database server, or vice versa, an error is reported.
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |