Skip to content

Commit af26d83

Browse files
committed
Hided output table under view to be EBR-ready
1 parent e023d9e commit af26d83

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed

docs/userguide/install.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ The installation user/schema must have the following Oracle system permissions d
1919
- CREATE PROCEDURE
2020
- CREATE TYPE
2121
- CREATE TABLE
22+
- CREATE VIEW
2223
- CREATE SYNONYM
2324
- ALTER SESSION
2425

source/core/ut_output_buffer_tmp.sql

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
create table ut_output_buffer_tmp(
1+
create table ut_output_buffer_tmp$(
22
/*
33
utPLSQL - Version X.X.X.X
44
Copyright 2016 - 2017 utPLSQL Project
@@ -27,4 +27,37 @@ create table ut_output_buffer_tmp(
2727
) nologging nomonitoring initrans 100
2828
;
2929

30-
create index ut_output_buffer_tmp_i on ut_output_buffer_tmp(start_date) initrans 100 nologging;
30+
create index ut_output_buffer_tmp_i on ut_output_buffer_tmp$(start_date) initrans 100 nologging;
31+
32+
-- This is needed to be EBR ready as editioning view can only be created by edition enabled user
33+
declare
34+
ex_nonedition_user exception;
35+
ex_view_doesnt_exist exception;
36+
pragma exception_init(ex_nonedition_user,-42314);
37+
pragma exception_init(ex_view_doesnt_exist,-942);
38+
begin
39+
begin
40+
execute immediate 'drop view ut_output_buffer_tmp';
41+
exception
42+
when ex_view_doesnt_exist then
43+
null;
44+
end;
45+
46+
execute immediate 'create or replace editioning view ut_output_buffer_tmp as
47+
select reporter_id
48+
,message_id
49+
,text
50+
,is_finished
51+
,start_date
52+
from ut_output_buffer_tmp$';
53+
exception
54+
when ex_nonedition_user then
55+
execute immediate 'create or replace view ut_output_buffer_tmp as
56+
select reporter_id
57+
,message_id
58+
,text
59+
,is_finished
60+
,start_date
61+
from ut_output_buffer_tmp$';
62+
end;
63+
/

source/create_utplsql_owner.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ define ut3_tablespace = &3
2727

2828
create user &ut3_user identified by &ut3_password default tablespace &ut3_tablespace quota unlimited on &ut3_tablespace;
2929

30-
grant create session, create sequence, create procedure, create type, create table, create synonym to &ut3_user;
30+
grant create session, create sequence, create procedure, create type, create table, create view, create synonym to &ut3_user;
3131

3232
grant execute on dbms_lock to &ut3_user;
3333

0 commit comments

Comments
 (0)