Saturday, October 30, 2021

Oracle Orion and IO Calibrate -- Check IO efficiency

 

Oracle  Orion - ORacle I/O Numbers

Since Oracle 11g, the Oracle ORION package has bee shipped within the Oracle Database and Grid Infrastructure binaries $ORACLE_HOME/bin/orion and requires no downloads and only minimal set-up, so is really easy to be get started quickly.


NOTE: orion requires you to provide a full path e.g. $ORACLE_HOME/bin/orion , if you try to call without providing a full path orion will return an ORA-56727 error.


Setting-Up Orion
Now we have prepared and presented our storage we can configure Orion, by default Orion looks for orion.lun, you can also use alternative configuration files by using the testname switch. (Example bellow)

[oracle@z-oracle orion_test]$ cat orion.lun 
/dev/mapper/orion-vol1
/dev/mapper/orion-vol2
/dev/mapper/orion-vol3
/dev/mapper/orion-vol4
/dev/mapper/orion-vol5



Orion support 5 types of workload tests Simple, Normal, Advanced, DSS and OLTP. (example output from orion -help

   simple   - Tests random small (8K) IOs at various loads,
              then random large (1M) IOs at various loads.
   normal   - Tests combinations of random small (8K) IOs and 
              random large (1M) IOs.
   advanced - Tests the workload specified by the user 
              using optional parameters.
   dss      - Tests with random large (1M) IOs at increasing 
              loads to determine the maximum throughput.
   oltp     - Tests with random small (8K) IOs at increasing 
              loads to determine the maximum IOPS.


For a preliminary set of data
 -run simple 

For a basic set of data
 -run normal 

To evaluate storage for an OLTP database
 -run oltp 

To evaluate storage for a data warehouse
 -run dss 

To generate combinations of 32KB and 1MB reads to random locations
 -run advanced 
 -size_small 32 -size_large 1024 -type rand 
 -matrix detailed

To generate multiple sequential 1MB write streams, simulating RAID0 striping
 -run advanced 
 -simulate RAID0 -write 100 -type seq
 -matrix col -num_small 0




# $ORACLE_HOME/bin/orion -run simple -testname simpletest

# $ORACLE_HOME/bin/orion -run advanced -testname advancedtest -matrix max -num_small 4 -num_large 4 -size_large 512

# $ORACLE_HOME/bin/orion -run oltp -testname oltp_write -write 20

./orion_linux_em64t -run advanced -testname orion1 -num_disks 1 -write 0 -simulate concat -matrix detailed
./orion_linux_em64t -run advanced -testname orion3 -num_disks 3 -write 0 -simulate concat -matrix detailed


%> . ./orion -run oltp -testname test -write 60


I can see TWP was released in 2009 and not updated after that. 
https://support.oracle.com/epmos/main/downloadattachmentprocessor?parent=DOCUMENT&sourceId=810394.1&attachid=810394.1:LTP&clickstream=yes

Please make sure that Orion tool only interact with RAW disk provided by Infra team. If we use write option and provide ASM disk to orion it will corrupt ASM disk. 



#################################
ORION
#################################

Oracle Orion tool:

1) For Predicting the performance of an Oracle database without having to install Oracle or create a database
2) Orion for Oracle Administrators: Oracle administrators can use Orion to evaluate and compare different storage arrays, based on the expected
workloads.
3) Unlike other I/O calibration tools, Oracle Orion is expressly designed for simulating Oracle database I/O workloads using the same
   I/O software stack as Oracle.
4)  Orion can also simulate the effect of striping performed by Oracle Automatic Storage Management
5) Orion can run tests using different I/O loads to measure performance metrics such as MBPS, IOPS, and I/O latency Run Orion when the storage is idle

ORION (ORacle IO Numbers) mimics the type of I/O performed by Oracle databases, 
which allows you to measure I/O performance for storage systems without actually installing Oracle.
It used to be available to download for a number of platforms from OTN, but that download is no longer available. 
Instead, it is included in the "$ORACLE_HOME/bin" directory of Grid Infrastructure (GI) and database installations.
Doing the run using the "normal" option can take a long time, so you may want to try using the "basic" option first.

Orion Command Line Samples
The following provides sample Orion commands for different types of I/O workloads:
To evaluate storage for an OLTP database:
-run oltp
To evaluate storage for a data warehouse:
-run dss
For a basic set of data:
-run normal
To understand your storage performance with read-only, small and large random I/O workload:
$ orion -run simple 
To understand your storage performance with a mixed small and large random I/O workload:
$ orion -run normal 
To generate combinations of 32KB and 1MB reads to random locations:
$ orion -run advanced -size_small 32 -size_large 1024 -type rand -matrix detailed
To generate multiple sequential 1 MB write streams, simulating 1 MB RAID-0 stripes:
$ orion -run advanced -simulate raid0 -stripe 1024 -write 100 -type seq -matrix col -num_small 0
To generate combinations of 32 KB and 1 MB reads to random locations:
 -run advanced -size_small 32 -size_large 1024 -type rand -matrix detailed
