Saturday 24 December 2011

Using SRVCTL for Administration of RAC Database

Using SRVCTL for Administration of RAC Database :::


Overview:
This article is a comprehensive guide for Using SRVCTL for Administration of RAC Database.
The Server Control (SRVCTL) utility is installed on each node by default. We can use SRVCTL to start and stop the database and instances, manage configuration information, and to move or remove instances and services. We can also use SRVCTL to add services. SRVCTL also manages configuration information.
Please do keep in mind that this article should not be considered a substitution of the official guide from Oracle (http://www.oracle.com). The below mentioned link can be used to acceess the official SRVCTL Utility Guide:





Objective of the Article:
By the time we finish this article, we should be able to understand the following:
(1)Basic idea of Server Control (SRVCTL) utility.
(2)The use of Server Control (SRVCTL) utility for managing RAC Database.

Values and parameters used in the article:
 Parameter  Node1  Node2
 Hostname  RAC1  RAC2
 Instance Name  RACDB1  RACDB2
 RAC Database Name  RACDB






Summary of SRVCTL commands:
 Command  Description
 srvctl add  Adds the node applications, database, database instance, ASM instance, or service.
 srvctl remove  Removes the node applications, database, database instance, ASM instance, or service.
 srvctl config  Lists the configuration for the node applications, database, ASM instance, or service.
 srvctl enable  Enables the database, database instance, ASM instance, or service.
 srvctl disable  Disables the database, database instance, ASM instance, or service.
 srvctl start  Starts the node applications, database, database instance, ASM instance, or service.
 srvctl stop  Stops the node applications, database, database instance, ASM instance, or service.
 srvctl modify  Modifies the node applications, database, database instance, or service configuration.
 srvctl relocate  Relocates the service from one instance to another.
 srvctl status  Obtains the status of the node applications, database, database instance, ASM instance, or service.
 srvctl getenv  Displays the environment variable in the configuration for the node applications, database, database instance, or service.








 SRVCTL Command Syntax and Options:
SRVCTL commands, objects, and options are case sensitive. Database, instance, and service names are case insensitive and case preserving. SRVCTL interprets the following command syntax:
command_prompt> srvctl command object [options]
In SRVCTL syntax:
  • srvctl is the command to start the SRVCTL utility.
  • command is a verb such as start, stop, or remove.
  • object is an object or target on which SRVCTL performs the command, such as database or instance.
  • options extend the use of a preceding command combination to include additional parameters for the command.


 For all the screenshots, please visit the link::: http://www.sensehaze.com/mydata/resources_section/rac/srvctl/index.php


SRVCTL Command Examples:

Obtaining Command-Line Help for SRVCTL:
For Obtaining Command-Line Help for SRVCTL, from command prompt(terminal) type:
[oracle@rac1 ] srvctl -h

Obtaining version of SRVCTL:
For Obtaining version of SRVCTL, from command prompt(terminal) type:
[oracle@rac1 ] srvctl -v

Display configuration for our RAC database:
For displaying various configuration for our RAC database, from command prompt(terminal) type:
For configuration of database
[oracle@rac1 ] srvctl config database -d racdb
For configuration of services
[oracle@rac1 ] srvctl config service -d racdb
For configuration of nodeapps
[oracle@rac1 ] srvctl config nodeapps -n rac1
[oracle@rac1 ] srvctl config nodeapps -n rac2
For configuration of ASM
[oracle@rac1 ] srvctl config asm -n rac1
[oracle@rac1 ] srvctl config asm -n rac2
For configuration of listener
[oracle@rac1 ] srvctl config listener -n rac1
[oracle@rac1 ] srvctl config nodeapps -n rac2


SRVCTL enable option:
For enabling database/instance etc, of our RAC database, from command prompt(terminal) type:
For enabling database:
[oracle@rac1 ] srvctl enable database -d racdb
For enabling instance:
[oracle@rac1 ] srvctl enable instance -d racdb -i racdb1
[oracle@rac1 ] srvctl enable instance -d racdb -i racdb2



SRVCTL disable option:
For disabling database/instance etc, of our RAC database, from command prompt(terminal) type:
For disabling database:
[oracle@rac1 ] srvctl disable database -d racdb
[oracle@rac1 ] srvctl enable database -d racdb
For dsabling instance:
[oracle@rac1 ] srvctl disable instance -d racdb -i racdb1
[oracle@rac1 ] srvctl disable instance -d racdb -i racdb2


SRVCTL start option:
For starting database:
[oracle@rac1 ] srvctl start database -d racdb
For starting an instance:
[oracle@rac1 ] srvctl start instance -d racdb -i racdb1
For starting nodeapps:
[oracle@rac1 ] srvctl start nodeapps -n rac1
[oracle@rac1 ] srvctl start nodeapps -n rac2
For starting ASM:
[oracle@rac1 ] srvctl start asm -n rac1
[oracle@rac1 ] srvctl start asm -n rac2
For starting listener:
[oracle@rac1 ] srvctl start listener -n rac1
[oracle@rac1 ] srvctl start listener -n rac2


SRVCTL stop option:
For stopping database:
[oracle@rac1 ] srvctl stop database -d racdb
For stopping instance:
[oracle@rac1 ] srvctl stop instance -d racdb -i racdb1


SRVCTL status option:
For status of database:
[oracle@rac1 ] srvctl status database -d racdb
For status of instance(s):
[oracle@rac1 ] srvctl status instance -d racdb -i "racdb1,racdb2"
[oracle@rac1 ] srvctl status instance -d racdb -i racdb1
For status of service(s):
[oracle@rac1 ] srvctl status service -d racdb -s racdb_srvc


For all the screenshots, please visit the link::: http://www.sensehaze.com/mydata/resources_section/rac/srvctl/index.php











Friday 16 December 2011

Data Guard Command-Line Interface (DGMGRL)

In this article we are going to learn, Data Guard Command-Line Interface (DGMGRL).


Overview:
This article is a comprehensive guide for the use of Data Guard Command-Line Interface (DGMGRL). The Data Guard command-line interface (DGMGRL) enables us to manage a Data Guard broker configuration and its databases directly from the command line.
Data Guard Broker eliminates the need for the complex commands that are needed during role transitions – such as, switchover between a primary and a standby database.
Please do keep in mind that this article should not be considered a substitution of the official guide from Oracle (http://www.oracle.com). The below mentioned link can be used to download the official Data Guard Command-Line Interface Reference.




Objective of the Article:
By the time we finish this article, we should be able to understand the following:
(1)How to utilize Data Guard Command Line Interface (DGMGRL).
(2)Performing switchover by DGMGRL utility.



Names and Parameter Values Used:
   Node1 (Primary)  Node2 (Standby)
  Machine Name  DG1  DG2
  IP Address  192.168.1.100  192.168.1.101
  Oracle Database Version  11g Ent. R2(11.2.0.1)- 64 bit  11g Ent. R2(11.2.0.1)- 64 bit
  DB Service Name  orcl  stdby
  Oracle Software Owner  O/S User – oracle  O/S User – oracle




Prerequisites for Data Guard Broker Configuration:
We have to set initialization parameter DG_BROKER_START to a value of TRUE on both databases (primary and standby) so that Data Guard Broker background process (DMON) would start automatically whenever a Data Guard configuration was successfully implemented.
For setting "DG_BROKER_START" parameter to "TRUE", connect to the database and fire the below command (Do these from both the Nodes).
Do these from node 1:
[oracle@dg1 ~]export ORACLE_SID=orcl
[oracle@dg1 ~]sqlplus sys/sys@orcl as sysdba

SQL> select name , db_unique_name , database_role from v$database ;

SQL> show parameter dg_broker_start ;
If the output shows "FALSE", then we have to set it to "TRUE".
SQL> alter system set dg_broker_start = TRUE ;


Similarly do these activities from the second node (node2).
[oracle@dg2 ~]sqlplus sys/sys@stdby as sysdba

SQL> select name , db_unique_name , database_role from v$database ;

SQL> show parameter dg_broker_start ;
If the output shows "FALSE", then we have to set it to "TRUE".
SQL> alter system set dg_broker_start = TRUE ;


We must have SYSDBA privileges to use the Data Guard command-line interface. So do not include "AS SYSDBA" on the CONNECT command because SYSDBA is the default setting for this command.

 Data Guard Broker configuration:
Start the Data Guard Command-Line Interface:
From the primary node (node1), open the terminal and connect to "DGMGRL" as the "SYS" user. As shown below:
[oracle@dg1 ~]dgmgrl
Then we will get the dgmgrl prompt. For connecting to the database, type:
DGMGRL> connect sys
Then we will be asked for password, Enter the correct password, then we will get connected to the database.


Create Data Guard Broker configuration for the primary database:
For creating Data Guard Broker configuration for the primary database (orcl), we will use "CREATE CONFIGURATION" command to initialize a Data Guard Broker configuration named "DG_orcl".
For doing so, type the following inside the DGMGRL prompt:
DGMGRL> CREATE CONFIGURATION 'DG_orcl' AS PRIMARY DATABASE IS orcl CONNECT IDENTIFIER IS orcl;


 For all the screenshots , please visit the link::: http://www.sensehaze.com/mydata/resources_section/dataguard/dgmgrl/index.php

For confirming its creation, type "SHOW CONFIGURATION" in the "DGMGRL" prompt.
DGMGRL> SHOW CONFIGURATION ;


Add standby database(s) to the Data Guard Broker configuration:
To add a standby database to the current configuration, we will use "ADD DATABASE" command.
For doing so, type the following inside the DGMGRL prompt:
DGMGRL> ADD DATABASE 'stdby' AS CONNECT IDENTIFIER IS stdby;

For verifying the configuration, type "SHOW CONFIGURATION" in the "DGMGRL" prompt.
DGMGRL> SHOW CONFIGURATION ;



Enable the Data Guard Broker configuration:
For enabling Data Guard Broker configuration, issue the "ENABLE CONFIGURATION" command to activate the configuration.

Verify the successful activation of the primary and standby database(s) by using "SHOW DATABASE" command.
Perform a Switchover using Data Guard Broker:
Once all the above activities are completed successfully , we can perform siwtchover from DGMGRL prompt by issuing only one command "SWITCHOVER TO target_standby_database ;".
DGMGRL> SWITCHOVER to stdby ;

After execution of the above command, our primary database should be "stdby"(Node2) and our standby database should be "orcl"(Node1). Lets verify it by connecting to the databases and querying the view "V$DATABASE" on all the nodes.
SQL> select name , db_unique_name , database from v$database ;


To see whether logfiles are being transmitting or not, lets switch logfile. For doing logfile switch, type the below from primary database (node2):
SQL> alter system switch logfile;
SQL> archive log list ;


On the standby database (node1) check archive log list status.
SQL> archive log list ;
For all the screenshots , please visit the link::: http://www.sensehaze.com/mydata/resources_section/dataguard/dgmgrl/index.php

 Perform a Revertback to original Primary Database:
We can Perform a Revertback to original Primary Database from DGMGRL prompt by issuing only one command "SWITCHOVER TO target_database ;".
DGMGRL> SWITCHOVER to orcl ;


After execution of the above command, our primary database should be "orcl"(Node1) again and our standby database should be "stdby"(Node2). Lets verify it by connecting to the databases and querying the view "V$DATABASE" on all the nodes.
SQL> select name , db_unique_name , database from v$database ;


To see whether logfiles are being transmitting or not, lets switch logfile. For doing logfile switch, type the below from primary database (node1):
SQL> alter system switch logfile;
SQL> archive log list ;


On the standby database (node2) check archive log list status.
SQL> archive log list ;
Convert Standby Database:
We can convert a physical standby database to a snapshot standby database, or revert the snapshot standby database back to a physical standby database byusing DGMGRL utility.

We are going to convert "Physical Standby Database(Node2-stdby)" to "Snapshot Standby Database" by using "DGMGRL" utility.
DGMGRL> CONVERT DATABASE stdby TO SNAPSHOT STANDBY ;
 Similarly we can convert the snapshot standby database to physical standby database.

For all the screenshots , please visit the link::: http://www.sensehaze.com/mydata/resources_section/dataguard/dgmgrl/index.php

Saturday 10 December 2011

Oracle 10g R2 Dataguard on 32 bit RedHat Enterprise Linux 5

In this article we are going to learn, how to configure Oracle 10g R2 Dataguard on 32 bit RedHat Enterprise Linux 5.

Overview:
This article is a comprehensive guide for the configuration of Oracle Dataguard with Database 10g Release 2 (10.2.0.1.0) x86 on the RedHat Enterprise Linux 5 (RHEL5) x86 Operating System Environment.
Please do keep in mind that this article should not be considered a substitution of the official guide from Oracle (http://www.oracle.com). The below mentioned link can be used to download the official dataguard configuration guide for Oracle Database 10g.



Objective of the Article:
By the time we finish this article, we should be able to understand the following:
(1)Installation of oracle database (10.2.0.1.0) x86 on RedHat Enterprise Linux 5 (RHEL5) x86.
(3)Creation & configuration of general-purpose Oracle 10g (10.2.0.1.0) database that makes use of the local file system for physical database file storage (control files, data files, flash recovery area, online redo log files).
(4)Configuration of Dataguard ( Physical Standby ) with oracle database (10.2.0.1.0) x86 on RedHat Enterprise Linux 5 (RHEL5) x86 by using RMAN.




Parameters Used in the Article:
   Node1(Primary)  Node2(Standby)
 Machine Name  REDHAT1  REDHAT2
 IP Address  192.168.15.100  192.168.15.101
 Oracle Database Version  10g Ent. R2(10.2.0.1)- 32 bit  10g Ent. R2(10.2.0.1)- 32 bit
 DB Service Name  mydb  mydbstb
 Oracle Software Owner  O/S User – oracle  O/S User – oracle
Do the below mentioned activity on both the nodes ( redhat1 , redhat2 ).
Open the "/etc/hosts" file and add the entries similar to the following on both the nodes:
192.168.15.100 redhat11
192.168.15.101 redhat2


Check the Ping Status of the Machines, from both the machines.
Prerequisites check & Database Installation:
For completing the prerequisites and installation of Oracle Database 10g R2 x86 on RHEL5 x86, please visit the below mentioned link:
Link for database 10g R2 installtion on RedHat Enterprise Linux x86
Follow the instructions given in the above link and follow the steps till "Listener Creation" on both the machines ( redhat1 and redhat2 ) including "Listener Creation".


Database Creation:
For creation of Database, please visit the below mentioned link:
Link for database creation
Create database on node1 (Redhat1) only. For the purpose of this article, we will use "mydb" as databae name.
Global Database Name - mydb



Setting User Environment:
Setting the environment for "oracle" user. For setting so, do the following( Do the below activity on both the nodes(redhat1,redhat2)):
[root@redhat1 ~]# su - oracle
[oracle@redhat1 ~]$ vim ~/.bash_profile
Add the lines, similar to below and save the file ( According to your path, please use the values).
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin




After editing the profile run it for checking errors.
[oracle@redhat1 ~]$ . ~/.bash_profile
If there is any syntax error in the profile it will be reported.If there is no error then we will get the prompt silently.
This completes setting up of Oracle User Environment.
Similarly repeat the above for node2 (redhat2) also.


Listener Entries:
Edit the file "tnsnames.ora" on both the nodes and add the entries for both the nodes (redhat1,redhat2) database (mydb , mydbstb).

Similarly edit the file "Listener.ora" on both the nodes (redhat1,redhat2) and add the entries for databases.
In "redhat1" make entry for "mydb"
In "redhat2" make entry for "mydbstb"
Check "tnsping" response from both the nodes (redhat1,redhat2):
From the first node ( redhat1 ) perform the following:
[oracle@redhat1 ~]$ tnsping mydb
[oracle@redhat1 ~]$ tnsping mydbstb


Configure the Primary Database:
Do the below activities only on the first node ( redhat1 ):
Enable Archivelogging Mode:
To check whether the database is in "archivelog mode", connect to the database and fire the command:
SQL> archive log list ;
If the output shows "Database Log mode - No Archive Mode", then we have to enable archive logging.

For enabling archive logging, We have to open the database in mount state.

If suppose we had shutdown the database, then start the database in mount mode, for doing so type the below commands:
SQL> startup mount
SQL> ALTER DATABASE ARCHIVELOG;
SQL> ALTER DATABASE OPEN;


Enable Force Logging:
SQL> alter database force logging ;

Setup Standby Redo Log Groups:
Create standby redo logfile groups ( The number of standby redo logfile groups should be atleast one more than the number of online redo logfile groups ).
This is to be done only at the primary site (redhat1).
Here, we have 3 online redo logfile groups, so we will create 4 standby redo logfile groups. For creating standby redo logfiles, fire the below mentioned commands:
SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 10 '/u01/app/oracle/oradata/mydb/srl01.log' SIZE 50M REUSE;
SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 11 '/u01/app/oracle/oradata/mydb/srl02.log' SIZE 50M REUSE;
SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 12 '/u01/app/oracle/oradata/mydb/srl03.log' SIZE 50M REUSE;
SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 13 '/u01/app/oracle/oradata/mydb/srl04.log' SIZE 50M REUSE;
N.B: Size of standby redofiles should be atleast equal to the size of the online redo logfiles.


Modify Primary Initialization Parameters:
The below mentioned steps to be performed on the Primary Site (redhat1).
We have to set the below mentioned parameters for configuring dataguard:
—log_archive_dest_1
—log_archive_dest_state_1
—log_archive_dest_2
—log_archive_dest_state_2
—standby_file_management
—log_archive_config
—fal_server
—fal_client
For setting these parameters, fire the below mentioned commands:
SQL> ALTER SYSTEM SET log_archive_dest_1 = 'LOCATION=/u01/app/oracle/flash_recovery_area/MYDB/ DB_UNIQUE_NAME=mydb VALID_FOR=(ALL_LOGFILES,ALL_ROLES)' ;
SQL> ALTER SYSTEM SET log_archive_dest_state_1 = 'ENABLE';
SQL> ALTER SYSTEM SET log_archive_dest_2 = 'SERVICE=mydbstb DB_UNIQUE_NAME=mydbstb VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE)' ;
SQL> ALTER SYSTEM SET log_archive_dest_state_2 = 'DEFER';
SQL> ALTER SYSTEM SET standby_file_management = 'AUTO' ;
SQL> ALTER SYSTEM SET log_archive_config = 'DG_CONFIG=(mydb,mydbstb)';
SQL> ALTER SYSTEM SET fal_client = 'mydb' ;
SQL> ALTER SYSTEM SET fal_server = 'mydbstb' ;


Note: We have initially put "log_archive_dest_state_2" to "DEFER" until the standby database has been created, mounted, and placed in managed recovery mode.


Create a Backup of the Primary Database:
Connect to RMAN Prompt and fire the below mentioned commands for taking backup of database.
RMAN> backup device type disk format '/u01/rman_bck/mydb_bck_%S_%U.dmp' database plus archivelog ;

Similarly backup the current controlfile for standby database.
RMAN> backup device type disk format '/u01/rman_bck/ctrl_file_bck_%U.dmp' current controlfile for standby ;

 
create an Initialization Parameter for Standby Database:
Create an initialiazation parameter file of the primary database.
SQL> create pfile='init_pfile_dest\pfile_for_stb.ora' from spfile ;


Transfer the required files to the standby Node:
Transfer "rman backups" taken and the "initialiaztion parameter file" created to the standby node.
Note: The directory structure of rman backup on both the nodes (node1 and node2) is same.

 Preparing the Standby Site:
Do these activities on second node ( redhat2 ).
Create Required Directories:
(1) Create "oradata" directory and its sub-directory "oradata/stdby".
(2) Create "flash_recovery_area" directory and its sub-directory "flash_recovery_area/STDBY".
(3) Create audit files directory ( adump,dpdump etc diretories ).


Set Up Password File:
Create a Password File for the standby database. For creating password file , please run the following command:
[oracle@redhat2 ~]$ orapwd file='/u01/app/oracle/product/10.2.0/db_1/dbs/orapwmydbstb' password=sys



Create Standby Initialization Parameter File:
For creating Initialization parameter file( Or we can edit the pfile of primary database and edit it for standby database) , please use any of the editors.
[oracle@dg2 ~]$ vim initsby.ora
Add the lines similar to the following:
db_name='mydbstb'
db_unique_name='mydbstb'

compatible='10.2.0.1.0'

audit_file_dest='/u01/app/oracle/admin/mydbstb/adump'
background_dump_dest='/u01/app/oracle/admin/mydbstb/bdump'
user_dump_dest='/u01/app/oracle/admin/mydbstb/udump'
core_dump_dest='/u01/app/oracle/admin/mydbstb/cdump'

control_files='/u01/app/oracle/oradata/mydbstb/control01.ctl' , '/u01/app/oracle/oradata/mydbstb/control02.ctl' , '/u01/app/oracle/oradata/mydbstb/control03.ctl'

log_archive_config='dg_config=(mydb,mydbstb)'
log_archive_dest_1 = 'LOCATION=/u01/app/oracle/flash_recovery_area/MYDB/ DB_UNIQUE_NAME=mydbstb VALID_FOR=(ALL_LOGFILES,ALL_ROLES)'
log_archive_dest_2 = 'SERVICE=mydb DB_UNIQUE_NAME=mydb VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE)'
log_archive_dest_state_1='enable'
log_archive_dest_state_2='enable'

db_file_name_convert='/u01/app/oracle/oradata/mydb/','/u01/app/oracle/oradata/mydbstb/'
log_file_name_convert='/u01/app/oracle/oradata/mydb/','/u01/app/oracle/oradata/mydbstb/'

fal_server='mydb'
fal_client='mydbstb'
standby_file_management='auto'


Create spfile for Standby Node:
Now connect to the standby database and create spfile for the standby database, using this newly created pfile.
For doing so, please follow the steps mentioned below:
[oracle@redhat2 ~]$ export ORACLE_SID=mydbstb
[oracle@redhat2 ~]$ sqlplus / as sysdba
SQL> create spfile from pfile='pfile_location/initsby.ora' ;

Start the database in nomount mode:
SQL> startup nomount


 Cloning the Standby Database:
Do this from the Standby Site ( redhat2 ).
From the standby host , duplicate the primary database as a standby using RMAN. As mentioned below:
[oracle@redhat2 ~]$ rman target sys/sys@mydb auxiliary sys/sys@mydbstb
In the rman prompt type the following::
RMAN> duplicate target database for standby ;


Place the Standby Database on Recovery Mode:
To place the standby database on recovery mode. Do the following:
SQL> alter database recover managed standby database using current logfile disconnect;


Enable Remote Archiving on Node1:
SQL> alter system set log_archive_dest_state_2='ENABLE' scope=both;


This finishes physical standby database creation.

Tuesday 6 December 2011

Oracle Database 10g R2 installation on RHEL5 x86

Overview:
This article is a comprehensive guide for the installation of Oracle Database 10g Release 2 (10.2.0.1.0) 32-bit on Redhat Enterprise Linux 5 (RHEL5) 32-bit Operating System Environment.
The official documentation for installation of Oracle Database 10g R2 32bit on Linux can be downloaded from the below mentioned link:
http://docs.oracle.com/cd/B19306_01/install.102/b15660/toc.htm 




Objective of the Article:
By the time we finish this article, we should be able to understand the following:
(1)Installation of oracle database (10.2.0.1.0) x86 on Redhat Enterprise Linux 5 (RHEL5) x86.
(3)Creation & configuration of general-purpose Oracle 10g (10.2.0.1.0) database that makes use of the local file system for physical database file storage (control files, data files, flash recovery area, online redo log files).




Installation of Redhat Enterprise Linux-5 x86:
Install Redhat Enterprise Linux 5 x86 on your machine.
For More information about RHEL5 installation visit the below site::




Download Oracle Database Software:
We first have to download the required Oracle Database software packages from the Oracle Technology Network (OTN) or Oracle Edelivery Site and then extract the Oracle Database Software packages.
Download the Oracle Database 10g Release 2 (10.2.0.1.0) Software for Linux x86 Operating System Environment.
Link for downloading oracle Database Software Package::
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html




Hardware Requirements Check:
Note:Login to the system as a root user for performing the below activities.
Memory Requirements:
Minimum:1 GB of RAM
To determine the RAM size, enter the following command:
[root@redhat1 ~]# grep MemTotal /proc/meminfo
Note:If the size of the RAM is less than the required size, then you must install more memory before continuing.
Available RAM SWAP Space Requirement
Between 1 GB and 2 GB 1.5 times the size of the RAM
Between 2 GB and 8 GB Equal to the size of the RAM
More than 8 GB 0.75 times the size of RAM
To determine the size of the configured swap space, enter the following command:
[root@redhat1 ~]# grep SwapTotal /proc/meminfo
Note:If there is a need of increasing swap space, see O/S documentation for increasing the swap space.


Disk Space Requirements:
At least 400 MB of free disk space should be available in the /tmp directory.
To determine the amount of disk space available in the /tmp directory, enter the following command:
[root@redhat1 ~]# df -h /tmp
If there is less than 400 MB of free disk space available in the /tmp directory, then do one of the below mentioned steps:
Ξ Delete unnecessary files from the tmp directory.
Ξ Increase the size of tmp directory as follows (Extend the file system that contains the /tmp directory):
[root@redhat1 ~]# vim /etc/fstab
Go to the row containig tmpfs and replace "defaults" with "rw,size=1200m". (or the size you want).


N.B:After doing this we have to reboot the machine so that resized tmp value takes effect.
The above discussed method is for RHEL, for increasing tmpfs of other flavour of Linux O/S please visit the vendor's website.
Disk space requirements for software files, and data files for each installation type on Linux x86:
Installation Type Minimum Requirement for Software Files (GB)
Enterprise Edition 1.5
Standard Edition 1.5
Installation Type Minimum Requirement for Data Files (GB)
Enterprise Edition 1.7
Standard Edition 1.5
To determine the amount of free disk space on the system, enter the following command:
[root@redhat1 ~]# df -h
If your diskspace is not enough, please contact administrator for increasing the disk space.




 For all the screenshots , please visit the link::: http://www.sensehaze.com 



Package Requirements Check:
After the installation of RHEL5 x86, the next task is to install all packages required by Oracle Database 10g R2 x86. During the installation process the Oracle Universal Installer performs prerequisites checks before the actual installation of database. For ensuring that these prerequisite checks complete successfully, ensure that all the packages listed below are installed properly.The following are the list of packages required for Oracle Database 10g Release 2 (10.2) x86 on RHEL-5 x86:
  • binutils-2.17.50.0.6
  • compat-db-4.2.52
  • compat-libstdc++-33-3.2.3
  • compat-gcc-34-3.4.6
  • compat-gcc-34-c++-3.4.6
  • gcc-4.1.2
  • gcc-c++-4.1.2
  • glibc-2.5-24
  • glibc-common-2.5
  • glibc-devel-2.5
  • glibc-headers-2.5
  • libstdc++-4.1.2
  • libstdc++-devel-4.1.2
  • libaio-0.3.106
  • libaio-devel-0.3.106
  • libXp-1.0.0-
  • make-3.81
  • openmotif-2.3.0
  • setarch-2.0
  • sysstat-7.0.2
The packages listed above can be found on the installer disc/image of Redhat Enterprise Linux 5 x86 or can be downloaded from the vendor's website.
To determine whether the required packages are installed, enter commands similar to the following:
[root@redhat1 ~]# rpm -q package_name
e.g:  [root@redhat1 ~]# rpm –q compat-db-4.2.52-5.1.i386.rpm 


if the package is not installed then install the package as mentioned below:
[root@redhat1 ~]# rpm -ivh package_name 


N.B: To use ODBC, you must also install the additional ODBC RPMs.
The odbc packages can be downloaded from http://www.unixodbc.org




 Creation of Required O/S Users and Groups:

The following local operating system user and groups are required for oracle database installation:
  • Oracle Inventory Group -- oinstall
  • OSBDA Group -- dba
  • Oracle Software Owner User -- Oracle
Check whether the groups/user exists , if doesn't exist please create them. Follow the below mentioned steps...
  1. To determine whether "oinstall" group exists, type the following command:
    [root@redhat1 ~]# more /etc/oraInst.loc
    If the output shows oinstall group then the group exists and need not to be created.
    .
  2. To determine whether "dba" group exists, type the following command:
    [root@redhat1 ~]#grep dba /etc/group
    If the output shows dba group then the group exists and need not to be created.
    .
  3. To determine whether "oracle" user exists, type the following command:
    [root@redhat1 ~]#id oracle
    If the output shows oracle user then the user exists and need not to be created.
    The output should be similar to following, indicating "oinstall" as primary and "dba" as secondary group.
    uid=500(oracle) gid=500(oinstall) groups=501(dba).
    If the primary group is not "oinstall" and the user "oracle" is not the member of "dba" group then we have to modify the user "oracle" as mentioned below::
    [root@redhat1 ~]#usermod -g oinstall -G dba oracle
    .
  4. If the user or the required groups doesn't exist then create them as mentioned below:
    [root@redhat1 ~]# groupadd -g 501 oinstall
    [root@redhat1 ~]# groupadd -g 502 dba
    [root@redhat1 ~]# useradd -m -u 501 -g oinstall -G dba oracle
    Now check the status of "oracle" user.
    [root@redhat1 ~]# id oracle
    The output should be similar to following, indicating "oinstall" as primary and "dba" as secondary group.
    uid=500(oracle) gid=500(oinstall) groups=501(dba).
    Now set the password of "oracle" user.
    [root@redhat1 ~]# passwd oracle
    and input a password for "oracle" user.
  5. Verify that the User nobody Exists:
    Before installtion of oracle software, complete the following steps to verify that the user "nobody" exists on the system:
    To determine if the user exists, enter the following command:
    [root@redhat1 ~]# id nobody
    If this command displays information about the "nobody" user, then you do not have to create that user.
    If the user "nobody" does not exist, then enter the following command to create it:
    [root@redhat1 ~]# useradd nobody



Configuration of Kernel Parameters:
Verify that the kernel parameters shown in the following table are set to values greater than or equal to the minimum value shown.
Using any text editor, edit the /etc/sysctl.conf file, and add or edit lines similar to the following:
 fs.file-max  65536
 kernel.shmall  2097152
 kernel.shmmax  2147483648
 kernel.shmmni  4096
 kernel.sem  250 32000 100 128
 net.ipv4.ip_local_port_range  1024 65000
 net.core.rmem_default  262144
 net.core.rmem_max  262144
 net.core.wmem_default  262144
 net.core.wmem_max  262144


After adding the above lines to the /etc/sysctl.conf file, they persist each time the system reboots. If you would like to make these kernel parameter value changes to the current system without having to reboot, enter the following command:
[root@redhat1 ~]# sysctl -p


 For all the screenshots , please visit the link::: http://www.sensehaze.com 


If the output of the above command shows any error, please rectify the error before proceeding to next step.

To improve the performance on Linux systems, Oracle recommends us to increase the shell limits for the oracle software owner user "oracle".
Update the resource limits in the /etc/security/limits.conf configuration file for the installation owner (Here "oracle" user is the owner).
----------------------------
oracle  soft  nproc  2047
oracle  hard  nproc  16384
oracle  soft  nofile  1024
oracle  hard  nofile  65536
----------------------------
[root@redhat1 ~]# vim /etc/security/limits.conf


Edit the /etc/pam.d/login file and add following lines:
session required /lib/security/pam_limits.so
session required pam_limits.so


"Disable secure linux" and "Firewall" also.


Creation of Required Directories:
The next step is to create directory that will be used to store the "Oracle Database software", "Oracle Database Datafiles" and "Flash Recovery Data".
After the directory is created, we must then specify the correct owner, group, and permissions for it.
For example:
[root@redhat1 ~]# mkdir -p /u01/app/oracle
[root@redhat1 ~]# chown -R oracle:oinstall /u01/app/oracle
[root@redhat1 ~]# chmod -R 775 /u01/app/oracle


 Mount Oracle Database Disc:
If the installer is in zip format then unzip it .If it is on a disc then mount the disc and copy the contents as follows:
N.B: I have created "oracle_soft" named directory for storing "oracle database installation files".
[root@redhat1 ~]# mkdir -p /oracle_soft
[root@redhat1 ~]# chown -R oracle:oinstall /oracle_soft/
[root@redhat1 ~]# chmod -R 775 /oracle_soft/

 Copy the installation files to the above created directory.




Configuring the oracle User’s Environment:
Set the default file mode creation mask (umask) to 022 for "oracle" user. For setting so, do the following:
[root@redhat1 ~]# su - oracle
[oracle@redhat1 ~]$ vim ~/.bash_profile
Add a line as written below and save the file.
umask 022
N.B:Before starting the Oracle Universal Installer, we should first verify that the server from where we are doing the installation, have X server installed on it. For verification we can type "xclok" in the terminal, it will show a clock if X server is available.
Before starting the installation we have to run the xhost + command as root from the console to allow X Server connections.

 [root@redhat1 ~]# xhost +


If we are performing installation from a remote machine then we have to give complete IP address of the remote machine, as shown below:
[oracle@redhat1 ~]$ export DISPLAY=IP_REMOTE_MACHINE:0.0 


Installation of Oracle Database:
For RHEL 5:Modify "database/install/oraparam.ini" file and add "redhat-5" to "Certified Versions" section.


After the above activity, start Oracle Universal Installer (OUI) and install Oracle Database as follows:
[root@redhat1 ~]# su - oracle
Go to the directory where our installation software is copied and type "./runInstaller" , then your installation will begin:
[oracle@redhat1 ~]$cd /oracle_soft/
[oracle@redhat1 ~]$ ./runInstaller

For all the screenshots , please visit the link::: http://www.sensehaze.com  



Set Oracle User Profile:
Open the profile file and add the below mentioned lines:

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
[oracle@redhat1 ~]$ vim ~/.bash_profile
Or use any editor of your choice, to edit the profile of "Oracle" user.


After editing the profile run it for checking errors.
[oracle@redhat1 ~]$ . ~/.bash_profile
If there is any syntax error in the profile it will be reported.If there is no error then we will get the prompt silently.
This completes setting up of Oracle User Environment.




Listener Creation:
Open command prompt(terminal) & type “netca”




Database Creation:
Open command prompt and type "dbca"




Connect to the Database:
Open command prompt(terminal).
[oracle@redhat1 ~]$ export ORACLE_SID=mydb
[oracle@redhat1 ~]$ sqlplus / as sysdba
And you will be connected to the database.


For all the screenshots , please visit the link::: http://www.sensehaze.com