Wednesday, April 6, 2011

RAC One Node Database--11.2.0.1

In this article I will discuss how to use rac one node option in 11.2.0.1.


Step1)Apply Patch #9004119 to enable rac one option in 11.2.0.1 database release.

*racnode1*<oracle:uk11201>:/u01/app/oracle/product/11.2.0.1/db_1/bin=>ls -tlr racone*
-rwxr-xr-x 1 oracle oinstall  7461 Oct 22  2009 raconestatus
-rwxr-xr-x 1 oracle oinstall 20268 Oct 22  2009 raconeinit
-rwxr-xr-x 1 oracle oinstall 25719 Oct 22  2009 raconefix
-rwxr-xr-x 1 oracle oinstall 12396 Oct 22  2009 racone2rac



Step2)Execute raconeinit script to initialize rac one ndoe database configuration.


*racnode1*<oracle:uk11201>:/u01/app/oracle/product/11.2.0.1/db_1/bin=>./raconeinit

Candidate Databases on this cluster:

 #      Database        RAC One Node    Fix Required
===     ========        ============    ============
[1]       racone             NO              N/A
[2]      uk11201             NO              N/A
Enter the database to initialize [1]: 2


Database uk11201 is now running on server racnode1

Candidate servers that may be used for this DB:  racnode2

Enter the names of additional candidate servers where this DB may run (space delimited): racnode2


 Please wait, this may take a few minutes to finish.......

Database configuration modified.


*racnode1*<oracle:uk11201>:/u01/app/oracle/product/11.2.0.1/db_1/bin=>./raconestatus

RAC One Node databases on this cluster:


  Database UP Fix Required        Current Server                    Candidate Server Names
  ======== == ============ ==============================  ========================================
   uk11201  Y       N                            racnode1                         racnode1 racnode2


Available Free Servers:


Step3)Relocate racone database to another server using Omotion. 




*racnode1*<oracle:uk11201>:/u01/app/oracle/product/11.2.0.1/db_1/bin=>Omotion

RAC One Node databases on this cluster:

 #      Database                    Server                      Fix Required
===     ========        ==============================          ============
[1]      uk11201                              racnode1                N

Enter number of the database to migrate [1]: 1


Specify maximum time in minutes for migration to complete (max 30) [30]: 30


Available Target Server(s) :
 #            Server            Available
===     ==================      =========
[1]               racnode2          Y

Enter number of the target node [1]: 1

Omotion Started...
Starting target instance on racnode2...


Error num: 2
ERROR: Unable to start the new instance of uk11201 on racnode2.
Run raconefix and run Omotion again.
Exiting...

*racnode1*<oracle:uk11201>:/u01/app/oracle/product/11.2.0.1/db_1/bin=>./raconefix

RAC One Node databases on this cluster:

 #      Database                    Server                      Fix Required
===     ========        ==============================          ============
[1]      uk11201                     racnode1 racnode2                Y

Enter number of the database to fix [1]: 1


This database needs to be fixed.


RACOne Database uk11201 fixed.


Issue : 

no available public threads to mount, go to pnp wait
no available public threads to mount, go to pnp wait
ORA-1620 signalled during: ALTER DATABASE MOUNT /* db agent *//* {1:8141:2280} */...
Wed Apr 06 11:01:54 2011
Shutting down instance (abort)



Fix :


create undo tablespace UNDOTBS2 datafile '+DATA1' size 250M autoextend off;


alter database add logfile thread 2 group 4 '+DATA1' size 50M;
alter database add logfile thread 2 group 5 '+DATA1' size 50M;
alter database add logfile thread 2 group 6 '+DATA1' size 50M;



*racnode1*<oracle:uk11201_1>:/u01/app/oracle/product/11.2.0.1/db_1/bin=>./Omotion

RAC One Node databases on this cluster:

 #      Database                    Server                      Fix Required
===     ========        ==============================          ============
[1]      uk11201                              racnode1                N

Enter number of the database to migrate [1]: 1

Specify maximum time in minutes for migration to complete (max 30) [30]:

Available Target Server(s) :
 #            Server            Available
===     ==================      =========
[1]               racnode2          Y

Enter number of the target node [1]: 1

Omotion Started...
Starting target instance on racnode2...
Migrating sessions...
Stopping source instance on racnode1...
Omotion Completed...

=== Current Status ===
Database uk11201 is running on node racnode2



















Monday, April 4, 2011

RAC One Node Database--11.2.0.2

