We had IO issue in the DB,So we plan to move to the new fast disk and from db side we have to copy the whole DB as per the requirement and standard.
Like below
Old Disk group = +ASM_DATA01
New Disk = +BW_DATA_01, +BW_REDO_01, +BW_CONTROL_01, +BW_FRA_01, +BW_UNDO_01 and +BW_TEMP_01
BW_DATA_01 ==> Data file
BW_REDO_01 ==> Redo logiles
BW_CONTROL_01 ==> Controlfiles
BW_FRA_01 ==> Archive and FRA
BW_UNDO_01 ==> Undo files
BW_TEMP_01 ==> Temp files
Below is the steps followed
+ Added the new disk group to ASM disk
+ Stop and started the db in mount state
+ Copied the Init file and edited to new controlfile
+ Copied the controlfile to the new disk
+ Month the DB with new init file
+ Using RMAN copy the datafiles to new ASM disk
+ Switch the datafiles to new location.
+ Open the database and create the spfile
+ Start the DB in both the RAC node
+ Create the new temp file in new ASM disk group and drop the old temp file
+ Create the new UNDO tablespace in new ASM disk group and drop the old undo files.
+ Change the archive log and FRA location to the New ASM disk group.
+ Create the new Redo log in new ASM disk group and drop the old redo
++ Brief steps:
+ Adding disk group
/dev/sda1 ==> BW_DATA_01 ==> 1.5Tb
/dev/sdb1 ==> BW_REDO_01 ==> 50Gb
/dev/sdc1 ==> BW_CONTROL_01 ==> 50Gb
/dev/sdd1 ==> BW_FRA_01 ==> 500Gb
/dev/sde1 ==> BW_UNDO_01 ==> 100Gb
/dev/sdf1 ==> BW_TEMP_01 ==> 300Gb
/etc/init.d/oracleasm createdisk BW_DATA_01 /dev/sda1
/etc/init.d/oracleasm createdisk BW_REDO_01 /dev/sdb1
/etc/init.d/oracleasm createdisk BW_CONTROL_01 /dev/sdc1
/etc/init.d/oracleasm createdisk BW_FRA_01 /dev/sdd1
/etc/init.d/oracleasm createdisk BW_UNDO_01 /dev/sde1
/etc/init.d/oracleasm createdisk BW_TEMP_01 /dev/sdf1
/etc/init.d/oracleasm scandisks
/etc/init.d/oracleasm listdisks
Using asmca create the disk group in ASM.
####################################################################
++ Checking the current structure DB.
select name from v$controlfile;
select name from v$datafile;
select name from v$tempfile;
select member from v$logfile;
++Starting the activity ,
Login to the DB and switch the logs.
sqlplus
ALTER SYSTEM ARCHIVE LOG CURRENT;
ALTER SYSTEM ARCHIVE LOG CURRENT;
ALTER SYSTEM ARCHIVE LOG CURRENT;
ALTER SYSTEM ARCHIVE LOG CURRENT;
ALTER SYSTEM ARCHIVE LOG CURRENT;
ALTER SYSTEM ARCHIVE LOG CURRENT;
ALTER SYSTEM ARCHIVE LOG CURRENT;
alter system checkpoint;
alter system checkpoint;
alter session set nls_date_format='YYYY/MON/DD hh24:mi:ss';
select checkpoint_time,fuzzy,count(*),status
from ( select checkpoint_time,fuzzy,status
from v$datafile_header
union all
select controlfile_time,'CTL',null from v$database)
group by checkpoint_time,fuzzy,status;
####################################################################
++ Disable the Standby
alter system set log_archive_dest_state_2=DEFER scope=BOTH sid='*';
++ shut down and mount the db
shut immediate
startup mount
++ Copying control file to new disk group.
rman target /
copy current controlfile to '+BW_CONTROL_01/TESTDB/CONTROLFILE/BW_control.ctl';
+ Changing the parallelism to the max for parallel copy of db
CONFIGURE DEVICE TYPE DISK PARALLELISM 60 BACKUP TYPE TO BACKUPSET;
+Creating initfile in text format.
create pfile='/tmp/initTESTDB1.ora' from spfile;
shut immediate
++ edit the pfile in /tmp/initTESTDB1.ora for below
-Controlfile location *.control_files=
-Cluster value to false *.cluster_database=FALSE
++ mount the DB with updated initfile.
startup mount pfile='/tmp/initTESTDB1.ora';
++ Copy the datafiles from old to new mount point
(asmcmd cp +ASM_DATA01 to +BW_DATA_01 or rman copy command or rman "backup as copy database format +BW_DATA_01")
rman target /
backup as copy database format '+BW_DATA_01';
switch database to copy;
alter database open resetlogs;
Ignore this warring :error:RMAN-06497: WARNING: control file is not current, control file AUTOBACKUP skippe
####################################################################
++ Moving initfile to ASM
create SPFILE='+BW_DATA_01/TESTDB/spfileTESTDB.ora' from pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initTESTDB1.ora';
startup force;
####################################################################
+++Change Undo tablespace to BW_UNDO_01 disk group.
Follow the link
<< http://oracletechdba.blogspot.com/2015/02/moving-undo-tablespace-to-new-asm.html >>
####################################################################
+++Control file multiplex
Follow the link
<< http://oracletechdba.blogspot.com/2015/02/multiplexing-control-file-in-asm.html>>
####################################################################
+++ Changing Temp tablespace Location to new disk group.
Follow the link
<< http://oracletechdba.blogspot.com/2015/02/changing-temp-tablespace-location-to.html >>
####################################################################
+++ Changing Redo Log location:
Follow the link
<< http://oracletechdba.blogspot.com/2015/02/changing-redo-log-to-new-disk-group-in.html>>
####################################################################
++ Changing Archive log location
Follow the link
<< http://oracletechdba.blogspot.com/2015/02/changing-archive-log-location.html >>
####################################################################
Restart the DB
####################################################################verify all the files are in new location.
select name from v$controlfile
union
select name from v$datafile
union
select name from v$tempfile
union
select member from v$logfile
union
select filename from v$block_change_tracking
show parameter log
show parameter recover
Like below
Old Disk group = +ASM_DATA01
New Disk = +BW_DATA_01, +BW_REDO_01, +BW_CONTROL_01, +BW_FRA_01, +BW_UNDO_01 and +BW_TEMP_01
Splitting the file as below.
BW_REDO_01 ==> Redo logiles
BW_CONTROL_01 ==> Controlfiles
BW_FRA_01 ==> Archive and FRA
BW_UNDO_01 ==> Undo files
BW_TEMP_01 ==> Temp files
+ Added the new disk group to ASM disk
+ Stop and started the db in mount state
+ Copied the Init file and edited to new controlfile
+ Copied the controlfile to the new disk
+ Month the DB with new init file
+ Using RMAN copy the datafiles to new ASM disk
+ Switch the datafiles to new location.
+ Open the database and create the spfile
+ Start the DB in both the RAC node
+ Create the new temp file in new ASM disk group and drop the old temp file
+ Create the new UNDO tablespace in new ASM disk group and drop the old undo files.
+ Change the archive log and FRA location to the New ASM disk group.
+ Create the new Redo log in new ASM disk group and drop the old redo
++ Brief steps:
+ Adding disk group
/dev/sda1 ==> BW_DATA_01 ==> 1.5Tb
/dev/sdb1 ==> BW_REDO_01 ==> 50Gb
/dev/sdc1 ==> BW_CONTROL_01 ==> 50Gb
/dev/sdd1 ==> BW_FRA_01 ==> 500Gb
/dev/sde1 ==> BW_UNDO_01 ==> 100Gb
/dev/sdf1 ==> BW_TEMP_01 ==> 300Gb
/etc/init.d/oracleasm createdisk BW_DATA_01 /dev/sda1
/etc/init.d/oracleasm createdisk BW_REDO_01 /dev/sdb1
/etc/init.d/oracleasm createdisk BW_CONTROL_01 /dev/sdc1
/etc/init.d/oracleasm createdisk BW_FRA_01 /dev/sdd1
/etc/init.d/oracleasm createdisk BW_UNDO_01 /dev/sde1
/etc/init.d/oracleasm createdisk BW_TEMP_01 /dev/sdf1
/etc/init.d/oracleasm scandisks
/etc/init.d/oracleasm listdisks
Using asmca create the disk group in ASM.
####################################################################
++ Checking the current structure DB.
select name from v$controlfile;
select name from v$datafile;
select name from v$tempfile;
select member from v$logfile;
++Starting the activity ,
Login to the DB and switch the logs.
sqlplus
ALTER SYSTEM ARCHIVE LOG CURRENT;
ALTER SYSTEM ARCHIVE LOG CURRENT;
ALTER SYSTEM ARCHIVE LOG CURRENT;
ALTER SYSTEM ARCHIVE LOG CURRENT;
ALTER SYSTEM ARCHIVE LOG CURRENT;
ALTER SYSTEM ARCHIVE LOG CURRENT;
ALTER SYSTEM ARCHIVE LOG CURRENT;
alter system checkpoint;
alter system checkpoint;
alter session set nls_date_format='YYYY/MON/DD hh24:mi:ss';
select checkpoint_time,fuzzy,count(*),status
from ( select checkpoint_time,fuzzy,status
from v$datafile_header
union all
select controlfile_time,'CTL',null from v$database)
group by checkpoint_time,fuzzy,status;
####################################################################
++ Disable the Standby
alter system set log_archive_dest_state_2=DEFER scope=BOTH sid='*';
++ shut down and mount the db
shut immediate
startup mount
++ Copying control file to new disk group.
rman target /
copy current controlfile to '+BW_CONTROL_01/TESTDB/CONTROLFILE/BW_control.ctl';
+ Changing the parallelism to the max for parallel copy of db
CONFIGURE DEVICE TYPE DISK PARALLELISM 60 BACKUP TYPE TO BACKUPSET;
+Creating initfile in text format.
create pfile='/tmp/initTESTDB1.ora' from spfile;
shut immediate
++ edit the pfile in /tmp/initTESTDB1.ora for below
-Controlfile location *.control_files=
-Cluster value to false *.cluster_database=FALSE
++ mount the DB with updated initfile.
startup mount pfile='/tmp/initTESTDB1.ora';
++ Copy the datafiles from old to new mount point
(asmcmd cp +ASM_DATA01 to +BW_DATA_01 or rman copy command or rman "backup as copy database format +BW_DATA_01")
rman target /
backup as copy database format '+BW_DATA_01';
switch database to copy;
alter database open resetlogs;
Ignore this warring :error:RMAN-06497: WARNING: control file is not current, control file AUTOBACKUP skippe
####################################################################
++ Moving initfile to ASM
create SPFILE='+BW_DATA_01/TESTDB/spfileTESTDB.ora' from pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initTESTDB1.ora';
startup force;
####################################################################
+++Change Undo tablespace to BW_UNDO_01 disk group.
Follow the link
<< http://oracletechdba.blogspot.com/2015/02/moving-undo-tablespace-to-new-asm.html >>
####################################################################
+++Control file multiplex
Follow the link
<< http://oracletechdba.blogspot.com/2015/02/multiplexing-control-file-in-asm.html>>
####################################################################
+++ Changing Temp tablespace Location to new disk group.
Follow the link
<< http://oracletechdba.blogspot.com/2015/02/changing-temp-tablespace-location-to.html >>
####################################################################
+++ Changing Redo Log location:
Follow the link
<< http://oracletechdba.blogspot.com/2015/02/changing-redo-log-to-new-disk-group-in.html>>
####################################################################
++ Changing Archive log location
Follow the link
<< http://oracletechdba.blogspot.com/2015/02/changing-archive-log-location.html >>
####################################################################
Restart the DB
####################################################################verify all the files are in new location.
select name from v$controlfile
union
select name from v$datafile
union
select name from v$tempfile
union
select member from v$logfile
union
select filename from v$block_change_tracking
show parameter log
show parameter recover
No comments:
Post a Comment