0% found this document useful (0 votes)
32 views

D-H-N.de Raw - Block - Asm

The document discusses installing Oracle Database 11gR2 and creating a database on Oracle Linux 6. It describes running the Oracle installer, configuring security updates, installing just the database software, configuring the database with dbca, and setting the ORACLE_SID variable.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

D-H-N.de Raw - Block - Asm

The document discusses installing Oracle Database 11gR2 and creating a database on Oracle Linux 6. It describes running the Oracle installer, configuring security updates, installing just the database software, configuring the database with dbca, and setting the ORACLE_SID variable.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

d-h-n.de » Oracle http://d-h-n.

de/blog/category/oracle/page/2

d-h-n.de
Blog about Oracle, Linux..

Home
About
All Posts

Install Oracle Database 11.2.0.3 on Oracle Linux 6.2


June 14th, 2012 . by admin

Task: Install Oracle Database 11.2.0.3 for Standalone Server on OEL 6.2

Steps:

Install Oracle Grid Infrastructure


Install Oracle Database Software Only
Create database with dbca

Install Oracle Database Software Only

Run Installer:
[oracle@oel62 ~]$ /mnt/hgfs/soft/oracle-11.2.0.3.0-linux86-64/database/runInstaller

Step through the install dialoge:

Configure Securitiy Updates


– Uncheck I wish to receive security updates via My Oracle Support
– Next
Download Software Updates
– Skip software updates
– Next
Select Installation Option
– Install database software only
– Next
Grid Installation Options
– Single instance database installation
– Next
Select Prduct Languages
– English
– Next
Select Database Edition
– Enterprise Edition (4.5GB)
– Next
Specify Installation Location
– Oracle Base: /u01/app/oracle
– Software Location: /u01/app/oracle/product/11.2.0/dbhome_1
– Next
Privileged Operating System Groups
– Database Administrator (OSDBA) Group: dba
– Database Operator (OSOPER) Group (Optional): oper
– Next
Perform Prerequisites checks
You should pass this step without warnings!
Summary
– Click Install
as root run: /u01/app/oracle/product/11.2.0/dbhome_1/root.sh

Create Database with dbca

edit file .bash_profile


#for oracle
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=/usr/lib:$ORACLE_HOME/lib
export SQLPATH=$HOME/scripts

export ORACLE_SID=orcl

1 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

Reload .bash_profile
[oracle@oel62 ~]$ source .bash_profile

Run dbca:
[oracle@oel62 ~]$ dbca

Step through the create database dialoge:

Database Configuration Assistant: Wecome


– Next
Database Configuration Assistant, Step 1 of 12: Operations
– Create a Database
– Next
Database Configuration Assistant, Step 2 of 12: Database Templates
– General Pupose or Transaction Processing
– Next
Database Configuration Assistant, Step 3 of 12: Database Identification
– Global Database Name: orcl
– SID: orcl
– Next
Database Configuration Assistant, Step 4 of 12: Management Options
– Check Configure Enterprise Manager
– Next
Database Configuration Assistant, Step 5 of 12: Database Credentials
– Use the Same Administrative Password for All Account
– Password: ***
– Confirm Password: ***
– Next
Database Configuration Assistant, Step 6 of 12: Management Options
– Specify storage type and locations for database files
Storage Type: Automatic Storage Management (ASM)
– Use Oracle-Managed Files
Database Area: +DATA
Specify ASMSNMP password specific to ASM: ***

Database Configuration Assistant, Step 7 of 12: Recovery Configuration


– Check Specify Fast Recovery Area
– Fast Recovery Area: +DATA
– Check Enable Archiving
– Next
Database Configuration Assistant, Step 8 of 12: Database Content
– Check Sample Schema
– Next
Database Configuration Assistant, Step 9 of 12: Initialization Parameters
– Next
Database Configuration Assistant, Step 10 of 12: Initialization Parameters
– Next
Database Configuration Assistant, Step 11 of 12: Creation Options
– Finish
Database Configuration Assistant, Step 12 of 12: Confirmation
– Ok

Posted in Oracle | No Comments »

Install Oracle Grid Infrastructure 11.2.0.3.0 for Standalone Server on Oracle Linux 6.2
June 11th, 2012 . by admin

Task: Install Oracle Grid Infrastructure for Standalone Server

Oracle Linux Version: 6.2 (2.6.32-300.3.1.el6uek.x86_64)


Oracle Grid Version: 11.2.0.3.0
Storage: using block device UDEV

Steps to setup

Create a VM machine
Install Oracle Enterprise Linux 6.2
Install oracle-rdbms-server-11gr2-preinstall

2 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

Create user grid and directories


Setup ASM disks with UDEV
Install Oracle Grid Infrastructure
Verify Test

Create user grid and directories

User oracle, group oinstall, dba are ready created by oracle-rdbms-server-11gr2-preinstall:


# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba)

# id grid
id: grid: No such user

# cat /etc/group
..
oinstall:x:54321:
dba:x:54322:oracle

Add this new groups:


# groupadd oinstall
# groupadd dba
# groupadd oper
# groupadd asmadmin
# groupadd asmdba
# groupadd asmoper

