Custom Search . . .

Sunday, February 22, 2015

12c EM Express NOT working - sec_error_ca_cert_invalid



Many of you knows Oracle deprecated the EM db console  [ EMCA ] and introduced EM Express in 12c..

I have Oracle enterprise linux 6 in VMware and successfully installed 12c release 1 but seems to be when I open EM always got "sec_error_ca_cert_invalid" in my firebox. 



I was thinking this could be hitting BUG so I have applied latest bundle patch in 12c but still got same error

By looking 1943645.1. This error was hitting bug in firebox 31 & 32 release.. So this workaround was solved my problem.. 

Thank you.


PRVF-0002 : Could not retrieve local nodename



All,

When I try to install Oracle 12c release one on my oracle Enterprise Linux 6 virtual machine below error reported. 

PRVF-0002 : Could not retrieve local nodename

Whats is PRVF-0002 ?  When you install 12c R1 from Oracle universal installer [OUI] its perform basic checks including hostname & networking confirmation. 




In my case hostname NOT configured properly in /etc/hosts. So I made changes like below and then installation went fine. 


Thank you.. 

Saturday, June 21, 2014

DNS Configuration for 11g R2 Grid installation


Friends,

As I said earlier I was not in touch with blog / other forums due to business reason.. now I got little time touch base with you all.. 

I am back to oracle forums and my blog.. there are up coming oracle events , post I am going to share with you guys.. 

Thank you all..


NOW I want to share DNS configuration in my 11g R2 vmware 10 workstation..  This would be high level configuration between your vm.. 

Pre-Request for DNS configuration in VMware

I am going to share 2 node RAC configuration for DNS in RHEL 5.10.. So I have 2 guest vm and here is my configuration below.. 



babudba01ca
babudba01cb
Public IP
192.168.1.8
192.168.1.10
VIP
192.168.1.11
192.168.1.13
Private IP
192.168.1.20
192.168.1.30
DNS
192.168.1.10
192.168.1.8

Once you have VM with above configuration you need to make below configuration for DNS. 

1. /etc/hosts - 
2. /etc/resolve.conf 
3. /var/named/chroot/etc/named.conf
4. /var/named/chroot/var/named/<>.zone





















As I said, All I did DNS configuration by using above configuration and please make sure you should have this changes in your all nodes. 

















Note: I post above details from my techlab system for 11g Grid installation in test machine.. If you don't have DNS domain server then you can try for DNS file configuration. 

Please feel free to reach me for questions.. 

thank you all, Babu

Saturday, January 26, 2013

ORA-03111: break received on communication channel


I have seen this communication break channel error in one of my database. By doing all analysis about this error. I have learned few interesting things and wants to share with you all. 

First I would like to Thank Mr Roy blog. This blog was clearly explaining about commutation break channel error. 

http://royontechnology.blogspot.com/2009/06/mysterious-ora-03111-error.html

But being Oracle DBA, I want to share few more things. 

As Roy. The communication break channel will occur few possibility's. 

   a. Network timeout between application server and database server. 
   b. SQL Query cross the specified timeout value from web services like tomcat Or JDBC connection. 
   c. Or if client JDBC Thin driver use lower version to compare the oracle version then you might need to upgrade the JDBC Thin driver. 

Example. Your database running 11.2.0.3 and JDBC Thin driver use lower version then there should be some bug from Oracle. There is one patch recommended by Oracle and needs to apply into JDBC Thin from you're client site. 

But based on my experience by increasing the timout value from JDBC Thin statement timeout and Apache Tomcat timeout value only help to avoid the ORA-03111 communication channel break error but this will NOT help you out the real problem. 

The critical / Onair application the SQL Query execution should be < 1 min [ For example <=30 Sec ], If this query takes more than >=30 sec then you should get this error.. 

Please have a look your AWR , ADDM reports and find the if any SQL Query takes more than 1 min .


Please let me know if your thougts and feedback. 

Regards, Babu

Saturday, June 2, 2012

