Extracting schemas using the EDB DDL Extractor v4
Download the latest EDB DDL Extractor script from the Migration Portal Projects page.
Note
Migration Portal might become unresponsive for very large SQL files, depending on your system and browser resource availability. To resolve this issue, try extracting fewer schemas at a time to reduce the SQL file size.
Prerequisites
You can run the EDB DDL Extractor script in SQL Developer or SQL*Plus. It uses Oracle’s DBMS_METADATA
built-in package to extract DDLs for different objects under schemas (specified while running the script). The EDB DDL Extractor creates the DDL file uploaded to the portal and analyzed for EDB Postgres Advanced Server compatibility.
Note
You must have CONNECT
and SELECT_CATALOG_ROLE
roles and CREATE TABLE
privilege.
For SQL*Plus
Connect to SQL*Plus and run this command:
@edb_ddl_extractor.sql
The script prompts you to provide the details described in the steps that follow.
If the Oracle user that's running the script has the required privileges, press Enter to continue running the script.
Provide the schema name. When extracting multiple schemas, use a comma (
‘,’
) as a delimiter.Note
If you want to extract all the user schemas from the current database, don't mention any schema names while extracting. However, we recommend mentioning the schema names that you want to extract.
Enter the path or directory for the extractor to store the extracted DDL. If you don't specify a path, the extracted DDL is output to the directory where you ran the SQL*Plus command.
Enter
yes
to extract dependent objects from other schemas orno
if you don't want to extract them.Enter
yes
to extract grant statements from other schemas orno
if you don't want to want to extract them.
Example
Run the extractor script:
@edb_ddl_extractor.sql
Press Enter.
Specify three schemas by separating them with commas:
Enter a comma separated list of schemas to be extracted (Default all schemas): HR, SCOTT, FINANCE
Enter a path for the output file:
On Linux, you might use:
Location for output file (Default current location) : /home/oracle/extracted_ddls/
Similarly on Windows:
Location for output file (Default current location) : c:\Users\Example\Desktop\
Enter
yes
to extract dependent objects in other schemas:WARNING: Given schema(s) list may contain objects which are dependent on objects from other schema(s), not mentioned in the list.` `Assessment may fail for such objects. It is suggested to extract all dependent objects together. Extract dependent object from other schemas?(yes/no) (Default no / Ignored for all schemas option): yes
Enter
yes
to extract grant statements:Extract GRANT statements?(yes/no) (Default no): yes
For SQL Developer
After loading the edb_ddl_extractor.sql
script into SQL Developer and connecting to the source Oracle database, run the script. As the script executes, respond to the prompts.
If the user for the database connection has the required privileges as listed in the Script Output tab, select Yes to continue running the script.
Enter a comma-separated list of schemas, and select OK.
Enter the path for the output file, and select OK. The default is the location of the DDL Extractor script.
Enter
yes
orno
to extract dependent objects, and select OK. The default is not to extract dependent objects.Enter
yes
orno
to extract grant statements, and select OK. The default is not to extract grant statements.
Output of the DDL Extractor run appears in the Script Output tab. The name of the output file appears after the Extraction Completed
message in the script output.
Note
You can also enter single schema name in both SQL*Plus and SQL Developer.
The script then iterates through the object types in the source database. After the task is completed, the .SQL
output is stored at the location you entered (for example, c:\Users\Example\Desktop\
).
See File encoding for information about the file encoding format Migration Portal expects.
- On this page
- Prerequisites
- Example