-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6259 from EnterpriseDB/mp/note_DDL_extraction
Mig Portal: DDL Extractor note and reorg of extraction section
- Loading branch information
Showing
4 changed files
with
126 additions
and
114 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...tal/4/04_mp_migrating_database/01_mp_schema_extraction/01_data_pump_utility.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
...portal/4/04_mp_migrating_database/01_mp_schema_extraction/edb_ddl_extractor.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
--- | ||
title: "Extracting schemas using the EDB DDL Extractor" | ||
navTitle: Using EDB DDL Extractor | ||
--- | ||
|
||
|
||
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, 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 | ||
|
||
1. Connect to SQL\*Plus and run this command: | ||
|
||
```sql | ||
@edb_ddl_extractor.sql | ||
``` | ||
|
||
1. When prompted, if the Oracle user that is running the script has the required privileges, press **Enter** to continue running the script. | ||
|
||
1. When prompted, 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. | ||
|
||
1. When prompted, 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. | ||
|
||
1. When prompted, enter `yes`or `no` depending on whether you want to extract dependent objects from other schemas. | ||
|
||
1. When prompted, enter `yes`or `no` depending on whether you want to extract grant statements from other schemas. | ||
|
||
## Example | ||
|
||
1. Run the extractor script: | ||
|
||
```text | ||
@edb_ddl_extractor.sql | ||
``` | ||
|
||
1. Press **Enter**. | ||
|
||
1. Specify three schemas by separating them with commas: | ||
|
||
```text | ||
Enter a comma separated list of schemas to be extracted (Default all schemas): HR, SCOTT, FINANCE | ||
``` | ||
|
||
1. Enter a path for the output file: | ||
|
||
On Linux, you might use: | ||
|
||
```text | ||
Location for output file (Default current location) : /home/oracle/extracted_ddls/ | ||
``` | ||
|
||
Similarly on Windows: | ||
|
||
```text | ||
Location for output file (Default current location) : c:\Users\Example\Desktop\ | ||
``` | ||
|
||
1. Enter `yes` to extract dependent objects in other schemas: | ||
|
||
```text | ||
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 | ||
``` | ||
|
||
1. Enter `yes` to extract grant statements: | ||
|
||
```text | ||
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. | ||
|
||
1. 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. | ||
|
||
2. Enter a comma-separated list of schemas, and select **OK**. | ||
|
||
3. Enter the path for the output file, and select **OK**. The default is the location of the DDL Extractor script. | ||
|
||
4. Enter `yes` or `no` to extract dependent objects, and select **OK**. The default is to not extract dependent objects. | ||
|
||
5. Enter `yes` or `no` to extract grant statements, and select **OK**. The default setting 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. Once the task is completed, the `.SQL` output is stored at the location you entered (e.g., `c:\Users\Example\Desktop\`). | ||
|
||
See [file encoding](/migration_portal/latest/known_issues_notes/#file-encoding) for information about the file encoding format expected by Migration Portal. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters