Category: Oracle Database

Oracle-11g-step-by-step-Installation-Guide-with-Screenshots

This is a 16 step Oracle 11g installation guide that covers a typical installation scenario with screenshots.

Note: Since there are several screenshots of various Oracle installation steps on this page, I’ve shown only the thumbnails of the screenshot. Click on the individual thumbnail image to view the full-size screenshot of a particular Oracle installation step.

1. Select installation method

Following two installation methods are available:

  • Basic Installation – Choose this to perform the full Oracle Database 11g installation with standard configuration options. You can use only filesystem for storage in this option.
  • Advanced Installation – This gives your full control over the installation, including the ability to choose Automatic Storage Management. Select this option as shown below.
[Select Installation Method]
Fig – Select Installation Method (Click on the image to enlarge it)

2. Specify Inventory directory and credentials

Enter the following information:

  • Enter the inventory directory: /u01/app/oraInventory
  • Specify operating system group name: oinstall
[Specify Inventory Directory]
Fig – Specify Inventory directory and credentials (Click on the image to enlarge it)

3. Select Installation Type

Following three installation types are available:

  • Enterprise Edition – Select this option.
  • Standard Edition
  • Custom
[Select Installation Type]
Fig – Select Installation Type (Click on the image to enlarge it)

4. Specify Install Location

Enter the following information:

  • Oracle Base: /u01/app/oracle
  • Name: Oracle_Home
  • Path: /u01/app/oarcle/product/11.1.0
[Specify Install Location]
Fig – Select Install Location (Click on the image to enlarge it)

5. Product-Specific Prerequisite Checks

In this screen, the Installer verifies that your environment meets all of the minimum requirements for installing and configuring the products that you have chosen to install. You must manually verify and confirm the items that are flagged with warnings and items that require manual checks.

6. Select Configuration Option

Following three configuration options are available:

  • Create a Database – Select this option.
  • Configure Automatic Storage Management (ASM)
  • Install Software Only
[Select Configuration Option]
Fig – Select Configuration Option (Click on the image to enlarge it)

7. Select a Database Configuration

Following three database configuration options are available.

  • General Purpose/Transaction Processing – Select this option.
  • Data Warehouse
  • Advanced
[Select Database Configuration]
Fig – Select Database Configuration (Click on the image to enlarge it)

8. Specify Database Configuration

Enter the following information:

  • Global Database Name: devdb.example.com . An Oracle database is uniquely identified by a Global Database Name, typically of the form “name.domain”
  • SID: devdb

9. Specify Database Configuration Details

There are four different tabs in this screen as shown below:

  • Memory Tab
    • Select the check-box to Enable Automatic Memory Management
    • Drag the bar to allocate the memory. This will automatically allocate memory size for SGA and PGA depending on the total database memory allocated.
  • Character Sets Tab. Following three character set options are given in this tab.
    • Use the default
    • Use Unicode (AL32UTF8)
    • Choose from the list of character sets.  Select Database Character Set as Unicode standard UTF-8AL32UTF8 – Select this option.
  • Security Tab – Just leave the defaults in this tab.
  • Sample Schema Tab – Just leave the defaults in this tab.
[Specify Config Details for Memory]
Fig – Select Database Config Details with Memory Tab (Click on the image to enlarge it)

10. Select Database Management Option

Following two management options are available:

  • Use Grid Control for Database Management
    • Management Service: Choose an agent.
  • Use Database Control for Database Management- Select this option.
    • Select the check-box to Enable Email Notifications
    • Outgoing mail (SMTP) Server:
    • Email Address:
[Select DB Management Option]
Fig – Select Database Management Option (Click on the image to enlarge it)

11. Specify Database Storage Option

Following two storage options are available:

  • File System – Select this option.
    • Specify Database File location: /u01/app/oracle/oradata/
  • Automatic Storage Management. ASM simplifies database storage administration and optimizes database layout for I/O performance.

12. Specify Backup and Recovery Option

Enable automated backup as shown below. If you’ve configured ASM, you can choose to store the automated backups on ASM. If not, select File System option.

[Specify Backup Recovery Option]
Fig – Specify Backup and Recovery Options (Click on the image to enlarge it)

13. Specify database schema password

Enter the password for sys, system, sysman, dbsnmp schemas. You have the option of either using the same passwords or different password for all the accounts in this screen.

14. Privileged Operating System Groups

Enter the following information in this screen:

  • Database Administrator (OSDBA) Group: dba
  • Database Operator (OSOPER) Group: dba
  • ASM administrator (OSASM) Group: dba

15. Oracle Configuration Manager Registration

You can associate your configration information with your metalink account as shown below.

[Oracle Configuration Manager]
Fig – Oracle Configuration Manager Registration (Click on the image to enlarge it)

16. Final Summary Screen

This will display a summary of all the installation option you’ve selected so far. Click on Install to complete the installation.

[Install Summary Screen]
Fig – Installation Summary Screen (Click on the image to enlarge it)

 

Advertisements

Oracle-Database-11g-Release-2-RAC-On-Linux-Using-NFS

This article describes the installation of Oracle Database 11g Release 2 (11.2 64-bit) RAC on Linux (Oracle Enterprise Linux 5.4 64-bit) using NFS to provide the shared storage.

Introduction

NFS is an abbreviation of Network File System, a platform independent technology created by Sun Microsystems that allows shared access to files stored on computers via an interface called the Virtual File System (VFS) that runs on top of TCP/IP. Computers that share files are considered NFS servers, while those that access shared files are considered NFS clients. An individual computer can be either an NFS server, a NFS client or both.

We can use NFS to provide shared storage for a RAC installation. In a production environment we would expect the NFS server to be a NAS, but for testing it can just as easily be another server, or even one of the RAC nodes itself.

To cut costs, this articles uses one of the RAC nodes as the source of the shared storage. Obviously, this means if that node goes down the whole database is lost, so it’s not a sensible idea to do this if you are testing high availability. If you have access to a NAS or a third server you can easily use that for the shared storage, making the whole solution much more resilient. Whichever route you take, the fundamentals of the installation are the same.

The Single Client Access Name (SCAN) should really be defined in the DNS or GNS and round-robin between one of 3 addresses, which are on the same subnet as the public and virtual IPs. In this article I’ve defined it as a single IP address in the “/etc/hosts” file, which is wrong and will cause the cluster verification to fail, but it allows me to complete the install without the presence of a DNS.

This article was inspired by the blog postings of Kevin Closson.

Assumptions. You need two machines available to act as your two RAC nodes. They can be physical or virtual. In this case I’m using two virtual machines called “rac1” and “rac2”. If you want a different naming convention or different IP addresses that’s fine, but make sure you stay consistent with how they are used.

Download Software

Download the following software.

Operating System Installation

This article uses Oracle Enterprise Linux 5.4. A general pictorial guide to the operating system installation can be found here. More specifically, it should be a server installation with a minimum of 2G swap (preferably 3-4G), firewall and secure Linux disabled. Oracle recommend a default server installation, but if you perform a custom installation include the following package groups:

  • GNOME Desktop Environment
  • Editors
  • Graphical Internet
  • Text-based Internet
  • Development Libraries
  • Development Tools
  • Server Configuration Tools
  • Administration Tools
  • Base
  • System Tools
  • X Window System

To be consistent with the rest of the article, the following information should be set during the installation.

RAC1.

  • hostname: ol5-112-rac1.localdomain
  • IP Address eth0: 192.168.2.101 (public address)
  • Default Gateway eth0: 192.168.2.1 (public address)
  • IP Address eth1: 192.168.0.101 (private address)
  • Default Gateway eth1: none

RAC2.

  • hostname: ol5-112-rac2.localdomain
  • IP Address eth0: 192.168.2.102 (public address)
  • Default Gateway eth0: 192.168.2.1 (public address)
  • IP Address eth1: 192.168.0.102 (private address)
  • Default Gateway eth1: none

You are free to change the IP addresses to suit your network, but remember to stay consistent with those adjustments throughout the rest of the article.

Oracle Installation Prerequisites

Perform either the Automatic Setup or the Manual Setup to complete the basic prerequisites. The Additional Setup is required for all installations.

Automatic Setup

If you plan to use the “oracle-validated” package to perform all your prerequisite setup, follow the instructions at http://public-yum.oracle.com to setup the yum repository for OL, then perform the following command.

# yum install oracle-validated

All necessary prerequisites will be performed automatically.

It is probably worth doing a full update as well, but this is not strictly speaking necessary.

# yum update

Manual Setup

If you have not used the “oracle-validated” package to perform all prerequisites, you will need to manually perform the following setup tasks.

In addition to the basic OS installation, the following packages must be installed whilst logged in as the root user. This includes the 64-bit and 32-bit versions of some packages.

# From Oracle Linux 5 DVD
cd /media/cdrom/Server
rpm -Uvh binutils-2.*
rpm -Uvh compat-libstdc++-33*
rpm -Uvh elfutils-libelf-0.*
rpm -Uvh elfutils-libelf-devel-*
rpm -Uvh gcc-4.*
rpm -Uvh gcc-c++-4.*
rpm -Uvh glibc-2.*
rpm -Uvh glibc-common-2.*
rpm -Uvh glibc-devel-2.*
rpm -Uvh glibc-headers-2.*
rpm -Uvh ksh-2*
rpm -Uvh libaio-0.*
rpm -Uvh libaio-devel-0.*
rpm -Uvh libgcc-4.*
rpm -Uvh libstdc++-4.*
rpm -Uvh libstdc++-devel-4.*
rpm -Uvh make-3.*
rpm -Uvh sysstat-7.*
rpm -Uvh unixODBC-2.*
rpm -Uvh unixODBC-devel-2.*

cd /
eject

Add or amend the following lines to the “/etc/sysctl.conf” file.

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1054504960
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586

Run the following command to change the current kernel parameters.

/sbin/sysctl -p

Add the following lines to the “/etc/security/limits.conf” file.

oracle               soft    nproc   2047
oracle               hard    nproc   16384
oracle               soft    nofile  1024
oracle               hard    nofile  65536

Add the following lines to the “/etc/pam.d/login” file, if it does not already exist.

session    required     pam_limits.so

Create the new groups and users.

groupadd -g 1000 oinstall
groupadd -g 1200 dba
useradd -u 1100 -g oinstall -G dba oracle
passwd oracle

Create the directories in which the Oracle software will be installed.

mkdir -p  /u01/app/11.2.0/grid
mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01/

Additional Setup

Perform the following steps whilst logged into the “rac1” virtual machine as the root user.

Set the password for the “oracle” user.

passwd oracle

Install the following package from the Oracle grid media after you’ve defined groups.

cd /your/path/to/grid/rpm
rpm -Uvh cvuqdisk*

If you are not using DNS, the “/etc/hosts” file must contain the following information.

127.0.0.1       localhost.localdomain   localhost
# Public
192.168.0.101   ol5-112-rac1.localdomain        ol5-112-rac1
192.168.0.102   ol5-112-rac2.localdomain        ol5-112-rac2
# Private
192.168.1.101   ol5-112-rac1-priv.localdomain   ol5-112-rac1-priv
192.168.1.102   ol5-112-rac2-priv.localdomain   ol5-112-rac2-priv
# Virtual
192.168.0.103   ol5-112-rac1-vip.localdomain    ol5-112-rac1-vip
192.168.0.104   ol5-112-rac2-vip.localdomain    ol5-112-rac2-vip
# SCAN
192.168.0.105   ol5-112-scan.localdomain        ol5-112-scan
192.168.0.106   ol5-112-scan.localdomain        ol5-112-scan
192.168.0.107   ol5-112-scan.localdomain        ol5-112-scan

The SCAN address should not really be defined in the hosts file. Instead is should be defined on the DNS to round-robin between 3 addresses on the same subnet as the public IPs. For this installation, we will compromise and use the hosts file. This may cause problems if you are using 11.2.0.2 onward.

