Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5f5769d

Browse files
authored
Merge pull request #202 from Pazus/ebr-enabled
Hided output table under view to be EBR-ready
2 parents e023d9e + 3d55adf commit 5f5769d

3 files changed

Lines changed: 63 additions & 3 deletions

File tree

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: 61 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,63 @@ 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+
/*
48+
utPLSQL - Version X.X.X.X
49+
Copyright 2016 - 2017 utPLSQL Project
50+
Licensed under the Apache License, Version 2.0 (the "License"):
51+
you may not use this file except in compliance with the License.
52+
You may obtain a copy of the License at
53+
http://www.apache.org/licenses/LICENSE-2.0
54+
Unless required by applicable law or agreed to in writing, software
55+
distributed under the License is distributed on an "AS IS" BASIS,
56+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
57+
See the License for the specific language governing permissions and
58+
limitations under the License.
59+
*/
60+
select reporter_id
61+
,message_id
62+
,text
63+
,is_finished
64+
,start_date
65+
from ut_output_buffer_tmp$';
66+
exception
67+
when ex_nonedition_user then
68+
execute immediate 'create or replace view ut_output_buffer_tmp as
69+
/*
70+
utPLSQL - Version X.X.X.X
71+
Copyright 2016 - 2017 utPLSQL Project
72+
Licensed under the Apache License, Version 2.0 (the "License"):
73+
you may not use this file except in compliance with the License.
74+
You may obtain a copy of the License at
75+
http://www.apache.org/licenses/LICENSE-2.0
76+
Unless required by applicable law or agreed to in writing, software
77+
distributed under the License is distributed on an "AS IS" BASIS,
78+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
79+
See the License for the specific language governing permissions and
80+
limitations under the License.
81+
*/
82+
select reporter_id
83+
,message_id
84+
,text
85+
,is_finished
86+
,start_date
87+
from ut_output_buffer_tmp$';
88+
end;
89+
/

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)