Out of blog for Sometime..

Hello Blog Readers,

I'm completely NOT Touch with my blog. If you have any question in oracle drop mail to me.

Thanks

Thursday, April 28, 2011

Oracle 11g RMAN DUPLICATE DATABASE WITHOUT TARGET CONNECTION

Here is the RMAN DUPLICATE DATABASE by using without a target connection and without a recovery catalog connection. 


I hope this short example will explain you about rman duplication database. 


Here is the example:


This is my below setting in TARGET DATABASE


RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;



new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored


RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'I:\Ora-Backup\DB001\CF_%F';


new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'I:\Ora-Backup\DB001\CF_%F';
new RMAN configuration parameters are successfully stored


RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'I:\Ora-Backup\DB001\BKP_%U';


new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   'I:\Ora-Backup\DB001\BKP_%U';
new RMAN configuration parameters are successfully stored

Here is the complete full backup script on TARGET DATABASE

RMAN> run
2> {
3> backup database;
4> backup archivelog all;
5> }


Starting backup at 28-APR-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=144 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=G:\ORADATA\DB001\DB001\SYSTEM01.DBF
input datafile file number=00002 name=G:\ORADATA\DB001\DB001\SYSAUX01.DBF
input datafile file number=00003 name=G:\ORADATA\DB001\DB001\UNDOTBS01.DBF
input datafile file number=00004 name=G:\ORADATA\DB001\DB001\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 28-APR-11
channel ORA_DISK_1: finished piece 1 at 28-APR-11
piece handle=I:\ORA-BACKUP\DB001\BKP_01MAU0UD_1_1 tag=TAG20110428T165432 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
Finished backup at 28-APR-11


Starting backup at 28-APR-11
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=2 RECID=1 STAMP=749667205
input archived log thread=1 sequence=3 RECID=2 STAMP=749667218
input archived log thread=1 sequence=4 RECID=3 STAMP=749667233
input archived log thread=1 sequence=5 RECID=4 STAMP=749667235
input archived log thread=1 sequence=6 RECID=5 STAMP=749667240
input archived log thread=1 sequence=7 RECID=6 STAMP=749667241
input archived log thread=1 sequence=8 RECID=7 STAMP=749667245
input archived log thread=1 sequence=9 RECID=8 STAMP=749667261
input archived log thread=1 sequence=10 RECID=9 STAMP=749667285
input archived log thread=1 sequence=11 RECID=10 STAMP=749667352
input archived log thread=1 sequence=12 RECID=11 STAMP=749667360
input archived log thread=1 sequence=13 RECID=12 STAMP=749667365
channel ORA_DISK_1: starting piece 1 at 28-APR-11
channel ORA_DISK_1: finished piece 1 at 28-APR-11
piece handle=I:\ORA-BACKUP\DB001\BKP_02MAU117_1_1 tag=TAG20110428T165606 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15
Finished backup at 28-APR-11


Starting Control File and SPFILE Autobackup at 28-APR-11
piece handle=I:\ORA-BACKUP\DB001\CF_C-1064524120-20110428-00 comment=NONE
Finished Control File and SPFILE Autobackup at 28-APR-11


RMAN>

Most of Oracle DBA's should famiour in windows environment but still we need to follow some process to creating the database instance by using ORADIM and password file creation by using ORAPWD

C:\>SET ORACLE_SID=DB002   --> My Auxiliary guy


C:\>oradim -new -sid DB002 -pfile D:\11g\product\11.2.0\dbhome_1\database\INITdb002.ORA
Instance created.


C:\>orapwd file=D:\11g\product\11.2.0\dbhome_1\database\PWDDB002.ora password=sys entries=10


C:\>




C:\>sqlplus


SQL*Plus: Release 11.2.0.1.0 Production on Thu Apr 28 17:03:40 2011


Copyright (c) 1982, 2010, Oracle.  All rights reserved.


Enter user-name: sys as sysdba
Enter password:
Connected to an idle instance.


