Friday, September 26, 2014

Oracle Switch datafile example

RMAN> report schema;

Report of database schema for database with db_unique_name DW

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    1250     SYSTEM               ***     /u01/app/oracle/oradata/dw/system01.dbf
2    860      SYSAUX               ***     /u01/app/oracle/oradata/dw/sysaux01.dbf
3    470      UNDOTBS1             ***     /u01/app/oracle/oradata/dw/undotbs01.dbf
4    861      USERS                ***     /u02/oradata/dw/USERS.dbf
5    100      EXAMPLE              ***     /u02/oradata/dw/EXAMPLE.dbf
6    10       FLOW_1               ***     /u02/oradata/dw/FLOW_1.dbf
7    250      FLOW_2               ***     /u01/app/oracle/oradata/dw/FLOW_2.dbf
8    250      FLOW_3               ***     /u02/oradata/dw/FLOW_3.dbf
9    1024     DM                   ***     /u02/oradata/dw/DM.dbf
10   20       DM_ARCHIVE           ***     /u02/oradata/dw/DM_ARCHIVE.dbf
11   556      APEX                 ***     /u02/oradata/dw/APEX.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    384      TEMP                 32767       /u01/app/oracle/oradata/dw/temp01.dbf

change datafile to

/u02/oradata/dw

sql 'ALTER TABLESPACE FLOW_2 OFFLINE';

COPY DATAFILE 7 TO '/u02/oradata/dw/FLOW_2.dbf';

SWITCH DATAFILE 7 TO COPY;

recover tablespace FLOW_2;

sql 'ALTER TABLESPACE USERS ONLINE';

*rman backup as copy before switch datafile ( image copy )

backup as copy datafile x format 'new_location_of_datafile';


Examples
RMAN> LIST ARCHIVELOG ALL;
RMAN> LIST BACKUP OF ARCHIVELOG ALL;
RMAN> LIST BACKUP;
RMAN> LIST BACKUP OF DATABASE;
RMAN> LIST BACKUP OF DATAFILE 1;
RMAN> LIST BACKUP SUMMARY;
RMAN> LIST INCARNATION;
RMAN> LIST BACKUP BY FILE;
RMAN> LIST COPY OF DATABASE ARCHIVELOG ALL;
RMAN> LIST COPY OF DATAFILE 1, 2, 3;
RMAN> LIST BACKUP OF DATAFILE 11 SUMMARY;
RMAN> LIST BACKUP OF ARCHIVELOG FROM SEQUENCE 1437;
RMAN> LIST CONTROLFILECOPY "/tmp/cntrlfile.copy";
RMAN> LIST BACKUPSET OF DATAFILE 1;
RMAN> LIST FAILURE;
RMAN> LIST FAILURE 641231 detail;

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

ALCATEL 6900

write memory copy running certified reload from working no rollback-timeout