ASM ile asmlib ve raw device performans karsılastırılması

Linux ortamlarda ASM kurulumu ASMlib sofware ve raw devicelar üzerinden yapılabilir.ASMlibte raw deviceslarda aday disklere ihtiyacları vardır. vmware 3 tane 10gb disk olusturalım ilk önce.Birçok teknik dökümanı incelediğimizde ASMlib performans olarak raw deviceslardan iyi oldukaları söylerken bir kısım dokümanda ise bunun aksi idda edilir. Bu durum beni bir karsilaştirma testini yapıp kendime göre sonucaları cıkarmaya itti. Bu teste günlük yaptığımız işlerden olan DML komutlarını baz aldım. bu çalışmada high redundancy kullandım.

# ls sd*
sda sda1 sda2 sdb sdc sdd
# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won’t be recoverable.
The number of cylinders for this disk is set to 1305.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1305, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305):
Using default value 1305
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
#
bu islemi diger iki disk icinde yapalım.

daha sonra asmlib kernal module gecelim.

# /etc/init.d/oracleasm configure
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. The current values
will be shown in brackets (‘[]’). 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
Fix permissions of Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: [ OK ]
Creating /dev/oracleasm mount point: [ OK ]
Loading module “oracleasm”: [ OK ]
Mounting ASMlib driver filesystem: [ OK ]
Scanning system for ASM disks: [ OK ]
#
kernal modulu yukledikten sonra etiket islemini yani label yapalım.
# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1
Marking disk “/dev/sdb1” as an ASM disk: [ OK ]
# /etc/init.d/oracleasm createdisk VOL2 /dev/sdc1
Marking disk “/dev/sdc1” as an ASM disk: [ OK ]
# /etc/init.d/oracleasm createdisk VOL3 /dev/sdd1
Marking disk “/dev/sdd1” as an ASM disk: [ OK ]
#
Eger raw device olacaksa
/etc/sysconfig/rawdevices doyasını edit yapıp asağıdaki değişikleri ekleyelim.

/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdc1
/dev/raw/raw3 /dev/sdd1
rawdevices servisini asagıdaki komutla restart edelim.
service rawdevices restart

/etc/rc.local dosyasını asagıdaki bilgileri ekleyelim.

chown oracle:oinstall /dev/raw/raw1
chown oracle:oinstall /dev/raw/raw2
chown oracle:oinstall /dev/raw/raw3
chmod 600 /dev/raw/raw1
chmod 600 /dev/raw/raw2
chmod 600 /dev/raw/raw3

bundan sonrası klasik asm instance create etme asamasıdır. onuda başka bir yazımda detaylı anlatacağım. test icin yaptıgım sql komutları aşağıdaıdr.

export ORACLE_SID=orcl
sqlplus / as sysdba

CREATE TABLESPACE test_ts;
CREATE USER test_user IDENTIFIED BY test_user
DEFAULT TABLESPACE test_ts QUOTA UNLIMITED ON test_ts;
GRANT CONNECT, CREATE TABLE TO test_user;
CONN test_user/test_user
CREATE TABLE test_tab (
id NUMBER,
data VARCHAR2(4000),
CONSTRAINT test_tablosu_pk PRIMARY KEY (id)
);

SET SERVEROUTPUT ON
DECLARE
l_loops NUMBER := 1000;
l_data VARCHAR2(32767) := RPAD(‘X’, 4000, ‘X’);
l_start NUMBER;
BEGIN
l_start := DBMS_UTILITY.get_time;
FOR i IN 1 .. l_loops LOOP
INSERT INTO test_tab (id, data) VALUES (i, l_data);
COMMIT;
END LOOP;
DBMS_OUTPUT.put_line(‘Inserts (‘ l_loops ‘): ‘ (DBMS_UTILITY.get_time – l_start) ‘ hsecs’);
l_start := DBMS_UTILITY.get_time;
FOR i IN 1 .. l_loops LOOP
UPDATE test_tab
SET data = l_data
WHERE id = i;
COMMIT;
END LOOP;
DBMS_OUTPUT.put_line(‘Updates (‘ l_loops ‘): ‘ (DBMS_UTILITY.get_time – l_start) ‘ hsecs’);
l_start := DBMS_UTILITY.get_time;
FOR i IN 1 .. l_loops LOOP
DELETE FROM test_tab
WHERE id = i;
COMMIT;
END LOOP;
DBMS_OUTPUT.put_line(‘Deletes (‘ l_loops ‘): ‘ (DBMS_UTILITY.get_time – l_start) ‘ hsecs’);
EXECUTE IMMEDIATE ‘TRUNCATE TABLE test_tab’;
END;
/

Bu islemler sayesinde 1000 kere insert,update ve delete yapmış oldum.bu islemleri her iki ortamdada denedikten sonra aşağıdaki sonuca vardık.

Operation ASMLib (hsecs) Raw Devices (hsecs)
============== ============== ===================
Inserts 468 852
Updates 956 1287
Deletes 1281 1995

Bu sonucalar neticesinde asmlib performansının raw devicesdan iyi olduğu fikrine vardım.
Unutulmaması gereken bir konu ise bu testlerin Vmware üzerinde tek sata diskte yapıldıgıdır. Bu durumdan dolayı kesin konusmak çokda mümkün değildir.

Advertisements

About oracledocuments

Zekeriya Beşiroğlu, It joined the Bilginc IT Academy in July 2000. In the meantime, the Oracle Education, Oracle Data Base Management System and Oracle Internet Technologies, Oracle development technologies such as the training of Oracle products is responsible for training as consultants. During this task, since 1 April 2008 with 293 Oracle training in total, in 2150 Oracle customers successfully submitted. Oracle 10g New York in November 2002 have received training and education in Turkey was the first time the consultants. 20 April 2008 on education in Turkey 11g is the first who was a consultant. Oracle Real Application Cluster Expert advisor is certified is the first . Http://zekeriyabesiroglu.blogspot.com and Http://www.oracleforum.info owner and manager of the site. Its own has more than one hundred articles. In addition, creation and improvement of training materials are also related to work. Oracle products are used, database management and reporting Academy eruditely It also is working on. From the date of 1 January 2009 will continue to work as the Technical Director
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s