Skip to content

Commit

Permalink
Merge pull request #5767 from peterrinehart/PPP-4776-fix2
Browse files Browse the repository at this point in the history
[PPP-4776] Ensure tablespace does not exist before trying to create it.
  • Loading branch information
ddiroma authored Nov 4, 2024
2 parents dbe7866 + 17518e4 commit b672a1f
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,25 @@

alter session set "_ORACLE_SCRIPT"=true;

declare tablespaceexists integer;
begin
select count(*) into tablespaceexists from dba_tablespaces where tablespace_name='PENTAHO_TABLESPACE';
if (tablespaceexists = 0) then
execute immediate 'create tablespace pentaho_tablespace logging datafile ''ptho_ts.dbf'' size 32m autoextend on next 32m maxsize 2048m extent management local';
end if;
end;
/

declare userexist integer;
begin
select count(*) into userexist from dba_users where username='QUARTZ';
if (userexist = 0) then
execute immediate 'create tablespace pentaho_tablespace logging datafile ''ptho_ts.dbf'' size 32m autoextend on next 32m maxsize 2048m extent management local';
execute immediate 'create user quartz identified by "password" default tablespace pentaho_tablespace quota unlimited on pentaho_tablespace temporary tablespace temp quota 5M on system';
execute immediate 'grant create session, create procedure, create table to quartz';
end if;
end;
/


--CREATE QUARTZ TABLES

CONN quartz/password
Expand Down

0 comments on commit b672a1f

Please sign in to comment.