How to install utPLSQL on AUTONOMOUS DATABASE?


According to the installation instructions, to install utPLSQL, we need a user with the SYSDBA role. So how can we install the tool on an AUTONOMOUS database where we don't have such a user? Is it possible to install utPLSQL from the ADMIN account?
Let's find out.

--------------------------------------------------------------------------------
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
--------------------------------------------------------------------------------

The following instructions will guide us step by step through the installation of utPLSQL.

DOWNLOADING THE INSTALLATION FILE

You can download the installation file from GitHub. The latest version of the tool can be found at https://github.com/utPLSQL/utPLSQL/releases.
Download the utPLSQL.zip file and extract it to your chosen location on the disk.

Open CMD and change directory to SOURCE

>Cd C:\_monika\utPLSQL\source

Next, log in to the AUTONOMOUS DATABASE (here H2O database) using SQL*Plus as the ADMIN user:

>>sqlplus ADMIN@h2o_high




and now we can proceed with the tool's installation:

SQL> @install_headless_with_trigger.sql utp3 TestoweHaslo123! users


The installation parameters are the username, password, and tablespace.



After the installation is complete, we can try logging in as the utp3 user and run a test.
The username and password will be the ones provided during the installation. In the example: utp3/TestoweHaslo123!



Now we can run our first test. Let's check if 2 + 2 equals 4.

-------------------------------------------------------------------------
-- UT001
-------------------------------------------------------------------------
-- test blok anonimowy
declare
nEquation       number;
nExpectedResult number;

  begin 
  nEquation := 2+2;
  nExpectedResult := 4;

    -- porownanie wartosci z wartoscia oczekiwana
    ut.expect(nEquation).to_equal(nExpectedResult);
  end;
  /

SUCCESS

  Actual: 4 (number) was expected to equal: 4 (number)


PL/SQL procedure successfully completed.

Success! 2 + 2 equals 4. We are ready to start creating our first unit tests using utPLSQL!

Stay tuned for more posts with tips and tricks for utPLSQL coming soon :)


Komentarze