SQL> startup nomount
ORACLE instance started.


Total System Global Area  535662592 bytes
Fixed Size                  1375792 bytes
Variable Size             297796048 bytes
Database Buffers          230686720 bytes
Redo Buffers                5804032 bytes
SQL>

My Target & Auxiliary both are in same system but different file structures, so use the below CONVERT parameter in your auxiliary database.

SQL> show parameter convert


NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert                 string      G:\oradata\DB001\DB001, G:\oradata\D
                                                 B002
log_file_name_convert                string      G:\oradata\DB001\DB001, G:\oradata\D
                                                 B002


C:\>rman auxiliary sys
Recovery Manager: Release 11.2.0.1.0 - Production on Thu Apr 28 17:41:19 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
auxiliary database Password:
connected to auxiliary database: DB002 (not mounted)


RMAN> DUPLICATE DATABASE TO DB002 BACKUP LOCATION 'I:\Ora-Backup\DB001\';


Starting Duplicate Db at 28-APR-11


contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DB001'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''DB002'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile from  'I:\ORA-BACKUP\DB001\CF_C-1064524120-20110428-01';
   alter clone database mount;
}
executing Memory Script


sql statement: alter system set  db_name =  ''DB001'' comment= ''Modified by RMAN duplicate'' scope=spfile


sql statement: alter system set  db_unique_name =  ''DB002'' comment= ''Modified by RMAN duplicate'' scope=spfile


Oracle instance shut down


Oracle instance started


Total System Global Area     535662592 bytes


Fixed Size                     1375792 bytes
Variable Size                297796048 bytes
Database Buffers             230686720 bytes
Redo Buffers                   5804032 bytes


Starting restore at 28-APR-11
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK


channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08
output file name=G:\ORADATA\DB002\CONTROL01.CTL
output file name=G:\ORADATA\DB002\CONTROL02.CTL
Finished restore at 28-APR-11


database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK


contents of Memory Script:
{
   set until scn  13195367;
   set newname for datafile  1 to
 "G:\ORADATA\DB002\SYSTEM01.DBF";
   set newname for datafile  2 to
 "G:\ORADATA\DB002\SYSAUX01.DBF";
   set newname for datafile  3 to
 "G:\ORADATA\DB002\UNDOTBS01.DBF";
   set newname for datafile  4 to
 "G:\ORADATA\DB002\USERS01.DBF";
   restore
   clone database
   ;
}
executing Memory Script


executing command: SET until clause


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


Starting restore at 28-APR-11
using channel ORA_AUX_DISK_1


channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to G:\ORADATA\DB002\SYSTEM01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00002 to G:\ORADATA\DB002\SYSAUX01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00003 to G:\ORADATA\DB002\UNDOTBS01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00004 to G:\ORADATA\DB002\USERS01.DBF
channel ORA_AUX_DISK_1: reading from backup piece I:\ORA-BACKUP\DB001\BKP_01MAU0UD_1_1
channel ORA_AUX_DISK_1: piece handle=I:\ORA-BACKUP\DB001\BKP_01MAU0UD_1_1 tag=TAG20110428T165432
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:05
Finished restore at 28-APR-11


contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script


datafile 1 switched to datafile copy
input datafile copy RECID=5 STAMP=749670210 file name=G:\ORADATA\DB002\SYSTEM01.DBF
datafile 2 switched to datafile copy
input datafile copy RECID=6 STAMP=749670211 file name=G:\ORADATA\DB002\SYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=7 STAMP=749670211 file name=G:\ORADATA\DB002\UNDOTBS01.DBF
datafile 4 switched to datafile copy
input datafile copy RECID=8 STAMP=749670211 file name=G:\ORADATA\DB002\USERS01.DBF


contents of Memory Script:
{
   set until scn  13195367;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script


executing command: SET until clause


Starting recover at 28-APR-11
using channel ORA_AUX_DISK_1


starting media recovery


channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=11
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=12
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=14
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=15
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=16
channel ORA_AUX_DISK_1: restoring archived log
archived log file name=D:\ARCH\DB002\ARC_DB002_0000000116_0749666459.0001 RECID=103 STAMP=749670751
media recovery complete, elapsed time: 00:02:48
Finished recover at 28-APR-11


contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
   sql clone "alter system set  db_name =
 ''DB002'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script


database dismounted
Oracle instance shut down


connected to auxiliary database (not started)
Oracle instance started


Total System Global Area     535662592 bytes


Fixed Size                     1375792 bytes
Variable Size                297796048 bytes
Database Buffers             230686720 bytes
Redo Buffers                   5804032 bytes


sql statement: alter system set  db_name =  ''DB002'' comment= ''Reset to original value by RMAN'' scope=spfile


sql statement: alter system reset  db_unique_name scope=spfile


Oracle instance shut down


connected to auxiliary database (not started)
Oracle instance started


Total System Global Area     535662592 bytes


Fixed Size                     1375792 bytes
Variable Size                297796048 bytes
Database Buffers             230686720 bytes
Redo Buffers                   5804032 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "DB002" RESETLOGS ARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP  1 ( 'G:\ORADATA\DB002\REDO01.LOG' ) SIZE 50 M  REUSE,
  GROUP  2 ( 'G:\ORADATA\DB002\REDO02.LOG' ) SIZE 50 M  REUSE,
  GROUP  3 ( 'G:\ORADATA\DB002\REDO03.LOG' ) SIZE 50 M  REUSE
 DATAFILE
  'G:\ORADATA\DB002\SYSTEM01.DBF'
 CHARACTER SET WE8MSWIN1252




contents of Memory Script:
{
   set newname for tempfile  1 to
 "G:\ORADATA\DB002\TEMP01.DBF";
   switch clone tempfile all;
   catalog clone datafilecopy  "G:\ORADATA\DB002\SYSAUX01.DBF",
 "G:\ORADATA\DB002\UNDOTBS01.DBF",
 "G:\ORADATA\DB002\USERS01.DBF";
   switch clone datafile all;
}
executing Memory Script


executing command: SET NEWNAME


renamed tempfile 1 to G:\ORADATA\DB002\TEMP01.DBF in control file


cataloged datafile copy
datafile copy file name=G:\ORADATA\DB002\SYSAUX01.DBF RECID=1 STAMP=749670954
cataloged datafile copy
datafile copy file name=G:\ORADATA\DB002\UNDOTBS01.DBF RECID=2 STAMP=749670955
cataloged datafile copy
datafile copy file name=G:\ORADATA\DB002\USERS01.DBF RECID=3 STAMP=749670955


datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=749670954 file name=G:\ORADATA\DB002\SYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=749670955 file name=G:\ORADATA\DB002\UNDOTBS01.DBF
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=749670955 file name=G:\ORADATA\DB002\USERS01.DBF


contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script


database opened
Finished Duplicate Db at 28-APR-11


RMAN>

Fell free write your comments here.. Thanks !

Monday, April 25, 2011

Oracle 11g RMAN DUPLICATE DATABASE

Hello Friends, 


Happy New year !!!


This is my first post in 2011 year. [ may it's long time for me]. Now this is the time to share with you guys for Oracle 11g stuff. 


I would like to RMAN Backup / Recovery features in 11g. This will help you all to understand about oracle rman features in 11g { but not like oracle documentation :-) }


RMAN DUPLICATE DATABASE. 


In duplication database here is the three new features.


1. Duplication without a target database connection. Rman obtains metadata about backups from recovery catalog. 


2. Duplication without a target database connection and with out recovery catalog connection. Rman obtains metadata about backup from BACKUP LOCATION.


3. Duplication with a target database connection. Rman obtains metadata about backups from control file / Recovery catalog. 


let me test duplication database without a target database & without recovery catalog. 

Saturday, December 25, 2010

How to Export and Import Statistics.



How to Export and Import Statistics. 


A critical application suddenly seems to hang, wait events show long table scans running on the OLTP environment.
It comes out that the DBA in charge of this system did run statistics on the tables of the user that owns the application.
The gather statistics got stuck and the process was killed. Since this moment the application started to perform extremely slowly.


The production database has several clones; we decide to export back statistics from one of these clones, to the production database.


This document will descripe the steps to perform the export and import statistics. 


1. Create the stat table 


SQL> exec DBMS_STATS.CREATE_STAT_TABLE('SCOTT','OLD_STATS');


PL/SQL procedure successfully completed.


SQL> GRANT SELECT,INSERT,UPDATE,DELETE ON SCOTT.OLD_STATS TO PUBLIC;


Grant succeeded.


SQL>


SQL> select 'exec dbms_stats.export_table_stats('||chr(39)||owner||chr(39)||','||chr(39)||table_name||chr(39)||',nu
  2  ||chr(39)||',null,true,'||chr(39)||'SCOTT'||chr(39)||')'
  3  from dba_tables where owner ='&usrname'
  4
SQL> /
Enter value for usrname: SCOTT
old   3: from dba_tables where owner ='&usrname'
new   3: from dba_tables where owner ='SCOTT'
exec dbms_stats.export_table_stats('SCOTT','DEPT',null,'DEPT',null,true,'INV')
exec dbms_stats.export_table_stats('SCOTT','EMP',null,'EMP',null,true,'INV')
exec dbms_stats.export_table_stats('SCOTT','BONUS',null,'BONUS',null,true,'INV')
exec dbms_stats.export_table_stats('SCOTT','SALGRADE',null,'SALGRADE',null,true,'INV')
exec dbms_stats.export_table_stats('SCOTT','OLD_STATS',null,'OLD_STATS',null,true,'INV')


SQL>
SQL> select num_rows,last_analyzed from dba_tables where owner='SCOTT';


  NUM_ROWS LAST_ANAL
---------- ---------
         4 25-DEC-10
        14 25-DEC-10
         0 25-DEC-10
         5 25-DEC-10




SQL> exec DBMS_STATS.EXPORT_SCHEMA_STATS('&username','&stattablename');
Enter value for username: SCOTT
Enter value for stattablename: OLD_STATS


PL/SQL procedure successfully completed.


SQL> COMMIT;


Commit complete.


SQL>


SQL> host
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.


E:\>exp system/sys file=soctt_stat.dmp tables=scott.old_stats


Export: Release 10.2.0.1.0 - Production on Sat Dec 25 14:58:20 2010


Copyright (c) 1982, 2005, Oracle.  All rights reserved.




Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Product
With the Partitioning, OLAP and Data Mining options
Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set


About to export specified tables via Conventional Path ...
Current user changed to SCOTT
. . exporting table                      OLD_STATS         24 rows exported
Export terminated successfully without warnings.


E:\>




I'm deleting statistics by using the below method.


SQL> exec DBMS_STATS.delete_SCHEMA_STATS('&username');
Enter value for username: SCOTT


PL/SQL procedure successfully completed.


SQL> commit;


Commit complete.


SQL>






SQL> seLEct stale_stats ,num_rows from dba_tab_statistics where owner='SCOTT' and stale_stats is not null;


no rows selected




Here, Im not importing existing statistics by using export dump. Im trying to generate the new stats


SQL> exec dbms_stats.gather_schema_stats  -
>     (ownname=> 'SCOTT', -
>       cascade=>TRUE,   -
>       degree => 4, -
>     estimate_percent=>dbms_stats.auto_sample_size,-
>       options =>'GATHER');


PL/SQL procedure successfully completed.


SQL> commit;


Commit complete.


SQL> seLEct stale_stats ,num_rows from dba_tab_statistics where owner='SCOTT' and stale_stats is not null;
NO           4
NO          14
NO           0
NO           5
NO          24


SQL>


Thanks

ORA-01157: cannot identify/lock data file 37 - see DBWR trace file

Greeting!!! One of our RAC environment getting the below error

ORA-01157: cannot identify/lock data file 37 - see DBWR trace file
ORA-01110: data file 37: '+D02/datafile/01_data.306


This error means only one instance mounted to ASM others are DISMOUNTED. Even when we try to mount the ASM Instance getting the above message.

All the RAC services up but still getting same error .

Work Around:

ALTER SYSTEM CHECK DATAFILES.

After execute this command the one of cluster sync process released from hung stage. We’re able to connect the instance.

Welcome your comments and suggestion, Thanks

Saturday, November 13, 2010

Daylight Saving Time Problem

Daylight Saving Time Problem


Interesting topic for daylight saving time problem in oracle database. Many of DBA's thinking for daylight saving time changes database timestamp changes require. 

Just wants to share you all. Daylight saving time is related to application setup not database related. If your using > oracle 9i no changes require from database level. 

As  per my understanding there might be some EMC tool available for daylight saving time changes for application or operating system. 


Thanks, Babu

Sunday, August 22, 2010

Step by Step to create physical standby database using RMAN


Dear blog readers and friends, In my busy schedule do not have time to write oracle tech..,  This week and next week planing to write something in oracle hints query's , data guard switch over etc.. 


Today I have done physical standby database using recovery manager and sharing my experience with you., Please let me know your feedback / comments

Step by Step to create physical standby database using RMAN

RMAN will take care the following procedure for creating standby database

a. Standby controlfile restore

b. Primary data files backup restore 

c. After restore standby controlfile, Rman recover the standby database by specify time or latest archive log generated. 

c. Finally, RMAN leave the standby database once it's mounted. If needed manually we can start MRP process. 

According to oracle documentation, RMAN cannot full automate for create standby database, there are some manual process require. 

Manual Process:

1. Starting database with out mount stage. 
2. Configuring INIT parameter in primary & standby database.  ( In windows env., manually need to create password file)
3. And we must have backup of database including current standby controlfile.

1. How to Configure NET Service (INIT) parameter in primary & standby database. 


2. Once completed net service configuration in primary database, copy same init parameter for standby database & needed some necessary changes like FAL_SERVER, FAL_CLIENT, LOG_ARCHIVE_DEST_1 and LOG_ARCHIVE_DEST2

3. In standby database manually create password file & start the database with out mount stage

4. As i said, In production need to take complete backup with current standby controlfile. I used the below command for taking complete backup. 

Execute the below script in Target database:-

run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
backup incremental level 0 format 'e:\DBbackup\i001_%T_%u_s%s_p%p' database;
backup format 'e:\DBbackup\i001_arch_%T_%u_s%s_p%p' archivelog all;
backup current controlfile for standby format'e:\DBbackup\i001_CF_%T_%u_s%s_p%p' ; 
}


