Sei sulla pagina 1di 2

1. Change init file to reflect following parameter, : compatible='10.2.0.3.0' control_files='+DATA','+DATA','+FLASHBACK db_create_file_dest='+DATA' db_recovery_file_dest='+FLASHBACK' db_flashback_retention_target=20160 2. Create SPFILE. 3. Shutdown database.

4. Startup nomount 5. Restore controlfile to ASM using rman target / restore controlfile from '/opt/oracle/ctldir/dbsid/control02.ctl'; 6. Mount and increase parallelism for rman channels using rman target / alter database mount; configure device type disk parallelism 4; 7. Backup database to ASM backup as copy database format '+DATA'; If it is going to take long time, then run above as the following Unix script in nohup
NB_ORA_CLIENT=swing export NB_ORA_CLIENT; ORACLE_SID=rptest1 export ORACLE_SID; NLS_DATE_FORMAT="YYYYMMDDHH24MISS"; export NLS_DATE_FORMAT; NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1 export NLS_LANG; rman target / cmdfile asm_move_to_from_flat_files.cmd log asm_move_to_from_flat_files.log

8. Make ASM copy as current database switch database to copy; alter database open; 9. Convert Redologs to ASM:
declare cursor rlc is select group# grp, thread# thr, bytes/1024 bytes_k, 'NO' srl from v$log union select group# grp, thread# thr, bytes/1024 bytes_k, 'YES' srl from v$standby_log order by 1; stmt varchar2(2048); swtstmt varchar2(1024) := 'alter system switch logfile'; ckpstmt varchar2(1024) := 'alter system checkpoint global'; begin for rlcRec in rlc loop if (rlcRec.srl = 'YES') then stmt := 'alter database add standby logfile thread ' || rlcRec.thr || ' ''+DATA'' size ' || rlcRec.bytes_k || 'K'; execute immediate stmt; stmt := 'alter database drop standby logfile group ' || rlcRec.grp; execute immediate stmt; else

10. Make Sure Temp files are on ASM. Drop and add if required alter database tempfile '/opt/oracle/oradata08/dbsid/pstemp01.dbf' alter database tempfile '/opt/oracle/oradata08/dbsid/pstemp01.dbf' alter database tempfile '/opt/oracle/oradata08/dbsid/pstemp02.dbf' alter database tempfile '/opt/oracle/oradata08/dbsid/pstemp02.dbf' alter database tempfile '/opt/oracle/oradata08/dbsid/pstemp03.dbf' alter database tempfile '/opt/oracle/oradata08/dbsid/pstemp03.dbf'

stmt := 'alter database add logfile thread ' || rlcRec.thr || ' ''+DATA'' size ' || rlcRec.bytes_k || 'K'; execute immediate stmt; begin stmt := 'alter database drop logfile group ' || rlcRec.grp; dbms_output.put_line(stmt); execute immediate stmt; exception when others then execute immediate swtstmt; execute immediate ckpstmt; execute immediate stmt; end; end if; end loop; end; /

offline; drop; offline; drop; offline; drop;

ALTER TABLESPACE "PSTEMP" ADD TEMPFILE '+DATA' SIZE 1G AUTOEXTEND ON NEXT 1G MAXSIZE UNLIMITED; ALTER TABLESPACE "PSTEMP" ADD TEMPFILE '+DATA' SIZE 1G AUTOEXTEND ON NEXT 1G MAXSIZE UNLIMITED; ALTER TABLESPACE "PSTEMP" ADD TEMPFILE '+DATA' SIZE 1G AUTOEXTEND ON NEXT 1G MAXSIZE UNLIMITED; 11. Check all files if they are converted to ASM or not select name from v$datafile union select name from v$controlfile union select name from v$tempfile union select member from v$logfile;

Potrebbero piacerti anche