Search This Blog

Monday, October 24, 2016

DB CLONING – RMAN DUPLICATE (Backup based)

Hello Everyone,

Below is tested in my environment and i have done refresh successfully using this method. Following will be backup based duplicate with no production downtime. Here i have done the refresh for oracle e-business suite.


DB CLONING – RMAN DUPLICATE (Backup based)


Source
Target
Host name
ORAPROD
ORACLONE
Instance name
PROD
CLONE






Preclone in Prod dbTier : 

Go to /u01/oracle/PROD/11.2.0/appsutil/scripts/PROD_oraprod

Perl adpreclone.pl dbTier

Please make sure stage created successfully.

Login to clone server :

Create directory for clone oracle home.

Mkdir –p /a02/oraclone/CLONE/11.2.0
Mkdir –p /a02/oraclone/CLONE/data

Copy oracle home from prod to clone server.

(Note : Copy only oracle home, don’t copy any db files since we will duplicating the db through RMAN.)

Adcfgclone in CLONE server :

Once oracle home copied to clone server, Execute the below.

Go to $ORACLE_HOME/clone/bin

Perl adcfgclone.pl dbTechStack

dbTechSTack – It will configure the clone oracle home and will make necessary directories and configuration files for clone instance.
Once adcfgclone.pl completes successfully, we can get the env file clone instance under $ORACLE_HOME. We can use the populated env file for clone instance.

Backup the production database :
Go to prod server :

Cd /tmp/sikky/rman/scripts/

Backup the production database, archive logs and control files.

Use the below command :

Nohup rman cmdfile= full_bkp_ar_cf.rcv log= full_bkp_ar_cf.log &

Make sure rman completed without any error.
Script used :
connect target sys/sys123
RUN
 {
 ALLOCATE CHANNEL t1 DEVICE TYPE DISK MAXPIECESIZE = 8G;
 ALLOCATE CHANNEL t2 DEVICE TYPE DISK MAXPIECESIZE = 8G;
 ALLOCATE CHANNEL t3 DEVICE TYPE DISK MAXPIECESIZE = 8G;
 ALLOCATE CHANNEL t4 DEVICE TYPE DISK MAXPIECESIZE = 8G;
 ALLOCATE CHANNEL t5 DEVICE TYPE DISK MAXPIECESIZE = 8G;
 backup as compressed backupset incremental level 0 FILESPERSET 4
 format '/export/home/oracle/PROD/backup/FULL_%d_%U'
 (database);
 RELEASE CHANNEL t1 ;
 RELEASE CHANNEL t2 ;
 RELEASE CHANNEL t3 ;
 RELEASE CHANNEL t4 ;
 RELEASE CHANNEL t5 ;
 sql 'alter system archive log current';
 backup
  filesperset 20
  format '/export/home/oracle/PROD/backup/ar_%t_%s_%p'
  (archivelog all);

 backup
  format '/export/home/oracle/PROD/backup/cf_%d_%U'
  (current controlfile);
 }

Above script can be used to backup the full database, archive logs and current control file.

Move backup pieces to Clone :

Check the directories where backup pieces have been stored in Prod server. Create the same directory structure in clone server.

Mkdir –p /export/home/oracle/PROD/backup
(Please create a similar directory in clone server like prod to avoid any irrelevant errors)

Scp the backup pieces from prod to clone.

Cd /export/home/oracle/PROD/backup
Scp * oraclone@oraclone: /export/home/oracle/PROD/backup/

TNSNAMES.ORA :

Make sure both servers able to ping with each other. Add the both instance tns entries in both tnsnames.ora

Prod :

PROD=
        (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=oraprod.ebs.com)(PORT=1521))
            (CONNECT_DATA=
                (SERVICE_NAME=PROD)
                (INSTANCE_NAME=PROD)
            )
        )

CLONE = (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=oraclone)(PORT=1542))
                (CONNECT_DATA=(SID=CLONE))
            )

Clone :

CLONE = (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=oraclone)(PORT=1542))
                (CONNECT_DATA=(SID=CLONE))
            )

PROD=
        (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=oraprod.ebs.com)(PORT=1521))
            (CONNECT_DATA=
                (SERVICE_NAME=PROD)
                (INSTANCE_NAME=PROD)
            )
        )

Orapwd creation :

Please make sure both oracle homes have password file with same password.
orapwd file=$ORACLE_HOME/dbs/orapwPROD password=sys123 entries=4
orapwd file=$ORACLE_HOME/dbs/orapwCLONE password=sys123 entries=4

Please read my blog once before you do the above. It may be helpful to create password file.
http://sikkyappsdba.blogspot.com/2016/10/ora-01994-grant-failed-password-file.html

Pfile creation :

If prod is running with spfile create a pfile from spfile and scp it to clone server.

$sqlplus / as sysdba
SQL > create pfile from spfile;

Scp pfile to $ORACLE_HOME/dbs to clone server.

Edit the pfile and update the below parameters.

db_name                         = CLONE
control_files                   = /a02/oraclone/CLONE/data/cntrl01.dbf,/a02/oraclone/CLONE/data/cntrl02.dbf,/a02/oraclone/CLONE/data/cntrl03.dbf
db_file_name_convert='/u01/oracle/PROD/data','/a02/oraclone/CLONE/data'
log_file_name_convert='/u01/oracle/PROD/data','/a02/oraclone/CLONE/data'

Clone instance :

Once pfile is created start the instance in nomount.
sqlplus / as sysdba
startup nomount pfile=initCLONE.ora

RMAN Connectivity :

Check whether you are able to connect to both database through RMAN.
Rman> connect target sys/sys123@PROD
RMAN> connect auxiliary sys/sys123@CLONE

Nohup rman cmdfile= dup_bkp.rcv log= dup_bkp.rcv &

Script used :

connect auxiliary sys/change_on_install@CLONE
connect target sys/change_on_install@PROD
RUN
{
ALLOCATE AUXILIARY CHANNEL ch01 device type disk; 
ALLOCATE AUXILIARY CHANNEL ch02 device type disk;
ALLOCATE CHANNEL ch03 device type disk;
ALLOCATE CHANNEL ch04 device type disk;
duplicate target database to 'CLONE';
RELEASE CHANNEL ch01;
RELEASE CHANNEL ch02;
RELEASE CHANNEL ch03;
RELEASE CHANNEL ch04;

}

RMAN will do the rest. Just sit and monitor the logs.

Output :

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

database opened
Finished Duplicate Db at 24-OCT-16

released channel: ch01
released channel: ch02
released channel: ch03
released channel: ch04
Recovery Manager complete.

RMAN will do the refresh and will open the database. It is recommended to Create spfile once and bounce the database.

ORA-01994: GRANT failed: password file missing or disabled

How to replicate?

Below is the one of the way to replicate this issue. Connect to sysdba and grant sysdba privilage to sys user.

Cause :

Oracle is unable to read your password file.

Just make sure the below,

1) Create a password file if it does not exist

2) While creating password file make sure to mention $ORACLE_HOME/dbs in file variable.
 Ex : orapwd file=$ORACLE_HOME/dbs/orapwORADEV password=change_on_install entries=4

By default oracle looks for password file here. Either mentioned the above or move to $ORACLE_HOME/dbs and create password file.

3) Make sure your sid matches with the password file (Upper case or lower case).

Ex :

NAME      OPEN_MODE
--------- --------------------
ORADEV    READ WRITE

For my db, it worked only after created like orapwORADEV

The above should fix this error. 

Thursday, October 20, 2016

Step by step R12.1.1 installation

Hello DBA's,

This post will be useful for beginners who installing e-business suite for first time.

Pre-requisites :

Please create OS users needed for the installation. Recommended are applmgr and oracle.

Applmgr - Application binary owner
Oracle - Database binary owner

How to create OS user?

Run the below as root user,

Lets create the groups before we create users.

# groupadd dba
#groupadd oinstall

Now create the user,

useradd oracle -g oinstall -G dba (g denotes primary group and G denotes secondary group)
useradd applmgr -g oinstall -G dba

If you dont have root password reach out to your UNIX or OS team. They will assist you on this.

OS Pre-requisites :

Please read the below note before you start the installation.

Oracle E-Business Suite Release 12 Installation Guidelines (Doc ID 405565.1)

Pick the note id depends on your hardware. In this post we will be installing on Linux (32 bit) so we have to refer note id 761564.1/

Platform-Specific Documents - Release 12.1.1

Platform
Refer To
Linux x86 (32-bit)
Linux x86-64 (64-bit)
HP-UX Itanium
HP-UX PA-RISC (64-bit)
IBM AIX on Power Systems (64-bit)
IBM: Linux on System z
Microsoft Windows Server (32-bit)
Oracle Solaris on SPARC (64-bit)


Please make sure your server has all the recommended RPM's.

Our hardware will be as follows :

