Vous êtes sur la page 1sur 1

LOAD TESTING Written JP Vijaykumar Date 12-12-12 In one of our applications, we need to test heavy sorting operations.

I chose one of the largest tables and ran the following script. In this test case, I had limited the number rows with the condition "where rownu m < 100000". set serverout on size 1000000 timing on declare v_str number:=0; v_opt varchar2(100):=' where rownum<100000 '; --v_opt varchar2(100):=''; --JUST GIVE '' TO COUNT ALL ROWS v_tab varchar2(30):='VEEKSHA'; --CHOOSE A VERY LARGE TABLE IN THE DB v_cmd varchar2(1000):='NULL'; begin execute immediate 'alter session set cursor_sharing=exact'; for c1 in (select column_name,column_id from user_tab_columns where table_name=v _tab order by 2) loop begin --execute immediate 'alter system flush shared_pool'; --execute immediate 'alter system flush buffer_cache'; if (v_cmd = 'NULL') then v_cmd:=c1.column_name; else v_cmd:=c1.column_name||','||v_cmd; end if; execute immediate 'select count(1) from (select '||v_cmd||',count(1) from '||v_t ab||' '||v_opt|| ' group by '||v_cmd||' having count(1) > 0 order by '||v_cmd||')' into v_str; dbms_output.put_line(v_cmd||' '||v_str); exception when others then dbms_output.put_line(v_str||' '||sqlerrm); end; end loop; end; / ............. ............. ............. PL/SQL procedure successfully completed. Elapsed: 00:00:06.66

Vous aimerez peut-être aussi