Friday, November 22, 2013

Installing 12c database in Linux 6 x84_64

STEP BY STEP INSTALLATION OF 12 C DATABASE IN REDHAT LINUX 6.4 X86_64

This are the steps to install the 12c database [single node] in Redhat Linux 6.4 [or ] oracle Linux 6.4

Step1

create the oracle public yum repository and enable the version
Run the prerequisite Rpm for the 12 c from the oracle public yum repository
oracle has the pre- built rpm like 11g release for the 12c which will be helpful
[root@oracledb1 ~]# yum install *oracle*12*
Loaded plugins: downloadonly, product-id, refresh-packagekit, rhnplugin, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is receiving updates from RHN Classic or RHN Satellite.
ol6_UEK_latest
ol6_addons
ol6_ofed_UEK                                                                                                                                     | 1.2 kB     00:00
ol6_u4_base                                                                                                                                      | 1.4 kB     00:00
rackspace-rhel-x86_64-server-6-ius                                                                                                               |  871 B     00:00
rhel-x86_64-server-6                                                                                                                             | 1.5 kB     00:00
rhel-x86_64-server-6-common                                                                                                                      |  871 B     00:00
rhel-x86_64-server-optional-6                                                                                                                    | 1.5 kB     00:00
rhn-tools-rhel-x86_64-server-6                                                                                                                   | 1.3 kB     00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package oracle-em-agent-12cR1-preinstall.x86_64 0:1.0-4.el6 will be installed
---> Package oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-8.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
 Package                                                      Arch                           Version                           Repository                          Size
========================================================================================================================================================================
Installing:
 oracle-em-agent-12cR1-preinstall                             x86_64                         1.0-4.el6                         ol6_addons                         7.0 k
 oracle-rdbms-server-12cR1-preinstall                         x86_64                         1.0-8.el6                         ol6_latest                          15 k

Transaction Summary
========================================================================================================================================================================
Install       2 Package(s)

Total size: 22 k
Installed size: 42 k
Is this ok [y/N]: Y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : oracle-em-agent-12cR1-preinstall-1.0-4.el6.x86_64                                                                                                    1/2
  Installing : oracle-rdbms-server-12cR1-preinstall-1.0-8.el6.x86_64                                                                                                2/2
  Verifying  : oracle-rdbms-server-12cR1-preinstall-1.0-8.el6.x86_64                                                                                                1/2
  Verifying  : oracle-em-agent-12cR1-preinstall-1.0-4.el6.x86_64                                                                                                    2/2
Installed:
  oracle-em-agent-12cR1-preinstall.x86_64 0:1.0-4.el6                              oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-8.el6

Complete!
 It will create the necessary Rpm's with the dependencies and add the entries in the /etc/sysctl.conf for the necessary Kernel Parameter's.. and /etc/security/limits.conf files
and it will create the new user named oracle with the oinstall as the group id 

Step 2
If you are using the oracle linux with support we can use the ksplice to apply the security updates with out rebooting

[1] Download the ksplice Rpm

[root@oracledb1 security]# wget https://www.ksplice.com/yum/uptrack/ol/ksplice-uptrack-release.noarch.rpm
--2013-11-20 20:29:27--  https://www.ksplice.com/yum/uptrack/ol/ksplice-uptrack-release.noarch.rpm
Resolving www.ksplice.com... 137.254.56.32
Connecting to www.ksplice.com|137.254.56.32|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6876 (6.7K) [application/x-redhat-package-manager]
Saving to: âksplice-uptrack-release.noarch.rpmâ

100%[==============================================================================================================================>] 6,876       --.-K/s   in 0s

2013-11-20 20:29:27 (15.4 MB/s) - âksplice-uptrack-release.noarch.rpmâ

[root@oracledb1 security]# rpm -i ksplice-uptrack-release.noarch.rpm
warning: ksplice-uptrack-release.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 16c083cd: NOKEY


[2] Install the ksplice rpm using the yum

[root@oracledb1 security]# yum -y install uptrack
Loaded plugins: downloadonly, product-id, refresh-packagekit, rhnplugin, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is receiving updates from RHN Classic or RHN Satellite.
ksplice-uptrack                                                             951 B     00:00
ksplice-uptrack/primary                                               3.9 kB     00:00
kspliceuptrack                                                                                                                                           12/12
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package uptrack.noarch 0:1.2.12-0.el6 will be installed
--> Processing Dependency: uptrack-PyYAML for package: uptrack-1.2.12-0.el6.noarch
--> Running transaction check
---> Package uptrack-PyYAML.x86_64 0:3.08-4.el6 will be installed
--> Processing Dependency: uptrack-libyaml >= 0.1.3-1 for package: uptrack-PyYAML-3.08-4.el6.x86_64
--> Running transaction check
---> Package uptrack-libyaml.x86_64 0:0.1.3-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
 Package                                    Arch                              Version                                  Repository                                  Size
========================================================================================================================================================================
Installing:
 uptrack                                    noarch                            1.2.12-0.el6                             ksplice-uptrack                            375 k
Installing for dependencies:
 uptrack-PyYAML                             x86_64                            3.08-4.el6                               ksplice-uptrack                            143 k
 uptrack-libyaml                            x86_64                            0.1.3-1.el6                              ksplice-uptrack                             48 k

Transaction Summary
========================================================================================================================================================================
Install       3 Package(s)

Total download size: 566 k
Installed size: 1.8 M
Downloading Packages:
(1/3): uptrack-1.2.12-0.el6.noarch.rpm                                                                                                           | 375 kB     00:00
(2/3): uptrack-PyYAML-3.08-4.el6.x86_64.rpm                                                                                                      | 143 kB     00:00
(3/3): uptrack-libyaml-0.1.3-1.el6.x86_64.rpm                                                                                                    |  48 kB     00:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                   330 kB/s | 566 kB     00:01
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : uptrack-libyaml-0.1.3-1.el6.x86_64                                                                                                                   1/3
  Installing : uptrack-PyYAML-3.08-4.el6.x86_64                                                                                                                     2/3
  Installing : uptrack-1.2.12-0.el6.noarch                                                                                                                          3/3
There are no existing modules on disk that need basename migration.
  Verifying  : uptrack-PyYAML-3.08-4.el6.x86_64                                                                                                                     1/3
  Verifying  : uptrack-1.2.12-0.el6.noarch                                                                                                                          2/3
  Verifying  : uptrack-libyaml-0.1.3-1.el6.x86_64                                                                                                                   3/3

Installed:
  uptrack.noarch 0:1.2.12-0.el6

Dependency Installed:
  uptrack-PyYAML.x86_64 0:3.08-4.el6                                                uptrack-libyaml.x86_64 0:0.1.3-1.el6

Complete!

Step 3

Prerequisite rpm's for 12c database 

Required rpm's  the Oracle r12c database for Linux x86_64

check the installed rpm this rpm's are the mandatory rpm's for the database installation if some of the rpm's are not install install through the oracle public yum
[root@oracledb1 ~]# rpm -q binutils-* \
>  compat-libcap* \
>  compat-libstdc++* \
>  compat-libstdc++* \
>  gcc-* \
>  gcc-c++* \
>  glibc-* \
>  glibc-devel* \
>  ksh* \
>  libgcc-* \
>  libstdc++* \
>  libstdc++-devel * \
>  libaio * \
>  libaio-devel \
>  libXext- \
>  libXtst \
>  libX11 \
>  libXau- \
>  libxcb- \
>  libXi-1.3 \
>  make- \
>  sysstat \
>  unixODBC \
>  cvuqdisk \
>  cloog-ppl \
>  cpp.x86_64 \
>  glibc-headers \
> kernel-headers \
> mpfr.x86_64 \
>  ppl.x86_64
libXtst-1.2.1-2.el6.x86_64
binutils-devel-2.20.51.0.2-5.36.el6.x86_64
gcc-objc++-4.4.7-3.el6.x86_64
cloog-ppl-0.15.7-1.2.el6.x86_64
libXtst-1.2.1-2.el6.i686
gcc-objc-4.4.7-3.el6.x86_64
unixODBC-2.2.14-12.el6_3.x86_64
compat-libstdc++-33-3.2.3-69.el6.x86_64
glibc-common-2.12-1.107.el6_4.5.x86_64
libaio-devel-0.3.107-10.el6.x86_64
libstdc++-4.4.7-3.el6.x86_64
ksh-20100621-19.el6_4.4.x86_64
libX11-1.5.0-4.el6.i686
libaio-0.3.107-10.el6.x86_64
glibc-devel-2.12-1.107.el6_4.5.x86_64
compat-libstdc++-296-2.96-144.el6.i686
gcc-gnat-4.4.7-3.el6.x86_64
gcc-c++-4.4.7-3.el6.x86_64
compat-libcap1-1.10-1.x86_64
glibc-headers-2.12-1.107.el6_4.5.x86_64
libstdc++-devel-4.4.7-3.el6.x86_64
gcc-gfortran-4.4.7-3.el6.x86_64
glibc-static-2.12-1.107.el6_4.5.x86_64
libstdc++-docs-4.4.7-3.el6.x86_64
glibc-utils-2.12-1.107.el6_4.5.x86_64
kernel-headers-2.6.32-358.23.2.el6.x86_64
libX11-1.5.0-4.el6.x86_64
sysstat-9.0.4-20.el6.x86_64
gcc-java-4.4.7-3.el6.x86_64
[root@oracledb1 ~]#

