Database 11g

Saturday, November 28, 2015

Rebuilding Indexes in Oracle




  •   First we will discuss what are indexes?


An indexes are schema objects that contains an entry for each value that appears in the indexed columns of the table and provides fast access to rows.

 We can say Indexes are the easiest way to improve the performance of long running queries with full tables scan. By properly indexing large tables query completion time
Can go from hours to minutes.

Indexes not only improve Select queries but also it improves Update & Delete



  •  Some Indexes Names with their Functions:-


B-Tree index :- This index is default index in oracle, Good for high cardinality (not identical or unique values like usernames, user-ids)

Bitmap index:- Excellent in Data warehouse environments Good for low cardinality values ( Less repeated values ex: Gender)

Reverse index:-  A form of B-tree index; useful to balance I/O in an index that has many sequential inserts.

Function Based index:- Good for columns that have SQL functions applied to them. This can be used with either a B-tree or bitmap index.
           
Concatenate or Composite index: - Is an index on multiple columns in a table.

Global Partitioned Index:- Global index across all partitions in a partitioned table or regular table. This can be a B-tree index type and can’t be a bitmap index type.

Local Partitioned Index:- Local index based on individual partitions in a partitioned table. This can be either a B-tree or bitmap index type.

Descending Index:- A form of B-tree index; used with indexes where corresponding column values are sorted in a descending order (the default order is ascending).

INDEX STATISTICS :-

 Height      : This is the height of the index which refers to the number of levels that are                       spawned by the index as a result in row inserts.
                    When a large number of rows are added to a table,                                                           Oracle may spawn additional levels of an index to accommodate the new                         rows.Hence, an  Oracle index may have four levels, but only in those                               areas of the index tree where the massive inserts have occurred.
                      Oracle indexes can support many millions of entries in three levels, and                         any  Oracle index that has four or more levels  would benefit from                                    rebuilding.

LF_ROWS     : Number of leaf rows (values in the index) These leaf-rows will grow as                            rows inserts in the table.

LF_BLKS     :  Number of leaf blocks in the index.


DEL_LF_ROWS :  The number of index nodes that have been logically deleted as a                                      result of row deletes. Remember that Oracle leaves "dead" index                                    nodes in the index when rows are deleted.
                               This is done to speed up SQL deletes.Oracle does not re-balance                                   the index tree when rows are deleted.




  •   Creating Index is very simple.


CREATE INDEX emp_idx ON emp(ename)TABLESPACE users;



  •  When to rebuild the indexes.

                                              
When there is lot of  DML happened indexes becomes fragmented due to this indexes takes more time to give the output and index height will also increase.

                 OR

 Another rebuild condition would be cases where deleted leaf nodes comprise more than 20 percent of the index nodes.


  • Steps For Rebuilding Index:-


You have to collect some information to rebuild the indexes.

Query the table in which indexes are created.

You can see here multiple indexes are created on multiple columns.

SQL> select table_name,index_name,column_name from user_ind_columns where table_name='SHSHTDTA'

TABLE_NAME       INDEX_NAME         COLUMN_NAME
---------- --------------- -----------------------------------------------------------
SHSHTDTA               ASDCAD                       SDSHID
SHSHTDTA               ASDCAD                       SDMEDN
SHSHTDTA               IX_PANIC                     SDTYPE
SHSHTDTA               IX_PANIC                     SDHSCD
SHSHTDTA               IX_SHDATE                  SDORDN
SHSHTDTA               IX_SHDATE                  SDMDDT
SHSHTDTA               SHSHTDTA_INDX        SDITEM
SHSHTDTA               SHSHTDTA_INDX        SDOCUR
SHSHTDTA               SHSHTDTA_INDX        SDMDDT

>> Index Analyzing:  When you analyze the index oracle will pool the latest index statistics In index_stats tables.

SQL> analyze index HMIS.IX_PANIC validate structure;

Index analyzed.


SQL> select name,height,lf_rows,lf_blks,del_lf_rows from index_stats;

NAME                               HEIGHT    LF_ROWS     LF_BLKS       DEL_LF_ROWS
------------------------------ ---------- ---------- ---------- -----------------------------------------
IX_PANIC                               4         2050473            14218                 53342



  • This is the Good candidate key for rebuilding.



SQL> alter index HMIS.IX_PANIC rebuild online.

Index altered.

SQL> select name,height,lf_rows,lf_blks,del_lf_rows from index_stats;

NAME                               HEIGHT      LF_ROWS     LF_BLKS        DEL_LF_ROWS
------------------------------ ---------- ---------- -------------------------------------------------------
IX_PANIC                                3           2050473             4221                      0



Happy Learning…..

How to Stop and Start Cluster in Oracle Node by Node to Increase RAM in RAC


  •  Its quite simple to bounce the cluster and instances in Oracle 11g RAC.
  • We bounce the whole cluster to upgrade the RAM on the server from 64gb to 96 gb
  • Upgradation done Node by Node like OS team first upgraded to node1 and then they upgraded to node2.


Environment :-
  • Operating System    :   Windows 2008 R2 Server
  • Database                 :   11.2.0.3 
  • RAC                         :   2 Node Cluster


Steps Followed :-


  • Announced Down Time.
  • Shutdown the Application.
  • Shutdown the Instances on Node1.
          ] srvctl stop instance -i otslive1 -d otslive

         ] srvctl stop instance -i keplive1 -d keplive

  • Stop CRS services on Node1
         ] crsctl stop crs 

> When i stop  the CRS  we  informed OS Technical Team to update RAM on Node1 Server
    because when you stop the crs it disconnects the RDBMS & ASM instances including crs daemons, SCAN listeners etc....

  • Now check the status of the Instances it will show NO instances are running on Node1
        ] srvctl status instance -i otslive1 -d otslive

       ] srvctl status instance -i keplive1 -d keplive

  •  Now start CRS on Node1
  • When you start CRS all the Instances and daemons of Node1 will start automatically
  • Perform same steps for Node2.
  • Stop instances of Node2 & Stop CRS services in Node2 and after Upgrading RAM on Node2 then start CRS of Node2...
  • Now cross check all the CLUSTER services up and running or not...

     
Happy Learning....










Wednesday, November 18, 2015

How to Stop and Start RAC-Database


  • Oracle provide SRVCTL (Server Control) utility to Stop and Start the Database in RAC. 

Stopping RAC Database :-

  D:\app\oracle> Srvctl stop database -d bablive
  D:\app\oracle> Srvctl stop database -d otslive


  D:\app\oracle>srvctl status database -d bablive

   Instance BABLIVE1 is not running on node oradb1
   Instance BABLIVE2 is not running on node oradb2

 D:\app\oracle>srvctl status database -d otslive

   Instance OTSLIVE1 is not running on node oradb1
   Instance OTSLIVE2 is not running on node oradb2


Starting RAC Database :-

D:\app\oracle> srvctl start database -d bablive
D:\app\oracle> srvctl start database -d otslive


D:\app\oracle> srvctl status database -d bablive

   Instance BABLIVE1 is  running on node oradb1
   Instance BABLIVE2 is  running on node oradb2

D:\app\oracle> srvctl status database -d otslive

   Instance OTSLIVE1 is  running on node oradb1
   Instance OTSLIVE2 is  running on node oradb2


Happy Learning ....








Views and Materialized Views in Oracle


Features:-

Ø  A view is a result of a stored query.
Ø  We can also say it’s a logical representation of a table.
Ø  When you do any modification on base tables automatically it will get effected on views.
Ø  There could be performance issues in views because when you execute views it also run underline query.


Creating a Normal View:-

SQL> Create view view-name as select * from table-name;

 v  Before creating materialized view pls find some of its Features and Advantages of Materialized views.

Materialized VIEWS

Ø  Materialized views are database object which contains results of a query.  Database stored in a separate object.  It will not affect immediate because it depends upon refresh parameters.

Ø  Performance wise it is more robust if we compare with views because when you execute materialize-views it will not execute base query whereas in view it executes base query.

Ø  We can create separate indexes on materialized views.


  Ø  Traditionally, data warehousing and other similar large databases have needed summary tables to     perform their work. Defining these summary tables and constantly maintaining them was a            complex task. Any time you added data to the underlying detail table, you had to manually update all   the summary tables and their indexes.

Ø  When you create a new materialized view, Oracle will automatically create an internal table to 
       hold the data of this materialized view. Thus, a materialized view will take up physical space in 
           your database.


  Refreshing Materialized View Data

Ø  Since a materialized view is defined on underlying master tables, when the data in the master tables changes, the materialized view becomes outdated. To take care of this problem, materialized views are updated, thus keeping them in sync with the master tables. The following sections present the materialized view refresh options.

