пятница, 22 февраля 2013 г.

Сервисы в Oracle Restart

Создаем сервисы в БД testdb:

exec dbms_service.create_service(service_name => 'testdb_app', network_name=> 'testdb_app');
exec dbms_service.start_service('testdb_app');

удалять так:
exec dbms_service.stop_service('testdb_app');
exec dbms_service.delete_service('testdb_app');


Добавляем базу testdb в конфигурацию oracle restart:

srvctl add database -d testdb_p -n testdb -i testdb -o /u01/app/oradb/product/11.2.0.3/dbhome_1 -p /u01/app/oradb/product/11.2.0.3/dbhome_1/dbs/spfiletestdb.ora  -s OPEN  -r PRIMARY  -t IMMEDIATE -y AUTOMATIC -a "DATA,RECO,REDO";

srvctl add database -d testdb_s -n testdb -i testdb -o /u01/app/oradb/product/11.2.0.3/dbhome_1 -p /u01/app/oradb/product/11.2.0.3/dbhome_1/dbs/spfiletestdb.ora  -s MOUNT -r PHYSICAL_STANDBY -t IMMEDIATE -y AUTOMATIC -a "DATA,RECO,REDO";


Тестовую базу можно добавить в режиме (manual)
после перезагрузки сервера базу нужно будет запускать руками

srvctl add database -d testdb -n testdb -i testdb -o /u01/app/oradb/product/11.2.0.3/dbhome_1 -p /u01/app/oradb/product/11.2.0.3/dbhome_1/dbs/spfiletestdb.ora  -s OPEN -r PRIMARY -t IMMEDIATE -y MANUAL -a "DATA,RECO,REDO,TEST";

Добавляем сервисы в конфигурацию oracle restart:

$ srvctl add service -d testdb_p -s testdb_app -l primary -e SELECT -m BASIC
$ srvctl modify service -d testdb_p -s testdb_app -z 180 -w 1
$ srvctl config service -d testdb_p


standby:

$ srvctl add service -d testdb_s -s testdb_app -l primary -e SELECT -m BASIC
$ srvctl modify service -d testdb_s -s testdb_app -z 180 -w 1
$ srvctl config service -d testdb_s




Регистрация сервисов БД в случае БЕЗ использования GI


Названия сервисов: SIDAPP для Primary и  SIDREP для Standby

Без поддержки TAF    
  
-- Для БД с ролью PRIMARY

begin
  DBMS_SERVICE.CREATE_SERVICE (
            service_name => 'TESTAPP',
            network_name => 'TESTAPP');
end;
/


-- Для БД с ролью STANDBY + READ ONLY

begin
  DBMS_SERVICE.CREATE_SERVICE (
            service_name => 'TESTREP',
            network_name => 'TESTREP');
end;
/

С поддержкой TAF

-- Для БД с ролью PRIMARY

begin
  DBMS_SERVICE.CREATE_SERVICE (
            service_name => 'TESTAPP',
            network_name => 'TESTAPP',
            failover_method  => 'BASIC',
            failover_type    => 'SELECT',
            failover_retries => 20,
            failover_delay   => 5);
end;
/

-- Для БД с ролью STANDBY + READ ONLY

begin
  DBMS_SERVICE.CREATE_SERVICE (
            service_name => 'TESTREP',
            network_name => 'TESTREP',
            failover_method  => 'BASIC',
            failover_type    => 'SELECT',
            failover_retries => 20,
            failover_delay   => 5);
end;
/


Процедура автозапуска сервисов в БД в зависимости от её РОЛИ

CREATE OR REPLACE TRIGGER SYS.startDGservices after startup on database
DECLARE
  db_role VARCHAR(30);
  db_open_mode VARCHAR(30);
BEGIN
  SELECT DATABASE_ROLE, OPEN_MODE INTO db_role, db_open_mode FROM V$DATABASE;
  IF db_role = 'PRIMARY' THEN DBMS_SERVICE.START_SERVICE('TESTAPP'); END IF;
  IF db_role = 'PHYSICAL STANDBY' AND db_open_mode LIKE 'READ ONLY%' THEN DBMS_SERVICE.START_SERVICE('TESTREP'); END IF;