Once all the rpm's are installed you can query and get Conformed

[root@oracledb1 ~]# rpm -q binutils  compat-libcap compat-libstdc++  compat-libstdc++  gcc  gcc-c++  glibc  glibc-devel  ksh  libgcc   libstdc++  libstdc++-devel   libaio   libaio-devel  libXext  libXtst   libX11   libXau  libxcb  libXi-1.3  make sysstat unixODBC cvuqdisk  cloog-ppl  cpp.x86_64   glibc-headers  kernel-headers  mpfr.x86_64   ppl.x86_64

Step 4 

Creating the user,groups for the 12 c database

[i] If you are using the pre-installation rpm then the  from the public yum then it will create the user named oracle and the group as oinstall
we can provide the same user group to all the group's during the installation but that is not the recommended method so we need to create the below groups and assign it to the oracle user

[root@oracledb1 app]# id oracle
uid=54321(oracle) gid=502(oinstall) groups=502(oinstall),503(dba)
 In 12c the new groups are introduced for the different purpose 

 [ii.a] BACKUPDBA GROUP 
This new group is needed when we need to configure the separate access for the operating system user's only for backup and restoration it is typically know as [sysbackup] 
Create the group  as backupdba
[root@oracledb1 app]# groupadd -g 505 backupdba

[ii.b]DGDBA
This particular group is assigned to the data guard user's [ it is typically can be use to assign the o/s user's who will monitor the data guard operation's]
Create the group as dgdba
[root@oracledb1 app]# groupadd -g 506 dgdb

[ii.c]KMDBA
This particular group can be assigned to the o/s users who will manage the encryption key [like db wallet]
[root@oracledb1 app]# groupadd -g 507 kmdba

As the preinstall rpm had created the oracle user id  we need to modify the oracle user with the necessary groups

[root@oracledb1 app]# usermod -g oinstall -G oinstall,dba,oper,backupdba,dgdba,kmdba oracle

[root@oracledb1 app]# id oracle
uid=54321(oracle) gid=502(oinstall)groups=502(oinstall),503(dba),504(oper),505(backupdba),506(dgdba),507(kmdba)


Step 5 

Creating the Oracle Base Directory

[root@oracledb1 /]# mkdir /u01/app/oracle -p
[root@oracledb1 /]# chown -R oracle:oinstall /u01/app/oracle
[root@oracledb1 /]# chmod -R g+w /u01/app/oracle

Step 6

Required Kernel settings for the 12c database