Oracle Real Application Clusters One Node (Oracle RAC One Node) is a single instance of an Oracle Real Application Clusters (Oracle RAC) database that runs on one node in a cluster.


 Major Changes in 11.2.0.2 database version:

 1)OUI has a new option to select RAC One Installation.
 2)DBCA is now capable of configuring RAC One database.
  SRVCTL is capable of configuring and administering RAC One database. (In 11.2.0.1 this was  performed using scripts like "Omotion”, “raconestatus” etc).
 3)DBUA is RAC One aware.

 Administrating a RAC One Database:

Verifying an existing RAC One database:
 
*racnode1*<oracle:racone>:/home/oracle=>srvctl config database -d racone
Database unique name: racone
Database name: racone
Oracle home: /u01/app/oracle/product/11.2.0.2/db_1
Oracle user: oracle
Spfile: +DATA01/racone/spfileracone.ora
Domain: ukatru.com
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racone
Database instances:
Disk Groups: DATA01
Mount point paths: /u01/app/oracle
Services: onedv.ukatru.com
Type: RACOneNode
Online relocation timeout: 30
Instance name prefix: racone
Candidate servers: racnode1,racnode2
Database is administrator managed
*racnode1*<oracle:racone>:/home/oracle=>srvctl status database -d racone
Instance racone_1 is running on node racnode1
Online relocation: INACTIVE


*racnode1*<oracle:racone>:/home/oracle=>srvctl status database -d racone
Instance racone_1 is running on node racnode1
Online relocation: INACTIVE


Step1)Performing relocation: 


*racnode1*<oracle:racone>:/home/oracle=>srvctl relocate database -h

Initiate online relocation of the RAC One Node database.

Usage: srvctl relocate database -d <db_unique_name> {[-n <target>] [-w <timeout>] | -a [-r]} [-v]
    -d <db_unique_name>      Unique name of database to relocate
    -n <target>              Target node to which to relocate database
    -w <timeout>             Online relocation timeout in minutes
    -a                       Abort failed online relocation
    -r                       Remove target node of failed online relocation request from the candidate server list of administrator-managed RAC One Node database
    -v                       Verbose output
    -h                       Print usage



*racnode1*<oracle:racone>:/home/oracle=>srvctl relocate database -d racone -n racnode2

Status during Relocation:


*racnode1*<oracle:racone>:/home/oracle=>srvctl status database -d racone
Instance racone_1 is running on node racnode1
Instance racone_2 is running on node racnode2
Online relocation: ACTIVE
Source instance: racone_1 on racnode1
Destination instance: racone_2 on racnode2



Once the migration is completed, we should see the sessions moved to the remote instance.

*racnode1*<oracle:racone>:/home/oracle=>srvctl status database -d racone
Instance racone_2 is running on node racnode2
Online relocation: INACTIVE



Step2:)Converting a RAC One database to RAC or vice versa

Example commands : 


srvctl convert database -d <db_unique_name> -c RAC [-n <node>]


srvctl convert database -d racone -c RAC -n racnode1

To convert a database from RAC to RACOne:

command: srvctl convert database -d <db_unique_name> -c RACONENODE -i <inst prefix> -w <timeout>

Eg:  srvctl convert database -d racone -c RACONENODE -w 30 -i racone








Sunday, April 3, 2011

Oracle Database 11g Express Edition (11.2) Beta

In this article we will learn how to install 11g Express edition 11.2 Beta on linux x86_64 bit.


















Limitations:

1.If Oracle Database XE is installed on a computer with more than one CPU (including dual-core CPUs), then it will consume, at most, processing resources equivalent to one CPU

2.Only one installation of Oracle Database XE can be performed on a single computer

3.The maximum amount of user data in an Oracle Database XE database cannot exceed 11 gigabytes

4.The maximum amount of RAM that an Oracle Database XE database uses cannot exceed 1 gigabyte, even if more is available


Oracle Database XE is a great starter database for:
  • Developers working on PHP, Java, .NET, XML, and Open Source applications
  • DBAs who need a free, starter database for training and deployment
  • Independent Software Vendors (ISVs) and hardware vendors who want a starter database to distribute free of charge
  • Educational institutions and students who need a free database for their curriculum

Installing Oracle Database XE:

Log on to your computer with root permissions.

[root@oraexpress u01]# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm)

Run the Oracle Database XE executable oracle-xe-11.2.0-0.5.x86_64.rpm to install Oracle Database XE.