END;
/


Процедуры ручного запуска сервисов в БД в зависимости от её РОЛИ

CREATE OR REPLACE procedure SYS.startAPPservice as
DECLARE
  db_role VARCHAR(30);
  db_open_mode VARCHAR(30);
BEGIN
  SELECT DATABASE_ROLE, OPEN_MODE INTO db_role, db_open_mode FROM V$DATABASE;
  IF db_role = 'PRIMARY' THEN DBMS_SERVICE.START_SERVICE('TESTAPP'); END IF;
END;
/

CREATE OR REPLACE procedure SYS.startREPservice as
DECLARE
  db_role VARCHAR(30);
  db_open_mode VARCHAR(30);
BEGIN
  SELECT DATABASE_ROLE, OPEN_MODE INTO db_role, db_open_mode FROM V$DATABASE;
  IF db_role = 'PHYSICAL STANDBY' AND db_open_mode LIKE 'READ ONLY%' THEN DBMS_SERVICE.START_SERVICE('TESTREP'); END IF;
END;
/


Процедуры ручной остановки сервисов в БД

create or replace procedure SYS.stopAPPservice as
begin
  DBMS_SERVICE.STOP_SERVICE('TESTAPP');
end;
/


create or replace procedure SYS.stopREPservice as
begin
  DBMS_SERVICE.STOP_SERVICE('TESTREP');
end;
/



Регистрация сервисов БД в случае использованияGI


Регистрация сервисов в Grid Infrastructure (GI)

Без поддержки TAF

-- Для БД с ролью PRIMARY

. oraenv
$ srvctl add service -d TEST_OMEGA01 \
                     -s TESTAPP         \
                     -l PRIMARY   \
                     -y AUTOMATIC \
                     -P NONE      \
                     -e NONE      \
                     -m NONE      \
                     -w 5         \
                     -z 20         

-- Для БД с ролью STANDBY + READ ONLY

. oraenv
$ srvctl add service -d TEST_OMEGA02 \
                     -s TESTREP         \
                     -l PHYSICAL_STANDBY \
                     -y AUTOMATIC \
                     -P NONE      \
                     -e NONE      \
                     -m NONE      \
                     -w 5         \
                     -z 20         

С поддержкой TAF

-- Для БД с ролью PRIMARY

. oraenv
$ srvctl add service -d TEST_OMEGA01 \
                     -s TESTAPP         \
                     -l PRIMARY   \
                     -y AUTOMATIC \
                     -P BASIC     \
                     -e SELECT    \
                     -m BASIC     \
                     -w 5         \
                     -z 20   

-- Для БД с ролью STANDBY + READ ONLY

. oraenv
$ srvctl add service -d TEST_OMEGA02 \
                     -s TESTREP         \
                     -l PHYSICAL_STANDBY \
                     -y AUTOMATIC \
                     -P BASIC     \
                     -e SELECT    \
                     -m BASIC     \
                     -w 5         \
                     -z 20


Процедура автозапуска сервисов в БД в зависимости от её РОЛИ

Работа сервисов контролируется ПО Grid Infrastructure в АВТО-режиме

Процедуры ручного запуска сервисов в БД в зависимости от её РОЛИ

$ srvctl start  service -d TEST_OMEGA01 -s TESTAPP –o OPEN
$ srvctl start  service -d TEST_OMEGA02 -s TESTREP


Процедуры ручной остановки сервисов в БД

$ srvctl stop  service -d TEST_OMEGA01 -s TESTAPP
$ srvctl stop  service -d TEST_OMEGA02 -s TESTREP


Процедура проверки характеристик зарегистрированного сервиса

$ srvctl config service -d TEST_OMEGA01 -s TESTAPP
$ srvctl config service -d TEST_OMEGA02 -s TESTREP


Проверка клиентский соединения на предмет использования сервисов с поддержкой технологии TAF :

col username format a25
col machine format a30
col module format a15
col service_name format a15
col server format a12
col failover_type format a15
col failover_method format a15
col failed_over format a15

