Skip to content

Mockup for migration workaround section (Migration Handbook) #5747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions advocacy_docs/migrating/oracle/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ navigation:
- edb_migration_tools
- "#Comparing Postgres with Oracle"
- oracle_epas_comparison
- "#Migration workarounds"
- workaround_overview
- workarounds
---

Organizations migrate their Oracle applications to use other database technologies for a variety of reasons including:
Expand Down
56 changes: 56 additions & 0 deletions advocacy_docs/migrating/oracle/workaround_overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: 'Overview'
description: "Workaround overview"
indexCards: none
---

EDB provides a version of Postgres that is compatible with most Oracle features. This greatly simplifies migrations from Oracle by allowing many objects and application queries to work in Postgres without having to modify them.
Additionally, EBD offers several migration tools (Migration Portal, AI Copilot, Migration Toolkit, Replication Server) that facilitate the migration of complex Oracle databases to EDB Postgres.

For the remaining incompatibilities, EDB offers this workaround guide with practical aids for features and issues that you can't resolve automatically. It presents a collection of manual solutions to convert feature and query issues, accompanied by examples on how to address them.

Each workaround displays a summary table with the solution's key data:

- Complexity
- Availability
- Type

## Complexity

Specifies the complexity of the solution and the level of effort required to address the issue.

- **1 - Easy:**
Easy workarounds require minimal effort and are easy to implement. The compatibility with EDB Postgres is very high and the solution involves simple modifications. Performing tests to validate the solution is recommended.

- **2 - Moderate:**
These issues are still easily manageable and don't require a lot of background knowledge. The compatibility with EDB Postgres is high and the solution involves some modifications. Performing tests to validate the solution is recommended.

- **3 - Intermediate:**
The solution may require an understanding of the source Oracle database. You may need to perform troubleshooting efforts and perform comprehensive tests to validate the solution.

- **4 - Significant:**
Finding an equivalent for these functions requires effort, planning and a deeper understanding of Oracle and Postgres databases. The solution involves extensive modifications like using a combination of functions to reflect the original function. You will need to perform comprehensive troubleshooting efforts and end-to-end testing to validate the solution.

- **5 - Difficult:**
Finding an equivalent for these functions requires effort, planning and a deeper understanding of Oracle and Postgres databases. The solution involves extensive rewrites, using a combination of multi-level functions and the original function may not be entirely equivalent, but very similar. You will need to perform comprehensive troubleshooting efforts and end-to-end testing to validate the solution.

## Availability

Specifies the EDB Postgres distributions for which the solution is available.

- Yes, fully convertible to EDB Postgres and EDB Postgres Advanced Server.
- No, partially convertible or no available equivalent.

[Are there possibly solutions that will only apply to EPAS and not to PG? Do we need a category for that?]: #

## Type

- **In Database:**
These workarounds are implemented directly in the database environment. They often involve modifying database objects such as tables, views, stored procedures, and triggers to ensure compatibility between Oracle and Postgres. This type of workaround handles differences in SQL syntax, data types, and database functions.

- **MP Repair Handler:**
MP (Migration Portal) Repair Handlers are tools or scripts developed by EDB that automate solving compatibility issues during database migrations. These handlers can detect discrepancies between Oracle and Postgres environments and apply necessary fixes or adjustments.

- **Other:**
This category encompasses all other types of workarounds that do not fit into the In Database or MP Repair Handler classifications.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: 'BULK COLLECT INTO'
description: "Workarounds to migrate BULK COLLECT INTO functions to Postgres"
deepToC: true
---

## Solution Summary

| | |
|------------------|------------------------------------------------------------------|
| **Complexity** | 3 - Intermediate |
| **Availability** | Yes, fully convertible to PostgreSQL and EDB Postgres Advanced Server |
| **Type** | In Database |

## BULK COLLECT INTO in Oracle

Description of the function in Oracle.

## PostgreSQL solution

Description of the solution in PostgreSQL.

## EDB Postgres Advanced Server solution

Description of the solution in EPAS.

## Migration considerations

Further helpful information.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: 'NLS_SESSION_PARAMETERS'
description: "Workarounds to migrate NLS_SESSION_PARAMETERS functions to Postgres"
deepToC: true
---