released channel: ORA_DISK_1
....
...
..


5. Once completed your full backup, EXIT your session, We need to connect AUXILIARY by using TARGET as well Catalog / NoCatalog

Ex:

C:\>rman target / nocatalog auxiliary sys/sys@dg_i001

Recovery Manager: Release 10.2.0.1.0 - Production on Mon Aug 23 02:56:06 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: I001 (DBID=2720927431)
using target database control file instead of recovery catalog
connected to auxiliary database: I001 (DBID=2720927431, not open)

Script for Standby Database creation by using Duplicate RMAN::-

run
{
allocate auxiliary channel c1 device type disk;
allocate auxiliary channel c2 device type disk;
duplicate target database for standby
nofilenamecheck;
#dorecover;
}

Duplicate Standby RMAN Logs::-


RMAN> run
2> {
3> allocate auxiliary channel c1 device type disk;
4> allocate auxiliary channel c2 device type disk;
5> duplicate target database for standby
6> nofilenamecheck;
7> #dorecover;
8> }

allocated channel: c1
channel c1: sid=155 devtype=DISK

allocated channel: c2
channel c2: sid=158 devtype=DISK

Starting Duplicate Db at 23-AUG-10

contents of Memory Script:
{
   restore clone standby controlfile;
   sql clone 'alter database mount standby database';
}
executing Memory Script

