Moving Oracle Database between AWS instance.
When moving an Oracle database between two Amazon ec2 instances, we can easily accomplish it without backup/restore or Rman duplication as below.
Setup - Oracle 11.2.0.1 Running on Amazone ec2 Linux 6.4
Requirment - Moving above oracle database from one Amazone ec2 instance (A) to another (B).
Restrications - Need to Shutdown the database on source instance. (A)
Step 1.
In source ec2 instance,
Take control file create statement to trace using below command,
Create pfile from spfile.
Step 2.
In source ec2 instance,
Shutdown the oralce database. (In order put all data files on consistent state)
Identify the volumes (EBS) which are storing the data files and take snapshot of each of the volume.
(If you are dealing with large volumes, take a full AMI (Machine Image) prior to taking volume snapshots. Then after db shutdown take the volume snapshot. This will reduce the snapshot time)
Step 3.
In Amazone ec2 management,
Create new volumes from the snapshots, Mount this new volumes to instance which db need to be moved.
(Need to have same version of oracle installed on this second server)
If possible use the same mount point paths as it will reduce the changes in db creation. (eg - paths to data files)
Step 4.
In destination instance,
Go through the controlfile dumped to trace, (show parameter user_dump_dest;) and do required changes.
e.g,
*Change datafile paths to reflect the correct location in new instance.
*If redo log location is unchanged and the redo files were mounted from snap shots from source instance, remove those files from os level. (rm -rf)
*Remove "recover database" statements and "open database" statements..
*Changes 'NORESETLOGS' to 'RESETLOGS'.
Step 5.
Run the above edited control file create statement so the new db will be created.
Step 6.
Startup the database.
Setup - Oracle 11.2.0.1 Running on Amazone ec2 Linux 6.4
Requirment - Moving above oracle database from one Amazone ec2 instance (A) to another (B).
Restrications - Need to Shutdown the database on source instance. (A)
Step 1.
In source ec2 instance,
Take control file create statement to trace using below command,
alter database backup controlfile to trace;
Create pfile from spfile.
create pfile from spfile
Step 2.
In source ec2 instance,
Shutdown the oralce database. (In order put all data files on consistent state)
Identify the volumes (EBS) which are storing the data files and take snapshot of each of the volume.
(If you are dealing with large volumes, take a full AMI (Machine Image) prior to taking volume snapshots. Then after db shutdown take the volume snapshot. This will reduce the snapshot time)
Step 3.
In Amazone ec2 management,
Create new volumes from the snapshots, Mount this new volumes to instance which db need to be moved.
(Need to have same version of oracle installed on this second server)
If possible use the same mount point paths as it will reduce the changes in db creation. (eg - paths to data files)
Step 4.
In destination instance,
Go through the controlfile dumped to trace, (show parameter user_dump_dest;) and do required changes.
e.g,
*Change datafile paths to reflect the correct location in new instance.
*If redo log location is unchanged and the redo files were mounted from snap shots from source instance, remove those files from os level. (rm -rf)
*Remove "recover database" statements and "open database" statements..
*Changes 'NORESETLOGS' to 'RESETLOGS'.
Step 5.
Run the above edited control file create statement so the new db will be created.
Step 6.
Startup the database.
I really appreciate information shared above. It’s of great help to us. If someone wants to learn (ILT) instructor lead live training on AWS (Amazon Web Services) MaxMunus Offer World Class AWS Certification level classroom training in Bangalore, we have industry expert trainers. We provide Training Material and Software Support. MaxMunus has successfully conducted 1, 00,000 + trainings in India, USA, UK, Australia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
ReplyDeleteEnroll for the live & interactive classroom training
Arvind
MaxMunus
E-mail: arvind.sharma@maxmunus.com
Skype id: arvind.sharma901
Ph :( 0) 9019891304 / 080 - 41103383