10g ASM IMPLEMENTATION USING LOOPBACK DEVICES - OEL-5.5.pdf

July 20, 2017 | Author: G.R.THIYAGU ; Oracle DBA | Category: Oracle Database, Linux, Operating System Technology, Areas Of Computer Science, System Software
Share Embed Donate


Short Description

Download 10g ASM IMPLEMENTATION USING LOOPBACK DEVICES - OEL-5.5.pdf...

Description

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

ASM IMPLEMENTATION WITH LOOPBACK DEVICES This Tutorial was done on Oracle Linux (OEL-5.5) installed on VMWare for learning purpose. As we know ASM Works on Diskgroup concept which is collection of ASM Disks. ASM Disks are created out of Disk Devices; it could either be LUN's or direct Storage Devices. ASM can be setup using the ASM Library Driver or RAW Devices. One more option to implement ASM using FAKE RAW DEVICES, but this is NOT recommend Setup for a Production environment.

LOOPBACK DEVICE

A Loop Device is a virtual device (pseudo) which enables a regular file to be accessed as a block device. They would allow us to facilitate a software which needs virtual device as an input. This is possible as in UNIX/Linux Systems, it is possible to use a regular file as a block device.

To get light about loop back device from here.

SYSTEM CONFIGURATION

Operating System : Linux – Oracle Linux - 5.5 Kernel Version

: 2.6.18-194.el5

Architecture

: 32 bit - (i686)

Database Version : 10g R2 – 10.2.0.5.0

VIRTUAL FILE SYSTEM

 Create Zero-Filled flat files using dd command.  Attach a loop back device for each file. For the initial setup of the ASM Disks, execute these commands as OS user root-(#) Make a directory and create the flat files which would represent as disks. # mkdir –p /u03/asmdisk # dd if=/dev/zero of=/u03/asmdisk/disk1 bs=1024k count=1000 1000+0 records in 1000+0 records out 1048576000 bytes (1.0 GB) copied, 8.37345 seconds, 125 MB/s We have created a file with bs*count random bytes, in our case 1024*1000; each of 1GB size. The output will be as follows from the first command, and almost identical for the rest. I want to create 6 files (4 files for +DATA disk group and 2 files for +FRA disk group). # dd if=/dev/zero of=/u03/asmdisk/disk2 bs=1024k count=1000 # dd if=/dev/zero of=/u03/asmdisk/disk3 bs=1024k count=1000 .. ...

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

We now have six files to be used as virtual disks of 1G each.

# ls -l /asmdisk/* -rw-r--r-- 1 root root 1048576000 Feb 27 04:00 /asmdisk/disk1 -rw-r--r-- 1 root root 1048576000 Feb 27 05:30 /asmdisk/disk2 -rw-r--r-- 1 root root 1048576000 Feb 27 05:31 /asmdisk/disk3 -rw-r--r-- 1 root root 1048576000 Feb 27 05:45 /asmdisk/disk4 -rw-r--r-- 1 root root 1048576000 Feb 27 05:46 /asmdisk/disk5 -rw-r--r-- 1 root root 1048576000 Feb 27 05:48 /asmdisk/disk6

SETUP LOOPBACK DEVICES

Now we need to make the flat files available as Loopback Devices. # /sbin/losetup /dev/loop1 /u03/asmdisk/disk1 # /sbin/losetup /dev/loop2 /u03/asmdisk/disk2 # /sbin/losetup /dev/loop3 /u03/asmdisk/disk3 # /sbin/losetup /dev/loop4 /u03/asmdisk/disk4 # /sbin/losetup /dev/loop5 /u03/asmdisk/disk5 # /sbin/losetup /dev/loop6 /u03/asmdisk/disk6

The above command will create a loopback device against those files and will map the content of device to these flat files.

# losetup -a /dev/loop1: [0806]:1011842 (/asmdisk/disk1) /dev/loop2: [0806]:1142401 (/asmdisk/disk2) /dev/loop3: [0806]:1142402 (/asmdisk/disk3) /dev/loop4: [0806]:1142403 (/asmdisk/disk4) /dev/loop5: [0806]:1142404 (/asmdisk/disk5) /dev/loop6: [0806]:1142405 (/asmdisk/disk6)

Once the System is rebooted, assigned the Zero filled files to the loopback devices Setup will disappear. To make above configuration permanent after reboot, we need to add following entries to the file "/etc/rc.local" so that these devices are reinitialized on reboot. # vi /etc/rc.local /sbin/losetup /dev/loop1 /asmdisk/disk1 /sbin/losetup /dev/loop2 /asmdisk/disk2 /sbin/losetup /dev/loop3 /asmdisk/disk3 /sbin/losetup /dev/loop4 /asmdisk/disk4 /sbin/losetup /dev/loop5 /asmdisk/disk5 /sbin/losetup /dev/loop6 /asmdisk/disk6

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

POINTS TO NOTE

Normally, rc.local contains commands and daemons, we can use it to start a custom service. The rc.local file is executed by the init Process at the end of the System Boot Process. (Almost the last script at boot up). It can be edited by the administrator. OWNERSHIP & PERMISSIONS

# chown –R oracle:oinstall /u03/asmdisk/ # chmod –R 666 /u03/asmdisk/*

WHAT IS ASMLIB ?

Oracle has developed a storage management interface called the ASMLIB API. ASMLib is the support library for the ASM. Although ASMLib is NOT mandatory to run ASM. ASMLIB allows an Oracle database using ASM more efficient and capable access to disk groups. ASMLIB is an alternative interface for ASM to access block devices. ASM is capable of referencing disks as raw devices or by using the ASMLib software. DOWNLOAD ASMLIB RPMS

As I said above, for Linux Systems Oracle provides a custom device driver known as ASMLib, which is recommended for most ASM installations on Linux. Oracle ASMLib is available for Linux; as a kernel module is needed only the supported Linux distributions, the required RPM packages are downloadable. Yes, ASMLib is available for free download from OTN. Each Linux distribution has its own set of ASMLib packages. OEL 5 uses the Same RPMs as Red Hat Enterprise Linux 5 # cat /etc/issue Enterprise Linux Enterprise Linux Server release 5.5 (Carthage) # cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.5 (Tikanga)

There are Several ways to get ASMLIB, we can download it from the OTN here. Oracle ASMLib Downloads for Red Hat Enterprise Linux 5. For OEL, you can use the public YUM. You would need the internet access over the machine. NOTE: Easy way is to get it from Oracle’s public YUM repository. We can download it from ULN (Unbreakable Linux Network). If you are not subscribed to ULN and not using Unbreakable Linux then go to the OTN, where you have to select your Linux flavor and then navigate to the exact rpms according to the Linux kernel and then download the required files one by one.

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

DOWNLOAD THE ASM LIBRARIES THAT MATCHES OS KERNEL VERSION.

ASMLib 2.0 is delivered as a set of 3 RPM packages. There are 3 packages that one would normally install as part of ASM. oracleasm + oracleasm-support + oracleasmlib

 oracleasm (uname –r)

# Kernel Driver

 oracleaslib

# ASM Libraries

 oracleasm-support

# Support scripts for ASM driver up and running.

It is necessary to pick exact version that matches to our distribution based on kernel and architecture. Within each distribution, each kernel version has a corresponding oracleasm package. First we need to determine which kernel we are using. # uname -rm 2.6.18-194.el5 i686

The example shows that this is a 2.6.18 kernel, patch level 5, for Enterprise Linux 5 on 32-bit x86 compatible hardware (i686). So I am going to download the oracleasm package corresponding for my kernel version as per above output. Drivers for kernel 2.6.18-194.el5 oracleasm-2.6.18-194.el5-2.0.5-1.el5.i686.rpm

Next, download the oracleasmlib and oracleasm-support packages for OS version of Linux. All ASMLib installations require those packages appropriate for their machine. Those are grouped by architecture (AMD64/Intel em64t for x86_64, IA64 for Itanium, and IA32 for x86). At the top of each section is a Library and Tools heading, it is common for all. Download both of the files under this heading - these are the support utilities and ASM libraries. (oracleasm-support and oracleasmlib, respectively). Library and Tools oracleasm-support-2.1.3-1.el5.i386.rpm oracleasmlib-2.0.4-1.el5.i386.rpm

ASMLIB INSTALLATION

Once you download above packages using ftp upload above all in Linux Server. Install ASMLibs in following order to avoid package dependency errors and you need # (root) privilege to install all downloaded rpms.  oracleasm-support + oracleasm + oracleasmlib

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

The oracleasm-support package provides the utilities used to get the ASM driver up and running. The oracleasm kernel driver (for the kernel you use. The oracleasmlib package provides the actual ASM library; which provides the ASM discover utility, is not GPL and therefore a separate download and not included in the Linux OS release distribution.

# rpm -Uvih oracleasm-support-2.1.8-1.el5.i386.rpm warning: oracleasm-support-2.1.8-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing...

########################################### [100%]

1:oracleasm-support

########################################### [100%]

# rpm -Uvih oracleasm-2.6.18-194.el5-2.0.5-1.el5.i686.rpm warning: oracleasm-2.6.18-194.el5-2.0.5-1.el5.i686.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing...

########################################### [100%]

1:oracleasm-2.6.18-194.el########################################### [100%] # rpm -Uvih oracleasmlib-2.0.4-1.el5.i386.rpm warning: oracleasmlib-2.0.4-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing...

########################################### [100%]

1:oracleasmlib

########################################### [100%]

LISTING INSTALLED ORACLEASM RPMS

# rpm -qa | grep oracleasm* oracleasm-2.6.18-194.el5-2.0.5-1.el5 oracleasm-support-2.1.8-1.el5 oracleasmlib-2.0.4-1.el5

CONFIGURE THE ASM KERNEL MODULE.

You must be logged on as the # user to run the oracleasm script. The script calls a number of library functions which are declared in /usr/lib/oracleasm/oracleasm.init.functions. The /etc/init.d/oracleasm script has following options

# /etc/init.d/oracleasm Usage: /etc/init.d/oracleasm {start|stop|restart|enable|disable|configure|createdisk| deletedisk|querydisk|listdisks|scandisks|status} configure: Configure ASM. start: Start the ASM service.

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

stop: Stop the ASM service. status: Print the status of ASM service. createdisk: Create an ASM disk. scandisks: Search for ASM disks. l istdisks: List ASM disks. querydisk: Query the current status of an ASM disk. deletedisk: Delete an ASM disk. restart: Restart the ASM service. link: Load the oracleasm module. enable: Enable the ASM service. disable: Disable the ASM service. ASM is initially configured on each host using /etc/init.d/oraclesam # /etc/init.d/oracleasm configure -i Configuring the Oracle ASM library driver. This will configure the on-boot properties of the Oracle ASM library driver.

The following questions will determine whether the driver is

loaded on boot and what permissions it will have. will be shown in brackets ('[]').

The current values

Hitting without typing an

answer will keep that current value.

Ctrl-C will abort.

Default user to own the driver interface []: oracle Default group to own the driver interface []: oinstall Start Oracle ASM library driver on boot (y/n) [n]: y Scan for Oracle ASM disks on boot (y/n) [y]: y Writing Oracle ASM library driver configuration: done Initializing the Oracle ASMLib driver:

[

OK

]

Scanning the system for Oracle ASMLib disks:

[

OK

]

Installing ASMLib from here

CONFIGURE ASM DISKS - (LABELING DISKS)

To make our local loopback disk become ASM disk, execute following command as root # user /etc/init.d/oracleasm createdisk command:

# /etc/init.d/oracleasm createdisk ASMD1 /dev/loop1 Marking disk "ASMD1" as an ASM disk: [ OK ] # /etc/init.d/oracleasm createdisk ASMD2 /dev/loop2 Marking disk "ASMD2" as an ASM disk: [ OK ]

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

# /etc/init.d/oracleasm createdisk ASMD3 /dev/loop3 Marking disk "ASMD3" as an ASM disk: [ OK ] # /etc/init.d/oracleasm createdisk ASMD4 /dev/loop4 Marking disk "ASMD4" as an ASM disk: [ OK ] # /etc/init.d/oracleasm createdisk ASMD5 /dev/loop5 Marking disk "ASMD5" as an ASM disk: [ OK ] # /etc/init.d/oracleasm createdisk ASMD6 /dev/loop6 Marking disk "ASMD6" as an ASM disk: [ OK ]

LISTING & QUERYING LABLED DISKS

# /etc/init.d/oracleasm listdisks ASMD1 ASMD2 ASMD3 ASMD4 ASMD5 ASMD6 # /etc/init.d/oracleasm querydisk ASMD1 Disk "ASMD1" is a valid ASM disk # /etc/init.d/oracleasm querydisk ASMD2 Disk "ASMD2" is a valid ASM disk # /etc/init.d/oracleasm querydisk ASMD3 Disk "ASMD3" is a valid ASM disk # /etc/init.d/oracleasm querydisk ASMD4 Disk "ASMD4" is a valid ASM disk # /etc/init.d/oracleasm querydisk ASMD5 Disk "ASMD5" is a valid ASM disk # /etc/init.d/oracleasm querydisk ASMD6 Disk "ASMD6" is a valid ASM disk # /etc/init.d/oracleasm querydisk /dev/loop[1-5] Device "/dev/loop1" is marked an ASM disk with the label "ASMD1" Device "/dev/loop2" is marked an ASM disk with the label "ASMD2" Device "/dev/loop3" is marked an ASM disk with the label "ASMD3" Device "/dev/loop4" is marked an ASM disk with the label "ASMD4" Device "/dev/loop5" is marked an ASM disk with the label "ASMD5" Device "/dev/loop6" is marked an ASM disk with the label "ASMD6"

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

# /etc/init.d/oracleasm querydisk -p ASMD1 Disk "ASMD1" is a valid ASM disk /dev/loop1: LABEL="ASMD1" TYPE="oracleasm" # /etc/init.d/oracleasm querydisk -p ASMD4 Disk "ASMD4" is a valid ASM disk /dev/loop4: LABEL="ASMD4" TYPE="oracleasm"

CONFIGURING TO REINITILIZED THE LOOPBACK DEVICE ON A REBOOT

# vi /etc/rc.local /etc/init.d/oracleasm createdisk ASMD1 /dev/loop1 /etc/init.d/oracleasm createdisk ASMD2 /dev/loop2 /etc/init.d/oracleasm createdisk ASMD3 /dev/loop3 /etc/init.d/oracleasm createdisk ASMD4 /dev/loop4 /etc/init.d/oracleasm createdisk ASMD5 /dev/loop5 /etc/init.d/oracleasm createdisk ASMD6 /dev/loop6

ASM INSTALLATION BEST PRACTICES

When running more than one database instance on a single server, it’s recommended that you install ASM in its own Oracle home on that server. This is advisable even if you are running only one database instance but plan to add one or more database instances to the server. With separate Oracle homes, you can upgrade and patch ASM and databases independently, and you can deinstall database software without impacting the ASM instance. If an ASM instance does not already exist and you can select the OUI option to install and configure ASM only, OUI installs ASM in its own Oracle home. If you are running a single database instance on a server or node and have no plans to add one or more database instances to this server or node, ASM and the database can share a single Oracle home.

ASM ORACLE HOME



/u01/app/oracle/..../asm_1

DATABASE ORACLE HOME



/u01/app/oracle/..../db_1

DEPLOY ORACLE DATABASE WITH SEPARATE ASM_HOME & RDBMS_HOME

The following section provides the detailed steps on how to configure multiple Oracle Homes for ASM and Oracle instances [i.e. we will have Automatic Storage Management (ASM) instance running in one Oracle Home and Database instance running in another one].

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

ORACLE ASM HOME SETUP

Create a new directory path for $ASM_HOME Change ownership and permissions for ASM_HOME # mkdir –p /u01/app/oracle/product/10.2.0/asm_1 # chown –R oracle:oinstall /u01/app/oracle/ # chmod –R 755 /u01/app/oracle/product/10.2.0/asm_1 # xhost + access control disabled, clients can connect from any host # su oracle

CONFIGURE ENVIRONMENT FILES

$ cat ora10.env export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib export PATH=$ORACLE_HOME/bin:$PATH export ORACLE_SID=orcl $ cat asm.env export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/asm_1 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib export PATH=$ORACLE_HOME/bin:$PATH export ORACLE_SID=+ASM

Oracle Base and Oracle Homes for ASM Oracle Home and RDBMS Oracle Home

$ORACLE_BASE

 /u01/app/oracle

$ORACLE_HOME

 /u01/app/oracle/product/10.2.0/db_1

ASM ORACLE_HOME  /u01/app/oracle/product/10.2.0/asm_1

ASM_HOME INSTALLATION

Setup your environment variables to different location mainly ORACLE_HOME and ORACLE_SID $ export ORACLE_SID=+ASM $ export ORACLE_HOME=/u01/app/oracle/product/10.2.0/asm_1 Start Oracle Universal Installer (OUI) by running runIstaller from the staging area.

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

$ ./runInstaller Select Advanced Installation > Enterprise Edition

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Specify Home Details window in the Path field, verify that the complete Oracle Home path is /u01/app/oracle/product/10.2.0/asm_1

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Select Configuration option choose install database Software only

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Run the root.sh script as per the instruction to complete the installation.

# /u01/app/oracle/product/10.2.0/asm_1/root.sh Running Oracle10 root.sh script... The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME=

/u01/app/oracle/product/10.2.0/asm_1

.. ... [Trimmed] Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root.sh script. Now product-specific root actions will be performed.

START LISTENER

$ listener start listener_name $ listener start listener $ listenrt status listener

ASM INSTANCE SETUP FROM ASM_HOME

Invoke DBCA from the ASM Oracle Home (i.e. /u01/app/oracle/product/10.2.0/asm_1)

$ . ./asm.env $ export ORACLE_SID=+ASM $ export ORACLE_HOME=/u01/app/oracle/product/10.2.0/asm_1/ $ cd /u01/app/oracle/product/10.2.0/asm_1/ $ dbca

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

If the Oracle Cluster Synchronization Service (CSS) is not running, a warning message screen will be displayed. Follow the instruction and Click "OK” button. Once you’ve returned to the previous screen, Click the "Next" button.

EXECUTE LOCAL CONFIG SCRIPT AS # USER

Before creating and starting +ASM instance, CSS service must be up and running so in order to get our CSS service up and running just login as super user (root) run the localconfig utility from $ORACLE_HOME/bin or $ASM_HOME/bin to start CSS service.

# /u01/app/oracle/product/10.2.0/asm_1/bin/localconfig add Successfully accumulated necessary OCR keys. Creating OCR keys for user 'root', privgrp 'root'.. Operation successful. Configuration for local CSS has been initialized Adding to inittab Startup will be queued to init within 90 seconds. Checking the status of new Oracle init process... Expecting the CRS daemons to be up within 600 seconds. CSS is active on these nodes. oel-server CSS is active on all nodes. Oracle CSS service is installed and running under init(1M) Oracle CSS service is installed and running under init(1M) $ ps -ef | grep css root

19704

1

0 04:12 ?

00:00:00 /bin/su -l oracle -c sh -c 'cd

/u01/app/oracle/product/10.2.0/asm_1/log/oel-server/cssd; ulimit -c unlimited; exec /u01/app/oracle/product/10.2.0/asm_1/bin/ocssd ' oracle 19807 19704 0 04:13 ?

00:00:00 /u01/app/oracle/product/10.2.0/asm_1/bin/ocssd.bin

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Asking password for +ASM instance

Click ok on the confirmation screen

ASM Instance is created.

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Click Yes to close the screen

ASM INSTANCE BACKGROUND PROCESSES

$ ps -ef | grep asm root

19704

1

0 04:12 ?

00:00:00 /bin/su -l oracle -c sh -c 'cd

/u01/app/oracle/product/10.2.0/asm_1/log/oel-server/cssd;

ulimit -c unlimited; exec

/u01/app/oracle/product/10.2.0/asm_1/bin/ocssd ' oracle

19807 19704

0 04:13 ?

00:00:00

/u01/app/oracle/product/10.2.0/asm_1/bin/ocssd.bin oracle

20313

1

0 04:33 ?

00:00:00 asm_pmon_+ASM

oracle

20315

1

0 04:33 ?

00:00:00 asm_psp0_+ASM

oracle

20319

1

0 04:33 ?

00:00:00 asm_mman_+ASM

oracle

20321

1

0 04:33 ?

00:00:00 asm_dbw0_+ASM

oracle

20323

1

0 04:33 ?

00:00:00 asm_lgwr_+ASM

oracle

20325

1

0 04:33 ?

00:00:00 asm_ckpt_+ASM

oracle

20327

1

0 04:33 ?

00:00:00 asm_smon_+ASM

oracle

20329

1

0 04:33 ?

00:00:00 asm_rbal_+ASM

oracle

20331

1

0 04:33 ?

00:00:00 asm_gmon_+ASM

root

23421 18532

0 06:03 pts/3

00:00:00 grep asm

0 04:33 ?

00:00:00 asm_pmon_+ASM

0 06:17 pts/2

00:00:00 grep pmon

$ ps -ef | grep pmon oracle

20313

1

oracle

23771 11228

POINTS TO NOTE

ASMRBAL  ASM REBALANCER MASTER PROCESS It coordinates the rebalancing activity when a new disk is added or removed diskgroup. Now you can see +ASM Instance has been setup successfully and running from $ASM_HOME. For 10g versions of oracle ASM binaries are shipped with RDBMS binaries so that CSS is started and running from the $ORACLE_HOME by default. In our case its running from ASM_HOME. The CSS service must be running before the ASM Instance Starts. The CSS daemon is required to enable synchronization between ASM instance and RDBMS instance.

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

LET’S CREATE DATABASE

$ . ./ora10.env $ dbca

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Click on Edit Archive Mode parameters

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Change Archive Log Destinations to +FRA from +DATA

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

$ ps -ef | grep asm root

19704

1

0 04:12 ?

00:00:00 /bin/su -l oracle -c sh -c 'cd

/u01/app/oracle/product/10.2.0/asm_1/log/oel-server/cssd;

ulimit -c unlimited; exec

/u01/app/oracle/product/10.2.0/asm_1/bin/ocssd ' oracle

19807 19704

0 04:13 ?

00:00:01

/u01/app/oracle/product/10.2.0/asm_1/bin/ocssd.bin

oracle

20313

1

00:00:00 asm_pmon_+ASM oracle

20315

1

0 04:33 ?

00:00:00 asm_psp0_+ASM

oracle

20319

1

0 04:33 ?

00:00:00 asm_mman_+ASM

oracle

20321

1

0 04:33 ?

00:00:00 asm_dbw0_+ASM

oracle

20323

1

0 04:33 ?

00:00:00 asm_lgwr_+ASM

oracle

20325

1

0 04:33 ?

00:00:00 asm_ckpt_+ASM

oracle

20327

1

0 04:33 ?

00:00:00 asm_smon_+ASM

oracle

20329

1

0 04:33 ?

00:00:00 asm_rbal_+ASM

oracle

20331

1

0 04:33 ?

00:00:00 asm_gmon_+ASM

oracle

25870

1

0 07:38 ?

00:00:00 asm_o001_+ASM

oracle

25902

1

0 07:38 ?

00:00:00 ora_asmb_orcl

oracle

31430 21199

0 08:26 pts/1

00:00:00 grep asm

$ ps -ef | grep pmon oracle

20313

1

0 04:33 ?

00:00:00 asm_pmon_+ASM

oracle

25872

1

0 07:38 ?

00:00:00 ora_pmon_orcl

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

0 04:33 ?

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

CONNECTING ENTERPRISE MANAGER

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

CONNECTING RDBMS INSTANCE

$ . ./ora10.env ORACLE_SID = [orcl] ? orcl $ rlsqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 1 15:46:34 2016 Copyright (c) 1982, 2005, Oracle.

All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options SYS> select name from v$datafile; NAME -------------------------------------------------------------------------------+DATA/orcl/datafile/system.256.905325775 +DATA/orcl/datafile/undotbs1.258.905325785 +DATA/orcl/datafile/sysaux.257.905325779 +DATA/orcl/datafile/users.259.905325787 +DATA/orcl/datafile/example.265.905326495 SYS> select name from v$controlfile; NAME -------------------------------------------------------------------------------+DATA/orcl/controlfile/current.260.905326313 +FRA/orcl/controlfile/current.256.905326317 SYS> select member from v$logfile; MEMBER -------------------------------------------------------------------------------+DATA/orcl/onlinelog/group_3.263.905326425 +FRA/orcl/onlinelog/group_3.259.905326451 +DATA/orcl/onlinelog/group_2.262.905326375 +FRA/orcl/onlinelog/group_2.258.905326403 +DATA/orcl/onlinelog/group_1.261.905326323 +FRA/orcl/onlinelog/group_1.257.905326359 6 rows selected. SYS> show parameter db_recovery_file_dest; NAME

TYPE

VALUE

------------------------------------ ----------- -----------------------------db_recovery_file_dest

string

+FRA

db_recovery_file_dest_size

big integer 2G

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

CONNECTING ASM INSTANCE

$ . ./asm.env $ env | grep ORA | sort ORACLE_BASE=/u01/app/oracle ORACLE_HOME=/u01/app/oracle/product/10.2.0/asm_1 ORACLE_SID=+ASM $ sqlplus "/as sysdba" .. ... SYS> select status from v$instance; STATUS -----------STARTED SYS> show parameter instance_type; NAME

TYPE

VALUE

------------------------------------ ----------- -----------------------------instance_type

string

asm

SYS> select instance_name from v$instance; INSTANCE_NAME ---------------+ASM SYS> select group_number, name, type, state, total_mb, free_mb from v$asm_diskgroup; GROUP_NUMBER NAME

TYPE

STATE

TOTAL_MB

FREE_MB

------------ ------------ ------ ----------- ---------- ---------1 DATA

NORMAL MOUNTED

4000

1628

2 FRA

EXTERN MOUNTED

2000

981

SYS> select group_number, disk_number, path, name, failgroup, total_mb from v$asm_disk; GROUP_NUMBER DISK_NUMBER PATH

NAME

FAILGROUP

TOTAL_MB

------------ ----------- ---------------- ------------ ------------ ---------1

2 ORCL:ASMD1

DISK1

FG1

1000

1

3 ORCL:ASMD2

DISK2

FG1

1000

1

0 ORCL:ASMD3

DISK3

FG2

1000

1

1 ORCL:ASMD4

DISK4

FG2

1000

2

0 ORCL:ASMD5

DISK5

DISK5

1000

2

1 ORCL:ASMD6

DISK6

DISK6

1000

6 rows selected.

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

SYS> select group_number, name, allocation_unit_size au_sz, state, type, total_mb, free_mb, offline_disks from v$asm_diskgroup; GROUP_NUM

NAME

AU_SZ

STATE

TYPE

TOTAL_MB

FREE_MB

OFFLINE_DISKS

---------- ------ --------- ---------- -------- --------- -------- ---------------1

DATA

1048576

MOUNTED

NORMAL

4000

1628

0

2

FRA

1048576

MOUNTED

EXTERN

2000

981

0

SYS> show parameter pfile; NAME

TYPE

VALUE

------------------------------------ ----------- -----------------------------spfile

string

/u01/app/oracle/product/10.2.0 /asm_1/dbs/spfile+ASM.ora

SYS> create pfile='/tmp/init+ASM.ora' from spfile; File created. $ vi /tmp/init+ASM.ora *.asm_diskgroups='DATA','FRA' +ASM.asm_diskgroups='FRA','DATA'#Manual Mount *.background_dump_dest='/u01/app/oracle/admin/+ASM/bdump' *.core_dump_dest='/u01/app/oracle/admin/+ASM/cdump' *.instance_type='asm' *.large_pool_size=12M *.remote_login_passwordfile='SHARED' *.user_dump_dest='/u01/app/oracle/admin/+ASM/udump' SYS> shut immediate; ASM diskgroups dismounted ASM instance shutdown SYS> startup; ASM instance started Total System Global Area Fixed Size

83886080 bytes 1272120 bytes

Variable Size

57448136 bytes

ASM Cache

25165824 bytes

ASM diskgroups mounted

ASM instance has its own SGA and background processes. ASM instance cannot be in open status, it is instance only (only memory is allocated). ASM does NOT have any controlfile and database files for +ASM instance. When in MOUNT state means, database can use the diskgroup. Mount means mounting diskgroups.

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

STRIPPING AND MIRRORING

ASM provides Stripping and Mirroring. ASM is NOT RAID and it does NOT behave exactly as RAID, ASM can be even Smarter. STRIPPING: It spreads data evenly across all disks in a diskgroup to optimize performance and utilization. This even distribution of database files eliminates the need for regular monitoring and I/O performance tuning. Read more about Stripping and Mirroring. MIRRORING: ASM does NOT mirror disks but files. Mirroring means keeping redundant copies/mirrored copies of each extent of the file. Files based redundancy only between Failure Groups within Disk Group. The mirrored copy of each file extent is always kept on different disk from the original copy.

ASM uses Normal Redundancy (2-way), High Redundancy (3-way) and External redundancy. ASM diskGroup with the External redundancy, only stripping (even you have more than 1 disk). EXTERNAL



No mirroring at ASM level

 (Must have a Single Disk).

NORMAL



Requires 2 failure Groups

 1 Master Copy and 1 Mirror Copy.

HIGH



Requires 3 failure Groups

 1 Master Copy and 2 Mirror Copy.

By default each disk is a Failure Group, but we can also combine several disk into a single Failure Group. When we go to Normal or High redundancy multiple fail groups and each group must have at-least one disk. Read more about Mirroring and Failure Groups When a disk fails, ASM performs a file rebalance using available free disk space and remaining number of disk drives in order to maintain the same level of redundancy. ASM also rebalances files when adding another disk to increase space.

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

ASM IMPLEMENTATION USING LOOPBACK DEVICES | OEL 5.5

STRIPPING AND MIRRORING DIAGRAM

REPUDIATION: The content of the posts are published for NON-PROFIT MOTIVE.

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF