Friday, September 24, 2010

EOUC meeting

Velikanovs in Riga

Migrating Databases To and From DISK with Recovery Manager



Migrated 600GB with this doc to another ocfs2 disk, with only one restart.
Migrating Databases To and From ASM with Recovery Manager
(Migration BACKUP as COPY doesn't work in 9i, only >=10g)

with rman

run {
allocate channel dev3 type disk;
allocate channel dev4 type disk;
allocate channel dev5 type disk;
BACKUP AS COPY INCREMENTAL LEVEL 0 DATABASE
FORMAT '/usr8/oracle/oradata/DWH/%U.dbf' TAG 'ORA_TO_MIGRATION';
}



backup incremental level 1 for recover of copy with tag 'ORA_TO_MIGRATION' database;
recover copy of database with tag 'ORA_TO_MIGRATION';


SHUTDOWN IMMEDIATE;
STARTUP MOUNT
switch database to copy;
recover database;

to migrate controlfile:

SHUTDOWN IMMEDIATE;
STARTUP MOUNT
BACKUP AS COPY CURRENT CONTROLFILE FORMAT '/opt/oracle/pre-ASM-controfile.ctl';

sysdba
alter system set control_files='/opt/oracle/oradata/AIRT/AIRT/controfile1.ctl','/opt/oracle/oradata/AIRT/AIRT/controfile2.ctl','/opt/oracle/oradata/AIRT/AIRT/controfile3.ctl' scope=spfile sid='*';

shutdown immediate
startup nomount

restore controlfile from '/opt/oracle/pre-ASM-controfile.ctl';

shutdown immediate
startup
alter database open resetlogs;


FALLBACK


SET DBID 1827102997;


RUN {
ALLOCATE channel c1 TYPE disk;

ALLOCATE channel c2 TYPE disk;
RESTORE CONTROLFILE FROM autobackup;
}


SHUTDOWN IMMEDIATE;

STARTUP MOUNT
restore controlfile from '/opt/oracle/pre-ASM-controfile.ctl';

alter database mount;

Thursday, September 23, 2010