[root@oracledb1 ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.core_pattern = /root/core
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576

net.ipv4.ip_local_port_range = 9000 65500

Step 7

Required parameters in the limites.conf for 12c database

check the values in the /etc/security/limits.conf this values will be added by the 12c preinstall rpm if you are not using the pre install rpm add the values in the file

oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    2047
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768

Download the 12c database software
For installing the database we need to download the database software from the www.edelivery.oracle.com or through the otn
once you download the zip files unzip the files to create the staging directory to start the run installer
[oracle@oracledb1 Downloads]$ ls
  V38500-01_1of2.zip  V38500-01_2of2.zip

INSTALLATION OF 12c DATABASE

Navigate to the database software staging directory and from there start the runInstaller to start the installation
Step 1



Step 2


Step 3
If we need to only install the software and create the database later using the dbca you can use this method or you can use the create and configure the database

Step 4

we can choose the different methods of installation of database
[1] single database installation -- only the database installation[with out grid]
[2] RAC Database installation --- installation of the rac database[prior we need to install the grid and asm]
[3]RAC one node database --- with the HAS services for the single node [prior we need to install grid ]


Step 5



Step 6



Step 7


Step 8



Step 9



Step 10


Step 11


Step 12


Step 13


SEVERE: CVU do not support target environment Adding ExitStatus PREREQ_FAILURE to the exit status set

WARNING: Verification of target environment returned with errors.WARNING: [WARNING] [INS-13001] Environment does not meet minimum requirements.

when we are installing the oracle database 12c we are getting the error as below

SEVERE: CVU do not support target environment..
Refer associated stacktrace #oracle.install.ivw.common.validator.SupportedOSValidator:381
INFO: Completed verification of target environment.
WARNING: Verification of target environment returned with errors.
WARNING: [WARNING] [INS-13001] Environment does not meet minimum requirements.
   CAUSE: Minimum requirements were not met for this environment
   ACTION: Either check the logs for more information or check the supported configurations for this product..
Refer associated stacktrace #oracle.install.commons.util.exception.DefaultErrorAdvisor:384
INFO: Advice is WITHDRAW
WARNING: Advised to shutdown the installer due to target environment verification errors.
INFO: Adding ExitStatus PREREQ_FAILURE to the exit status set

The error message display as below and the installer and we cant proceed further and we need to exit the installer 



Solution
download the rh.noarch.tar from the oracle metalink note RHEL6: 12c OUI INS-13001: CVU Fails: Reference data is not available for verifying prerequisites on this operating system distribution (Doc ID 1567127.1)

[1] install the rpm redhat-release-6Server-1.noarch.rpm

[root@oracledb1 oracle]# rpm -ivh redhat-release-6Server-1.noarch.rpm
Preparing...                ########################################### [100%]
   1:redhat-release         ########################################### [100%]

Check the installed rpm 
[root@oracledb1 OraInstall2013-11-22_10-07-58AM]# rpm -qa | grep redhat-release
redhat-release-server-6Server-6.4.0.4.el6.x86_64
redhat-release-6Server-1.noarch
[root@oracledb1 OraInstall2013-11-22_10-07-58AM]#

clear the /tmp folder and restart the installation 

If you are installing the stand alone database non(rac) you can proceed the installation with out installing the rpm ...

as you can run the installer ./runInstaller -ignorePrereq to ignore the system prerequisite 



Thursday, November 21, 2013

Error in CreateOUIProcess( ): 13


Please wait ...Error in CreateOUIProcess(): 13: Permission denied

When we try to launch the 12c database run installer from the Linux  we are getting the below error

Step 1

[oracle@oracledb1 database]$ ./runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 500 MB.   Actual 1356 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 49151 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-11-21_06-59-43AM. Please wait ...Error in CreateOUIProcess(): 13: Permission denied

Step 2

Check the file permission of the java which will execute the oui  the java of the run installer can be located in the /tmp/OraInstall

[oracle@oracledb1 bin]$ pwd
/tmp/OraInstall2013-11-20_11-19-33PM/jdk/jre/bin
[oracle@oracledb1 bin]$ ls
ControlPanel  java  java_vm  javaws  jcontrol  keytool  orbd  pack200  policytool  rmid  rmiregistry  servertool  tnameserv  unpack200
[oracle@oracledb1 bin]$ ./java
-bash: ./java: Permission denied
[oracle@oracledb1 bin]$

Check the file whether it is corrupted 

[oracle@oracledb1 bin]$ file java
java: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.4.0, not stripped
Once the file show the details it is not corrupted and we can use 

Step 3
Solution 1

Export the TMP directory to the home folders tmp directory so it will not touch the /tmp
export TMP=$HOME/tmp
Now the installer starts and goes through 
[oracle@oracledb1 database]$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB.   Actual 2510 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 49151 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual
16777216    Passed
Preparing to launch Oracle Universal Installer from
/home/oracle/tmp/OraInstall2013-11-21_07-22-10AM. Please wait
...[oracle@oracledb1 database]$

Now we have permission to execute the java to invoke the GUI screen because the tmp folder is present in the home folder of the oracle user 
[oracle@oracledb1 bin]$ ./java -version
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)
[oracle@oracledb1 bin]$ pwd
/home/oracle/tmp/OraInstall2013-11-21_07-22-10AM/jdk/jre/bin
[oracle@oracledb1 bin]$

Solution 2

cat /etc/fstab

/dev/mapper/vglocal20130819-tmp00 /tmp                    ext4    defaults,nosuid,nodev,noexec        1 2

the execution permission was no execute and the java will not execute and start the oui installer change the mount option in the fstab and restart the ./runinstaller.. once you restart the run installer we need to reboot the Server to take effect ...





Tuesday, July 9, 2013

ERROR OGG-00868 Attaching to ASM server +ASM1: (12528) ORA-12528: TNS:listener: all appropriate instances are blocking new connections.

ERROR OGG-00868 Attaching to ASM server +ASM1: (12528) ORA-12528: TNS:listener: all appropriate instances are blocking new connections.

When the extract connects with the ASM instance to Read the data it get's this error due to the blocked connection in the  ASM instance Normally the ASM instance  is Blocked for the remote connectivity We need to add the parameter (UR=A) in the tnsnames.ora file for enabling the remote connection to the ASM instnace

Step 1

check the connectivity to the ASM by connecting the asm instance remotely

oraprod@db01[+ASM1]:$ sqlplus "sys/omoic@+asm1 as sysdba"
SQL*Plus: Release 10.2.0.3.0 - Production on Mon Jun 25 22:58:39 2013
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
ERROR:
ORA-12528: TNS:listener: all appropriate instances are blocking new connections

Navigate to the TNS_ADMIN and edit the tnsnames.ora file and add the parameter UR=A below the service name parameter

+ASM1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = <hostname>)(PORT = <port number>))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = +ASM)
        (UR=A)
 ))

+ASM2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = <hostname>)(PORT = <port number>))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = +ASM)
        (UR=A)
 ))

If we have Multiple ASM instance's then we need to add this parameter  in all the instance  refer the metalink note How to connect to ASM instance from a remote client (Doc ID 340277.1)

Step 2

Once the Parameter is added then we need to restart the listener services 
oracle@db01[PROD1]:$ lsnrctl reload LISTNER_DB01
oracle@db01[PROD2]:$ lsnrctl reload LISTNER_DB02

Step 3

Check the parameter Remote Log in password in the ASM instance if you have single asm instance it should be exclusive and it it is RAC environment you can use the shared for the password file
Move the existing Password file for the ASM into the new location and then create a new password file for the ASM instnace

oracle@db01[+ASM1]:$ orapwd file=orapw+ASM1 password=<password>

Once the new password file is created then use that password to connect remotely to the ASM instance  once by using the password you are able to connect the ASM instance then check the golden gate's process of extract


 


Monday, July 8, 2013

ERROR OGG-00868 : (12514) ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

ERROR   OGG-00868  Attaching to ASM server +ASM1: (12514) ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

When we are connecting to the Golden gate's Source database as RAC and with ASM then you nedd to create the ASM services in the Listener .. the asm Services will be blocked always science it is not allowed to connect remotely.. follow the steps to create the entry  in the listener.ora file and tnsnames.ora files for the asm instance and create the service's and the remote connection 

Step 1

Add the entries for the  ASM instance in the listener.ora file  check the listener has the services for the ASM

oracle@db01[PROD]:$  lsnrctl services LISTENER_db01 |grep ASM
oracle@db02[PROD]:$  lsnrctl services LISTENER_db02 |grep ASM

IF there is no services for asm then it will not return any rows we need to create the new services for the ASM .. to create the new services for ASM edit the listener.ora and tnsnames.ora file 
 Here we have assumed the paractice for two node cluster if you have n number of nodes then you shoud   create the respective ASM Instance's entry in each Node's

In Node 1 Listener make an entry for the ASM 1 Instance

SID_LIST_LISTENER_db01 =
  (SID_LIST =
    (SID_DESC = (ORACLE_HOME = /prod01/app/oracle/db/10.2.0)(SID_NAME = PROD1))
     (SID_DESC =(GLOBAL_DBNAME  = +ASM)(SID_NAME = +ASM1)(ORACLE_HOME =/prod01/app/oracle/asm/10.2.0 ))
        (SID_DESC = (SID_NAME = PLSExtProc)(ORACLE_HOME = /prod01/app/oracle/db/10.2.0)(PROGRAM = extproc))
)
 
