Popular

Latest

Installing Oracle Database 11g R2 on Linux with ASM

In this guide we are going to cover Oracle Database 11g R2 installation on Linux with ASM.

Automatic Storage Management (ASM) is a feature that has be introduced in Oracle 10g to simplify the storage of Oracle datafiles, controlfiles, logfiles and backups.

ASM will be used as the file system and volume manager for Oracle Database files (data, online redo logs, control files, archived redo logs), and the Fast Recovery Area.

 

NOTE: ASMLib in the Unbreakable Enterprise Kernel.

ASMLib - Linux specific ASM library and its associated driver.

The Oracle ASMLib kernel driver is now included in the Unbreakable Enterprise Kernel. No driver package needs to be installed when using this kernel.

The oracleasm-support and oracleasmlib packages still need to be installed.

The oracleasm-support  can be installed from Oracle Linux ISO image. For other Linux flavors could be found here – (Download section for particular Linux distribution)

The oracleasmlib can be downloaded from ULN (Unbreakable Linux Network), subscription is required. Non-subscribers are free to use the similar package built for RHEL on their Enterprise Linux machines, which we will use in this tutorial.

 

What we are going to show:

1. Installing Oracle Enterprise Linux and creating virtual hard disks in VMware for ASM disks

2. Creating recommended OS groups and user for Grid Infrastructure

3. Creating login scripts for grid and oracle users

4. Installing Oracle ASM packages

5. Creating ASM disk volumes

6. Downloading and installing Oracle Grid Infrastructure software

7. Creating ASM disk groups

8. Installing Oracle database software and create database instance 

 

1. Installing Oracle Enterprise Linux and creating virtual hard disks in VMware for ASM disks

Installation of the Oracle Linux in VMware environment has been described in the following article: Installing Oracle Linux in VMware virtual machine

Once we have Oracle Linux up and running we have to shut it down and create virtual hard disks which will be used for ASM disk groups.

Normally it would be a kind of SAN storage for example, attached to the Linux OS, sometimes several disks visible as multipath devices or raw devices.

However in the end it’s always a set of available disks mounted and accessible for Linux OS like a normal physical disk drives.


We are going to create three virtual hard disks with the following names:

1. CRSDISK1 (100 MB) – for CRSVOL1 disk where Cluster Ready Services (CRS) files will be stored. CRS provides many system management services and interacts with the vendor clusterware to coordinate cluster membership information.

2. DATADISK1 (10 GB) – disk for DATAVOL1 disk. Here database will keep all datafiles, control files, log files …

3. FRADISK1 (10 GB) disk for FRAVOL1 disk for database Fast Recovery Area (FRA) files. For example: database backup files, copy of database control files.

Open virtual machine properties window and use wizard to create new virtual hard disks:


 

Once virtual hard disks have been created power on virtual machine and let the Oracle Linux start.

Last Updated (Tuesday, 15 May 2012 18:26)

Read more...

 

Oracle user account on Linux good practice

Main user for most of the oracle products, especially for Oracle Database installations is an oracle user account. Oracle-validated package does create such account automatically with proper group membership configuration and "random" unknown password. 

In Linux world (following good practice rules) we all have our own, personal and dedicated user accounts which belongs to the particular system groups. For example, employees performing DBA role within an organization would have an account which belongs to "dba", "wheel" and other custom groups. Most of the organizations are dealing with massive OS and database installations which also have "oracle" accounts configured, but always the password of the oracle account should stay unknown to all users. 

But how to switch to oracle user when we don't know the password? Simply – using power of sudo, su in combination with sudoers. 
But first particular account needs to be configured to have sufficient privileges to switch to oracle and other users either with or without providing their own (not root or oracle accounts' passwords) passwords when switching.

Imagine we are a dba within an organization and we have a new account "fred" created in Linux OS.

 
[root@test-host ~]# useradd -m -n fred
[root@test-host ~]# passwd fred
Changing password for user fred.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@test-host ~]# id fred
uid=54322(fred) gid=100(users) groups=100(users)
[root@test-host ~]#
 

As we can see user fred belongs to group "users" by default.

Let's make that user also belong to "dba" group:

 
[root@test-host ~]# usermod -g users -G dba fred 
[root@test-host ~]# id fred
uid=54322(fred) gid=100(users) groups=100(users),54322(dba)
[root@test-host ~]#
 


Now user fred belongs to the following groups: users, dba
Let's try to switch to oracle account using sudo:

Last Updated (Wednesday, 02 May 2012 13:44)

Read more...

 

Installing Oracle Database 11g R2 on Linux

In article Installing Oracle Linux in VMware virtual machine we covered installation of Oracle Linux 5U8 including oracle-validated package.

Now, our system is ready for Oracle database installation, and no additional configuration tasks is required at this moment.

Note: Most of the time we work with OS from remote locations and target servers are located in data centers or somewhere else.

In this tutorial we assume that our server is located in a remote location and we use remote access tools in order to connect to the Linux terminal, transfer installation packages, and run Oracle Universal Installer on our local (client) machine.

 

What we are going to show:

1. Downloading Oracle database 11g installation packages from Oracle websites

2. Installing local X-Server Xming to be able to display GUI applets from a remote server on our local desktop, like we were sitting in front of the server.

3. Connecting to Linux server using WinSCP and transferring installation packages.

4. Connecting to Linux server via SSH protocol using PuTTY  and reset password for oracle user (WinSCP and PuTTY how-to can be found here: Enter The Linux ).

5. Configure PyTTY session with port forwarding enabled to be able to display GUI windows via Xming server

6. Unpacking and running Oracle Universal Installer to install Oracle database software

7. Creating new Oracle database instance with Enterprise Manager Database Control

8. Testing our installation connecting to running database instance using the following tools:

    • SqlPlus (general command line tool)
    • Oracle SQLDeveloper – GUI Oracle database client
    • Enterprise Manager Database Control 11g – web based powerful administration and monitoring tool

Let’s get started…

1. Download Oracle Database software installation package from Oracle Technology Network

We are going to download Linux 64bit version Oracle Database 11g Release 2 (11.2.0.1.0) for Linux x86-64 

  • linux.x64_11gR2_database_1of2.zip
  • linux.x64_11gR2_database_2of2.zip

2. Installing and running Xming X Server on Windows host


Xming will start minimized in system tray next to the system clock.

 

Last Updated (Tuesday, 15 May 2012 18:07)

Read more...

 

Installing Oracle Linux in VMware virtual machine

What is Oracle Linux?

Oracle Linux is an open source operating system available under the GNU General Public License (GPL) and is
available for free download .

Oracle Linux includes two kernels:

  • Unbreakable Enterprise Kernel, tracks mainline Linux kernel closely, and offers the latest features and
    tested performance and stability
  • The Red Hat Compatible Kernel, compiled directly from Red Hat Enterprise Linux source

In this tutorial we are going to install Oracle Linux 5 Update 8 (64 bit) prepared to install Orcale Database 11g on it.

What we are going to cover:

1. New virtual image creation

2. Linux Installation using Linux ISO Image downloaded from Oracle eDelivery website
 

 

Last Updated (Friday, 27 April 2012 21:14)

Read more...

 

A bit of fun with cut, paste, join and sort in Linux

1. cut - Removes sections from each line of files.

Prints selected parts of lines from each file to standard output.
Default separator is a "Tab" sign.

Imagine we've got a file file_numbers.txt, which consist of three columns:

col_1 col_2 col_3
 
one two three
 
four five six
 
seven eight nine
 
ten eleven twelve
 


In the following example cut will return only column (col_2):

cut -f2 file_numbers.txt
 
col_2
two
five
eight
eleven
 


in the next example cut will return columns 2 and 3:

cut -f1,3 file_numbers.txt
 
col_1 col_3
one three
four six
seven nine
ten twelve
 


There os few more options described in man pages. Let's take a look at two of them:

- c --characters=LIST select only these characters

- d --delimiter=DELIM use DELIM instead of TAB for field delimiter

In below example we will use "space" mark as a separator (-d " ")

NOTE: an input delimiter may be specified only when operating on fields

Last Updated (Thursday, 12 April 2012 10:09)

Read more...

 

How To Setup SSH equivalence , password-less SSH authentication

How To Setup SSH equivalency, password-less SSH between multiple hosts.


Imagine you have to administer more than one Linux hosts in your network, or clustered environment.
You would like to connect to each host in your environment in a secured way,
but without providing the password each time.

Here's is a quick guide how to configure your hosts for password less authentications.

  • We have host-1 and host-2 - two Linux hosts.
  • User "Trinity" exists on both hosts
  • We want to setup password-less authentication from host-1 to host-2 and the other way around
  • We are going to introduce two ways of achieving that (there is more ofcourse :)
Approach number one:


[
Trinity@host-1 ~]$ ssh-keygen -t dsa
Generating public/private dsa key pair. Enter file in which to save the key (/home/Trinity/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/Trinity/.ssh/id_dsa. Your public key has been saved in /home/Trinity/.ssh/id_dsa.pub. The key fingerprint is: 3f:8e:3d:1b:47:8d:49:dc:89:68:du:22:2e:e1:f8:4b Trinity@host-1.local   [Trinity@host-1 ~]$ cat ~/.ssh/id_dsa.pub | ssh Trinity@host-2 'cat - >> ~/.ssh/authorized_keys' Trinity@host-2's password:  

#Now let's connect to host-2, and this time password would not be required:
  [Trinity@host-1 ~]$ ssh host-2 Last login: Thu Dec 32 25:61:66 2037 from 11.69.33.255   Hello! Follow the white rabbit... My Lab_067 *** Linux Rulezz *** host host-2.local * Linux
[Trinity@host-2 ~]$ hostname host-2.local
 

Approach number two:

by using /usr/bin/ssh-copy-id script (available in most of the Linux flavours)

# Shell script to install your identity.pub on a remote machine
# Takes the remote machine name as an argument.
# Obviously, the remote machine must accept password authentication,
# or one of the other keys in your ssh-agent, for this to work.

 
[Trinity@host-1 ~]$ ssh-copy-id -i ~/.ssh/id_dsa.pub Trinity@host-2
30
Trinity@host-2's password:  
Now try logging into the machine, with "ssh 'Trinity@host-2'", and check in:  

.ssh/authorized_keys
 

to make sure we haven't added extra keys that you weren't expecting.

[Trinity@host-1 ~]$ ssh host-2

Last login: Thu Dec 33 26:16:69 2037 from 11.69.33.255
Hello! Follow the white rabbit...
My Lab_067 *** Linux Rulezz ***
host host-2.local * Linux

[Trinity@host-2 ~]$ hostname

host-2.local


To do it in other way around repeat steps from one of the above approach from host-2 towards host-1 and you are set.

That's it :)

Cheers!!


 

Last Updated (Thursday, 01 December 2011 15:22)

 

Installing Oracle RAC 11gR2 on Linux 64bit

Yet another way of installing Oracle RAC 11gR2

This tutorial shows how to install Oracle RAC 11gR2 on Linux 64bit with NAS connected via Native Multipathing (Device Mapper-Multipath).

1. Introduction

Oracle Real Application Clusters (Oracle RAC) enables an Oracle database to run across a cluster of servers, providing fault tolerance, performance, and scalability with no application changes necessary. Oracle RAC provides high availability for applications by removing the single point of failure with a single server.

This guide describes how to install, configure, and manage Oracle RAC, Oracle Clusterware, and Oracle Automatic Storage Management (Oracle ASM). It provides examples for how you could deploy Oracle RAC on a two-node cluster, using the Oracle Linux operating system. This installation guide assumes several points, see below.

Click to enlarge

 

Last Updated (Monday, 14 May 2012 12:45)

Read more...

 

Moving SPFILE from file system to ASM (ORACLE RAC11g)

  • There are two nodes in oracle RAC database [rac1] and [rac2]
  • Below tasks has to be executed from the first node [rac1]

1. Create spfile in ASM "+RACDB_DATA" disk group

Last Updated (Tuesday, 09 August 2011 11:08)

Read more...

 

How to multiply control files in Oracle DB RAC 11g

This examle shows how to multiply control files in Oracle Database RAC 11g.
An example cluster database racdb1 is up and running on two nodes (rac1 and rac2)
Two database instances: [racdb11] and [racdb12]

1. SHUTDOWN the database and start an instance [racdb11] only on the first node (rac1)
    and check the current configuration. Next, shutdwon an instance and start it up into "nomount" mode

Last Updated (Tuesday, 09 August 2011 10:28)

Read more...

 

Oracle DBA Interview Questions Answered: Technical

60 Oracle Database Administration (DBA) Interview Questions (Technical)
 
1. What is an Oracle Instance?

An Oracle database server consists of an Oracle database and an Oracle instance. Every time a database is started, a system global area (SGA) is allocated and Oracle background processes are started. The combination of the background processes and memory buffers is called an Oracle instance. We can run multiple instances on the same Oracle Database Server, where each instance connects to its database.
Oracle instance includes:
SGA - System or Shared Global Area
Components of SGA:
  • DBBC - Database Buffer Cache
  • SP - Shared Pool; divided into Library Cache (LC) and Data Dictionary Cache (DDC) or Row Cache.
  • RLB - Redo log Buffer
Background Process (10/11g database):
Mandatory Processes
  • SMON - System Monitor
  • PMON - Process Monitor
  • DBWR - Database writer
  • LGWR - Log Writer
  • CKPT - Check point
  • RECO - Recoverer
  • DIAG - Diagnosability (new in 11g)
  • VKTM - Virtual keeper of time (keeps "SGA Time" variable in current, new in 11g)
Optional Process
  • ARCN - Archiver
  • MMAN - Memory Manager - ASMM
  • MMON - Memory Monitor
  • MMNL - Memory Monitor Light - AWR
and few more...

Last Updated (Tuesday, 09 August 2011 10:31)

Read more...

 

Copy SQL Profiles to another Oracle database

Copying SQL Profiles from one database to another involves the following simple steps:
  1. Creating a staging table to store the SQL Profiles
  2. Packing the SQL Profiles to the staging table
  3. Export the table using Datapump or Export/Import
  4. Importing the SQL Profiles to the target database
  5. Unpack the SQL Profiles in the target database

Last Updated (Tuesday, 09 August 2011 11:04)

Read more...

 
More Articles...
Banner