Starting restore at 23-AUG-10

channel c1: starting datafile backupset restore
channel c1: restoring control file
channel c1: reading from backup piece E:\DBBACKUP\I001_CF_20100823_0ULM19RE_S30_
P1
channel c1: restored backup piece 1
piece handle=E:\DBBACKUP\I001_CF_20100823_0ULM19RE_S30_P1 tag=TAG20100823T020325

channel c1: restore complete, elapsed time: 00:00:03
output filename=E:\ORADATA\I001\CONTROL01.CTL
output filename=E:\ORADATA\I001\CONTROL02.CTL
output filename=E:\ORADATA\I001\CONTROL03.CTL
Finished restore at 23-AUG-10

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to
 "E:\ORADATA\I001\TEMP01.DBF";
   switch clone tempfile all;
   set newname for datafile  1 to
 "E:\ORADATA\I001\SYSTEM01.DBF";
   set newname for datafile  2 to
 "E:\ORADATA\I001\UNDOTBS01.DBF";
   set newname for datafile  3 to
 "E:\ORADATA\I001\SYSAUX01.DBF";
   set newname for datafile  4 to
 "E:\ORADATA\I001\USERS01.DBF";
   restore
   check readonly
   clone database
   ;
}
executing Memory Script

executing command: SET NEWNAME

