Sunday, January 4, 2009

Migration Of Database From One platform to Another

Migration Of Database From One Platform To Another

What is Migration of database?

Migration of database is a mechanism of creating a database from one platform to other platform using import and export utilities. Here the document is prepared in such a way that a target database is created in one platform from a source database located in another platform.
Assumptions:
Source database SID - 'ora9i'
Target database SID - 'mig'
Mount point - '/ora2/'
OS User - 'ora9i'
Creation of Target database using dbca:

Make a note of the physical structure of the source database, so that the similar structure of the target database can be created.

Note: Database creation can be done either by using dbca or manually. In this document database is created using dbca.
1. Creating the directory structure of Target database:

a. Create a .env file in which specify the ORACLE_BASE,
Example: ORACLE_HOME, ORACLE_SID.
ORACLE_BASE=’/ora2/mig/’
ORACLE_HOME=’/ora2/ora9i/9.2.0.4/’
ORACLE_SID=’mig’
Note: oracle_home should be the same as the source database.

b. Creating two directories in the oracle_base directory (admin and oradata)

mkdir /ora2/mig/admin
mkdir /ora2/mig/oradata
c. Create sub directories in the admin and oradata as the source database structure.
cd /ora2/mig/admin
$mkdir –p //bdump
$mkdir –p //cdump
$mkdir –p //udump

cd /ora2/mig/oradata
$mkdir
2. Run dbca in the $prompt i.e. $dbca. After the database is created open the
database and create all the tablespaces and users as per the source database.
Give all the grants for the users.

Note: Do not insert any data into the database.

Exporting the source database:
Open the source database and export full database using option 'full=y'

$exp system/welcome full=y file=expdat.dmp

The above exports all the contents of the source database into the specified file.

Importing to the Target database:
Use the import utility to import all the data from the source database into the target database.

$imp system/welcome full=y file=expdat.dmp
This command will import all the data from source database into the target database.

After successfully importing the data check whether all the data is available as per the source database.

No comments:

Post a Comment