If you are using DNS, then only the first line needs to be present in the “/etc/hosts” file. The other entries are defined in the DNS, as described here. Having said that, I typically include all but the SCAN addresses.

Change the setting of SELinux to permissive by editing the “/etc/selinux/config” file, making sure the SELINUX flag is set as follows.

SELINUX=permissive

Alternatively, this alteration can be done using the GUI tool (System > Administration > Security Level and Firewall). Click on the SELinux tab and disable the feature.

If you have the Linux firewall enabled, you will need to disable or configure it, as shown here or here. The following is an example of disabling the firewall.

# service iptables stop
# chkconfig iptables off

Either configure NTP, or make sure it is not configured so the Oracle Cluster Time Synchronization Service (ctssd) can synchronize the times of the RAC nodes. If you want to deconfigure NTP do the following.

# service ntpd stop
Shutting down ntpd:                                        [  OK  ]
# chkconfig ntpd off
# mv /etc/ntp.conf /etc/ntp.conf.orig
# rm /var/run/ntpd.pid

If you want to use NTP, you must add the “-x” option into the following line in the “/etc/sysconfig/ntpd” file.

OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"

Then restart NTP.

# service ntpd restart

Create the directories in which the Oracle software will be installed.

mkdir -p  /u01/app/11.2.0/grid
mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01/

Login as the “oracle” user and add the following lines at the end of the “/home/oracle/.bash_profile” file.

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=ol5-112-rac1.localdomain; export ORACLE_HOSTNAME
ORACLE_UNQNAME=RAC; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
GRID_HOME=/u01/app/11.2.0/grid; export GRID_HOME
DB_HOME=$ORACLE_BASE/product/11.2.0/db_1; export DB_HOME
ORACLE_HOME=$DB_HOME; export ORACLE_HOME
ORACLE_SID=RAC1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
BASE_PATH=/usr/sbin:$PATH; export BASE_PATH
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

alias grid_env='. /home/oracle/grid_env'
alias db_env='. /home/oracle/db_env'

Create a file called “/home/oracle/grid_env” with the following contents.

ORACLE_HOME=$GRID_HOME; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

Create a file called “/home/oracle/db_env” with the following contents.

ORACLE_SID=RAC1; export ORACLE_SID
ORACLE_HOME=$DB_HOME; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

Once the “/home/oracle/.bash_profile” has been run, you will be able to switch between environments as follows.

$ grid_env
$ echo $ORACLE_HOME
/u01/app/11.2.0/grid
$ db_env
$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/db_1
$

Remember to amend the environment setting accordingly on each server.

We’ve made a lot of changes, so it’s worth doing a reboot of the servers at this point to make sure all the changes have taken effect.

# shutdown -r now

Create Shared Disks

First we need to set up some NFS shares. In this case we will do this on the ol5-112-rac1 node, but you can do the on a NAS or a third server if you have one available. On the ol5-112-rac1 node create the following directories.

mkdir /shared_config
mkdir /shared_grid
mkdir /shared_home
mkdir /shared_data

Add the following lines to the “/etc/exports” file.

/shared_config               *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/shared_grid                 *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/shared_home                 *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/shared_data                 *(rw,sync,no_wdelay,insecure_locks,no_root_squash)

Run the following command to export the NFS shares.

chkconfig nfs on
service nfs restart

On both ol5-112-rac1 and ol5-112-rac2 create the directories in which the Oracle software will be installed.

mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/oracle/product/11.2.0/db_1
mkdir -p /u01/oradata
mkdir -p /u01/shared_config
chown -R oracle:oinstall /u01/app /u01/app/oracle /u01/oradata /u01/shared_config
chmod -R 775 /u01/app /u01/app/oracle /u01/oradata /u01/shared_config

Add the following lines to the “/etc/fstab” file.

nas1:/shared_config /u01/shared_config  nfs  rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0  0 0
nas1:/shared_grid   /u01/app/11.2.0/grid  nfs  rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0  0 0
nas1:/shared_home   /u01/app/oracle/product/11.2.0/db_1  nfs  rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0  0 0
nas1:/shared_data   /u01/oradata  nfs  rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0  0 0

Mount the NFS shares on both servers.

mount /u01/shared_config
mount /u01/app/11.2.0/grid
mount /u01/app/oracle/product/11.2.0/db_1
mount /u01/oradata

Make sure the permissions on the shared directories are correct.

chown -R oracle:oinstall /u01/shared_config
chown -R oracle:oinstall /u01/app/11.2.0/grid
chown -R oracle:oinstall /u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01/oradata

Install the Grid Infrastructure

Start both RAC nodes, login to ol5-112-rac1 as the oracle user and start the Oracle installer.

./runInstaller

Select the “Install and Configure Grid Infrastructure for a Cluster” option, then click the “Next” button.

Grid - Select Installation Option

Select the “Advanced Installation” option, then click the “Next” button.

Grid - Select Installation Type

Select the the required language support, then click the “Next” button.

Grid - Select Product Languages

Enter cluster information and uncheck the “Configure GNS” option, then click the “Next” button.

Grid - Grid Plug and Play Information

On the “Specify Node Information” screen, click the “Add” button.

Grid - Cluster Node Information

Enter the details of the second node in the cluster, then click the “OK” button.

Grid - Add Cluster Node Information

Click the “SSH Connectivity…” button and enter the password for the “oracle” user. Click the “Setup” button to to configure SSH connectivity, and the “Test” button to test it once it is complete. Click the “Next” button.

Grid - SSH Connectivity

Check the public and private networks are specified correctly, then click the “Next” button.

Grid - Specify Network Interface Usage

Select the “Shared File System” option, then click the “Next” button.

Grid - Storage Option Information

Select the required level of redundancy and enter the OCR File Location(s), then click the “Next” button.

Grid - OCR Storage Option

Select the required level of redundancy and enter the Voting Disk File Location(s), then click the “Next” button.

Grid - Voting Disk Storage Option

