DBA Hub

📋Steps in this guide1/6

Oracle Database Migration: Step-by-Step Guide

Oracle database Migration across platforms with Data Pump, RMAN, TTS, and GoldenGate. Includes pre-checks, execution steps, validation, and zero-downtime methods.

oracle configurationintermediate
by OracleDba
22 views
1

Oracle Database Migration: Step-by-Step Guide for DBAs

Database migration is a critical task for any Oracle DBA, especially when moving to a new version, platform, or cloud environment. Whether upgrading legacy systems, moving from on-premise to cloud, or switching hardware platforms, a proper migration strategy ensures data integrity, minimal downtime, and smooth cutover. This guide explains the end-to-end migration process in a clear, practical manner.
2

What is Oracle Database Migration?

Oracle Database Migration is the process of transferring an existing Oracle database from one environment to another. This may include: - Version upgrades (e.g., 11g → 19c) Version upgrades (e.g., 11g → 19c) - Cross-platform migration (Linux → Windows, AIX → Linux) Cross-platform migration (Linux → Windows, AIX → Linux) - Cloud migration (On-Prem → OCI / AWS / Azure) Cloud migration (On-Prem → OCI / AWS / Azure) - Hardware refresh or Storage change Hardware refresh or Storage change There are four primary methods for migrating an Oracle database, each with its own pros, cons, and use cases. - Cross-platform migration (e.g., Solaris to Linux) - Oracle version upgrades (e.g., 11g to 19c) - Selective migration of specific schemas - Consolidating multiple databases - Moving very large databases (VLDB) - When storage is being migrated along with the DB - Read-only or historical data migration - Refreshing test/development from production - Cloning databases - Same-platform migration (e.g., Linux to Linux) - Disaster Recovery setup - Zero-downtime migrations - Migrations to a different character set - Continuous data synchronization - Active-Active setups
3

Scenario 1: Migration using Data Pump (expdp / impdp)

This is the most common method for heterogeneous migrations and upgrades. Pre-Migration Steps: - Pre-migration Checks: Check character set ( ) and national character set of both source and target. Mismatches may require conversion. Identify and resolve any invalid objects on the source. Check for any data types not supported by Data Pump. Ensure sufficient disk space for the dump files on both source and target. Create a dedicated directory object for the dump files on both systems. Pre-migration Checks: - Check character set ( ) and national character set of both source and target. Mismatches may require conversion. Check character set ( ) and national character set of both source and target. Mismatches may require conversion. - Identify and resolve any invalid objects on the source. Identify and resolve any invalid objects on the source. - Check for any data types not supported by Data Pump. Check for any data types not supported by Data Pump. - Ensure sufficient disk space for the dump files on both source and target. Ensure sufficient disk space for the dump files on both source and target. - Create a dedicated directory object for the dump files on both systems. Create a dedicated directory object for the dump files on both systems. - Prepare the Target Environment: Install the same or a higher version of the Oracle Database software. Create a new database or ensure the target database exists. Create the necessary tablespaces to match the source (or let Data Pump create them). Prepare the Target Environment: - Install the same or a higher version of the Oracle Database software. Install the same or a higher version of the Oracle Database software. - Create a new database or ensure the target database exists. Create a new database or ensure the target database exists. - Create the necessary tablespaces to match the source (or let Data Pump create them). Create the necessary tablespaces to match the source (or let Data Pump create them). Migration Execution Steps: - Export from Source: sql Export from Source: - Transfer Dump Files: Use , , or shared storage to move the dump file(s) from the source server to the target server. Transfer Dump Files: Use , , or shared storage to move the dump file(s) from the source server to the target server. - Import to Target: sql Use parameters to change schema names, tablespaces, etc., if needed. Use to speed up the import by minimizing redo generation (use with caution). Import to Target: - Use parameters to change schema names, tablespaces, etc., if needed. Use parameters to change schema names, tablespaces, etc., if needed. - Use to speed up the import by minimizing redo generation (use with caution). Use to speed up the import by minimizing redo generation (use with caution). Post-Migration Steps: - Recompile invalid objects: Recompile invalid objects: - Update statistics: Update statistics: - Run application-specific validation scripts. Run application-specific validation scripts. - Plan and execute a cutover, redirecting applications to the new database. Plan and execute a cutover, redirecting applications to the new database.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
-- Full Database Export (as SYSDBA)
expdp system
/
password
FULL
=
YES DIRECTORY
=
export_dump
DUMPFILE
=
full_export_
%
U
.
dmp LOGFILE
=
export
.
log JOB_NAME
=
full_export
-- Schema-level Export
expdp system
/
password SCHEMAS
=
hr
,
oe DIRECTORY
=
export_dump
DUMPFILE
=
schema_export
.
dmp LOGFILE
=
export
.
log