renamed temporary file 1 to E:\ORADATA\I001\TEMP01.DBF in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 23-AUG-10

channel c1: starting datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to E:\ORADATA\I001\UNDOTBS01.DBF
restoring datafile 00003 to E:\ORADATA\I001\SYSAUX01.DBF
channel c1: reading from backup piece E:\DBBACKUP\I001_20100823_0OLM199H_S24_P1
channel c2: starting datafile backupset restore
channel c2: specifying datafile(s) to restore from backup set
restoring datafile 00001 to E:\ORADATA\I001\SYSTEM01.DBF
restoring datafile 00004 to E:\ORADATA\I001\USERS01.DBF
channel c2: reading from backup piece E:\DBBACKUP\I001_20100823_0NLM199G_S23_P1
channel c1: restored backup piece 1
piece handle=E:\DBBACKUP\I001_20100823_0OLM199H_S24_P1 tag=TAG20100823T015352
channel c1: restore complete, elapsed time: 00:01:05
channel c2: restored backup piece 1
piece handle=E:\DBBACKUP\I001_20100823_0NLM199G_S23_P1 tag=TAG20100823T015352
channel c2: restore complete, elapsed time: 00:01:40
Finished restore at 23-AUG-10

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy recid=6 stamp=727710709 filename=E:\ORADATA\I001\SYSTEM01.DB
F
datafile 2 switched to datafile copy
input datafile copy recid=7 stamp=727710709 filename=E:\ORADATA\I001\UNDOTBS01.D
BF
datafile 3 switched to datafile copy
input datafile copy recid=8 stamp=727710709 filename=E:\ORADATA\I001\SYSAUX01.DB
F
datafile 4 switched to datafile copy
input datafile copy recid=9 stamp=727710710 filename=E:\ORADATA\I001\USERS01.DBF

Finished Duplicate Db at 23-AUG-10
released channel: c1
released channel: c2

RMAN>


Successfully completed standby database creating by using RMAN & both database are in Sync.,

Sync Checking:

C:\>sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Aug 23 03:00:21 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            D:\ArchiveLog\i001
Oldest online log sequence     21
Next log sequence to archive   23
Current log sequence           23
SQL>
SQL> exit

C:\>sqlplus sys/sys@dg_i001 as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Aug 23 03:00:40 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            E:\ArchiveLog\i001
Oldest online log sequence     21
Next log sequence to archive   23
Current log sequence           23
SQL>

Thanks.,