Accept the default failure isolation support by clicking the “Next” button.

Grid - Failure Isolation Support

Select the preferred OS groups for each option, then click the “Next” button. Click the “Yes” button on the subsequent message dialog.

Grid - Privileged Operating System Groups

Enter “/u01/app/oracle” as the Oracle Base and “/u01/app/11.2.0/grid” as the software location, then click the “Next” button.

Grid - Specify Install Location

Accept the default inventory directory by clicking the “Next” button.

Grid - Create Inventory

Wait while the prerequisite checks complete. If you have any issues, either fix them or check the “Ignore All” checkbox and click the “Next” button. If there are no issues, you will move directly to the summary screen. If you are happy with the summary information, click the “Finish” button.

Grid - Summary

Wait while the setup takes place.

Grid - Setup

When prompted, run the configuration scripts on each node.

Grid - Execute Configuration Scripts

The output from the “orainstRoot.sh” file should look something like that listed below.

# cd /u01/app/oraInventory
# ./orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
#

The output of the root.sh will vary a little depending on the node it is run on. Example output can be seen here (Node1, Node2).

Once the scripts have completed, return to the “Execute Configuration Scripts” screen on ol5-112-rac1 and click the “OK” button.

Grid - Execute Configuration Scripts

Wait for the configuration assistants to complete.

Grid - Configuration Assistants

We expect the verification phase to fail with an error relating to the SCAN, assuming you are not using DNS.

INFO: Checking Single Client Access Name (SCAN)...
INFO: Checking name resolution setup for "rac-scan.localdomain"...
INFO: ERROR:
INFO: PRVF-4664 : Found inconsistent name resolution entries for SCAN name "rac-scan.localdomain"
INFO: ERROR:
INFO: PRVF-4657 : Name resolution setup check for "rac-scan.localdomain" (IP address: 192.168.2.201) failed
INFO: ERROR:
INFO: PRVF-4664 : Found inconsistent name resolution entries for SCAN name "rac-scan.localdomain"
INFO: Verification of SCAN VIP and Listener setup failed

Provided this is the only error, it is safe to ignore this and continue by clicking the “Next” button.

Click the “Close” button to exit the installer.

Grid - Finish

The grid infrastructure installation is now complete.

Install the Database

Start all the RAC nodes, login to ol5-112-rac1 as the oracle user and start the Oracle installer.

./runInstaller

Uncheck the security updates checkbox and click the “Next” button.

DB - Configure Security Updates

Accept the “Create and configure a database” option by clicking the “Next” button.

DB - Select Installation Option

Accept the “Server Class” option by clicking the “Next” button.

DB - System Class

Make sure both nodes are selected, then click the “Next” button.

DB - Node Selection

Accept the “Typical install” option by clicking the “Next” button.

DB - Select Istall Type

Enter “/u01/app/oracle/product/11.2.0/db_1” for the software location. The storage type should be set to “File System” with the file location set to “/u01/oradata”. Enter the appropriate passwords and database name, in this case “RAC.localdomain”.

DB - Typical Install Configuration

Wait for the prerequisite check to complete. If there are any problems either fix them, or check the “Ignore All” checkbox and click the “Next” button.

DB - Perform Prerequisite Checks

If you are happy with the summary information, click the “Finish” button.

DB - Summary

Wait while the installation takes place.

DB - Install Product

Once the software installation is complete the Database Configuration Assistant (DBCA) will start automatically.

DB - DBCA

Once the Database Configuration Assistant (DBCA) has finished, click the “OK” button.

DB - DBCA Complete

When prompted, run the configuration scripts on each node. When the scripts have been run on each node, click the “OK” button.

DB - Execute Configuration Scripts

Click the “Close” button to exit the installer.

DB - Finish

The RAC database creation is now complete.

Check the Status of the RAC

There are several ways to check the status of the RAC. The srvctl utility shows the current configuration and status of the RAC database.

$ srvctl config database -d rac
Database unique name: rac
Database name: rac
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: /u01/oradata/rac/spfilerac.ora
Domain: localdomain
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: rac
Database instances: ol5-112-rac1,ol5-112-rac2
Disk Groups: 
Services: 
Database is administrator managed
$

$ srvctl status database -d rac
Instance ol5-112-rac1 is running on node ol5-112-rac1
Instance ol5-112-rac2 is running on node ol5-112-rac2
$

The V$ACTIVE_INSTANCES view can also display the current status of the instances.

$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Sep 26 19:04:19 2009

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, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> SELECT inst_name FROM v$active_instances;

INST_NAME
--------------------------------------------------------------------------------
rac1.localdomain:rac1
rac2.localdomain:rac2

SQL>

If you have configured Enterprise Manager, it can be used to view the configuration and current status of the database using a URL like “https://rac1.localdomain:1158/em”.

OEM

Direct NFS Client

The Direct NFS Client should be used for CRS-related files, so it is important to have separate NFS mounts for the different types of files, rather than trying to compact them into a single NFS share.

For improved NFS performance, Oracle recommend using the Direct NFS Client shipped with Oracle 11g. The direct NFS client looks for NFS details in the following locations.

  1. $ORACLE_HOME/dbs/oranfstab
  2. /etc/oranfstab
  3. /etc/mtab

Since we already have our NFS mount point details in the “/etc/fstab”, and therefore the “/etc/mtab” file also, there is no need to configure any extra connection details.

For the client to work we need to switch the “libodm11.so” library for the “libnfsodm11.so” library, which can be done manually or via the “make” command.

srvctl stop database -d rac

# manual method
cd $ORACLE_HOME/lib
mv libodm11.so libodm11.so_stub
ln -s libnfsodm11.so libodm11.so

# make method
$ cd $ORACLE_HOME/rdbms/lib
$ make -f ins_rdbms.mk dnfs_on

srvctl start database -d rac

With the configuration complete, you can see the direct NFS client usage via the following views.

  • v$dnfs_servers
  • v$dnfs_files
  • v$dnfs_channels
  • v$dnfs_stats

For example.