select inst_id,sid,username, machine, substr(module,1,15) as module, service_name,server,
       case when failover_type='NONE'   then NULL else failover_type   end as failover_type,
       case when failover_method='NONE' then NULL else failover_method end as failover_method,
       case when failed_over='NO'       then NULL else failed_over     end as failed_over
from gv$session
order by 1,2;


Проверка работы сервисов

col host_name    format a22
col service_name format a22
col network_name format a22

select (select host_name from v$instance) host_name,
       name service_name,
       network_name
from v$services;


Настройка дескрипторов соединений на клиентской стороне


01 - Primary - должен быть поднят сервис APP
02 - Standby- доджен быть поднят сервис REP в режиме RO

Подключение к базам в БЕЗ Standby конфигурации:


Non-RAC конфигурация

TEST_APP =
  (DESCRIPTION =
    (ENABLE=BROKEN)
    (ADDRESS_LIST=
        (ADDRESS = (PROTOCOL = TCP)(HOST = omega01.localdomain)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TESTAPP)
    )
  )


RAC конфигурация

TEST_APP =
  (DESCRIPTION =
     (ENABLE=BROKEN)
     (CONNECT_TIMEOUT=30)
     (TRANSPORT_CONNECT_TIMEOUT=10)
     (RETRY_COUNT=3)
     (ADDRESS_LIST=
       (LOAD_BALANCE=on)
       (ADDRESS = (PROTOCOL = TCP)(HOST = scan_omega01)(PORT = 1521))
     )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TESTAPP)
    )
  )


Подключение к базам в  Standby конфигурации:


Non-RAC конфигурация

TEST_APP =
  (DESCRIPTION =
    (ENABLE=BROKEN)
    (TRANSPORT_CONNECT_TIMEOUT=10)
    (ADDRESS_LIST=
      (LOAD_BALANCE=OFF)
      (FAILOVER=ON)
        (ADDRESS = (PROTOCOL = TCP)(HOST = omega01.localdomain)(PORT = 1521))
        (ADDRESS = (PROTOCOL = TCP)(HOST = omega02.localdomain)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TESTAPP)
    )
  )

TEST_REP =
  (DESCRIPTION =
    (ENABLE=BROKEN)
    (TRANSPORT_CONNECT_TIMEOUT=10)
    (ADDRESS_LIST=
      (LOAD_BALANCE=OFF)
      (FAILOVER=ON)
        (ADDRESS = (PROTOCOL = TCP)(HOST = omega01.localdomain)(PORT = 1521))
        (ADDRESS = (PROTOCOL = TCP)(HOST = omega02.localdomain)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TESTREP)
    )
  )


RAC конфигурация

TEST_APP =
  (DESCRIPTION_LIST=
     (LOAD_BALANCE=OFF)
     (FAILOVER=ON)
       (DESCRIPTION=
          (ENABLE=BROKEN)
          (CONNECT_TIMEOUT=30)
          (TRANSPORT_CONNECT_TIMEOUT=10)
          (RETRY_COUNT=3)
          (ADDRESS_LIST=
            (LOAD_BALANCE=ON)
            (ADDRESS=(PROTOCOL=TCP)(HOST=scan_omega01)(PORT=1521))
          )
            (CONNECT_DATA=
              (SERVER = DEDICATED)
              (SERVICE_NAME=TESTAPP)
            )
       )
       (DESCRIPTION=
          (ENABLE=BROKEN)
          (CONNECT_TIMEOUT=30)
          (TRANSPORT_CONNECT_TIMEOUT=10)
          (RETRY_COUNT=3)
          (ADDRESS_LIST=
            (LOAD_BALANCE=ON)
            (ADDRESS=(PROTOCOL=TCP)(HOST=scan_omega02)(PORT=1521))
          )
            (CONNECT_DATA=
              (SERVER = DEDICATED)
              (SERVICE_NAME=TESTAPP)
            )
       )
  )


TEST_REP =
  (DESCRIPTION_LIST=
     (LOAD_BALANCE=OFF)
     (FAILOVER=ON)
       (DESCRIPTION=
          (ENABLE=BROKEN)
          (CONNECT_TIMEOUT=30)
          (TRANSPORT_CONNECT_TIMEOUT=10)
          (RETRY_COUNT=3)
          (ADDRESS_LIST=
            (LOAD_BALANCE=ON)
            (ADDRESS=(PROTOCOL=TCP)(HOST=scan_omega01)(PORT=1521))
          )
            (CONNECT_DATA=
              (SERVER = DEDICATED)
              (SERVICE_NAME=TESTREP)
            )
       )
       (DESCRIPTION=
          (ENABLE=BROKEN)
          (CONNECT_TIMEOUT=30)
          (TRANSPORT_CONNECT_TIMEOUT=10)
          (RETRY_COUNT=3)
          (ADDRESS_LIST=
            (LOAD_BALANCE=ON)
            (ADDRESS=(PROTOCOL=TCP)(HOST=scan_omega02)(PORT=1521))
          )
            (CONNECT_DATA=
              (SERVER = DEDICATED)
              (SERVICE_NAME=TESTREP)
            )
       )
  )




Configure Oracle Grid Infrastructure for a Standalone Server

# /u01/app/11.2.0.3/grid/perl/bin/perl -I /u01/app/11.2.0.3/grid/perl/lib -I /u01/app/11.2.0.3/grid/crs/install /u01/app/11.2.0.3/grid/crs/install/roothas.pl -deconfig -force
Using configuration parameter file: /u01/app/11.2.0.3/grid/crs/install/crsconfig_params
CRS resources for listeners are still configured
PRKO-2573 : ONS daemon is already stopped.
CRS-2673: Attempting to stop 'ora.cssd' on 'omega.sun.com'
CRS-2677: Stop of 'ora.cssd' on 'omega.sun.com' succeeded
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'omega.sun.com'
CRS-2673: Attempting to stop 'ora.evmd' on 'omega.sun.com'
CRS-2677: Stop of 'ora.evmd' on 'omega.sun.com' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'omega.sun.com' has completed
CRS-4133: Oracle High Availability Services has been stopped.
Successfully deconfigured Oracle Restart stack

# /u01/app/11.2.0.3/grid/perl/bin/perl -I /u01/app/11.2.0.3/grid/perl/lib -I /u01/app/11.2.0.3/grid/crs/install /u01/app/11.2.0.3/grid/crs/install/roothas.pl
Using configuration parameter file: /u01/app/11.2.0.3/grid/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'oragrid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node omega.sun.com successfully pinned.
Adding Clusterware entries to inittab
omega.sun.com     2013/02/12 14:12:01     /u01/app/11.2.0.3/grid/cdata/omega.sun.com/backup_20130212_141201.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server


# ls -l /etc/inittab
-rw-r--r--   1 root     root        1130 Feb 12 14:11 /etc/inittab
root@omega.sun.ru # more /etc/inittab
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# The /etc/inittab file controls the configuration of init(1M); for more
# information refer to init(1M) and inittab(4).  It is no longer
# necessary to edit inittab(4) directly; administrators should use the
# Solaris Service Management Facility (SMF) to define services instead.
# Refer to smf(5) and the System Administration Guide for more
# information on SMF.
#
# For modifying parameters passed to ttymon, use svccfg(1m) to modify
# the SMF repository. For example:
#
#       # svccfg
#       svc:> select system/console-login
#       svc:/system/console-login> setprop ttymon/terminal_type = "xterm"
#       svc:/system/console-login> exit
#
#ident  "@(#)inittab    1.41    04/12/14 SMI"
ap::sysinit:/sbin/autopush -f /etc/iu.ap
sp::sysinit:/sbin/soconfig -f /etc/sock2path
smf::sysinit:/lib/svc/bin/svc.startd    >/dev/msglog 2<>/dev/msglog
p3:s1234:powerfail:/usr/sbin/shutdown -y -i5 -g0 >/dev/msglog 2<>/dev/msglog
pt:s1234:powerfail:/lib/svc/method/installupdates lock

h1:3:respawn:/etc/init.d/init.ohasd run >/dev/null 2>&1

#


# ps -ef|grep ohas
 oragrid 17353     1   0 14:11:35 ?           0:02 /u01/app/11.2.0.3/grid/bin/ohasd.bin reboot
    root 17766  6506   0 14:19:46 pts/3       0:00 grep ohas
    root 17322     1   0 14:11:35 ?           0:00 /bin/sh /etc/init.d/init.ohasd run
#


# /u01/app/11.2.0.3/grid/bin/crsctl status resource -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ons
               OFFLINE OFFLINE      omega.sun.com
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        OFFLINE OFFLINE
ora.diskmon
      1        OFFLINE OFFLINE
ora.evmd
      1        ONLINE  ONLINE       omega.sun.com


# /u01/app/11.2.0.3/grid/bin/crsctl check has
CRS-4638: Oracle High Availability Services is online

# /u01/app/11.2.0.3/grid/bin/crsctl check css
CRS-4530: Communications failure contacting Cluster Synchronization Services daemon
#

# /u01/app/11.2.0.3/grid/bin/crsctl start resource ora.cssd -init
CRS-2672: Attempting to start 'ora.cssd' on 'omega.sun.com'
CRS-2672: Attempting to start 'ora.diskmon' on 'omega.sun.com'
CRS-2676: Start of 'ora.diskmon' on 'omega.sun.com' succeeded
CRS-2676: Start of 'ora.cssd' on 'omega.sun.com' succeeded
#

# /u01/app/11.2.0.3/grid/bin/crsctl status resource -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ons
               OFFLINE OFFLINE      omega.sun.com
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       omega.sun.com
ora.diskmon
      1        OFFLINE OFFLINE
ora.evmd
      1        ONLINE  ONLINE       omega.sun.com
#



В 11.2.0.3 diskmon.bin  не offline только для Exadate.

Если нет процессов то переконфигурировать  Grid Infrastructure.

А так делать не нужно:

crsctl delete resource ora.cssd
.....

crsctl add resource ora.cssd
.....


# /u01/app/11.2.0.3/grid/bin/crsctl modify resource "ora.cssd" -attr "AUTO_START=1"
# /u01/app/11.2.0.3/grid/bin/crsctl modify resource "ora.diskmon" -attr "AUTO_START=1"

#
# /u01/app/11.2.0.3/grid/bin/crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'omega.sun.com'
CRS-2673: Attempting to stop 'ora.cssd' on 'omega.sun.com'
CRS-2677: Stop of 'ora.cssd' on 'omega.sun.com' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'omega.sun.com'
CRS-2677: Stop of 'ora.evmd' on 'omega.sun.com' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'omega.sun.com' has completed
CRS-4133: Oracle High Availability Services has been stopped.

#
# /u01/app/11.2.0.3/grid/bin/crsctl start has
CRS-4123: Oracle High Availability Services has been started.
#


# /u01/app/11.2.0.3/grid/bin/crsctl status resource -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ons
               OFFLINE OFFLINE      omega.sun.com
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       omega.sun.com
ora.diskmon
      1        OFFLINE OFFLINE
ora.evmd
      1        ONLINE  ONLINE       omega.sun.com
root@omega.sun.ru #


Конфигурация листенера:

$netca &


$srvctl config listener
Name: LISTENER
Home: /u01/app/11.2.0.3/grid
End points: TCP:1521
$

/u01/app/11.2.0.3/grid/bin/srvctl add listener -l LISTENER -s -p TCP:1521 -o /u01/app/11.2.0.3/grid

Конфигурация ASM:

$asmca &

$srvctl config asm
ASM home: /u01/app/11.2.0.3/grid
ASM listener: LISTENER
Spfile: +DATA/asm/asmparameterfile/registry.253.807812965
ASM diskgroup discovery string: /dev/rdsk/c*s4
$

$srvctl stop asm -f

$srvctl start asm

$srvctl modify resource "ora.asm" -attr "AUTO_START=1"

$srvctl add asm -l LISTENER -p +DATA/asm/asmparameterfile/registry.253.807812965 -d /dev/rdsk/c*s4


