Database
Migration to ASM with short downtime
1.
SQL>
select * from v$version;
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 -
64bit Production
2.
SQL> select name from v$datafile union select
name from v$tempfile;
/APPDBA01/app/oracle/oradata/LEMURC/datafile/o1_mf_example_bygnqfos_.dbf
/APPDBA01/app/oracle/oradata/LEMURC/datafile/o1_mf_sysaux_bygnmrn2_.dbf
/APPDBA01/app/oracle/oradata/LEMURC/datafile/o1_mf_system_bygnmrkl_.dbf
/APPDBA01/app/oracle/oradata/LEMURC/datafile/o1_mf_temp_bygnqb2l_.tmp
/APPDBA01/app/oracle/oradata/LEMURC/datafile/o1_mf_undotbs1_bygnmron_.dbf
/APPDBA01/app/oracle/oradata/LEMURC/datafile/o1_mf_users_bygnmrqy_.dbf
3.
SQL> select name from v$controlfile;
/APPDBA01/app/oracle/oradata/LEMURC/controlfile/o1_mf_bygnq1tg_.ctl
4.
SQL> select member from v$logfile
/APPDBA01/app/oracle/oradata/LEMURC/onlinelog/o1_mf_3_bygnq6gy_.log
/APPDBA01/app/oracle/oradata/LEMURC/onlinelog/o1_mf_2_bygnq5pt_.log
/APPDBA01/app/oracle/oradata/LEMURC/onlinelog/o1_mf_1_bygnq4xc_.log
5.
Archivelogs
will now be created into FRA. We also put our spfile there. The ‘from memory’
clause is an 11g New Feature
create spfile='+DATA/spfilelemurc.ora' from memory;
6.
We remove our spfile from $ORACLE_HOME/dbs and replace it with a
pointer to the new spfile:
SQL> host cat /u01/app/oracle/product/11.2.0/dbhome_1/dbs/initprima.ora
spfile='+DATA/spfileprima.ora'
7. RMAN> backup as copy database format '+DATA';
8.
Attention: Now we need to shutdown and restart the
productive instance and have a short downtime:
slqplus / as sysdba
shutdown immediate;
shutdown immediate;
9.
SQL>
startup force nomount
10.
SQL>
alter system set control_files='+DATA' scope=spfile;
11.
RMAN>
restore controlfile from '/APPDBA01/app/oracle/oradata/LEMURC/controlfile/o1_mf_bygnq1tg_.ctl';
12.
RMAN> switch database to copy;
datafile 1 switched to datafile copy
"+DATA/lemurc/datafile/system.271.889377225"
datafile 2 switched to datafile copy
"+DATA/lemurc/datafile/sysaux.272.889377237"
datafile 3 switched to datafile copy
"+DATA/lemurc/datafile/undotbs1.274.889377251"
datafile 4 switched to datafile copy
"+DATA/lemurc/datafile/users.276.889377253"
datafile 5 switched to datafile copy
"+DATA/lemurc/datafile/example.273.889377243"
13.
RMAN> recover database;
Starting recover at 02-SEP-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=70 device type=DISK
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 02-SEP-15
14.
RMAN> alter database open;
No hay comentarios.:
Publicar un comentario