SQL> SELECT svrname, dirname FROM v$dnfs_servers;

SVRNAME        DIRNAME
-------------  -----------------
nas1           /shared_data

SQL>

The Direct NFS Client supports direct I/O and asynchronous I/O by default.

For more information see:

Oracle-Database-11g-Release-2-Installation-on-RHEL-CentOS-6.x-5.x-4.x

As we all know Oracle database is the most popular and widely used Relational Database Management System (RDBMS) in the world. This post describes step by step installation of Oracle Database 11g Release 2 32bit on CentOS 6.4 32bit. The installation steps should not be vary on most of the Red Hat based Linux distributions.

Installing Oracle Database 11g Release 2

Step 1: Install Oracle Dependencies

We use “oracle-rdbms-server-11gR2-preinstall” package offered by “Oracle Public Yum” repository. The Oracle public yum repository provides a free and easiest way to install all the latest Oracle Linux dependencies automatically. To setup yum repository, follow the instructions provided below.

Use “wget” command to Download appropriate yum configuration file under /etc/yum.repos.d/ directory as root user.

RHEL/CentOs 6.x
# cd /etc/yum.repos.d
# wget https://public-yum.oracle.com/public-yum-ol6.repo
RHEL/CentOs 5.x
# cd /etc/yum.repos.d
# wget https://public-yum.oracle.com/public-yum-el5.repo
RHEL/CentOs 4.x
# cd /etc/yum.repos.d
# wget https://public-yum.oracle.com/public-yum-el4.repo

Now perform the following “yum” command to install all the necessary prerequisites automatically.

[root@oracle]# yum install oracle-rdbms-server-11gR2-preinstall

While importing GPG key, you might get “GPG key retrieval failed” error as shown below. Here, you need to import proper GPG key for your OS release.

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

Download and verify the appropriate Oracle Linux GPG Key that best matches your RHEL/CentOS compatible OS release.

RHEL/CentOs 6.x
# wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
RHEL/CentOs 5.x
# wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
RHEL/CentOs 4.x
# wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-el4 -O /usr/share/rhn/RPM-GPG-KEY-oracle

Step 2: Setting Hostname

Open the “/etc/sysconfig/network” file and modify the HOSTNAME to match your FQDN (Fully Qualified Domain Name) host name.

[root@oracle]# vi /etc/sysconfig/network
HOSTNAME=oracle.tecmint.com

Open “/etc/hosts” file and add fully qualified hostname for the server.

[root@oracle]# vi /etc/hosts
192.168.246.128		oracle.tecmint.com		oracle

Now you need to restart networking on the server to make sure that changes will be persistent on reboot.

[root@oracle]# /etc/init.d/network restart

Step 3: Oracle User Settings

Set the password for the “oracle” user.

[root@oracle]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.

Add the entry to file “/etc/security/limits.d/90-nproc.conf” as described below.

[root@oracle]# vi /etc/security/limits.d/90-nproc.conf
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
*          soft    nproc     1024
# To this
* - nproc 16384

Set SELinux to “permissive” mode by editing the file “/etc/selinux/config“.

[root@oracle]# vi /etc/selinux/config
SELINUX=permissive

Once you’ve made change, don’t forger to restart the server to reflect new changes.

[root@oracle]# reboot

Login as Oracle user and open file “.bash_profile“, which is available on oracle user’s home directory, make an entries as described below. Make sure you set correct hostname to “ORACLE_HOSTNAME=oracle.tecmint.com“.

[root@oracle]# su oracle
[oracle@oracle ~]$ vi .bash_profile
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=oracle.tecmint.com; export ORACLE_HOSTNAME
ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=DB11G; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH export PATH

Switch to root user and issue the following command to allow Oracle user to access X Server.

[root@oracle]# xhost +

Create the directories and set the appropriate permissions in which the Oracle software will be installed.

[root@oracle]# mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
[root@oracle]# chown -R oracle:oinstall /u01
[root@oracle]# chmod -R 775 /u01

Step 4: Downloading Oracle Software

Sign-up and Download the Oracle software using the following link.

  1. Oracle Database 11g Release 2

Download Oracle 11g Release 2

Download Oracle 11g Release 2

The Oracle package contains 2 zip files which you must first accept the license agreement before downloading. I’ve given the files names for you reference, please download these files for your system architecture somewhere under “/home/oracle/“.

For Linux x86 Systems
http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_database_1of2.zip
http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_database_2of2.zip
For Linux x86-64 Systems
http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_1of2.zip
http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_2of2.zip

Step 5: Oracle Installation

Now let’s start Oracle installation. First of all need to switch as ‘oracle’ user to install database.

[oracle@oracle ~]$ su oracle

Extract compressed Oracle database source files to the same directory “/home/oracle/“.

[oracle@oracle ~]$ unzip linux_11gR2_database_1of2.zip
[oracle@oracle ~]$ unzip linux_11gR2_database_2of2.zip

Post unzip source file, directory called database will be created, go to inside the directory and execute below script to start Oracle database installation process.

[oracle@oracle database]$ cd database
[oracle@oracle database]$ ./runInstaller

1. RunInstaller will call Oracle Universal Installer (OUI), wherein look and feel & steps are the same across all the operating system.

Oracle Universal Installer

Oracle Universal Installer

2. Provide your email address to be informed of security issues and receive security updates.

Configure Security Updates

Configure Oracle Security Updates

3. Create and Configure a Database

Create Oracle Database

Create Oracle Database

4. Choose the system class, either Desktop or Server.

Select System Class

Select Oracle System Class

5. Select the type of database installation you want to perform.

Oracle Node Selection

Select Database Installation Type

6. Select “Typical install” option to install full oracle installation with basic configuration.

Select Oracle Install Type

Select Typical Install

7. Set Administrative password and perform full Database installation with basic configuration.

Oracle Typical Installation Configuration

Set Oracle Administrative Password

8. Please click on “Yes” to continue with installation.

Oracle Typical Install Configuration

Typical Install Configuration Confirm

