Posts

Showing posts from February, 2011

Moving datafiles for database using ASM

Individual datafile(s): 1. Take the datafile(s) in question offline. (example)        alter database datafile 6 offline; 2. Login to ASM via asmcmd.  Then copy the datafiles from current diskgroup to destination diskgroup. (example)      asmcmd> cp +DG01/svc_ctm.dbf  +DG01/prmrydb/datafile/svc_ctm.dbf asmcmd> copy datafile ' +DG01/svc_ctm.dbf' to '+DG01'; 3. Login to database via sqlplus and rename the datafiles. (example)     ALTER DATABASE RENAME FILE '+DG01/svc_ctm.dbf' to '+DG01/prmrydb/datafile/svc_ctm.dbf'; 4. Login to RMAN or sqlplus to recover the datafile(s) and place datafile(s) online. (example)      rman target /      RECOVER DATAFILE 6;      SQL 'alter database datafile 6 online'; ---------------------------------------------- Individual tablespace(s): You can complete the following steps all within RMAN: connect target / run{ ALLOCATE CHANNEL disk1 DEVICE TYPE DISK; ALLOCATE CHANNEL disk2 DEVICE

Create 11g standby without backup

In 11g, Oracle has simplified the building of standby further so that it can be built out without taking an ad-hoc backup against primary database.  The method is called 'active database'.  This is an additional option especially for small databases.   Below are the steps I typically follow for building out my standbys in 11g. Before building out your standby, ensure that the database has force logging enabled in your primary database.      ALTER DATABASE FORCE LOGGING; 1.  Either configure your listener under the ORACLE_HOME for the standby (typically using NETCA) or if you are using 11gR2 RAC, you can use the Grid Infrastructure listener.ora to add your entries.  Configure listener.ora with your standby SID and reload listener. (example) SID_LIST_LISTENER =   (SID_LIST =     (SID_DESC =       (SID_NAME = PLSExtProc)       (ORACLE_HOME = /orabase/product/11.2.0/db_1)       (PROGRAM = extproc)     )     (SID_DESC =       (GLOBAL_DBNAME = stbydb)       (SID_NAM