-- Full Database Import (as SYSDBA)
impdp system
/
password
FULL
=
YES DIRECTORY
=
import_dump
DUMPFILE
=
full_export_
%
U
.
dmp LOGFILE
=
import
.
log REMAP_SCHEMA
=
HR:HR_NEW REMAP_TABLESPACE
=
USERS:NEW_USERS
-- Schema-level Import
impdp system
/
password SCHEMAS
=
hr DIRECTORY
=
import_dump
DUMPFILE
=
schema_export
.
dmp LOGFILE
=
import
.
log REMAP_SCHEMA
=
hr:hr_new
4

Scenario 2: Migration using RMAN DUPLICATE

This is ideal for cloning a production database to a new server for testing or for a like-for-like migration. Pre-Migration Steps: - Ensure the source database is in mode. Ensure the source database is in mode. - Take a full RMAN backup or ensure recent backups are available. Take a full RMAN backup or ensure recent backups are available. - Prepare the target server with the same Oracle version installed. Prepare the target server with the same Oracle version installed. - Create a password file for the target instance. Create a password file for the target instance. - Configure Oracle Net (listener.ora, tnsnames.ora) so the source and target can communicate. Configure Oracle Net (listener.ora, tnsnames.ora) so the source and target can communicate. Migration Execution Steps: - On the Target Server: Create an file with minimal parameters (e.g., ). Start the target instance in mode. On the Target Server: - Create an file with minimal parameters (e.g., ). Create an file with minimal parameters (e.g., ). - Start the target instance in mode. Start the target instance in mode. - From RMAN on the Target: sql is the most common method as it doesn’t require a pre-existing backup. tells RMAN the file paths on the target are different from the source. From RMAN on the Target: - is the most common method as it doesn’t require a pre-existing backup. is the most common method as it doesn’t require a pre-existing backup. - tells RMAN the file paths on the target are different from the source. tells RMAN the file paths on the target are different from the source. Post-Migration Steps: - The duplicated database is an exact copy, including the SID/DB_NAME. You may need to change it. The duplicated database is an exact copy, including the SID/DB_NAME. You may need to change it. - Perform the same validation as in the Data Pump method. Perform the same validation as in the Data Pump method.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
rman TARGET sys
/
password
@SOURCE_DB
AUXILIARY sys
/
password
@TARGET_DB
RMAN
>
DUPLICATE
DATABASE
TO
TARGET_DB
FROM
ACTIVE
DATABASE
-- This copies directly over the network, no backup needed
SPFILE
SET
DB_UNIQUE_NAME
=
'TARGET_DB'
SET
LOG_ARCHIVE_DEST_1
=
'LOCATION=/u01/app/oracle/archive/'
NOFILENAMECHECK
;
5

Scenario 3: Migration using Transportable Tablespaces (TTS)

This is the fastest method for large datasets. High-Level Steps: - Check Transportability: Execute to verify the set of tablespaces is self-contained. Check Transportability: Execute to verify the set of tablespaces is self-contained. - Make Tablespaces Read-Only: Make Tablespaces Read-Only: - Export Metadata: Use Data Pump to export only the metadata of the tablespaces. sql Export Metadata: Use Data Pump to export only the metadata of the tablespaces. - Copy Datafiles and Dump File: Copy the actual datafiles ( ) and the metadata dump file to the target server. Copy Datafiles and Dump File: Copy the actual datafiles ( ) and the metadata dump file to the target server. - Import Metadata: On the target, use Data Pump to import the metadata, which plugs the datafiles into the database. sql Import Metadata: On the target, use Data Pump to import the metadata, which plugs the datafiles into the database. - Make Tablespaces Read-Write: Make Tablespaces Read-Write:

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
expdp system
/
password DIRECTORY
=
dpump_dir
DUMPFILE
=
tts_meta
.
dmp TRANSPORT_TABLESPACES
=
big_data LOGFILE
=
tts_export
.
log

impdp system
/
password DIRECTORY
=
dpump_dir
DUMPFILE
=
tts_meta
.
dmp TRANSPORT_DATAFILES
=
'/path/to/big_data01.dbf'
REMAP_SCHEMA
=
source_user:target_user
6

Final Thoughts

Oracle database migration is not just a technical task but a strategic move that impacts performance, availability, and long-term maintainability. Choosing the right approach depends on database size, platform compatibility, downtime tolerance, and business requirements. Want to see how we teach? Head over to our YouTube channel for insights, tutorials, and tech breakdowns: www.youtube.com/@learnomate To know more about our courses, offerings, and team: Visit our official website: www.learnomate.org Interested in mastering Oracle Database Administration? Check out our comprehensive Oracle DBA Training program here: https://learnomate.org/oracle-dba-training/ Want to explore more tech topics? Check out our detailed blog posts here: https://learnomate.org/blogs/ And hey, I’d love to stay connected with you personally! Let’s connect on LinkedIn: Ankush Thavali Happy Vibes! ANKUSH

Comments (0)

Please to add comments

No comments yet. Be the first to comment!