## Solution summary

| | |
|------------------|-----------------------------------------------------------------------|
| **Complexity** | 2 - Moderate |
| **Availability** | Yes, fully convertible to PostgreSQL and EDB Postgres Advanced Server |
| **Type** | In Database |


## NLS_SESSION_PARAMETERS in Oracle

Description of the function in Oracle.

## PostgreSQL solution

Description of the solution in PostgreSQL.

## EDB Postgres Advanced Server solution

Description of the solution in EPAS.

## Migration considerations

Further helpful information.
53 changes: 53 additions & 0 deletions advocacy_docs/migrating/oracle/workarounds/V$INSTANCE.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: 'V$INSTANCE'
description: "Workarounds to migrate V$INSTANCE functions to Postgres"
deepToC: true
---

## Solution summary

| | |
|------------------|-----------------------------------------------------------------------|
| **Complexity** | 1 - Easy |
| **Availability** | Yes, fully convertible to PostgreSQL and EDB Postgres Advanced Server |
| **Type** | In Database |

## V$INSTANCE in Oracle

`V$INSTANCE` is a dynamic performance view in Oracle that provides information about the instance,
such as the instance name, status, version, startup time, and host details.
This view is essential for monitoring and managing the Oracle database instance.

In Oracle, run a query to get the instance details:

```sql
SELECT instance_name, status, version, startup_time, host_name FROM V$INSTANCE;
```

## PostgreSQL solution

In PostgreSQL, similar information can be retrieved using system catalog tables and functions
such as `pg_stat_activity`, `pg_control_checkpoint`,` version()`, and others.

In Postgres, run a query to obtain similar information as with Oracle's `V$INSTANCE`:

```sql
CREATE VIEW v$instance AS
SELECT
(SELECT datname FROM pg_stat_activity WHERE pid = pg_backend_pid()) AS instance_name,
(SELECT state FROM pg_stat_activity WHERE pid = pg_backend_pid()) AS status,
version() AS db_version,
pg_postmaster_start_time() AS startup_time,
inet_server_addr() AS host_name;
```

## EDB Postgres Advanced Server solution

While EDB Postgres Advanced Server does not have a direct equivalent to Oracle's `V$INSTANCE`,
you can use PostgreSQL's system catalog tables and functions to achieve similar functionality mentioned in the PostgreSQL solution.

## Migration considerations

When migrating from Oracle to PostgreSQL or EDB Postgres Advanced Server,
you can map the `V$INSTANCE` view to a PostgreSQL view by aggregating information from various system catalog tables and functions.
You can create a custom view to encapsulate these queries, that provides similar instance monitoring capabilities as Oracle.
14 changes: 14 additions & 0 deletions advocacy_docs/migrating/oracle/workarounds/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: 'Workaround catalogue'
description: "Workarounds to migrate functions and syntax from Oracle to Postgres"
indexCards: none
---

| Feature in Oracle | Description |
|--------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [BULK COLLECT INTO](BULK_COLLECT_INTO) | Fetches multiple rows from an SQL query into a collection (associative array, nested table, varray, etc.) in a single context switch between the SQL and PL/SQL engines. |
| [NLS_SESSION_PARAMETER](NLS_SESSION_PARAMETERS) | Provides information about the National Language Support (NLS) parameters for the current user session. |
| [Pinelined function](pipelined_functions) | Allows a PL/SQL function to return a set of rows as a table, which can be queried like a regular table. |
| [V$INSTANCE](V$INSTANCE) | Provides information about the instance name, status, version, startup time, and host details. |
| [...] | description |
| [...] | description |
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: 'Pipelined function'
description: "Workarounds to migrate pipelined functions to Postgres"
deepToC: true
---

## Solution summary

| | |
|------------------|-----------------------------------------------------------------------|
| **Complexity** | 3 - Intermediate |
| **Availability** | Yes, fully convertible to PostgreSQL and EDB Postgres Advanced Server |
| **Type** | In Database |

## Pipelined function in Oracle

Description of the function in Oracle.

## PostgreSQL solution

Description of the solution in PostgreSQL.

## EDB Postgres Advanced Server solution

Description of the solution in EPAS.

## Migration considerations

Further helpful information.
Loading