9. Create Inventory

Create Oracle Inventory

Create Inventory

10. If you faced prerequisites warning during installation. Click on “Fix & Check Again“. Oracle fixes Prerequisites by itself. This is the new feature of Oracle Database 11g.

Perform Prerequisite Checks

Perform Prerequisite Checks

The pdksh package is not available in Oracle repository due to which you need to download and install it manually.

[root@oracle]# wget ftp://rpmfind.net/linux/redhat-archive/6.2/en/os/i386/RedHat/RPMS/pdksh-5.2.14-2.i386.rpm

During pdksh package installation you may encountered conflict error of ksh package. Remove ksh package forcefully and install the pdksh package with given below command:-

[root@oracle]# rpm -e ksh-20100621-19.el6_4.4.i686 --nodeps
[root@oracle]# rpm -ivh pdksh-5.2.14-2.i386.rpm

11. Performing Prerequisite checks: It’s test whether sufficient total SWAP space is available on the system.

Performing Prerequisite SWAP Check

Performing Prerequisite SWAP Check

12. Installation Summary: Click on Save Response File. This file is useful for Oracle Silent Mode Installation

Oracle Installation Summary

Oracle Installation Summary

13. Save Response File somewhere in your system.

Save Response File

Save Response File

14. Product Installation Progress

Install Oracle Product

Product Install

15. Copying database files

Copying Database Files

Copying Database Files

16. Click on “Password Management“.

Oracle Password Management

Oracle Password Management

17. Set password for user “SYS” and click on OK to continue.

Set SYS User Password

Set SYS User Password

18. Configuration scripts need to be executed as the “root” user. Go to the path given in the screen and execute the scripts one by one. Click on ‘OK‘ once scripts is executed.

Execute Configuration Scripts

Execute Configuration Scripts

[root@oracle]# cd /u01/app/oraInventory
[root@oracle oraInventory]# ./orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@oracle]# cd /u01/app/oracle/product/11.2.0/dbhome_2/
[root@oracle dbhome_2]# ./root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME=  /u01/app/oracle/product/11.2.0/dbhome_2
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.

19. The installation of Oracle Database is successful.

Oracle Installation Completed

Oracle Installation Finish

20. To test your Oracle installation navigate to web based management interface for your system at “localhost” with the user name “SYS” connecting as “SYSDBA” and using the password you set during the install of Oracle. Remember to open port 1158 on your firewall and restart the iptables service.

[root@oracle]# iptables -A INPUT -p tcp --dport 1158 -j ACCEPT
[root@oracle]# service iptables restart
https://localhost:1158/em/

Oracle Enterprise Manager Login

Oracle Enterprise Manager Login

21. Oracle Enterprise Database Control Manager

Oracle Database Control Manager

Oracle Database Control Manager

Now you can start using Oracle. I highly recommend you to follow the Oracle Documentation for more help. There are number of client applications out there which can help you, like the command line tool called Oracle Instant Client and the Oracle SQL Developer UI program.

This is end of the Oracle Database Software Installation. In our upcoming article we will be covering how to create database using DBCA and how to Start-up and Shutdown Oracle Database. Please stay tuned…!!!

Step-By-Step-Guide-On-Creating-Physical-Standby-Using-RMAN(ASM)

This article explains steps to create physical standby database using Oracle Database 11g RMAN  FROM ACTIVE DATABASE capability to the DUPLICATE FOR STANDBY command.

Primary database Name:primdv1

Standby database Name:stbydv1

Step1)Make sure primary database is running in archive log mode.

2)Determine if FORCE LOGGING is enabled. If it is not enabled, enable FORCE LOGGING mode.
SQL> SELECT force_logging FROM v$database;

FOR

NO

SQL> ALTER DATABASE FORCE LOGGING;

Database altered.

SQL> SELECT force_logging FROM v$database;

FOR

YES

3)Configure the primary database to receive redo data, by adding the standby logfiles to the primary
It is highly recommended that you have one more standby redo log group than you have online redo log groups as the primary database.
The files must be the same size or larger than the primary database’s online redo logs.

ALTER DATABASE ADD STANDBY LOGFILE
‘+DATA1/primdv1/srl01.log’
SIZE 52428800
/

ALTER DATABASE ADD STANDBY LOGFILE
‘+DATA1/primdv1/srl02.log’
SIZE 52428800
/

ALTER DATABASE ADD STANDBY LOGFILE
‘+DATA1/primdv1/srl03.log’
SIZE 52428800
/

ALTER DATABASE ADD STANDBY LOGFILE
‘+DATA1/primdv1/srl04.log’
SIZE 52428800
/

4)Set primary database initialization parameters

ALTER SYSTEM SET log_archive_config = ‘dg_config=(primdv1,stbydv1)’;

ALTER SYSTEM SET log_archive_dest_2 =
‘service=stbydv1 async valid_for=(online_logfile,primary_role) db_unique_name=stbydv1′;

show parameter log_archive_config

show parameter log_archive_dest_2
If you get following error
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-16019: cannot use LOG_ARCHIVE_DEST_1 with LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST

Solution :

1. Reset the LOG_ARCHIVE_DEST to NULL value :

SQL> ALTER SYSTEM set log_archive_dest=”;

2. Set the LOG_ARCHIVE_DEST_1 to the value set to LOG_ARCHIVE_DEST before

SQL> ALTER SYSTEM set log_archive_dest_1=’LOCATION=/…’;

if you use this code, you dont need to restart database:

ALTER SYSTEM SET LOG_ARCHIVE_DEST_1=’LOCATION=h:\oradata\archive’ SCOPE=BOTH;

To check archival destination issue is ok:
show parameter LOG_ARCHIVE_DEST;
select DEST_ID, DEST_NAME,DESTINATION from v$archive_dest;

update tnsnames.ora file with the following entries on both hosts:

PRIMDV1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgprim0001.ukatru.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = primdv1.ukatru.com)
)
)

