2026-03-12 20:23:15
This commit is contained in:
35
tpt/lotshparses3.sql
Normal file
35
tpt/lotshparses3.sql
Normal file
@@ -0,0 +1,35 @@
|
||||
-- Copyright 2018 Tanel Poder. All rights reserved. More info at http://tanelpoder.com
|
||||
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
--
|
||||
-- File name: lotshparses3.sql
|
||||
-- Purpose: Generate Lots of hard parses and shared pool activity
|
||||
-- for testing purposes
|
||||
--
|
||||
-- Author: Tanel Poder
|
||||
-- Copyright: (c) http://www.tanelpoder.com
|
||||
--
|
||||
-- Usage: @lotshparses <number>
|
||||
-- @lotshparses 100
|
||||
-- @lotshparses 1000000
|
||||
--
|
||||
-- Other: You probably don't want to run this in production as it can
|
||||
-- fill your shared pool with junk and flush out any useful stuff!
|
||||
--
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
alter session set plsql_optimize_level = 0;
|
||||
|
||||
declare
|
||||
x number;
|
||||
r varchar2(1000);
|
||||
begin
|
||||
for i in 1..&1 loop
|
||||
r := to_char(mod(dbms_random.random,1000));
|
||||
execute immediate 'select count(*) from dba_objects where object_id = '||r into x;
|
||||
execute immediate 'select count(*) from dba_objects where object_id = '||r into x;
|
||||
execute immediate 'select count(*) from dba_objects where object_id = '||r into x;
|
||||
end loop;
|
||||
end;
|
||||
/
|
||||
Reference in New Issue
Block a user