Wednesday, December 16, 2015

Steps to minimize Materialized Views redolog data generation



1. Materialized Views should be created with full refresh options.

2. Tables on which Materialized Views are based should be in nologging mode.

3. Indexes should be disabled on base tables on which M Views are created.

4. Better option to minimize redolog genaration is to use a custom job to refresh the MV, steps to this can be

a) disable indexes
b) call refresh
c) rebuild indexes with no logging




Never stop learning, because life never stops teaching.

Monday, December 14, 2015

Change Database name and DBID using "New Database ID (nid) "


New Database ID (nid) is an Oracle database utility to change  either any one of bother of the DBID and password since Oracle 9.2,

To change DBID database has to be opene via resetlogs options to reset the online redo logs sequence from 1 while only DB name is to be changed there is no need to reset the logs.

nid is a simple and useful utility to change dbid after database clone.

1. To change DBID, use below mentioned command as oracle user

$ nid target=sys/abc123

Login as sys user and bounce the DB and open with resetlogs option

SQL> startup mount;
SQL> alter database open resetlogs;


2. To change DB name, run the command

$ nid TARGET=SYS/abc123 DBNAME=orclsby1 SETNAME=Y

make a new pfile by copying existing one,

cd $ORACLE_HOME/dbs

cp initorcl.ora initorclsby1.ora

change db_name parameter in pfile

*.db_name='orclsby1'

startup database;


SQL> select database_name from v$database;

DATABASE_NAME
--------------------------------------------------------------------------------
ORCLSBY1