solidDB Help : Samples : solidDB tools sample
  
solidDB tools sample
This sample describes how to complete the following tasks by using a number of solidDB tools and scripts:
Import records into the table by using solidDB Speed Loader, see solidDB Speed Loader (solloado and solload).
Export records from a table by using solidDB Export, see solidDB Export (solexp).
Print the database definitions by using solidDB Data Dictionary, see solidDB Data Dictionary (soldd).
The sample consists of three sets of scripts (one for each solidDB tool) that are located in subdirectories of the soliddb-installdir\samples\importexport directory. For general information about running the samples, see Samples.
Note The commands that are listed in the following sections assume that the connect string is ”tcp 2315” and the user name and password are both dba. If these are not the correct values for your environment, change these values in the commands as appropriate.
Import records
Complete the following steps to create a table and import data into the table:
1 Start a solidDB server.
2 Create a sample table by running the following command in the samples\importexport\solload directory:
solsql "tcp 2315" dba dba load.sql
Result: The table TEST1 is created with the columns that are listed in the command output.
3 Import records into the table by running one of the following commands in the samples\importexport\solload directory:
To import a set of records by using a control file that uses a comma-delimited format, run the following command:
solload "tcp 2315" dba dba delim.ctr
To import a set of records by using a control file that uses a fixed-length format, run the following command:
solload -b500 "tcp 2315" dba dba fixed.ctr
Result: A number of rows are loaded into the table. The same set of data is used for both commands, so if you run both commands, you get duplicate records in the table.
Export records
Complete the following steps to export records from a table:
1 Start a solidDB server.
2 Export records from the system table SYS_TABLES by running the following command in the samples\importexport\solexp directory:
solexp "tcp 2315" dba dba SYS_TABLES
Result: Two files are created in the samples\importexport\solexp directory:
_SYSTEM_SYS_TABLES.dat: A data file that contains the exported data in comma-delimited format.
_SYSTEM_SYS_TABLES.ctr: A control file that specifies the format of the data file and can be used with solload to import the data to another table.
Print data definitions
Complete the following steps to print the data definitions for a database:
1 Start a solidDB server.
2 (Optional) If you do not already have any content in your database, create a sample table by running the following command in the samples\importexport\solload directory:
solsql "tcp 2315" dba dba load.sql
3 Print the data definitions for the database by running the following command in the samples\importexport\soldd directory:
soldd -o soldd.out "tcp 2315" dba dba
Result: A file soldd.out is created in the samples\importexport\soldd directory that lists all the data definitions for the database:
Go up to
Samples