Refresh Modes:-

You can choose between the ON COMMIT and ON DEMAND modes of data refresh.

ON COMMIT: In this mode, whenever a data change in one of the master tables is committed, the materialized view is refreshed automatically to reflect the change.

ON DEMAND: In this mode, you must execute a procedure like DBMS_MVIEW.REFRESH to update the materialized view.

Refresh Types:-

You can choose from the following four refresh types:

Ø   COMPLETE: This refresh option will completely recalculate the query underlying the materialized view. Thus, if the materialized view originally took you 12 hours to build, it’ll take about the same time to rebuild it. Obviously, you wouldn’t want to use this option each time a few rows are modified, dropped, or inserted into your master tables.

Ø  FAST REFRESH: Under the fast refresh mechanism, Oracle will use a materialized view log to log all changes to the master tables. It’ll then use the materialized view log to update the materialized view. The materialized view log is a table based on the associated materialized view. Each of the tables involved in the join in the materialized view needs its own materialized view log to capture changes to the tables.

Ø  FORCE: If you choose this option, Oracle will try to use the fast refresh mechanism. If it isn’t able to use it for some reason, it’ll use the complete refresh method.

Ø  NEVER: This refresh option never refreshes a materialized view. Obviously, this isn’t a viable option for a materialized view whose master tables undergo significant change over time.

Ø   The default refresh type is FORCE.



Query Rewrite


Ø  If users write queries using the underlying table, Oracle will automatically rewrite those queries
 to use the materialized views this query-optimization technique is known as query rewrite.

 Ø  By default query_rewrite_enabled parameter is True.

Ø  In large databases with heavy load- and processing power–consuming activity, such as table 
    joins and the use of aggregates like SUM, materialized views speed up queries.

Ø  Materialized views makes queries faster by recalculating and storing the results of expensive join        and aggregate operations.

Ø  The beauty of Oracle’s materialized view facility is that you can specify during their creation that     the database must automatically update the materialized views whenever there are changes             in the underlying base tables.

Ø    The Oracle CBO will automatically recognize that it should rewrite a user’s query to use the materialized view rather than the underlying tables if the estimated query cost of using the               materialized views is lower. Query cost here refers to the I/O, CPU, and memory costs involved     processing a SQL query. Complex joins involve a lot of I/O and CPU expense, and the use of   materialized views will avoid incurring this cost each time you need to perform such joins. Because the materialized views already have the summary information precomputed in them, your 
queries  will cost much less in terms of resource usage, and hence run much more quickly.


Ø  The QUERY_REWRITE_ENABLED initialization parameter allows you to enable or disable query 
writing at a global level. The parameter can take the following values:

       • FALSE: The database doesn’t rewrite any queries.
        • TRUE: The database compares the cost of the query with and without a rewrite and  
           Chooses the cheaper method.
  • FORCE: The database always rewrites the query, without evaluating any costs.
    Use the FORCE setting if you are certain that the query is beneficial and will result in 
    shortening the response time.

 Ø  The default value for this parameter is TRUE, provided you set the OPTIMIZER_FEATURES_ENABLE parameter to 10.0.0 or higher (it is FALSE if you set the OPTIMIZER_FEATURES_ENABLE parameter to 9.2.0 or lower), which means that Oracle automatically uses the query rewrite feature. When the parameter is set to TRUE, Oracle will estimate the cost of the query both with and without a rewrite
 and will choose the one with the lesser processing cost. When you enable query
 rewriting, it’s enabled systemwide, for the entire database.

Ø  You must specify the FORCE value for the OPTIMIZER_QUERY_REWRITE parameter only if you are sure that it is beneficial to do so. To enable query rewriting for a specific materialized view, you
         must explicitly specify the ENABLE QUERY REWRITE clause when you create the materialized
         view.

Steps:-

Ø  Target database Table should have primary (For refresh Parameters).

SQL> alter table emp add constraint pk_emp primary key (empno,ename);
Table altered.

Ø  Create materialized view log.

    SQL> create materialized view log on fmis.emp; ()

                Materialized view log created.

SQL> create materialized view eyes_mv1
           refresh fast
        START WITH SYSDATE NEXT SYSDATE + 1
        Enable query rewrite
           as select * from emp@mmmlink;

Materialized view created.


Querying materialized views