Recreate ASM parameterfile (spfile):

vi /tmp/init+ASM.ora

*.asm_diskstring='/dev/rdsk/c*s4'
*.asm_power_limit=1
*.diagnostic_dest='/u01/app/oragrid'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='EXCLUSIVE'


$sqlplus "/as sysasm"

alter diskgroup DATA mount;

create spfile='+DATA' from pfile='/tmp/init+ASM.ora';

show parameter spfile;




# /u01/app/11.2.0.3/grid/bin/crsctl start has
# /u01/app/11.2.0.3/grid/bin/crsctl stop has
# /u01/app/11.2.0.3/grid/bin/crsctl status resource -t


Перенос дисковой группы с одного диска на другой:


alter diskgroup DATA add disk new_disk;
alter diskgroup DATA drop disk old_disk;


подождать

select * from v$asm_operation;


ADD ASM

$srvctl add asm -l LISTENER -p /u01/app/11.2.0.3/grid/dbs/init+ASM.ora  -d /dev/rdsk/c*s4

$srvctl start asm



export ORACLE_SID=+ASM
export ORACLE_HOME=/u01/app/11.2.0.3/grid

sqlplus "/as sysasm"


create diskgroup DATA external redundancy
disk '/dev/rdsk/c6t.....d0s4',
disk '/dev/rdsk/c6t.....d0s4'
attribute 'compatible.asm'='11.2.0.0.0';


create pfile='/tmp/pfile' from memory;

Правим файл в другой сессии:

vi /tmp/pfile
*.asm_diskstring='/dev/rdsk/c*s4'
*.asm_power_limit=1
*.diagnostic_dest='/u01/app/oragrid'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='EXCLUSIVE'


create spfile='+DATA' from pfile='/tmp/pfile';
shutdown immediate;
startup;
show parameter spfile;

orapwd file=/u01/app/11.2.0.3/grid/dbs/orapw+ASM password=oracle




When setting ASM Monitoring Configuration with SYSASM or SYSDBA In Grid Control 11g [ID 977472.1]


For 11gR2 follow the procedure below to create the ASM password file:
1. Create the password file for ASM on all nodes (if RAC) as follows:
orapwd file=$GRID_INFRASTRUCTURE_HOME/dbs/orapw+ASM password= entries=5

2. Update the password file with the following users/roles:
sqlplus / as sysasm
SQL> create user asmsnmp identified by
SQL> grant sysasm to sys;
SQL> grant sysdba to asmsnmp;


3. Review changes to the password file by querying v$pwfile_users:

SQL> select * from v$pwfile_users;
USERNAME    SYSDB SYSOP SYSAS
---------   ----- ----- -----
SYS         TRUE  TRUE  TRUE
ASMSNMP     TRUE  FALSE FALSE



For 11gR1 follow the procedure below to create the ASM password file:
1. Create the password file for ASM on all nodes (if RAC) as follows:
orapwd file=$ORA_ASM_HOME/dbs/orapw password= entries=5

2. Update the password file with the following users/roles:
sqlplus / as sysdba
SQL> grant sysasm to sys;


3. Review changes to the password file by querying v$pwfile_users:

SQL> select * from v$pwfile_users;
USERNAME  SYSDB SYSOP SYSAS
--------- ----- ----- -----
SYS       TRUE  FALSE TRUE


Initialize the devices using dd

Clean the device before we will reformat.
$ dd if=/dev/zero of=/dev/sda8 bs=1M count=100

dd if=/dev/zero of=/dev/rdsk/c3t60080E500017CAA8000006954EEA57CDd0s0 bs=8192 count=12800

Linux:

OCR disk device
dd if=/dev/zero of=/dev/sdc1 bs=125829120 count=1

Voting disk
dd if=/dev/zero of=/dev/sde1 bs=20971520 count=1


Solaris:

OCR disk device
dd if=/dev/zero of=/dev/rdsk/c1t2d3s4 bs=1M count=256

Voting disk
dd if=/dev/zero of=/dev/rdsk/c1t2d3s4 bs=1M count=256