To generate multiple sequential 1 MB write streams, simulating RAID0 striping:
 -run advanced -simulate raid0 -write 100 -type seq -matrix col -num_small 0




Create a file to hold the LUN configuration. In this case I will call my test “test”, so my LUN configuration file must be called “test.lun”. It is assumed it is present in the current directory. The file should contain a list of the luns used in the test.
# cat test.lun
/luns/lun1
/luns/lun2
/luns/lun3
/luns/lun4
If you don’t specify a test name, the utility assumes the test is called “orion” and looks for the presence of the “orion.lun” file.
# $ORACLE_HOME/bin/orion -run normal -testname test




#################################
Calibrate I/O 
#################################


Introduced in Oracle Database 11g Release 1, the CALIBRATE_IO procedure gives an idea of the capabilities of the storage system from within Oracle. 
There are a few restrictions associated with the procedure.
The procedure must be called by a user with the SYSDBA priviledge.
TIMED_STATISTICS must be set to TRUE, which is the default when STATISTICS_LEVEL is set to TYPICAL.
Datafiles must be accessed using asynchronous I/O. This is the default when ASM is used.


SELECT d.name,
       i.asynch_io
FROM   v$datafile d,
       v$iostat_file i
WHERE  d.file# = i.file_no
AND    i.filetype_name  = 'Data File';



SET SERVEROUTPUT ON
DECLARE
  l_latency  PLS_INTEGER;
  l_iops     PLS_INTEGER;
  l_mbps     PLS_INTEGER;
BEGIN
   DBMS_RESOURCE_MANAGER.calibrate_io (num_physical_disks => 1, 
                                       max_latency        => 20,
                                       max_iops           => l_iops,
                                       max_mbps           => l_mbps,
                                       actual_latency     => l_latency);
 
  DBMS_OUTPUT.put_line('Max IOPS = ' || l_iops);
  DBMS_OUTPUT.put_line('Max MBPS = ' || l_mbps);
  DBMS_OUTPUT.put_line('Latency  = ' || l_latency);
END;
/






Calibration runs can be monitored using the V$IO_CALIBRATION_STATUS view.
SET LINESIZE 100
COLUMN start_time FORMAT A20
COLUMN end_time FORMAT A20
SELECT TO_CHAR(start_time, 'DD-MON-YYY HH24:MI:SS') AS start_time,
       TO_CHAR(end_time, 'DD-MON-YYY HH24:MI:SS') AS end_time,
       max_iops,
       max_mbps,
       max_pmbps,
       latency,
       num_physical_disks AS disks
FROM   dba_rsrc_io_calibrate;






#################################
Using system views 
#################################



DECLARE
run_duration number := 3600;
capture_gap number := 5;
loop_count number :=run_duration/capture_gap;
rdio number;
wtio number;
prev_rdio number :=0;
prev_wtio number :=0;
rdbt number;
wtbt number;
prev_rdbt number;
prev_wtbt number;
BEGIN s
FOR i in 1..loop_count LOOP
SELECT SUM(value) INTO rdio from gv$sysstat
WHERE name ='physical read total IO requests';
SELECT SUM(value) INTO wtio from gv$sysstat
WHERE name ='physical write total IO requests';
SELECT SUM(value)* 0.000008 INTO rdbt from gv$sysstat
WHERE name ='physical read total bytes';
SELECT SUM(value* 0.000008) INTO wtbt from gv$sysstat
WHERE name ='physical write total bytes';
IF i > 1 THEN
INSERT INTO peak_iops_measurement (capture_timestamp,
total_read_io, total_write_io, total_io, total_read_bytes,
total_write_bytes, total_bytes)
VALUES (sysdate,(rdio-prev_rdio)/5,(wtio-prev_wtio)/5,((rdioprev_rdio)/5)+((wtio-prev_wtio))/5,(rdbt-prev_rdbt)/5,(wtbtprev_wtbt)/5,((rdbt-prev_rdbt)/5)+((wtbt-prev_wtbt))/5);
END IF;
prev_rdio := rdio;
prev_wtio := wtio;
prev_rdbt := rdbt;
prev_wtbt := wtbt;
DBMS_LOCK.SLEEP(capture_gap);
ND LOOP;
COMMIT;
EXCEPTION
 WHEN OTHERS THEN
 ROLLBACK;
END;
/



SELECT SUM(value) , name  from gv$sysstat  WHERE name like 'physical read%'  or name like 'physical write%' group by name  ;
 


#################################
SLOB
#################################



1 comment: