|

UTPLSQL + HR + MACOS + DOCKER :)

Po wielu próbach zainstalowania UTPLSQL na lokalnej maszynie i problemem z uprawnieniem dla sys:

grant create context …

Pomogło przygotowanie dockera:

docker run –platform linux/amd64 -d \
–name utplsql-db \
-p 1521:1521 \
-e INSTALL_UTPLSQL=true \
-e CREATE_UT_USER=true \
aledv/docker-oracle-12c-utplsql

Chwilę to trwało więc nadzorowałam proces przy użyciu:

docker logs utplsql-db

Po uruchomieniu połączyłam się z SQL Developerem

ut3 / ut3

Wreszcie polecenie:

begin
ut.run();
end;
/

Zaczęło zwracać coś innego niż błąd:

Finished in ,000043 seconds
0 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)

Następnie doinstalowałam schemat hr:

— Usuń, jeśli już istnieje
drop user hr cascade;

— Tworzymy HR od nowa
create user hr identified by hr
default tablespace users
temporary tablespace temp
quota unlimited on users;

grant connect, resource to hr;
alter user hr account unlock;

uruchomilam hr_install.sql

A następnie dodałam użytkownikowi ut3 możliwość operowania na tabelach hr:

begin
for r in (select table_name from all_tables where owner = 'HR’) loop
execute immediate 'grant select, insert, update, delete on hr.’ || r.table_name || ’ to ut3′;
end loop;
end;
/

Podobne wpisy