IN Node two Listener Make the entry of ASM2 instance

SID_LIST_LISTENER_db02 =
  (SID_LIST =
    (SID_DESC = (ORACLE_HOME = /prod01/app/oracle/db/10.2.0)(SID_NAME = PROD2))
     (SID_DESC =(GLOBAL_DBNAME  = +ASM) (SID_NAME = +ASM2)(ORACLE_HOME =/prod01/app/oracle/asm/10.2.0 ))
       (SID_DESC = (SID_NAME = PLSExtProc)(ORACLE_HOME = /prod01/app/oracle/db/10.2.0)(PROGRAM = extproc))
  )
Once the listener files had been edited then edit the tnsnames.ora file for adding the entries for the 

In Node 1 add the entries to the tnsnames.ora file  for asm instance

ASM
+ASM1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = <host name>)(PORT = <port number>))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = +ASM)
        (UR=A)
 ))
In Node 2 add the entries to the  tnsnames.ora file for asm instance
 
+ASM2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = <host name>)(PORT = <port number>))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = +ASM)
       (UR=A)

Step 2
Check the Local_Listener parameter in the ASM instnace's

IN ASM Instance 1
SQL> show parameter LOCAL
NAME                                 TYPE                              VALUE
------------------------------------ --------------------------------- ------------------------------
local_listener                       string                           

IN ASM Instance 2

SQL> show parameter LOCAL

NAME                                 TYPE                              VALUE
------------------------------------ --------------------------------- ------------------------------
local_listener                       string                           
Add the listener value for the parameter in the respective instance's
IN ASM 1 instance

SQL>alter system set local_listener=LISTENER_DB01

SQL> show parameter LOCAL
NAME                                 TYPE                              VALUE
------------------------------------ --------------------------------- ------------------------------
local_listener                       string                            LISTENER_DB01
 IN ASM2 Instance

SQL>alter system set local_listener=LISTENER_DB02

SQL> show parameter local
NAME                                 TYPE                              VALUE
------------------------------------ --------------------------------- ------------------------------
local_listener                       string                            LISTENER_DB02

The Listener LISTENER_db01 and LISTENER_db02 are two listener which we have in the rac environment but according to your environment you can set the listener names 
Step 3
Reload the Listener for the changes to take effect

IN Node 1

oracle@db01[PROD]:$ lsnrctl reload LISTENER_DB01
LSNRCTL for HPUX: Version 10.2.0.3.0 - Production on 08-JUL-2013 16:34:44
Copyright (c) 1991, 2006, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<hostname>)(PORT=<portnumber>)(IP=FIRST)))
The command completed successfully

In Node 2
 
oracle@db02[PROD]:$ lsnrctl reload LISTENER_DB02
LSNRCTL for HPUX: Version 10.2.0.3.0 - Production on 08-JUL-2013 16:36:35
Copyright (c) 1991, 2006, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<hostname>)(PORT=<portnumber>)(IP=FIRST)))
The command completed successfully

Step 4

check the listener for the new services in both the nodes you will get the services it will be blocked by default and if you want to connect remotely then you need to add the (UR=A) parameter in the tnsnames .ora file

oracle@db01[+ASM1]:$ lsnrctl services LISTENER_DB01|grep ASM
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status BLOCKED, has 1 handler(s) for this service...
Service "+ASM_XPT" has 1 instance(s).
  Instance "+ASM1", status BLOCKED, has 1 handler(s) for this service...

oracle@db02[+ASM2]:$ lsnrctl services LISTENER_DB02|grep ASM
Service "+ASM" has 1 instance(s).
  Instance "+ASM2", status BLOCKED, has 1 handler(s) for this service...
Service "+ASM_XPT" has 1 instance(s).
  Instance "+ASM2", status BLOCKED, has 1 handler(s) for this service...

Step 5
Connect the ASM instance remotely and check whether it is able to connect the instance
oracle @db01[+ASM1]:$ sqlplus "sys<password>@+asm1 as sysdba"
SQL*Plus: Release 10.2.0.3.0 - Production on Mon Jul 8 16:40:29 2013
Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

