My database.
⇒ While database is up and running I will use RMAN to copy datafile of SYSTEM tablespace to another location.
⇒ Now I will shutdown database and start in mount mode.
⇒ Switch datafile to copy.
⇒ Now to perform quick recover.
⇒ That’s it! Open database.
⇒ Little check that I’ve moved datafile.
⇒ After switching datafiles, old datafile become copy so it is safe to drop it.
So the only downtime was period during bouncing database and recovering datafile.
RMAN> report schema;using target database control file instead of recovery catalogReport of database schema for database with db_unique_name AOCDBList of Permanent Datafiles===========================File Size(MB) Tablespace RB segs Datafile Name---- -------- -------------------- ------- ------------------------1 710 SYSTEM *** /u01/app/oradata/aocdb/system01.dbf2 750 SYSAUX *** /u01/app/oradata/aocdb/sysaux01.dbf3 1260 UNDOTBS1 *** /u01/app/oradata/aocdb/undotbs01.dbf4 2363 USERS *** /u01/app/oradata/aocdb/users01.dbf5 1024 REST *** /u01/app/oradata/aocdb/rest01.dbf6 1024 INDX_REST *** /u01/app/oradata/aocdb/indx_rest01.dbfList of Temporary Files=======================File Size(MB) Tablespace Maxsize(MB) Tempfile Name---- -------- -------------------- ----------- --------------------1 96 TEMP 32767 /u01/app/oradata/aocdb/temp01.dbf |
⇒ While database is up and running I will use RMAN to copy datafile of SYSTEM tablespace to another location.
RMAN> copy datafile 1 to '/u01/app/oradata/loc2/system01.dbf';Starting backup at 15.05.2012 19:35:23allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=126 device type=DISKchannel ORA_DISK_1: starting datafile copyinput datafile file number=00001 name=/u01/app/oradata/aocdb/system01.dbfoutput file name=/u01/app/oradata/loc2/system01.dbf tag=TAG20120515T193524 RECID=76 STAMP=783372953channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35Finished backup at 15.05.2012 19:35:59 |
⇒ Now I will shutdown database and start in mount mode.
RMAN> shutdown immediate;database closeddatabase dismountedOracle instance shut downRMAN> startup mount;connected to target database (not started)Oracle instance starteddatabase mountedTotal System Global Area 1071333376 bytesFixed Size 1318172 bytesVariable Size 352322276 bytesDatabase Buffers 713031680 bytesRedo Buffers 4661248 bytes |
⇒ Switch datafile to copy.
RMAN> switch datafile 1 to copy;datafile 1 switched to datafile copy "/u01/app/oradata/loc2/system01.dbf" |
⇒ Now to perform quick recover.
RMAN> recover datafile 1;Starting recover at 15.05.2012 19:38:55allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=154 device type=DISKstarting media recoverymedia recovery complete, elapsed time: 00:00:01Finished recover at 15.05.2012 19:38:57 |
⇒ That’s it! Open database.
RMAN> alter database open;database opened |
⇒ Little check that I’ve moved datafile.
1
| RMAN> report schema;Report of database schema for database with db_unique_name AOCDBList of Permanent Datafiles===========================File Size(MB) Tablespace RB segs Datafile Name---- -------- -------------------- ------- ------------------------1 710 SYSTEM *** /u01/app/oradata/loc2/system01.dbf2 750 SYSAUX *** /u01/app/oradata/aocdb/sysaux01.dbf3 1260 UNDOTBS1 *** /u01/app/oradata/aocdb/undotbs01.dbf…… |
⇒ After switching datafiles, old datafile become copy so it is safe to drop it.
RMAN> list copy of datafile 1;List of Datafile Copies=======================Key File S Completion Time Ckp SCN Ckp Time------- ---- - ------------------- ---------- -------------------77 1 A 15.05.2012 19:38:15 5250088 15.05.2012 19:37:03 Name: /u01/app/oradata/aocdb/system01.dbf RMAN> delete copy of datafile 1;released channel: ORA_DISK_1allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=154 device type=DISKList of Datafile Copies=======================Key File S Completion Time Ckp SCN Ckp Time------- ---- - ------------------- ---------- -------------------77 1 A 15.05.2012 19:38:15 5250088 15.05.2012 19:37:03 Name: /u01/app/oradata/aocdb/system01.dbf Do you really want to delete the above objects (enter YES or NO)? YESdeleted datafile copydatafile copy file name=/u01/app/oradata/aocdb/system01.dbf RECID=77 STAMP=783373095deleted datafile copy |
So the only downtime was period during bouncing database and recovering datafile.
No comments:
Post a Comment