# 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
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.
Hiç yorum yok:
Yorum Gönder