OS - Oracle linux 6 (32 bit)

How to check whether rpm is installed?

Use the below as root user.

# rpm -qa|grep <rpm name>

If the server returns rpm with the greater version of the recommended then we are good to keep the same. If it returns lower version we have to upgrade the rpm or if it does not return we need to install the rpm.

#rpm -ivh <rpm name> --> to install
#rpm -Uvh <rpm name> --> To upgrade


To force any rpm to be installed :

#rpm -ivh <rpm name> --nodeps

You can also use yum command to install rpm's.


Oracle Linux 6*
Red Hat Enterprise Linux 6*
Update 1 (6.1) or higher of Oracle Linux 6 is required.
Update 1 (6.1) or higher of Red Hat Enterprise Linux 6 is required.
The following packages (or versions of packages) are not part of the OS distribution media and must be downloaded separately (from http://oss.oracle.com/projects/compat-oracle/files/Enterprise_Linux) for both Oracle Linux 6 and RHEL 6 and installed manually:
  • openmotif21-2.1.30-11.EL6.i6861 --> Make sure you have exact version of openmotif as recommended by oracle or else you will not be able to open forms.
  • xorg-x11-libs-compat-6.8.2-1.EL.33.0.1.i386
The following packages must be installed from the Oracle Linux 6 or RHEL 6 distribution media:
  • binutils-2.20.51.0.2-5.20
  • compat-glibc-2.5-46.2.0.1
  • compat-glibc-headers-2.5-46.2.0.1
  • gcc-4.4.5-6
  • gcc-c++-4.4.5-6
  • glibc-2.12-1.252
  • glibc-common-2.12-1.252
  • glibc-devel-2.12-1.25
  • glibc-headers-2.12-1.25
  • libgcc-4.4.5-62
  • libstdc++-devel-4.4.5-6
  • libstdc++-4.4.5-62
  • make-3.81-192
  • gdbm-1.8.0-362
  • libXp-1.0.0-15.1
  • libaio-0.3.107-102
  • libgomp-4.4.5-6
  • sysstat-9.0.4-18
  • compat-libstdc++-296-2.96-144
  • compat-libstdc++-33-3.2.3-69
Additionally, the following RPMs are required for the database tier running 11gR2 (users must upgrade the bundled 11gR1 DB to 11gR2 either before or after installing 12.1) on the database tier:
  • elfutils-libelf-devel-0.152-1
  • libaio-devel-0.3.107-10
  • mksh-39-5
  • unixODBC-2.2.14-11
  • unixODBC-devel-2.2.14-11
  • xorg-x11-utils-7.4-8
Note:
1: The openmotif package version must be 2.1.30 (for example, openmotif-2.3.3-1 is not supported).
2: This rpm is distributed as part of the 'default' installation of Enterprise Linux

Once everything is setup we are good to begin the rapidwiz.

what is rapidwiz?

Rapidwiz is just a tool where we used to install ebs software. (like runinstaller)

Go to the stage directory and invoke the installation.

[oracle@dev  log]$ ./rapidwiz



- Select install option
- Upgrade option will be for R12 upgrades from 11i

Uncheck the tick box at this stage.


 - Select create new configuration


- Select port pool value. Its user defined.


- Since this is new implementation we will choose Fresh Database with below details
DB SID
DB Host and domain name
Os version
DB os user name and group 
$ORACLE_BASE value


select suite licensing

\


select DB characterset


Select application host name

 Below option is to enable or disable any service.







Rapidwiz will begin the installation now. 






If you get the error above please apply the below fix.

Solution:

1) Shut all application services.

2) create the below link for library file as below

 ln -s   /usr/lib/libgdbm.so.2.0.0  /usr/lib/libdb.so.2 (Please refer the screen shot below)

3) Startup all application services








Thats it. We can start the services and check the login page.

Step by step physical standby creation

Step by step dataguard configuration



In this exercise I have provided steps in detailed manner to build physical standby database in oracle 11g. We will be doing standby setup in the following servers.

Server details :


Hostname
Ip address
Primary
Dev186.ebs.com
192.168.55.42
Standby
Dev201.ebs.com
192.168.55.34

DB details :


SID
DB_Unique_Name
Service Name
Primary
Primary
Primary
PRIMARY
Standby
Primary
Standby
STANDBY

Prerequisites for primary server :

- Primary should be running in archive log mode and Force logging should be enabled as below


Please issue the below to check whether db is running in archive log mode or no archive log mode :

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST

Please issue the below to check whether db is running in force_logging mode :

SQL> select FORCE_LOGGING from v$database;

FOR
---
YES

In case your db is running in noarchivelog mode and non-force logging mode follow the below :

Before issuing the queries below make sure to keep your db in mount state :

SQL> alter database archivelog enable;

SQL>alter database force logging;

make sure you have  connectivity between primary and standby servers.

From primary :

[oracle@dev186 oracle]$ ping 192.168.55.34

From standby :

[oracle@dev186 oracle]$ ping 192.168.55.42



Primary listener file : (/oracle/11g/11gr2/network/admin/listener.ora)


# listener.ora Network Configuration File: /oracle/11g/11gr2/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER_PRIMARY = (SID_LIST = (SID_DESC =(SID_NAME = primary) (ORACLE_HOME = /oracle/11g/11gr2)))

INBOUND_CONNECT_TIMEOUT_LISTENER = 0


LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = dev186.ebs.com)(PORT = 1521))
    )
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = primary)
      (ORACLE_HOME = /oracle/11g/11gr2)
     )
  )
ADR_BASE_LISTENER = /oracle/11g









TNS files : (/oracle/11g/11gr2/network/admin/tnsnames.ora)

# tnsnames.ora Network Configuration File: /oracle/11g/11gr2/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

PRIMARY =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = dev186.ebs.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = PRIMARY)
    )
  )

LISTENER_PRIMARY =
  (ADDRESS = (PROTOCOL = TCP)(HOST = dev186.ebs.com)(PORT = 1521))


STANDBY =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = dev201.ebs.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = STANDBY)
    )
  )

Once you have updated both the listener and tnsnames files, start the listener in both the servers and check the below :

Primary :

[oracle@dev186 oracle]$  lsnrctl start

to check status,

[oracle@dev186 oracle]$ lsnrctl status

Standby :

[oracle@dev201 oracle]$ lsnrctl start

once listener is up issue the below and check the connectivity

[oracle@dev186 oracle]$tnsping primary
[oracle@dev186 oracle]$tnsping standby





In order to configure dataguard, your primary and standby should use same password file. Create a new password file if you dont remember current sys password else you can move  the current password file to standby as below :


[oracle@dev186 oracle]$ cd $ORACLE_HOME

[oracle@dev186 11gr2]$ cd dbs

[oracle@dev186 dbs]$ ls

hc_clone.dat  hc_primary.dat  initCLONE.ora    initstandby.ora  lkSTANDBY     redo.sql          spfileprimary.ora
hc_DBUA0.dat  hc_standby.dat  init.ora         lkCLONE          orapwprimary  snapcf_primary.f
hc_orcl.dat   initclone.ora   initPRIMARY.ora  lkPRIMARY        primary.ora   spfileclone.ora

[oracle@dev186 dbs]$ scp orapwprimary oracle@192.168.55.34:/oracle/11g/product/11.2.0/dbhome_1/dbs/ orapwstandby

Add standby redo logs  :

SQL>alter database add standby logfile group 4 ‘/oracle/11g/flash_recovery_area/PRIMARY/onlinelog/log4a.log’ size 500M;

Database altered.



Update required parameters in primary pfile. Your primary pfile should be as below :

Primary pfile = $ORACLE_HOME/dbs/initprimary.ora


initPRIMARY.ora :

primary.__db_cache_size=520093696
primary.__java_pool_size=16777216
primary.__large_pool_size=16777216
primary.__oracle_base='/oracle/11g'#ORACLE_BASE set from environment
primary.__pga_aggregate_target=771751936
primary.__sga_target=855638016
primary.__shared_io_pool_size=0
primary.__shared_pool_size=285212672
primary.__streams_pool_size=0
*.audit_file_dest='/oracle/11g/admin/primary/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/oracle/11g/oradata/PRIMARY/controlfile/o1_mf_9q0v8cyw_.ctl','/oracle/11g/flash_recovery_area/PRIMARY/controlfile/o1_mf_9q0v8d1v_.ctl'
*.db_block_size=8192
*.db_create_file_dest='/oracle/11g/oradata'
*.db_domain=''
*.db_name='primary'
*.db_recovery_file_dest='/oracle/11g/flash_recovery_area'
*.db_recovery_file_dest_size=5242880000
*.DB_UNIQUE_NAME='primary'
*.diagnostic_dest='/oracle/11g'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=primaryXDB)'
*.FAL_SERVER='standby'
*.local_listener='LISTENER_PRIMARY'
*.LOG_ARCHIVE_CONFIG='DG_CONFIG=(primary,standby)'
*.LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=primary'
*.LOG_ARCHIVE_DEST_2='SERVICE=standby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=standby'
*.LOG_ARCHIVE_DEST_STATE_1='ENABLE'
*.LOG_ARCHIVE_DEST_STATE_2='ENABLE'
*.LOG_ARCHIVE_MAX_PROCESSES=30
*.memory_target=1613758464
*.open_cursors=300
*.processes=150
*.REMOTE_LOGIN_PASSWORDFILE='EXCLUSIVE'
*.STANDBY_FILE_MANAGEMENT='AUTO'
*.undo_tablespace='UNDOTBS1'


initstandby.ora :

primary.__db_cache_size=671088640
primary.__java_pool_size=16777216
primary.__large_pool_size=16777216
primary.__oracle_base='/oracle/11g'#ORACLE_BASE set from environment
primary.__pga_aggregate_target=654311424
primary.__sga_target=973078528
primary.__shared_io_pool_size=0
primary.__shared_pool_size=251658240
primary.__streams_pool_size=0
*.audit_file_dest='/oracle/11g/admin/standby/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/oracle/11g/oradata/standby/control01.ctl','/oracle/11g/flash_recovery_area/standby/control02.ctl'
*.db_block_size=8192
*.db_create_file_dest='/oracle/11g/oradata/standby'
*.db_domain=''
*.db_name='primary'
*.db_recovery_file_dest='/oracle/11g/flash_recovery_area'
*.db_recovery_file_dest_size=5242880000
*.diagnostic_dest='/oracle/11g'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=standbyXDB)'
*.local_listener='LISTENER_STANDBY'
*.memory_target=1613758464
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
DB_UNIQUE_NAME='standby'
LOG_ARCHIVE_CONFIG='DG_CONFIG=(primary,standby)'
LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=standby'
LOG_ARCHIVE_DEST_2='SERVICE=primary LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=primary'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_MAX_PROCESSES=30
FAL_SERVER=standby
#db_create_online_log_dest_1='/oracle/11g/oradata/standby'
STANDBY_FILE_MANAGEMENT=AUTO
db_file_name_convert=('/oracle/11g/oradata/PRIMARY','/oracle/11g/oradata/STANDBY')
log_file_name_convert=('/oracle/11g/oradata/PRIMARY','/oracle/11g/oradata/STANDBY')

Once you have updated standby pfile, bring up standby instance to nomount state.

[oracle@dev201 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jun 7 12:06:04 2014

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> startup nomount pfile='$ORACLE_HOME/dbs/initstandby.ora'

Your instance should be started without any error.


Next, we have to clone primary db from primary server to standby server. In order to achieve this, we can use any of the cloing of the method as per our covenience. Here we will use duplicate statement to replicate db. Make sure you have updated the parameters below in standby pfile if your directory structure is different.

db_file_name_convert='/oracle/11g/oradata/STANDBY','/oracle/11g/oradata/PRIMARY'
log_file_name_convert='/oracle/11g/oradata/STANDBY','/oracle/11g/oradata/PRIMARY'







Take backup of primary database and controlfile using RMAN as below :

[oracle@dev186 oracle]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jun 7 12:14:37 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: PRIMARY (DBID=1684851363)


RMAN> backup current controlfile for standby;

Starting backup at 07-JUN-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=147 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including standby control file in backup set
channel ORA_DISK_1: starting piece 1 at 07-JUN-14
channel ORA_DISK_1: finished piece 1 at 07-JUN-14
piece handle=/oracle/11g/flash_recovery_area/PRIMARY/backupset/2014_06_07/o1_mf_ncnnf_TAG20140607T121717_9s5fcrs3_.bkp tag=TAG20140607T121717 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 07-JUN-14

RMAN> backup database plus archivelog;

Starting backup at 07-JUN-14
using channel ORA_DISK_1
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=/oracle/11g/oradata/PRIMARY/datafile/o1_mf_system_9q0v6hgo_.dbf
input datafile file number=00002 name=/oracle/11g/oradata/PRIMARY/datafile/o1_mf_sysaux_9q0v6hkx_.dbf
input datafile file number=00005 name=/oracle/11g/oradata/PRIMARY/datafile/o1_mf_example_9q0v8sz0_.dbf
input datafile file number=00003 name=/oracle/11g/oradata/PRIMARY/datafile/o1_mf_undotbs1_9q0v6hl7_.dbf
input datafile file number=00004 name=/oracle/11g/oradata/PRIMARY/datafile/o1_mf_users_9q0v6hm1_.dbf
channel ORA_DISK_1: starting piece 1 at 07-JUN-14

Starting backup at 07-JUN-14
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=71 RECID=87 STAMP=849615566
channel ORA_DISK_1: starting piece 1 at 07-JUN-14
channel ORA_DISK_1: finished piece 1 at 07-JUN-14
piece handle=/oracle/11g/flash_recovery_area/PRIMARY/backupset/2014_06_07/o1_mf_annnn_TAG20140607T121926_9s5fhp63_.bkp tag=TAG20140607T121926 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 07-JUN-14


once backup is finished, Move all your backup including controlfile backup to standby server using scp command. Move all backup pieces to flash_recovery_area in standy server.

FRA ==> /oracle/11g/flash_recovery_area but your backup pieces should be in the below as same as primary server, 

Move backup pieces to the follwing in standby server --> oracle/11g/flash_recovery_area/PRIMARY/backupset/2014_06_06


Before we duplicate standby db we have create following directory structure into standby server.

[oracle@dev201 oracle]$ mkdir -pr oracle/11g/flash_recovery_area/PRIMARY/backupset/2014_06_06

[oracle@dev201 oracle]$ mkdir -pr oracle/11g/flash_recovery_area/PRIMARY/onlinelog


[oracle@dev201 oracle]$ mkdir -pr oracle/11g/oradata/standby

Now connect both target and auxiliary servers using RMAN,


[oracle@dev201 trace]$ rman

Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jun 7 12:27:59 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

RMAN> connect auxiliray /

connected to target database: PRIMARY (DBID=1684851363)

RMAN> connect target sys/sys@primary

connected to auxiliary database: PRIMARY (DBID=1684851363)

RMAN> duplicate target database for standby nofilenamecheck dorecover;

once done.

Start MRP process in standby database,

SQL> alter database recover managed standy database disconnect;

once you issued, mrp bg process will be started in standby, confirm be the below :

[oracle@dev201 STANDBY]$ ps -ef | grep mrp

oracle    9543     1  0 09:28 ?        00:00:01 ora_mrp0_standby

once MRP process have been stared in standby, our standby db is all set receive redo log changes from primary. Now manually switch log file and check archive log sequences to make sure both have same count.

Connect to primary db and issue the below :

SQL>alter system switch logfile;

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     72
Next log sequence to archive   74
Current log sequence           74

Connect to standy db and issue the below :

SQL>archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     72
Next log sequence to archive   0
 Current log sequence           74




Check both the primary and standby alert logs for any errors. If not we have successfully configured physical standby and we can confirm it by the following queries,

DG Queries  :

Issue the following query to show information about the protection mode, the protection level, the role of the database, and switchover status:

SELECT DATABASE_ROLE, DB_UNIQUE_NAME INSTANCE, OPEN_MODE, PROTECTION_MODE, PROTECTION_LEVEL, SWITCHOVER_STATUS FROM V$DATABASE;

On the standby database, query the V$ARCHIVED_LOG view to identify existing files in the archived redo log.

SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

Or

SELECT THREAD#, MAX(SEQUENCE#) AS "LAST_APPLIED_LOG" FROM V$LOG_HISTORY GROUP BY THREAD#;

On the standby database, query the V$ARCHIVED_LOG view to verify the archived redo log files were applied.

SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

Query the physical standby database to monitor Redo Apply and redo transport services activity at the standby site.

SELECT PROCESS, STATUS, THREAD#, SEQUENCE#, BLOCK#, BLOCKS FROM V$MANAGED_STANDBY;

To determine if real-time apply is enabled, query the RECOVERY_MODE column of the V$ARCHIVE_DEST_STATUS view.

SELECT RECOVERY_MODE FROM V$ARCHIVE_DEST_STATUS;

The V$DATAGUARD_STATUS fixed view displays events that would typically be triggered by any message to the alert log or server process trace files.

SELECT MESSAGE FROM V$DATAGUARD_STATUS;

Hope this document helps! :) Happy learning! Cheers!

You cannot complete this task because one of the following events caused a loss of page data: A system failure has occurred "Front end is locked after 12.2 upgrade"

  If you have upgraded to Oracle E-Business Suite 12.2.10 Release Update Pack from Oracle E-Business Suite 12.2.6 Release Update Pack (or ea...