SQL> select * from emp@mmmlink;
SQL> SELECT owner, mview_name, last_refresh_date FROM all_mviews;
OWNER               MVIEW_NAME                                                                   LAST_REFR
--------- ------------------------------ --------------------------------------------------------------------------------------------------
SYSMAN             MGMT_ECM_MD_ALL_TBL_COLUMNS                                03-NOV-11
SYS                      EYES_MV                                                                              07-JUN-15
SYS                      EYES_MV1                                                                           07-JUN-15
SYS                      EYES_MV2                                                                           07-JUN-15


SQL> SELECT mview_name, last_refresh_date, fullrefreshtim, increfreshtim FROM dba_mview_analysis;
MVIEW_NAME                                                    LAST_REFR              FULLREFRESHTIM INCREFRESHTIM
----------------------------- --------- -------------- ------------------------------------------------------------------------------------
MGMT_ECM_MD_ALL_TBL_COLUMNS              03-NOV-11                                   1                        0
EYES_MV                                                               07-JUN-15                                   0                        0
EYES_MV1                                                            07-JUN-15                                    0                        0
EYES_MV2                                                            07-JUN-15                                     0                       0

SQL> select MVIEW_NAME, to_char(LAST_REFRESH_DATE,'YYYY-MM-DD HH24:MI:SS') from       dba_mviews;
MVIEW_NAME                                                                  TO_CHAR(LAST_REFRES
------------------------------ ----------------------------------------------------------------------------
MGMT_ECM_MD_ALL_TBL_COLUMNS                              2011-11-03 06:20:15
EYES_MV                                                                           2015-06-07 13:57:48
EYES_MV1                                                                         2015-06-07 15:00:31
EYES_MV2                                                                          2015-06-07 15:19:12


You can go for manual refresh also by executing DMS procedure
SQL> EXEC DBMS_MVIEW.REFRESH('EYES_MV1'); 
PL/SQL procedure successfully completed.

SQL> select NAME, to_char(LAST_REFRESH,'YYYY-MM-DD HH24:MI:SS') from dba_mview_refresh_times;
NAME                                                                              TO_CHAR(LAST_REFRES
------------------------------ ---------------------------------------------------------------------
EYES_MV                                                                            2015-06-08 11:07:57
EYES_MV1                                                                          2015-06-08 11:07:47
EYES_MV2                                                                          2015-06-08 12:36:27

MGMT_ECM_MD_ALL_TBL_COLUMNS                        2011-11-03 06:20:15


Happy Learning ...


Tuesday, November 17, 2015

ORA-00257,UDE-00257 Archiver Error Connect Internal Only, Until Freed in RAC




>> As per the Oracle Support they suggested to bounce the complete cluster and restart all the                  databases for this issue.

Problems Faced.....

>> RMAN backups are not executing

E:\Backup\Scripts> runrmanhr.cmd


>> Data-pump jobs are also not running its showing Archiver Error then i checked Archive destination.

D:\otsexp> expdp dumpfile=OTSLIVE_23_AUG2015FULL directory=otslive full=y


Export: Release 11.2.0.3.0 - Production on Sun Nov 15 18:09:39 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Username : system
Password : xxxxx

UDE-00257 : operation generated Oracle error 257
ORA-00257 : archiver error. Connect Internal only, until freed



>> I checked the ASM diskgroup status & space for archive destination lot of space is available
   every thing is fine upto here.


SQL> select name,total_mb,free_mb from v$asm_diskgroup;

NAME                             TOTAL_MB         FREE_MB
------------------------------ ---------- -----------------------------
DATA                               511994                385213
OCRVOTE                       102397                102002
RECO                               511997                460833



SQL>  select name,inst_id,state from gv$asm_diskgroup;

NAME                              INST_ID          STATE
------------------------------ ---------- ------------------------
DATA                                    1               MOUNTED
OCRVOTE                            1               MOUNTED
RECO                                   1               MOUNTED
DATA                                    2               MOUNTED
OCRVOTE                            2               MOUNTED
RECO                                   2               MOUNTED

6 rows selected.


>> I checked the datafile status all are ok.


SQL> select file_name,status from dba_data_files

FILE_NAME                                                                        STATUS
--------------------------------------------- ---------------------------------------
+DATA/otslive/datafile/system.258.860628911               AVAILABLE
+DATA/otslive/datafile/sysaux.264.860628911               AVAILABLE
+DATA/otslive/datafile/undotbs1.262.860628913           AVAILABLE
+DATA/otslive/datafile/users.259.860628913                 AVAILABLE
+DATA/otslive/datafile/undotbs2.269.860629051          AVAILABLE
+DATA/otslive/datafile/users.256.860630027                AVAILABLE
+DATA/otslive/datafile/users.274.860630073                AVAILABLE

7 rows selected.


>> When i check CRS resource its showing INTERMEDIATE & CHECK TIMED OUT status for ocrvoting diskgroup and both my production database bablive and otslive...


 E:\Backup\Scripts>crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       oradb1
               ONLINE  ONLINE       oradb2
ora.LISTENER.lsnr
               ONLINE  ONLINE       oradb1
               ONLINE  ONLINE       oradb2
ora.OCRVOTE.dg
               ONLINE  INTERMEDIATE oradb1                    CHECK TIMED OUT
               ONLINE  ONLINE       oradb2
ora.RECO.dg
               ONLINE  ONLINE       oradb1
               ONLINE  ONLINE       oradb2
ora.asm
               ONLINE  ONLINE       oradb1                   Started
               ONLINE  ONLINE       oradb2                   Started
ora.gsd
               OFFLINE OFFLINE      oradb1
               OFFLINE OFFLINE      oradb2
ora.net1.network
               ONLINE  ONLINE       oradb1
               ONLINE  ONLINE       oradb2
ora.ons
               ONLINE  ONLINE       oradb1
               ONLINE  ONLINE       oradb2
ora.registry.acfs
               ONLINE  ONLINE       oradb1
               ONLINE  ONLINE       oradb2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       oradb2
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       oradb1
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       oradb1
ora.cvu
      1        ONLINE  ONLINE       oradb1
ora.bablive.db
      1        ONLINE  INTERMEDIATE oradb1                   CHECKED TIMED OUT
      2        ONLINE  ONLINE       oradb2                   Open
ora.otslive.db
      1        ONLINE  INTERMEDIATE oradb1                   CHECKED TIMED OUT
      2        ONLINE  ONLINE       oradb2                   Open
ora.oc4j
      1        ONLINE  ONLINE       oradb1
ora.oradb1.vip
      1        ONLINE  ONLINE       oradb1
ora.oradb2.vip
      1        ONLINE  ONLINE       oradb2
ora.scan1.vip
      1        ONLINE  ONLINE       oradb2
ora.scan2.vip
      1        ONLINE  ONLINE       oradb1
ora.scan3.vip
      1        ONLINE  ONLINE       oradb1


Steps:-
------

1. First we announce the down time for the users for 1 hour.

2. Shutdown the application.

3. Started Bouncing our Cluster

4. Use srvctl utility to stop and start the database in RAC.

   > Srvctl stop database -d otslive

   > Srvctl stop database -d bablive


   > Node1 : crsctl stop crs
   > Node2 : crsctl stop crs


   > Node1 : crsctl start crs
   > Node2 : crsctl stop  crs


Now check the crs services are online or not....

   > Node1 : crsctl check crs
   > Node2 : crsctl check crs


If all the CRS services are online then you can check the status.

D:\app\oracle>srvctl status database -d otslive

   Instance OTSLIVE1 is running on node oradb1
   Instance OTSLIVE2 is running on node oradb2

D:\app\oracle>srvctl status database -d bablive

   Instance BABLIVE1 is running on node oradb1
   Instance BABLIVE2 is running on node oradb2



Happy Learning ....





Wednesday, November 11, 2015

Database Creation Date & Instance Startup in Oracle





  • How to check startup_time of instances in RAC


SQL> select inst_id,instance_name,startup_time from gv$instance;

          INST_ID             INSTANCE_NAME                     STARTUP_TIME
       -------------------------------------------------------------------------------------
               1                         otslive1                                      09-SEP-15
               2                         otslive2                                      09-SEP-15


  • How to check database creation date.


SQL> select name,created from v$database;

                  NAME                CREATED
              -----------------------------------------
                 OTSLIVE             22-NOV-14



Happy Learning .....








Tuesday, November 10, 2015

Exporting Tables in Oracle



Exporting Single Table :-

  •  First create Directory at OS and DB level on Source and Target Machine and then start export and import.

[oracle@bab fiexp]$ expdp system/manager dumpfile=f.dmp directory=fiexp tables=sam.emp


  • Copy .dmp to target  Location by using SCP or OS Team will copy this .dmp file to your target location.


Now Start Importing Single Table:-


  •  We are using here Remap parameter if we use remap option oracle will change source directory name to new name like on source our emp table is in  SAM schema and we are importing into BAB schema and also it will rename your table.

[oracle@bab ~]$ impdp system/manager dumpfile=f.dmp directory=fiimp remap_schema=bab:emphr


                                                                  *****************



SCHEMA LEVEL EXPORT:- 

  • It exports objects of particular schema and on the fly  it creates new schema at target machine.



[oracle@bab fiexp]$ expdp system/manager dumpfile=schema.dmp directory=fiexp schemas=ots


[oracle@bab fiimp]$ impdp system/manager directory=fiimp dumpfile=schema.dmp  remap_schema=ots:jld

                                                                 *****************

TABLESPACE LEVEL:-

  • Create Directories at OS level and Database level with read, write permissions.
  • Create tablespace with same name at target machine as source.
  • Create same users at target machine with minimum connect, resource privileges.



[oracle@bab tsexp]$ expdp system/manager dumpfile=pts.dmp directory=tsexp tablespaces=prodtsl

  • Scp .dmp file to target.


[oracle@akram tsimp]$ impdp system/manager dumpfile=pts.dmp directory=tsimp remap_tablespace=prodts:prodts

Note:-


To import at target side Target tablespace name can be diff but users should be same.




Happy Learning ....















Sunday, November 8, 2015

Installing ASM Grid Infrastructure on Linux




Ø  First we will discuss about ASM and its Features..

1. What is ASM ?

ASM is a file system provided by oracle for storing data with high performance I/O and failure proof.

2. Advantages of Using ASM?

 * Two major reasons for using ASM ie Performance & Protection.

 * ASM gives performance and redundancy through Striping & Mirroring

STRIPPING:-
 
   ASM stripes all files across every disk which are part of a diskgroup.
 
   ASM have 2 types of striping Coarse & Fine Striping

   Coarse Striping :
   Uses a stripe size of 1MB. you can use coarse striping for every file in your database except   ctlfile,online redologfiles and falshback files.

   Fine Striping :
   Uses a stripe size 128Kb, you can use fine striping for ctlfiles, online redologfiles and flashback       files.

MIRRORING:-

Mirroring means data redundancy, This means if you lose disk,you can use the mirror disk to continue operations.

When a disk in a groups fails ASM rebuilds the failed disk using mirrored extents from other disks in the group.

When ASM reconstructs a failed disk, the storage system takes a small performance hit,
because ASM requires some extra I/O to reconstruct the failed device.


TYPES OF MIRRORING:-

ASM supports 3 types of disk mirroring, each with a different level of data redundancy.

External Redundancy, Normal Redundancy and High Redundancy.

External = doesn’t have failure groups and no mirroring strategy.

Normal = It have 2 way mirroring of fields in a diskgroup.

High = It have 3 failure groups.


FAILURE GROUPS:-

If any disk fails ASM can survive the disaster and reconstruct the lost disks from the mirror copies.


Background Process in ASM :-


  •  Oracle ASM instances uses several Oracle Background Process, Such as SMON,PMON and             LGWR.  
  •    For managing ASM oracle uses 2 instances.       
   RBAL = The coordinates disk activity.
  
   ARBn = Performs the re-balancing like moving data extents.

   ASMB = Connects to asm instance and links the ASM instance.


  Installation of ASM-GRID INFRASTRUCTURE on Linux

 Ø  Make Partitions using Fdisk

] fdisk /dev/sdb

  n = new partation

  p = primary partation

  1 = 

  +20g = Partation Size

   W = Save & Exit

 Ø  Run Partprobe to update the OS about Partitions.

] partprobe /dev/sdb

 Ø   Check Partitions, check the Ownership and Permissions from Unix Team

] fdisk -l  

] Chown -R oracle:dba /dev/sdb1 or sdb2 or sdb*

] Chmod -R 775 /dev/sdb* 

] xhost +

] Su - oracle



grid] ./runInstaller


Ø   Set the Environment Variable

] cat > grid.env

export ORACLE_HOME=/u01/home/grid/oracle/product/11.2.0/grid

export PATH=$ORACLE_HOME/bin:$PATH:.

] .grid.env

] export ORACLE_SID=+ASM

] conn / as sysasm

Ø   Check ASM status.

> Select Instance_name,status from v$instance;

] asmcmd

asmcmd> ls

asmcmd ] lsdisk


asmcmd ] ls -ltr



Happy Learning .....