Create new user grid:


# useradd -g oinstall -G asmadmin,asmdba,asmoper,dba -c "Grid Infrastructure Owner" grid

Modify user oracle:


# usermod -G dba,oper,asmdba -c "Database Owner" oracle

Result:
# id grid
uid=54322(grid) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54324(asmadmin),54325(asmdba),54326(asmoper)

# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54325(asmdba)

Note: User grid must be put on secondary group dba and


user oracle must be put on secondary group asmdba

Create directories:

# mkdir -p /u01/app/grid
# chown -R grid:oinstall /u01

# mkdir -p /u01/app/oracle
# chown oracle:oinstall /u01/app/oracle

# chmod -R 775 /u01

Setup ASM disks with UDEV

add 2 new disks each size 20GB.

Setting..Add Hardware Wizard->Hard Disk->Next


->Create a new virtual disk->Next
->SCSI, Independent, Persistent->Next
->Maximum disk size: 20, Store virtual disk as single file->Next
-Finish

Open file .vmx, add this parameters:


disk.locking = "FALSE"
disk.EnableUUID = "TRUE"

why?

3 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

Save and power on the machine!

Create partitions:
[root@oel62 ~]# ls /dev/sd*
/dev/sda /dev/sda1 /dev/sda2 /dev/sdb /dev/sdc

[root@oel62 ~]# fdisk /dev/sdb


(press: n, p, 1, Enter, Enter, w)

[root@oel62 ~]# fdisk /dev/sdc


(press: n, p, 1, Enter, Enter, w)

[root@oel62 ~]# ls /dev/sd*


/dev/sda /dev/sda1 /dev/sda2 /dev/sdb /dev/sdb1 /dev/sdc /dev/sdc1

What is the SCSI ID?


[root@oel62 ~]# scsi_id -g -u -d /dev/sdb
36000c29c01f099da587bf90861741b19

[root@oel62 ~]# scsi_id -g -u -d /dev/sdc


36000c2917d51599b3f027d6975551f13

Wenn you see nothing here, see here

Create file /etc/udev/rules.d/99-oracle-asmdevices.rules with this 2 lines


KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent",
RESULT=="36000c29c01f099da587bf90861741b19", NAME="asm-disk1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent",
RESULT=="36000c2917d51599b3f027d6975551f13", NAME="asm-disk2", OWNER="grid", GROUP="asmadmin", MODE="0660"

Test:
udevadm test /block/sdb/sdb1
udevadm test /block/sdc/sdc1

Reload and start udev


# udevadm control --reload-rules
# start_udev
Starting udev: [ OK ]

Result:
# ls -l /dev/asm-*
brw-rw---- 1 root root 8, 17 Jun 6 12:33 /dev/asm-disk1
brw-rw---- 1 root root 8, 33 Jun 6 12:33 /dev/asm-disk2

Install Oracle Grid Infrastructure


[root@oel62 ~]# xhost +
access control disabled, clients can connect from any host

[root@oel62 ~]# su - grid


[grid@oel62 ~]$ cd /mnt/hgfs/soft/oracle-11.2.0.3.0-linux86-64/grid/
[grid@oel62 database]$ ./runInstaller &

Step through the install dialog with this choice:

Download Software Updates


- Skip software updates

Select Installation Option


- Configure Grid Insfrastructur for Standalone Server

Select Product Languages


– English

Create ASM diskgroup


– Disk Group Name: DATA
– Redundancy: External
– Change Discovery Path: /dev/asm*
– Choose /dev/asm-disk1

4 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

– Choose /dev/asm-disk2

Specify ASM Password


– Use same passwords for these account

Privileged Operating System Group


– Oracle ASM DBA (OSDBA for ASM) Group: asmdba
– Oracle ASM Operator (OSOPER for ASM) Group (Optional): asmoper
– Oracle ASM Administrator (OSASM) Group: asadmin

Specifiy Installation Location


– Oracle Base: /u01/app/grid
– Software Location: /u01/app/grid/product/11.2.0/grid

Create Inventory
– Inventory Directory: /u01/app/oraInventory

Perfom Prerequisite Checks


You will pass all prerequisite checks, but when something are required,
as root run: /tmp/CVU_11.2.0.1.0_grid/runfixup.sh
(Ignore all waring about missing package, click button Ignore all and Next..)

At the end of the installation, run script:


