This repository was archived by the owner on Sep 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocedure.sql
More file actions
79 lines (71 loc) · 2.63 KB
/
procedure.sql
File metadata and controls
79 lines (71 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
--
-- This file is a part of SLOB - The Simple Database I/O Testing Toolkit for Oracle Database
--
-- Copyright (c) 1999-2017 Kevin Closson and Kevin Closson d.b.a. Peak Performance Systems
--
-- The Software
-- ------------
-- SLOB is a collection of software, configuration files and documentation (the "Software").
--
-- Use
-- ---
-- Permission is hereby granted, free of charge, to any person obtaining a copy of the Software, to
-- use the Software. The term "use" is defined as copying, viewing, modifying, executing and disclosing
-- information about use of the Software to third parties.
--
-- Redistribution
-- --------------
-- Permission to redistribute the Software to third parties is not granted. The Software
-- is obtainable from kevinclosson.net/slob. Any redistribution of the Software to third parties
-- requires express written permission from Kevin Closson.
--
-- The copyright notices and permission notices shall remain in all copies of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
-- BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-- USE OR OTHER DEALINGS IN THE SOFTWARE.
WHENEVER OSERROR EXIT FAILURE ;
WHENEVER SQLERROR EXIT SQL.SQLCODE ;
grant execute on sys.dbms_flashback to user1;
create or replace procedure user1.slobupdate (pv_random PLS_INTEGER, pv_work_unit PLS_INTEGER, pv_redo_stress VARCHAR2)
authid current_user
AS
SCN varchar2(128);
BEGIN
SCN:=rpad(to_char(dbms_flashback.get_system_change_number),20,'A')||'AAAABBBBBBBBAAAAAAAABBBBBBBBAAAAAAAABBBBBBBBAAAAAAAABBBBBBBBAAAAAAAABBBBBBBBAAAAAAAABBBBBBBBAAAAAAAABBBBBBBB';
IF ( pv_redo_stress = 'HEAVY' ) THEN
UPDATE cf1 SET
c2 = SCN,
c3 = SCN,
c4 = SCN,
c5 = SCN,
c6 = SCN,
c7 = SCN,
c8 = SCN,
c9 = SCN,
c10 = SCN,
c11 = SCN,
c12 = SCN,
c13 = SCN,
c14 = SCN,
c15 = SCN,
c16 = SCN,
c17 = SCN,
c18 = SCN,
c19 = SCN,
c20 = SCN
WHERE custid > ( pv_random - pv_work_unit ) AND ( custid < pv_random);
COMMIT;
ELSE
UPDATE cf1 SET
c2 = SCN,
c20 = SCN
WHERE ( custid > ( pv_random - pv_work_unit )) AND (custid < pv_random);
COMMIT;
END IF;
END slobupdate;
/
SHOW ERRORS
EXIT;