STBYDV1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgstby0001.ukatru.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = stbydv1.ukatru.com)
)
)
update the listner.ora with the following values on standby database:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = standby1.example.com)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = standby1)
)
)

copy the remote login password file (orapwprimdv1) from the primary database system to the $ORACLE_HOME/dbs directory on the
standby database system, renaming it to orapwstbydv1.
In the $ORACLE_HOME/dbs directory of the standby system, create an initialization parameter file named initstbydv1.ora
containing a single parameter: DB_NAME=stbydv1(i.e. stbydv1)

On the standby system, change to the /u01/app/oracle/admin directory. Create a directory with a name that matches your physical standby SID (i.e. stbydv1).
Change to the newly created directory (i.e. stbydv1) and create an adump directory.

now on the standby system log into database
export ORACLE_SID=stbydv1
dgstby0001:/u01/app/oracle/admin/stbydv1>export ORACLE_SID=stbydv1
dgstby0001:/u01/app/oracle/admin/stbydv1>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Sat Apr 14 22:57:24 2012

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

Connected to an idle instance.

SQL>
SQL> startup nomount pfile=$ORACLE_HOME/dbs/initstbydv1.ora
ORACLE instance started.

Total System Global Area 238034944 bytes
Fixed Size 2227136 bytes
Variable Size 180356160 bytes
Database Buffers 50331648 bytes
Redo Buffers 5120000 bytes

RMAN> connect target sys

target database Password:
connected to target database: PRIMDV1 (DBID=1462743077)

RMAN> connect auxiliary sys@stbydv1

auxiliary database Password:
connected to auxiliary database: STBYDV1 (not mounted)

Below is the rman script to create standby database:
run {
allocate channel prmy1 type disk;
allocate channel prmy2 type disk;
allocate channel prmy3 type disk;
allocate channel prmy4 type disk;
allocate auxiliary channel stby type disk;
duplicate target database for standby from active database
spfile
parameter_value_convert ‘primdv1′,’stbydv1′
set db_unique_name=’stbydv1′
set db_file_name_convert=’/primdv1/’,’/stbydv1/’
set log_file_name_convert=’/primdv1/’,’/stbydv1/’
set control_files=’+DATA1′
set log_archive_max_processes=’5′
set fal_client=’stbydv1′
set fal_server=’primdv1′
set standby_file_management=’AUTO’
set log_archive_config=’dg_config=(primdv1,stbydv1)’
set log_archive_dest_2=’service=primdv1 ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=primdv1′
;
}

channel prmy3: SID=55 device type=DISK

allocated channel: prmy4
channel prmy4: SID=56 device type=DISK

allocated channel: stby
channel stby: SID=19 device type=DISK

Starting Duplicate Db at 14-APR-12

contents of Memory Script:
{
backup as copy reuse
targetfile ‘/u01/app/oracle/product/11.2.0.3/db_1/dbs/orapwprimdv1’ auxiliary format
‘/u01/app/oracle/product/11.2.0.3/db_1/dbs/orapwstbydv1’ targetfile
‘+DATA1/primdv1/spfileprimdv1.ora’ auxiliary format
‘/u01/app/oracle/product/11.2.0.3/db_1/dbs/spfilestbydv1.ora’ ;
sql clone “alter system set spfile= ”/u01/app/oracle/product/11.2.0.3/db_1/dbs/spfilestbydv1.ora””;
}
executing Memory Script

Starting backup at 14-APR-12
Finished backup at 14-APR-12

sql statement: alter system set spfile= ”/u01/app/oracle/product/11.2.0.3/db_1/dbs/spfilestbydv1.ora”

