Sunday 21 June 2015

Migrating the Database from Non-ASM FileSystem to ASM FileSystem

1. Create a ASM groups say "DATA1".

2.  connect to database which is in READ_WRITE mode.

3. 
sql> show parameter spfile;
sql> show parameter control_file;
sql> select name from v$datafile;

4. 
sql> alter system set db_create_file_dest='+DATA1' scope=spfile;

sql> alter system set control_files='+DATA1' scope=spfile;

5. shut immediate

6. startup nomount

7. connect to RMAN

rman> restore controlfile from  '/../../control01.ctl';

rman> sql 'alter database mount'

rman> backup as copy database format '+DATA1';

rman> switch database to copy;

rman> sql 'alter database open''

8. 
sql> show parameter spfile;
sql> show parameter control_file;
sql> select name from v$datafile;

9. 
sql> create pfile from spfile;
sql> create spfile='+DATA1/spfile/spfileDB.ora' from pfile;

10. goto ORACLE_HOME/dbs location

$> vi initDB.ora
spfile='+DATA1/spfile/spfileDB.ora'
:wq

11.  bounce database (restart database)

note:
online redolog files and temporary datafiles are not in ASM. So we need to move them manually.

12. create default temporary tablespace
sql> alter database default temporary tablespace temp001;


13. drop previous default temporary tablespace
sql> select name from v$tempfile;
sql> drop tablespace <defaultTSName>;

14. bounce database

Optimizer Access Paths using Indexes

Introduction In this tutorial you will use the Optimizer Access Paths for the following cases (scenarios): Case 1: With and Without Index Ca...