<commit_before># Database migration

###### Please note that this is an open source project which is *not officially supported* by Exasol. We will try to help you as much as possible, but can't guarantee anything since this is not an official Exasol product.

## Table of Contents
1. [Overview](#overview)
2. [Migration source:](#migration-source)
    * [CSV](#csv)
    * [DB2](#db2)
    * [Exasol](#exasol)
    * [MySQL](#mysql)
    * [Oracle](#oracle)
    * [PostgreSQL](#postgres)
    * [Redshift](#redshift)
    * [S3](#s3)
    * [SQL Server](#sqlserver)
    * [Teradata](#teradata)
    * [Vectorwise](#vectorwise)
    * [Vertica](#vertica)
3. [Post-load optimization](#post-load-optimization)
4. [Delta import](#delta-import)


## Overview

This project contains SQL scripts for automatically importing data from various data management systems into Exasol.

You'll find SQL scripts which you can execute on Exasol to load data from certain databases or
database management systems. The scripts try to extract the meta data from the source system and create the appropriate IMPORT statements automatically so that you don't have to care about table names, column names and types.

If you want to optimize existing scripts or create new scripts for additional systems, we would be very glad if you share your work with the Exasol user community.

## Migration source
### CSV
The method of importing a CSV file depends on the location of the file.
- Import a file stored on your **local machine** via EXAplus:
```sql
IMPORT INTO <table> FROM LOCAL CSV FILE '<filename>' <options>;
```
- Import from **HDFS**: See [SOL-322](https://www.exasol.com/support/browse/SOL-322)

- Import from **S3**: See [Exasol-1774](https://www.exasol.com/support/browse/Exasol-1774) for single file import, for importing multiple files scroll down to [S3](#s3)

For more details on `IMPORT` see paragraph 2.2.2 of the User Manual

### DB2
See script [db2_to_exasol.sql](db2_to_exasol.sql)
### Exasol
See script [exasol_to_exasol.sql](exasol_to_exasol.sql)
### MySQL

Create a connection:
```SQL
CREATE CONNECTION <name_of_connection>
TO 'jdbc:mysql://192.168.137.5:3306'
USER '<user>'
IDENTIFIED BY '<password>';
```

Test your connection:<commit_msg>Added sentence about CSV-Import to README<commit_after># Database migration

###### Please note that this is an open source project which is *not officially supported* by Exasol. We will try to help you as much as possible, but can't guarantee anything since this is not an official Exasol product.

## Table of Contents
1. [Overview](#overview)
2. [Migration source:](#migration-source)
    * [CSV](#csv)
    * [DB2](#db2)
    * [Exasol](#exasol)
    * [MySQL](#mysql)
    * [Oracle](#oracle)
    * [PostgreSQL](#postgres)
    * [Redshift](#redshift)
    * [S3](#s3)
    * [SQL Server](#sqlserver)
    * [Teradata](#teradata)
    * [Vectorwise](#vectorwise)
    * [Vertica](#vertica)
3. [Post-load optimization](#post-load-optimization)
4. [Delta import](#delta-import)


## Overview

This project contains SQL scripts for automatically importing data from various data management systems into Exasol.

You'll find SQL scripts which you can execute on Exasol to load data from certain databases or
database management systems. The scripts try to extract the meta data from the source system and create the appropriate IMPORT statements automatically so that you don't have to care about table names, column names and types.

If you want to optimize existing scripts or create new scripts for additional systems, we would be very glad if you share your work with the Exasol user community.

## Migration source
### CSV
The method of importing a CSV file depends on the location of the file.
- Import a file stored on your **local machine** via EXAplus:
```sql
IMPORT INTO <table> FROM LOCAL CSV FILE '<filename>' <options>;
```
- Import from **HDFS**: See [SOL-322](https://www.exasol.com/support/browse/SOL-322)

- Import from **S3**: See [Exasol-1774](https://www.exasol.com/support/browse/Exasol-1774) for single file import, for importing multiple files scroll down to [S3](#s3)

For more details on `IMPORT` see paragraph 2.2.2 in the User Manual. For further help on typical CSV-formatting issues, see [SOL-578](https://www.exasol.com/support/browse/SOL-578).

### DB2
See script [db2_to_exasol.sql](db2_to_exasol.sql)
### Exasol
See script [exasol_to_exasol.sql](exasol_to_exasol.sql)
### MySQL

Create a connection:
```SQL
CREATE CONNECTION <name_of_connection>
TO 'jdbc:mysql://192.168.137.5:3306'
USER '<user>'
IDENTIFIED BY '<password>';
```

Test your connection:
{'fraction_non_alphanumeric': 0.11566840277777778, 'fraction_numerical': 0.020833333333333332, 'mean_word_length': 4.60705596107056, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 5, 'lorem ipsum': 0, 'www.': 5, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4342730', 'n_tokens_mistral': 1513, 'n_tokens_neox': 1373, 'n_words': 541}