[root@oel62 ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.


The execution of the script is complete.

[root@oel62 ~]# /u01/app/grid/product/11.2.0/grid/root.sh


Performing root user operation for Oracle 11g

The following environment variables are set as:


ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/grid/product/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:


Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...

Creating /etc/oratab file...


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 script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'grid', 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 oel62 successfully pinned.
Adding Clusterware entries to upstart

oel62 2012/06/06 15:43:38 /u01/app/grid/product/11.2.0/grid/cdata/oel62/backup_20120606_154338.olr


Successfully configured Oracle Grid Infrastructure for a Standalone Server
[root@oel62 ~]#

Add to .bash_profile:
#for grid
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/grid
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=/usr/lib:$ORACLE_HOME/lib
export SQLPATH=$HOME/scripts

export ORACLE_SID=+ASM

Reload .bash_profile:
$ source .bash_profile

5 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

Verify Test
[grid@oel62 ~]$ asmcmd -p
ASMCMD [+] > lsdsk -p
Group_Num Disk_Num Incarn Mount_Stat Header_Stat Mode_Stat State Path
1 0 3915997341 CACHED MEMBER ONLINE NORMAL /dev/asm-disk1
1 1 3915997340 CACHED MEMBER ONLINE NORMAL /dev/asm-disk2
ASMCMD [+] > exit

[grid@oel62 ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Wed Jun 6 16:21:41 2012

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Automatic Storage Management option

select instance_name, status from v$instance;

INSTANCE_NAME STATUS
---------------- ------------
+ASM STARTED

[grid@oel62 ~]$ srvctl status asm


ASM is running on oel62

[grid@oel62 ~]$ srvctl status diskgroup -g DATA


Disk Group DATA is running on oel62

[grid@oel62 ~]$ srvctl status listener


Listener LISTENER is enabled
Listener LISTENER is running on node(s): oel62

Posted in Oracle | No Comments »

Install oracle-rdbms-server-11gR2-preinstall
June 5th, 2012 . by admin

Download oracle-rdbms-server-11gR2-preinstall-1.0-3.el6.x86_64.rpm manual from


http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64 or direct via wget
# cd /tmp
# wget http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/oracle-rdbms-server-11gR2-preinstall-1.0-3.el6.x86_64.rpm

Install:
# yum install oracle-rdbms-server-11gR2-preinstall-1.0-3.el6.x86_64.rpm

Files affected: /etc/sysctl.conf, /etc/security/limits.conf, /boot/grub/menu.lst.


(see rpm -qi oracle-rdbms-server-11gR2-preinstall)

Default created group user and group:


# cat /etc/group
..
oinstall:x:54321:
dba:x:54322:oracle

# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba)

more see:
http://oss.oracle.com/pipermail/el-errata/2012-March/002727.html

Posted in Oracle | No Comments »

Location of Oracle archive log files


May 21st, 2012 . by admin

There are 3 possible locations for Oracle archive log files:

inside of FRA (Oracle default)


outside of FRA

6 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

in $ORACLE_HOME/dbs/arch

1. Store archive log files inside FRA

This is the Oracle default

Enable archive log:


SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database archivelog;
SQL> alter database open;

Default Oracle store archive log in FRA:


SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 9
Next log sequence to archive 11
Current log sequence 11

This mean also: the destination for archive log is USE_DB_RECOVERY_FILE_DEST


and DB_RECOVERY_FILE_DEST is:
SQL> show parameter DB_RECOVERY_FILE_DEST

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /u01/app/oracle/fast_recovery_area
db_recovery_file_dest_size big integer 4122M

now let create a archive log


SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;

a archive log is created in:


$ find /u01/app/oracle/fast_recovery_area/
..
/u01/app/oracle/fast_recovery_area/DWH/archivelog
/u01/app/oracle/fast_recovery_area/DWH/archivelog/2012_05_20
/u01/app/oracle/fast_recovery_area/DWH/archivelog/2012_05_20/o1_mf_1_10_7vktd9mk_.arc
..

you see it in view V$ARCHIVED_LOG:


SQL> select name, sequence# from V$ARCHIVED_LOG;
NAME SEQUENCE#
------------------------------------------------------------------------------------------ ----------
/u01/app/oracle/fast_recovery_area/DWH/archivelog/2012_05_20/o1_mf_1_10_7vktd9mk_.arc 10

Note:
When archive log store in FRA, the filenames are managed by Oracle, NOT base on LOG_ARCHIVE_FORMAT!
A self defined format filename for log archive (in FRA) is not possible

SQL> select dest_name ,destination ,status ,binding from v$archive_dest

DEST_NAME DESTINATION STATUS BINDING


=================== ========================= ======== =========
LOG_ARCHIVE_DEST_1 USE_DB_RECOVERY_FILE_DEST VALID MANDATORY
..

2. Store archive log files outside of FRA

Make a directory for log archive files:


$ mkdir /u01/app/oracle/oradata/dwh/archive

and this 2 parameter must be set:


SQL> alter system set log_archive_dest_1='location=/u01/app/oracle/oradata/dwh/archive' scope=both;
SQ> alter system set log_archive_format='%t_%s_%r.arc' scope=spfile;

7 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

where:

%t : Thread number
%s : Log sequence number
%r : Resetlogs ID associated with the archived redo log.

Enable arhive log:


SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database archivelog;
SQL> alter database open;

SQL> archive log list


Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/oradata/dwh/archive
Oldest online log sequence 8
Next log sequence to archive 10
Current log sequence 10

The Archive destination is outside of FRA: /u01/app/oracle/oradata/dwh/archive

Now let create a archive log


SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;

No archive log found in FRA:


[oracle@oel62 ~]$ find /u01/app/oracle/fast_recovery_area/
..
/u01/app/oracle/fast_recovery_area/DWH/onlinelog
..

But a new archive log is found in:


[oracle@oel62 ~]$ ls -l /u01/app/oracle/oradata/dwh/archive/
total 31248
-rw-r----- 1 oracle oinstall 31ou995392 May 20 15:55 1_10_783258072.arc

and in V$ARCHIVED_LOG:
SQL> select name, sequence#, resetlogs_id from V$ARCHIVED_LOG;

NAME SEQUENCE# RESETLOGS_ID


------------------------------------------------------------ ---------- ------------
/u01/app/oracle/oradata/dwh/archive/1_10_783258072.arc 10 783258072

783258072 is RESETLOGS_ID and can be found per:


SQL> select resetlogs_id from v$database_incarnation
where incarnation# = (select max(incarnation#) from v$database_incarnation);

RESETLOGS_ID
------------
783258072

3. Store archive log files in $ORACLE_HOME/dbs/arch

If FRA is disabled and parameter log_archive_dest_1 is not specified then store Oracle archive log files in
$ORACLE_HOME/dbs/arch

Disable FRA:
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='' SCOPE=BOTH SID='*';

System altered.

and parameter log_archive_dest_1 is not set:


SQL> show parameter log_archive_dest_1

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------

8 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

log_archive_dest_1 string
...

and with default log_archive_format:


SQL> show parameter log_archive_format

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
log_archive_format string %t_%s_%r.dbf

Now enable archive log:


SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database archivelog;
SQL> alter database open;

SQL> archive log list


Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch
Oldest online log sequence 8
Next log sequence to archive 10
Current log sequence 10

Make directory arch:


$ mkdir /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch

Create a archive log:


SQL> alter system archive log current;

System altered.

Result:
SQL> select name from v$archived_log;

NAME
--------------------------------------------------------------------
/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch/1_10_783258072.dbf

Posted in Oracle | No Comments »

Setup Oracle ASM disk using block device UDEV


May 16th, 2012 . by admin

TASK: Create a ASM diskgroup with 2 disks using block device UDEV

add 2 new disks:


[root@rac1 ~]# ls -l /dev/sdb /dev/sdc
brw-r----- 1 root disk 8, 16 May 15 11:08 /dev/sdb
brw-r----- 1 root disk 8, 32 May 15 11:08 /dev/sdc

Create partition:

# fdisk /dev/sdb
# fdisk /dev/sdc

Press ‘n’ for add a new partition, ‘p’ for primary partition, ’1′ for Partition number,
Enter for default first/last cylinder, ‘w’ for write partition table

Get the SCSI UID

[root@rac1 ~]# scsi_id -g -u -s /block/sdb/sdb1


36000c297c65fe681b4d2f5224f35d280
[root@rac1 ~]# scsi_id -g -u -s /block/sdc/sdc1
36000c29b69a4f6a08d1318471c17d92e
[root@rac1 ~]#

9 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

Create udev rules

Create file /etc/udev/rules.d/99-oracle-asmdevices.rules


KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p",
RESULT=="36000c297c65fe681b4d2f5224f35d280", NAME="myasm-disk1",
OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p",
RESULT=="36000c29b69a4f6a08d1318471c17d92e", NAME="myasm-disk2",
OWNER="grid", GROUP="asmadmin", MODE="0660"

Test with udevtest


[root@rac1 ~]# udevtest /block/sdb/sdb1
main: looking at device '/block/sdb/sdb1' from subsystem 'block'
udev_rules_get_name: add symlink 'disk/by-id/scsi-36000c297c65fe681b4d2f5224f35d280-part1'
udev_rules_get_name: add symlink 'disk/by-path/pci-0000:00:10.0-scsi-0:0:1:0-part1'
run_program: '/lib/udev/vol_id --export /dev/.tmp-8-17'
run_program: '/lib/udev/vol_id' returned with status 4
run_program: '/sbin/scsi_id -g -u -s /block/sdb/sdb1'
run_program: '/sbin/scsi_id' (stdout) '36000c297c65fe681b4d2f5224f35d280'
run_program: '/sbin/scsi_id' returned with status 0
udev_rules_get_name: rule applied, 'sdb1' becomes 'myasm-disk1'
udev_device_event: device '/block/sdb/sdb1' already in database, validate currently present symlinks
udev_node_add: creating device node '/dev/myasm-disk1', major = '8', minor = '17', mode = '0660', uid = '501', gid = '1300'
udev_node_add: creating symlink '/dev/disk/by-id/scsi-36000c297c65fe681b4d2f5224f35d280-part1' to '../../myasm-disk1'
udev_node_add: creating symlink '/dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:1:0-part1' to '../../myasm-disk1'
main: run: 'socket:/org/kernel/dm/multipath_event'
main: run: 'socket:/org/kernel/udev/monitor'
main: run: '/lib/udev/udev_run_devd'
main: run: 'socket:/org/freedesktop/hal/udev_event'
main: run: '/sbin/pam_console_apply /dev/myasm-disk1 /dev/disk/by-id/scsi-36000c297c65fe681b4d2f5224f35d280-part1 /dev/disk/by-
path/pci-0000:00:10.0-scsi-0:0:1:0-part1'
[root@rac1 ~]#

[root@rac1 ~]# udevtest /block/sdc/sdc1


..
udev_rules_get_name: rule applied, 'sdc1' becomes 'myasm-disk2'
....

Restart udev

# udevcontrol reload_rules
# start_udev

List disks:
[root@rac1 ~]# ls -l /dev/my*
brw-rw---- 1 grid asmadmin 8, 17 May 15 11:36 /dev/myasm-disk1
brw-rw---- 1 grid asmadmin 8, 33 May 15 11:36 /dev/myasm-disk2

It seem correct with ownership and permissions. The rules are correct applied.

Create diskgroup
CREATE DISKGROUP block_dg EXTERNAL REDUNDANCY
DISK '/dev/myasm-disk1' name myasm1, '/dev/myasm-disk2' name myasm2;

CREATE DISKGROUP block_dg EXTERNAL REDUNDANCY


2 DISK '/dev/myasm-disk1' name myasm1, '/dev/myasm-disk2' name myasm2;
CREATE DISKGROUP block_dg EXTERNAL REDUNDANCY
*
ERROR at line 1:
ORA-15018: diskgroup cannot be created
ORA-15031: disk specification '/dev/myasm-disk2' matches no disks
ORA-15014: path '/dev/myasm-disk2' is not in the discovery set
ORA-15031: disk specification '/dev/myasm-disk1' matches no disks
ORA-15014: path '/dev/myasm-disk1' is not in the discovery set

Change Parameter asm_diskstring

Before:
SQL> show parameter asm_diskstring

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------

10 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

asm_diskstring string

SQL> select name, label, mount_status, header_status, path from v$asm_disk;

NAME LABEL MOUNT_S HEADER_STATU PATH


-------------------- -------------------- ------- ------------ --------------------
V1 V1 CACHED MEMBER ORCL:V1
V2 V2 CACHED MEMBER ORCL:V2
V3 V3 CACHED MEMBER ORCL:V3

SQL> ALTER SYSTEM SET asm_diskstring ='ORCL:*','/dev/myasm*' SCOPE=both SID='*';

Note:
‘ORCL:*’ mean all disks, which are stamped by ASMLib (oracleasm createdisk …)
asm_diskstring with null string ” is equivalent as ‘ORCL:*’

After:
SQL> show parameter asm_diskstring

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
asm_diskstring string ORCL:*, /dev/myasm*

SQL> select name, label, mount_status, header_status, path from v$asm_disk;

NAME LABEL MOUNT_S HEADER_STATU PATH


-------------------- -------------------- ------- ------------ --------------------
CLOSED FORMER /dev/myasm-disk2
CLOSED FORMER /dev/myasm-disk1
V1 V1 CACHED MEMBER ORCL:V1
V2 V2 CACHED MEMBER ORCL:V2
V3 V3 CACHED MEMBER ORCL:V3

Run create diskgroup again:


CREATE DISKGROUP block_dg EXTERNAL REDUNDANCY
2 DISK '/dev/myasm-disk1' name myasm1, '/dev/myasm-disk2' name myasm2;

Diskgroup created.

SQL> select name, label, mount_status, header_status, path from v$asm_disk;

NAME LABEL MOUNT_S HEADER_STATU PATH


-------------------- -------------------- ------- ------------ --------------------
V1 V1 CACHED MEMBER ORCL:V1
V2 V2 CACHED MEMBER ORCL:V2
V3 V3 CACHED MEMBER ORCL:V3
MYASM2 CACHED MEMBER /dev/myasm-disk2
MYASM1 CACHED MEMBER /dev/myasm-disk1

Posted in Linux, Oracle | No Comments »

Setup Oracle ASM disk with loopback device file


May 12th, 2012 . by admin

TODO: Create a ASM diskgroup using loopback device files

Creat the files

# mkdir /asmdisks

# dd if=/dev/zero of=/asmdisks/disk1 bs=1k count=30000


# dd if=/dev/zero of=/asmdisks/disk2 bs=1k count=30000

mean: writes 30000 blocks of 1k(or 1024bytes), also 30000×1024 bytes of binary zeros into the file /asmdisks/disk1
# ls -lh
total 587M
-rw-r--r-- 1 root root 293M May 12 22:08 disk1
-rw-r--r-- 1 root root 293M May 12 22:08 disk2

11 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

Setup lopback devices

# losetup /dev/loop1 /asmdisks/disk1


# losetup /dev/loop2 /asmdisks/disk2

List:
# losetup -a
/dev/loop1: [fd00]:684796 (/asmdisks/disk1)
/dev/loop2: [fd00]:684797 (/asmdisks/disk2)

Stamp the disks with ASMLib

# oracleasm createdisk LO_DISK1 /dev/loop1


# oracleasm createdisk LO_DISK2 /dev/loop2

Create diskgroup

SQL> sqlplus / as sysasm


SQL> CREATE DISKGROUP loop_dg EXTERNAL REDUNDANCY
DISK 'ORCL:LO_DISK1' name loop_disk1,
'ORCL:LO_DISK2' name loop_disk2;

Diskgroup created.

SQL> select a.name, b.name, b.path


from v$asm_diskgroup a, v$asm_disk b
where a.name = 'LOOP_DG'
and a.group_number=b.group_number;

NAME NAME PATH


-------------------- -------------------- --------------------
LOOP_DG LOOP_DISK1 ORCL:LO_DISK1
LOOP_DG LOOP_DISK2 ORCL:LO_DISK2

Posted in Linux, Oracle | No Comments »

Setup Oracle ASM disk using RAW device


April 26th, 2012 . by admin

The question is exm: How can i create a new ASM diskgroup with 2 disks using raw device?

Add 3 new virtual disks

Create partition

Create 1 new primary partition for each disk:


fdisk /dev/sdf

“n” : new partition


“p” : primary partition
“1″ : 1. partittion
Enters: accept all default
“w” : write
fdisk /dev/sdg

fdisk /dev/sdh

Binding raw devices

Edit file /etc/sysconfig/rawdevices


# raw device bindings
# format:
#
# example: /dev/raw/raw1 /dev/sda1
# /dev/raw/raw2 8 5
/dev/raw/raw1 /dev/sdf1

12 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

/dev/raw/raw2 /dev/sdg1
/dev/raw/raw3 /dev/sdh1

Restart service

service rawdevices restart

Change owner, permissions

add this to /etc/rc.local


chown grid:oinstall /dev/raw/raw1
chown grid:oinstall /dev/raw/raw2
chmod 664 /dev/raw/raw1
chmod 664 /dev/raw/raw2

Note: the file permission should be 664 but not 600, when you use job role separation (user grid and oracle).
With permission 600 you get privilege problem when create database (with user oracle) on this raw device.

List raw devices

[root@oel57 ~]# raw -a


/dev/raw/raw1: bound to major 8, minor 81
/dev/raw/raw2: bound to major 8, minor 97
/dev/raw/raw3: bound to major 8, minor 113

[root@oel57 ~]# ls -l /dev/raw


total 0
crw-rw-r-- 1 grid oinstall 162, 1 Apr 25 14:41 raw1
crw-rw-r-- 1 grid oinstall 162, 2 Apr 25 14:41 raw2
crw-rw-r-- 1 grid oinstall 162, 3 Apr 25 14:41 raw3

Test

create diskgroup:
[grid@oel57 ~]$ sqlplus / as sysasm
SQL> CREATE DISKGROUP raw_dg EXTERNAL REDUNDANCY DISK
'/dev/raw/raw1' name raw_disk1,
'/dev/raw/raw2' name raw_disk2,
'/dev/raw/raw3' name raw_disk3;

SQL> select a.name, b.name, b.path


from v$asm_diskgroup a, v$asm_disk b
where a.name = 'RAW_DG'
and a.group_number=b.group_number;
NAME NAME PATH
-------------------- -------------------- ------------------------------
RAW_DG RAW_DISK2 /dev/raw/raw2
RAW_DG RAW_DISK3 /dev/raw/raw3
RAW_DG RAW_DISK1 /dev/raw/raw1

now you can exm. run dbca to create a new database storing in this ASM diskgroup

Posted in Oracle | No Comments »

Setup DNS for SCAN used in Oracle RAC 11gR2


April 24th, 2012 . by admin

Create for example a VM machine named mydns and install following:

Need RPMs

[root@mydns ~]# rpm -qa | grep bind


ypbind-1.19-12.el5_6.1
bind-9.3.6-16.P1.el5
bind-utils-9.3.6-16.P1.el5
bind-libs-9.3.6-16.P1.el5

13 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

/etc/named.conf

# minimal DNS conf file for RAC 11g

options {
//i Forward any name this DNS can't resolve to my router.
forwarders { 192.168.80.2; };

// Directory where named will look for zone files.


directory "/var/named";
};

# Forward Zone
zone "mydom.com" IN {
type master;
file "mydom.com.zone";
allow-update { none; };
};

# Reverse Zone
zone "80.168.192.in-addr.arpa" IN {
type master;
file "80.168.192.zone";
allow-update { none; };
};

Overview

Server DNS RAC node 1 RAC node 2


Public Name mydns.mydom.com rac1.mydom.com rac2.mydom.com
Private Name - rac1-priv.mydom.com rac2-priv.mydom.com
VIP Name - rac1-vip.mydom.com rac2-vip.mydom.com
Public IP – eth0 192.168.80.140 192.168.80.151 192.168.80.152
VIP IP – eth0:1 - 192.168.80.171 192.168.80.172
Private IP – eth1 - 192.168.136.151 192.168.136.152

SCAN Adresse FQN Shortname


192.168.80.201 rac-scan.mydom.com rac-scan
192.168.80.202 rac-scan.mydom.com rac-scan
192.168.80.203 rac-scan.mydom.com rac-scan

Zone file /etc/named/mydom.com.zone

$ORIGIN mydom.com.
$TTL 1D ; time-to-live - (1 day)

@ IN SOA mydns.mydom. master.mydom.com. (


201011021 ; serial number - (yyyymmdd+s)
1d ; refresh - (1 day)
1h ; retry - (1 hour)
1w ; expire - (1 week)
60 ; minimum - (1 minute)
)
;
@ NS mydns ; mydns.mydom.com is the name server

localhost A 127.0.0.1

; RAC nodes
rac1 A 192.168.80.151
rac2 A 192.168.80.152
rac1-vip A 192.168.80.171
rac2-vip A 192.168.80.172
rac1-priv A 192.168.136.151
rac2-priv A 192.168.136.152

; DNS
mydns A 192.168.80.140

; SCAN - Single Client Access Name


rac-scan A 192.168.80.201
rac-scan A 192.168.80.202
rac-scan A 192.168.80.203

Reverse zone file /etc/named/80.168.192.zone

$ORIGIN 80.168.192.in-addr.arpa.
$TTL 1D ; time-to-live - (1 day)

14 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

@ IN SOA mydns.mydom. master.mydom.com. (


201011021 ; serial number - (yyyymmdd+s)
1d ; refresh - (1 day)
1h ; retry - (1 hour)
1w ; expire - (1 week)
60 ; minimum - (1 minute)
)
;
@ NS mydns ; mydns.mydom.com is the name server

; RAC nodes
151 PTR rac1.mydom.com.
152 PTR rac2.mydom.com.

; RAC-VIP nodes
171 PTR rac1-vip.mydom.com.
172 PTR rac1-vip.mydom.com.

; DNS server
40 PTR mydns.mydom.com.

; SCAN - Single Client Access Name


201 PTR rac-scan.mydom.com.
202 PTR rac-scan.mydom.com.
203 PTR rac-scan.mydom.com.

/etc/resolv.conf (in DNS machine)

[root@mydns ~]# cat /etc/resolv.conf


nameserver 127.0.0.1
search mydom.com

Check config file

[root@mydns ~]# named-checkconf /etc/named.conf

[root@mydns ~]# named-checkzone mydom.com /var/named/mydom.com.zone


zone mydom.com/IN: loaded serial 201011021
OK

[root@mydns ~]# named-checkzone 80.168.192.in-addr.arpa /var/named/80.168.192.zone


zone 80.168.192.in-addr.arpa/IN: loaded serial 201011021
OK
[root@mydns ~]#

Run service named

[root@mydns ~]# service named start


Starting named: [ OK ]
[root@mydns ~]#

/etc/resolv.conf (in a RAC Node)

[root@rac1 ~]# cat /etc/resolv.conf


nameserver 192.168.80.140
search mydom.com
[root@rac1 ~]#

Test

[root@rac1 ~]# nslookup rac1


Server: 192.168.80.140
Address: 192.168.80.140#53

Name: rac1.mydom.com
Address: 192.168.80.151

[root@rac1 ~]# nslookup rac1-vip


Server: 192.168.80.140
Address: 192.168.80.140#53

Name: rac1-vip.mydom.com
Address: 192.168.80.171

15 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

[root@rac1 ~]# nslookup rac-scan


Server: 192.168.80.140
Address: 192.168.80.140#53

Name: rac-scan.mydom.com
Address: 192.168.80.201
Name: rac-scan.mydom.com
Address: 192.168.80.202
Name: rac-scan.mydom.com
Address: 192.168.80.203

[root@rac1 ~]# nslookup rac-scan


Server: 192.168.80.140
Address: 192.168.80.140#53

Name: rac-scan.mydom.com
Address: 192.168.80.203
Name: rac-scan.mydom.com
Address: 192.168.80.201
Name: rac-scan.mydom.com
Address: 192.168.80.202

Note: nslookup must return 3 IPs in a different order each time

[root@rac1 ~]# dig rac-scan.mydom.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>> rac-scan.mydom.com


;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10628
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;rac-scan.mydom.com. IN A

;; ANSWER SECTION:
rac-scan.mydom.com. 86400 IN A 192.168.80.202
rac-scan.mydom.com. 86400 IN A 192.168.80.203
rac-scan.mydom.com. 86400 IN A 192.168.80.201

;; AUTHORITY SECTION:
mydom.com. 86400 IN NS mydns.mydom.com.

;; ADDITIONAL SECTION:
mydns.mydom.com. 86400 IN A 192.168.80.140

;; Query time: 0 msec


;; SERVER: 192.168.80.140#53(192.168.80.140)
;; WHEN: Tue Apr 24 10:56:49 2012
;; MSG SIZE rcvd: 120

[root@rac1 ~]# dig -x 192.168.80.203

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>> -x 192.168.80.203


;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56995
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;203.80.168.192.in-addr.arpa. IN PTR

;; ANSWER SECTION:
203.80.168.192.in-addr.arpa. 86400 IN PTR rac-scan.mydom.com.

;; AUTHORITY SECTION:
80.168.192.in-addr.arpa. 86400 IN NS mydns.80.168.192.in-addr.arpa.

;; Query time: 0 msec


;; SERVER: 192.168.80.140#53(192.168.80.140)
;; WHEN: Tue Apr 24 10:57:14 2012
;; MSG SIZE rcvd: 97

[root@rac1 ~]#

Link:
http://www.oracle.com/technetwork/products/clustering/overview/scan-129069.pdf

Posted in Oracle | No Comments »

ACFS – Automatically loading Oracle ACFS driver


April 18th, 2012 . by admin

- ACFS driver is not automatically loaded in Oracle Restart(Grid Infrastructur for standalone server)

16 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

see http://docs.oracle.com/cd/E14072_01/server.112/e10500/asmfs_extra.htm#CACBDGCC

- to correctly install of ACFS see: work arround

Before:
[root@oel57 ~]# lsmod | grep oracle
oracleasm 46356 1
[root@oel57 ~]#

You don’t see anything with ACFS!

TODO:
Creata a file acfsload
[root@oel57 ~]# vi /etc/init.d/acfsload

#!/bin/sh

# chkconfig: 2345 30 21
# description: Load Oracle ACFS drivers at system boot
/u01/app/grid/product/11.2.0/grid/bin/acfsload start -s

Note:
chkconfig: 2345 30 21: mean run in levels 2,3,4,5 start priority 30, stop priority 21
see: http://tldp.org/HOWTO/HighQuality-Apps-HOWTO/boot.html

[root@oel57 ~]# chmod u+x /etc/init.d/acfsload


[root@oel57 ~]# chkconfig --add acfsload
[root@oel57 ~]#
[root@oel57 ~]# reboot

After:
[root@oel57 ~]# lsmod | grep oracle
oracleacfs 787460 0
oracleadvm 177792 0
oracleoks 226656 2 oracleacfs,oracleadvm
oracleasm 46356 1
[root@oel57 ~]#

Test:
[root@oel57 ~]# su - grid

[grid@oel57 ~]$ acfsdriverstate version


ACFS-9205: OS/ADVM,ACFS installed version = 2.6.18-8.el5(i386)/090715.1

[grid@oel57 ~]$ acfsdriverstate supported


ACFS-9200: Supported

[grid@oel57 ~]$ acfsdriverstate loaded


ACFS-9203: true

[grid@oel57 ~]$ acfsdriverstate installed


ACFS-9203: true

Posted in Oracle | No Comments »

User grid on dba group?


April 18th, 2012 . by admin

when install Oracle Grid Infrastructure, exactly when run script:

/u01/app/grid/product/11.2.0/grid/root.sh

you can may be got:


PRCR-1079 : Failed to start resource ora.orcl.db
ORA-01031: insufficient privileges
ORA-01031: insufficient privileges
CRS-2674: Start of 'ora.orcl.db' on 'pc5' failed

TODO:

17 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

Put user grid in secondary group dba, run:


usermod -G asmadmin,asmdba,asmoper,dba grid

Before:
[root@pc5 ~]# id grid
uid=501(grid) gid=1000(oinstall) groups=1000(oinstall),1300(asmadmin),1400(asmdba),1500(asmoper)

Run:
[root@pc5 ~]# usermod -G asmadmin,asmdba,asmoper,dba grid

After:
[root@pc5 ~]# id grid
uid=501(grid) gid=1000(oinstall) groups=1000(oinstall),1100(dba),1300(asmadmin),1400(asmdba),1500(asmoper)

and runInstaller again!

Posted in Oracle | 3 Comments »

« Previous Entries Next Entries »

Search this blog:

Recent Posts:
Create Oracle user using OS Authentication
Duplicate database to a remote server from active database
Duplicate Oracle database on the same server
RMAN – Multisection Backups
Installing VMWare Tools on Debian 6 (squeeze)
ORA-00214: inconsistent control files
Multiplex control files in ASM
Move Oracle database from filesystem to ASM
What mean: SWITCH DATABASE TO COPY?
ORA-15025, ORA-27041 and setasmgidwrap

Topics:
Else (7)
IT (2)
Java (13)
Oracle (128)
Uncategorized (2)
Unix (43)
Linux (37)
Debian (9)
VMWare (25)

Archives:
August 2012 (3)
July 2012 (4)
June 2012 (10)
May 2012 (9)
April 2012 (6)
March 2012 (1)
December 2011 (3)
November 2011 (4)
August 2011 (4)

18 of 19 7/23/2014 6:28 PM
d-h-n.de » Oracle http://d-h-n.de/blog/category/oracle/page/2

July 2011 (5)


January 2011 (2)
December 2010 (1)
November 2010 (5)
October 2010 (3)
September 2009 (2)
August 2009 (3)
July 2009 (8)
June 2009 (10)
May 2009 (12)
April 2009 (20)
March 2009 (3)
January 2009 (5)
December 2008 (15)
November 2008 (2)
October 2008 (2)
July 2008 (11)
June 2008 (14)
May 2008 (8)
April 2008 (8)
March 2008 (7)
January 2008 (2)

Links:
10g Documentation
11g Documentation

Pages:
Home Page
About
All Posts

Meta:
Log in

Visitor locations:

© Copyright 2007 The Blog Mill and JTk, All Rights Reserved Except Where Explicitly Stated

19 of 19 7/23/2014 6:28 PM

You might also like