[root@oraexpress u01]# rpm -ivh oracle-xe-11.2.0-0.5.x86_64.rpm
Preparing...                ########################################### [100%]
   1:oracle-xe              ########################################### [100%]
Executing post-install steps...

You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.
[root@oraexpress u01]# /etc/init.d/oracle-xe configure

Oracle Database 11g Express Edition Configuration
-------------------------------------------------
This will configure on-boot properties of Oracle Database 11g Express
Edition.  The following questions will determine whether the database should
be starting upon system boot, the ports it will use, and the passwords that
will be used for database accounts.  Press <Enter> to accept the defaults.
Ctrl-C will abort.

Specify the HTTP port that will be used for Oracle Application Express [8080]:8080

Specify a port that will be used for the database listener [1521]:1521

Specify a password to be used for database accounts.  Note that the same
password will be used for SYS and SYSTEM.  Oracle recommends the use of
different passwords for each database account.  This can be done after
initial configuration:
Password can't be null. Enter password:
Confirm the password:

Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:n

Starting Oracle Net Listener...Done
Configuring database...Done
Starting Oracle Database 11g Express Edition instance...Done
Installation completed successfully.

$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
$ export ORACLE_SID=XE
$ cd /u01/app/oracle/product/11.2.0/xe/bin
$ ./sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Beta on Sun Apr 3 12:36:57 2011

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


Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Beta

SQL>




Create 10gR2(10.2.0.5) database on 11gR2 ASM and Cluster

In this article we will look at creating database 10gR2 database on 11gR2 asm and cluster.

Env : Two node Rac 
OS
*racnode1*<oracle:>:/etc=>cat redhat-release
Red Hat Enterprise Linux Server release 5.6 (Tikanga)


Node1:racnode1.ukatru.com
Node2:racnode2.ukatru.com
Scan-Name : racnode-scan.ukatru.com


Step1:Install 10gr2 database and appy 10.2.0.5 patch set(We don't get any issues while installation)

To run older database on 11gR2 ASM and clusterware we need to create a persistent configuration for the nodes(pinning a node).Cluster configuration in 11gR2 is dynamic.This dynamic configuration is incompatible with older database releases:
If we don't pinn nodes dbca will not recognize the rac cluster;instead dbca will create a single node database.


Please check metalin for following article if you face any more issues while creating 10gR2 database.


Pre 11.2 Database Issues in 11gR2 Grid Infrastructure Environment [ID 948456.1]


Pinning nodes:


[root@racnode1 bin]# ./crsctl pin css -h
Usage:
  crsctl pin css -n <node1>[...]
 Pin the nodes (make leases non-expiring).

[root@racnode1 bin]# ./crsctl pin css -n racnode1
CRS-4664: Node racnode1 successfully pinned.
[root@racnode1 bin]# ./crsctl pin css -n racnode2
CRS-4664: Node racnode2 successfully pinned.
[root@racnode1 bin]# ./olsnodes -n -t
racnode1        1       Pinned
racnode2        2       Pinned




*racnode1*<oracle:onedv1_1>:/u01/app/oracle1/product/10.2.0.5/db_1=>export ORACLE_HOME=/u01/app/oracle1/product/10.2.0.5/db_1

export TNS_ADMIN=/u01/app/11.2.0/grid/network/admin
*racnode1*<oracle:onedv1_1>:/u01/app/oracle1/product/10.2.0.5/db_1=>cd bin
*racnode1*<oracle:onedv1_1>:/u01/app/oracle1/product/10.2.0.5/db_1/bin=>./dbca &


now dbca failed with following error:


Encountered file error when copying listeners from home=/u01/app/11.2.0/grid/(The grid home).



sol:Setting $GRID_HOME/network/admin to 775 permisson fixed the problem.

Issues faced:
Solution :


click on Back and select Initialization parameter and changed REMOTE_LISTENER to : racnode-scan.ukatru.com:1521 and set ora10g1.LOCAL_LISTENER and ora10g2.LOCAL_LISTENER to empty values.

 *racnode1*<oracle:ora10g1>:/u01/app/11.2.0/grid/bin=>/u01/app/oracle1/product/10.2.0.5/db_1/bin/srvctl status database -d ora10g
Instance ora10g1 is running on node racnode1
Instance ora10g2 is running on node racnode2

Advantage : you can use scan name in the tns entries instead of virtual ip from each node.
ORA10G =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = racnode-scan.ukatru.com )(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ora10g.ukatru.com)
    )
  )