Wednesday, June 10, 2015

Active Data Guard Configuration

When Active Data guard is configured.You can use stand by site in Read only mode.By enabling Reporting on Stand by node It may reduce the weight on Primary site.Keep in remember You may required additional license to  configure this and .Bothe side as to be licensed according to same metrics.

On Primary Database

select status,instance_name,database_role from v$instance,v$database;

select max(sequence#) from v$archived_log;












 On Stand by database

select status,instance_name,database_role from v$database,v$instance;

select max(sequence#) from v$archived_log where applied='YES';











select process,status,sequence# from v$managed_standby;



































 alter database recover managed standby database cancel;

 alter database open;

select status,instance_name,database_role,open_mode from v$database,v$instance;

alter database recover managed standby database disconnect from session;


select process,status,sequence# from v$managed_standby;

















Now your database is configured with Active Data guard.

MRP process is Continue running  while stand by database is on read only mode.
Redo logs will be applied real time.



Wednesday, June 3, 2015

Data Guard Extended...Broker Method Configuartion.!!!

Make Sure Your Data guard configuration works fine..Logs shipping and Log applying is happening continuously.

My Primary Database is  DB11G
My Standby Database is  DB11G_STBY



Enable Broker Process
On Primary and Stand By server You need to enable broker process.

SQL> ALTER SYSTEM SET DG_BROKER_START=TRUE SCOPE=BOTH;
 
 
 
Edit Listener.ora
Then you will edit listner.ora file on Both Primary and Stand by servers

 Make Sure that the GLOBAL_DBNAME is set to db_unique_name_DGMGRL.















Create Broker Configuration.

DGMGRL>Connect sys/oracle
DGMGRL>CREATE CONFIGURATION 'GenesisDR' AS PRIMARY DATABASE IS 'DB11G' CONNECT IDENTIFIER IS 'DB11G' ;












Add the Standby database to the configuration

 DGMGRL>ADD DATABASE  'DB11G_STBY'  AS CONNECT IDENTIFIER IS 'DB11G_STBY';





















Enable Configuration

DGMGRL>Enable Configuration

















View Primary and Stand by Server Properties.

DGMGRL>show database DB11G
DGMGRL>show database DB11G_STBY
even though its in the database configuration it says "object "db11g" not found ".


















So what I did was as follows;

single quotations were required.

DGMGRL>show database 'DB11G'
DGMGRL>show database 'DB11G_STBY'



















































Performing a switchover;
DGMGRL>switchover to 'DB11G_STBY'


























That is  it. :) now you can perform switch overs using broker utility. :)

Granting Views access to a Schema User.


When granting view access to a schema user on 11g database.I tried giving select on to a particular views.But it raised me an error.So  I used  "select_catalog_role" privilege.That works fine for me.

grant select_catalog_role to lahiru;



 :)




ORA-16139 media recovery required.


When Switching Stand by Database to Primary Database.This error message raised.

I carried out following on Stand by server.Then it was switched to primary with out any error.

SQL>Recover Managed Standby Database Finish;
SQL> Alter database Commit to switchover to Primary;












Monday, June 1, 2015

Export Script In Oracle DB "System" User

This is working Properly.


#!/bin/sh
STARTTIME=`date`
export ORACLE_SID=ORCL243
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
DATEFORMAT=`date +%Y%m%d`
export PATH=$PATH:$ORACLE_HOME/bin
DATEFORMAT=`date +%Y%m%d`
STARTTIME=`date`
exp userid=system/oracle@ORCL243 file=/u01/app/backup/`echo $ORACLE_SID`_`echo $DATEFORMAT`.dmp log=/u01/app/backup/`echo $ORACLE_SID`_`echo $DATEFORMAT`.log full=y compress=n statistics=none
ENDTIME=`date`