Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Grouper is now containerized and this document is in reference to the legacy installation process.

Setting up core Grouper components - database and Daemon

...

On a Linux host with Postgres 8 installed and with the Postgres utilities in the system path I run the following commands:

Code Block

su postgres
createdb grouperdb -E utf-8
psql
>CREATE user grouper with password 'grouper';
>GRANT ALL PRIVILEGES ON DATABASE grouperdb TO grouper;
>GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA whatever TO someuser;
\q

For MySQL the commands are:

Code Block

mysql -u root (if you have set a root password in mysql you will need to use the -p switch to be prompted for a password)
CREATE DATABASE grouperdb character set='latin1';
GRANT ALL PRIVILEGES ON grouperdb.* to 'grouper'@'localhost' IDENTIFIED BY 'grouper';
FLUSH PRIVILEGES;

...

If you are using Oracle you may be using a database that is shared with other applications, with each application having it's own schema in the database, with its name defined by the username used to log in. This can be problematic if you have to use (for some reason) a different username to log on to the database, since this can require that all tables names are qualified by the schema name in order for queries to work. This is not properly supported in the libraries that Grouper uses to connect to the database, so you may find that you need an alternative strategy for ensuring that the correct schema is used in queries. I have found myself in this situation and have had great success with a system trigger which sets the default schema on user login. This works on Oracle 10i:

Code Block

CREATE OR REPLACE TRIGGER global_logon_trg AFTER logon ON DATABASE
DECLARE
    username varchar2(64);
BEGIN
    username:=SYS_CONTEXT('USERENV','SESSION_USER');;
    if username LIKE 'a_user' then
            EXECUTE IMMEDIATE 'ALTER SESSION SET CURRENT_SCHEMA = GROUPER';
    END IF;
END;/

...