contents of Memory Script:
{
sql clone “alter system set audit_file_dest =
”/u01/app/oracle/admin/stbydv1/adump” comment=
”” scope=spfile”;
sql clone “alter system set dispatchers =
”(PROTOCOL=TCP) (SERVICE=stbydv1XDB)” comment=
”” scope=spfile”;
sql clone “alter system set log_archive_dest_1 =
”LOCATION=+DATA1/stbydv1” comment=
”” scope=spfile”;
sql clone “alter system set db_unique_name =
”stbydv1” comment=
”” scope=spfile”;
sql clone “alter system set db_file_name_convert =
”/primdv1/”, ”/stbydv1/” comment=
”” scope=spfile”;
sql clone “alter system set log_file_name_convert =
”/primdv1/”, ”/stbydv1/” comment=
”” scope=spfile”;
sql clone “alter system set control_files =
”+DATA1” comment=
”” scope=spfile”;
sql clone “alter system set log_archive_max_processes =
5 comment=
”” scope=spfile”;
sql clone “alter system set fal_client =
”stbydv1” comment=
”” scope=spfile”;
sql clone “alter system set fal_server =
”primdv1” comment=
”” scope=spfile”;
sql clone “alter system set standby_file_management =
”AUTO” comment=
”” scope=spfile”;
sql clone “alter system set log_archive_config =
”dg_config=(primdv1,stbydv1)” comment=
”” scope=spfile”;
sql clone “alter system set log_archive_dest_2 =
”service=primdv1 ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=primdv1” comment=
”” scope=spfile”;
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script

sql statement: alter system set audit_file_dest = ”/u01/app/oracle/admin/stbydv1/adump” comment= ”” scope=spfile

sql statement: alter system set dispatchers = ”(PROTOCOL=TCP) (SERVICE=stbydv1XDB)” comment= ”” scope=spfile

sql statement: alter system set log_archive_dest_1 = ”LOCATION=+DATA1/stbydv1” comment= ”” scope=spfile

sql statement: alter system set db_unique_name = ”stbydv1” comment= ”” scope=spfile

sql statement: alter system set db_file_name_convert = ”/primdv1/”, ”/stbydv1/” comment= ”” scope=spfile

sql statement: alter system set log_file_name_convert = ”/primdv1/”, ”/stbydv1/” comment= ”” scope=spfile

sql statement: alter system set control_files = ”+DATA1” comment= ”” scope=spfile

sql statement: alter system set log_archive_max_processes = 5 comment= ”” scope=spfile

sql statement: alter system set fal_client = ”stbydv1” comment= ”” scope=spfile

sql statement: alter system set fal_server = ”primdv1” comment= ”” scope=spfile

sql statement: alter system set standby_file_management = ”AUTO” comment= ”” scope=spfile

sql statement: alter system set log_archive_config = ”dg_config=(primdv1,stbydv1)” comment= ”” scope=spfile

sql statement: alter system set log_archive_dest_2 = ”service=primdv1 ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=primdv1” comment= ”” scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area 1068937216 bytes

Fixed Size 2235208 bytes
Variable Size 616563896 bytes
Database Buffers 444596224 bytes
Redo Buffers 5541888 bytes
allocated channel: stby
channel stby: SID=21 device type=DISK

contents of Memory Script:
{
sql clone “alter system set control_files =
”+DATA1/stbydv1/controlfile/current.256.780620989” comment=
”Set by RMAN” scope=spfile”;
backup as copy current controlfile for standby auxiliary format ‘+DATA1/stbydv1/controlfile/current.257.780620989’;
sql clone “alter system set control_files =
”+DATA1/stbydv1/controlfile/current.257.780620989” comment=
”Set by RMAN” scope=spfile”;
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script

sql statement: alter system set control_files = ”+DATA1/stbydv1/controlfile/current.256.780620989” comment= ”Set by RMAN” scope=spfile

Starting backup at 14-APR-12
channel prmy1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/product/11.2.0.3/db_1/dbs/snapcf_primdv1.f tag=TAG20120414T230949 RECID=1 STAMP=780620989
channel prmy1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 14-APR-12

sql statement: alter system set control_files = ”+DATA1/stbydv1/controlfile/current.257.780620989” comment= ”Set by RMAN” scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area 1068937216 bytes

Fixed Size 2235208 bytes
Variable Size 616563896 bytes
Database Buffers 444596224 bytes
Redo Buffers 5541888 bytes
allocated channel: stby
channel stby: SID=23 device type=DISK

contents of Memory Script:
{
sql clone ‘alter database mount standby database’;
}
executing Memory Script

sql statement: alter database mount standby database
RMAN-05529: WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.

contents of Memory Script:
{
set newname for tempfile 1 to
“+data1”;
switch clone tempfile all;
set newname for datafile 1 to
“+data1”;
set newname for datafile 2 to
“+data1”;
set newname for datafile 3 to
“+data1”;
set newname for datafile 4 to
“+data1”;
backup as copy reuse
datafile 1 auxiliary format
“+data1” datafile
2 auxiliary format
“+data1” datafile
3 auxiliary format
“+data1” datafile
4 auxiliary format
“+data1” ;
sql ‘alter system archive log current’;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to +data1 in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 14-APR-12
channel prmy1: starting datafile copy
input datafile file number=00001 name=+DATA1/primdv1/datafile/system.261.780607599
channel prmy2: starting datafile copy
input datafile file number=00002 name=+DATA1/primdv1/datafile/sysaux.262.780607621
channel prmy3: starting datafile copy
input datafile file number=00003 name=+DATA1/primdv1/datafile/undotbs1.263.780607639
channel prmy4: starting datafile copy
input datafile file number=00004 name=+DATA1/primdv1/datafile/users.265.780607653
output file name=+DATA1/stbydv1/datafile/users.260.780621011 tag=TAG20120414T231009
channel prmy4: datafile copy complete, elapsed time: 00:00:08
output file name=+DATA1/stbydv1/datafile/undotbs1.261.780621011 tag=TAG20120414T231009
channel prmy3: datafile copy complete, elapsed time: 00:01:47
output file name=+DATA1/stbydv1/datafile/system.258.780621011 tag=TAG20120414T231009
channel prmy1: datafile copy complete, elapsed time: 00:02:28
output file name=+DATA1/stbydv1/datafile/sysaux.259.780621011 tag=TAG20120414T231009
channel prmy2: datafile copy complete, elapsed time: 00:02:27
Finished backup at 14-APR-12

sql statement: alter system archive log current

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

datafile 1 switched to datafile copy
input datafile copy RECID=1 STAMP=780621158 file name=+DATA1/stbydv1/datafile/system.258.780621011
datafile 2 switched to datafile copy
input datafile copy RECID=2 STAMP=780621158 file name=+DATA1/stbydv1/datafile/sysaux.259.780621011
datafile 3 switched to datafile copy
input datafile copy RECID=3 STAMP=780621158 file name=+DATA1/stbydv1/datafile/undotbs1.261.780621011
datafile 4 switched to datafile copy
input datafile copy RECID=4 STAMP=780621158 file name=+DATA1/stbydv1/datafile/users.260.780621011
Finished Duplicate Db at 14-APR-12
released channel: prmy1
released channel: prmy2
released channel: prmy3
released channel: prmy4
released channel: stby

RMAN> **end-of-file**
Perform a log switch on the primary database and redo will start being sent to the standby.
dgprim0001:/u01/app/oracle/wkdir>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Sat Apr 14 23:14:57 2012

Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> alter system switch logfile;

System altered.

dgstby0001:/u01/app/oracle/product/11.2.0.3/db_1/network/admin>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Sat Apr 14 23:15:50 2012

Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> alter database recover managed standby database
2 using current logfile disconnect;

Database altered.

Now Verify that the Physical Standby Database is Performing Correctly

SELECT sequence#, first_time, next_time, applied
FROM v$archived_log
ORDER BY sequence#
/

SQL> SELECT sequence#, first_time, next_time, applied
FROM v$archived_log
ORDER BY sequence#
/
2 3 4
SEQUENCE# FIRST_TIM NEXT_TIME APPLIED
———- ——— ——— ———
31 14-APR-12 14-APR-12 YES
32 14-APR-12 14-APR-12 YES
33 14-APR-12 14-APR-12 YES
34 14-APR-12 14-APR-12 YES
35 14-APR-12 14-APR-12 YES
36 14-APR-12 14-APR-12 IN-MEMORY

6 rows selected.