Step 6

Check the parameter to use the TRANLOGOPTIONS for the extract 
 Add the TRANLOGOPTIONS parameter with the below syntax

Syntax  for the parameter 
TRANLOGOPTIONS ASMUSER <username>@<instnace_name> , ASMPASSWORD<password>

Now start the extract to read the data from the ASM
 




 




























Sunday, May 19, 2013

Rman catalog creation in 11gr2 database

RMAN CATALOG CREATION IN 11GR2 DATABASE

The catalog database acts as the centralized inventory of  database's and stores the backup details of all the database which is registered with it .. there are two methods the Rman can be operated the control file and the Recovery catalog
For creating the recovery catalog database we need to create the new database or we can use the existing database .. But the safe parctice is to create the new database which is dedicated for the CATALOG ..
The benefit of using the recover catalog is all the backup information of the database is stored in recover catalog database tables and we can query the status of the backup and the details of the backup from the recovery catalog database

Step 1
Create the Separate database which is going to host the Rman catalog database

Step 2
Create the Separate  table space which will hold all the catalog schema tables in it 
SQL> CREATE TABLESPACE <tables pace_name>
  2  DATAFILE '<datafile_name>' size 10240M
  3  Autoextend on;
Tablespace created.


Step3 

Create the new user which will the Owner of the Rman catalog
Create user <username> identified by <password>
Default tablespace <tablespace_name>
Temporary tablespace <temporary tablespace name>
Quota <percentage of allocated quota> on <table space>


 Step 4
Grant the recovery catalog owner role to the rcat user


Step5
Fom the O/S Prompt connect to the rman


Step 6 
Connect to the recover catalog by using the new user name which we have created 

Step 7
Connect to the recover catalog and register the database










Tuesday, May 14, 2013

RMAN-20020: database incarnation not set

RMAN-06004: ORACLE error from recovery catalog database: RMAN-20020: database incarnation not set

When we try to back the resync the catalog with the target database if we get this message then we have to reset the database to set the incarnation to the current
it can be cauased when we open the database with reset logs or if the  upgrade the catalog and connect with the target database
The database incarnations are used to identify the database backup belongs to which period .. for ex. day 1 when we take the back of the database then a incarnation will be generated and stored .. if we restore the database and the open it again then the new incarnation number will be generated .. now if we want to restore the backup which is take on the day one then we must set the database incarnation to the first incarnation number by using the RESET DATABASE TO INCARNATION                        the database control file will also hold the incarnation number in it

Step 1
connect to  rman and connect to the target database with recovery catalog
[ora@fa ~]$ rman
Recovery Manager: Release 11.2.0.3.0 - Production on Tue May 14 13:35:00 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
 
RMAN> connect target /
connected to target database: <SID> (DBID=<database_id>)
 
RMAN> connect catalog rcat/<password>@<catalog database service name>
connected to recovery catalog database

Step2

RMAN> resync catalog
2> ;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of resync command on default channel at 05/14/2013 13:36:02
RMAN-20020: database incarnation not set

RMAN> backup datafile <file_number>;
Starting backup at 14-MAY-13
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 05/14/2013 13:37:14
RMAN-03014: implicit resync of recovery catalog failed
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20020: database incarnation not set

Step 3
once you got the incarnation not set check the list of incarnation the database has

RMAN> list incarnation ;
List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
29      360     FAHDB    728861041        PARENT  1          05-MAR-12
29      361     FAHDB    728861041        PARENT  14640435   08-JUN-12
29      98      FAHDB    728861041        PARENT  14882874888 22-JUN-12
29      30      FAHDB    728861041        ORPHAN  15574861795 11-JUL-12
29      321     FAHDB    728861041        CURRENT 15996977185 22-AUG-12
1       17      ORACAT   2821584587       PARENT  1          05-SEP-10
1       2       ORACAT   2821584587       CURRENT 972274     12-MAY-13

SQL> select * from v$controlfile_record_section where TYPE ='DATABASE INCARNATION';

TYPE                         RECORD_SIZE RECORDS_TOTAL RECORDS_USED FIRST_INDEX LAST_INDEX LAST_RECID
---------------------------- ----------- ------------- ------------ ----------- ---------- ----------
DATABASE INCARNATION                  56           292            4           1          4          4

we can check the no of database incarnations in the database control file ...

Step 4
To sync the incarnation number with the catalog issue the Reset the database  command in the rman 
and test the backup

RMAN> reset database;

database incarnation already registered

RMAN> backup datafile 3;
Starting backup at 14-MAY-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=4256 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=00003 name=+DATA/fahdb/datafile/<datafile_number>
channel ORA_DISK_1: starting piece 1 at 14-MAY-13
channel ORA_DISK_1: finished piece 1 at 14-MAY-13
piece handle=+FLASH/fahdb/backupset/2013_05_14/nnndf0_tag20130514t135843_0.282.815407125 tag=TAG20130514T135843 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 14-MAY-13
Starting Control File and SPFILE Autobackup at 14-MAY-13
piece handle=+FLASH/fahdb/autobackup/2013_05_14/s_815407132.326.815407133 comment=NONE
Finished Control File and SPFILE Autobackup at 14-MAY-13

RMAN> resync catalog ;
starting full resync of recovery catalog
full resync complete






Monday, May 13, 2013

PL/SQL package RCAT.DBMS_RCVCAT version 11.02.00.02 in RCVCAT database is not current

PL/SQL package RCAT.DBMS_RCVCAT version 11.02.00.02 in RCVCAT database is not current

when we are trying to connect the Rman catalog database we are getting  the error it is cause because The particular version of the source database catalog is not sync with the current catalog..
The Cause of this Error is due to the recover catalog database or the target database must be upgraded .. or the recover catalog database is changed

Step 1

[ora@fah ~]$ rman

Recovery Manager: Release 11.2.0.3.0 - Production on Mon May 13 17:18:58 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
RMAN> connect target /
connected to target database: <SID> (DBID=<>)

RMAN> connect catalog rcat/<password>@ORACAT<Domain_name>
connected to recovery catalog database
PL/SQL package RCAT.DBMS_RCVCAT version 11.02.00.02 in RCVCAT database is not current
PL/SQL package RCAT.DBMS_RCVMAN version 11.02.00.02 in RCVCAT database is not current

Step 2

For check the issue if we give the Register database or Resync catalog thou will get the below error message

RMAN> register database;

DBGSQL:     RCVCAT> begin dbms_rcvman.dumpPkgState('RCVMAN after sqlerror'); end;
DBGSQL:        sqlcode = 6550
DBGSQL:     RCVCAT> begin dbms_rcvcat.dumpPkgState('RCVCAT after sqlerror');end;
DBGSQL:        sqlcode = 6550
database registered in recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03008: error while performing automatic resync of recovery catalog
RMAN-10015: error compiling PL/SQL program
RMAN-10014: PL/SQL error 0 on line 1655 column 12: Statement ignored
RMAN-10014: PL/SQL error 306 on line 1655 column 12: wrong number or types of arguments in call to 'CHECKTABLESPACE'

RMAN> resync catalog;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of resync command on default channel at 05/13/2013 17:19:38
RMAN-10015: error compiling PL/SQL program
RMAN-10014: PL/SQL error 0 on line 1655 column 12: Statement ignored
RMAN-10014: PL/SQL error 306 on line 1655 column 12: wrong number or types of arguments in call to 'CHECKTABLESPACE'

Step 3

We need to give the upgrade catalog command to sync the new change in the binaries to reflect in the catalog database

RMAN> upgrade catalog;

recovery catalog owner is RCAT
enter UPGRADE CATALOG command again to confirm catalog upgrade

RMAN> upgrade catalog;

recovery catalog upgraded to version 11.02.00.03
DBMS_RCVMAN package upgraded to version 11.02.00.03
DBMS_RCVCAT package upgraded to version 11.02.00.03



Step 4
Connect the target database with the rman and catalog now you can issue the command report schema

[oratest@fahtestapp ~]$ rman

Recovery Manager: Release 11.2.0.3.0 - Production on Mon May 13 17:21:20 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
RMAN> connect target /
connected to target database: <SID> (DBID=<dbid_number>)
RMAN> connect catalog rcat/<password>@ORACAT.<Domain_name>
connected to recovery catalog database

RMAN> report schema;
Report of database schema for database with db_unique_name <SID>
List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
---
----
----
List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
---
---