Code Extraction
Instructions to extract Oracle code.
To start a migration to snowflake we first need to extract the code from the oracle database.
For that task we provide a simple tool to help exporting your Oracle Code so it can be migrated to Snowflake.

Installation

1
$ pip3 install snowconvert-export-oracle --upgrade
Copied!
You can use sudo if you are installing to the system site packages. snowconvert-export-oracle can be installed using the --user option, which does not require sudo for example:$ pip3 install snowconvert-export-oracle --upgrade --user
After installation you can test if the tool is properly installed by running
1
$ sc-oracle-export -h
Copied!
If the tool is properly installed you will see an output like:
1
usage: sc-oracle-export [-h|-H] [-U|--user USER] [-P|--password PASSWORD] [-HO|--host HOST] [-S|--service SERVICE] [--as-sysdba]
2
3
Mobilize.NET Oracle Code Export ToolsVersion X.X.X
4
5
optional arguments:
6
-h , --help Show this help message and exit
7
-S , --service Service name. For example ORCL
8
-HO , --host Host
9
-U , --user Login ID for server
10
-P , --password The password for the given user.
11
--as-sysdba Connect as sysdba
Copied!

Running the tools

First create a folder for your extraction
1
$ mkdir OracleExport
2
$ cd OracleExport
Copied!
Run the tool passing the service name host, user and password
1
$ ./sc-oracle-export -S <service-name> -HO <host> -U <user> -P <password>
Copied!
For example for a local installation you will run it like this:
1
$ ./sc-oracle-export -S orcl -HO localhost:1521 -U system -P manager
Copied!
The tool will ask to install the SQLCL and the JDK. If you do not have sqlplus or sqlcl installed it is better to follow this step if no type no. You will then be asked for: INCLUDE_OPERATOR,INCLUDE_CONDITION, EXCLUDE_OPERATOR, EXCLUDE_CONDITION These values are used to customize which schemas are included or not.
An example of the output of the tool will be:
1
This script will install the Oracle SQLCL tool and JDK to enable connection to your database
2
Install tools to connect to Oracle (yes/no/cancel)
3
no
4
Creating the scripts to export object DDLs
5
Updating DDL export scripts....
6
1. Enter value for the 'INCLUDE_OPERATOR' (e.g. LIKE, IN, =, NOT IN, NOT LIKE): LIKE
7
2. Enter value for the 'INCLUDE_CONDITION': (OWNER1, ONWER2)
8
3. Enter value for the 'EXCLUDE_OPERATOR' (e.g. LIKE, IN): IN
9
4. Enter value for the 'EXCLUDE_CONDITION': ('SCHEMA3', 'SCHEMA4')
10
If nothing was entered, we will be using these default values: 1=LIKE 2=(OWNER1, ONWER2) 3=IN 4=('SCHEMA3', 'SCHEMA4')
11
12
NOTE: Run this script with your oracle tools. For example sqlplus USER/[email protected]/SERVICE @./scripts/create_ddls.sql
13
Cleaning up empty output files
14
15
You can now run the script ./scripts/create_ddls.sql to export your Oracle DDLs
16
The tool will ask before writing the scripts.
Copied!
After running the tool a new folder called scripts gets created with the customized create_ddls.sqlYou can open it on an editor and customize it even further.
After that just go to the scripts folder and run it.
When the script is done, the output folder will contain all the DDLs for the migration.
You can then compress this folder to use with SnowConvert
1
$ zip -r output.zip ./output
Copied!
Last modified 1mo ago