Skip to content

Instantly share code, notes, and snippets.

@jmchilton
Created November 9, 2012 18:37
Show Gist options
  • Save jmchilton/4047409 to your computer and use it in GitHub Desktop.
Save jmchilton/4047409 to your computer and use it in GitHub Desktop.
MSI Software Accounting Databases
<p>There are currently two software accounting databases. MSIdb contains the most up-to-date demographic, resource, and FLEXlm records but not collectl data. All collectl data is stored in an appdev managed database on appdev-dom0, the demographic, resource and FLEXlm records are occasionally copied over from MSIdb to appdev-dom0.</p>
<p>Both of these databases can be access from loon.msi.umn.edu. To access you will first need to create a .pgpass file in your home directory.</p>
<pre>
% touch $HOME/.pgpass; chmod 600 $HOME/.pgpass; cat /project/msistaff/appdev/softacct/PGPASS_EXAMPLE >> $HOME/.pgpass
</pre>
<p>Once your .pgpass file is setup, you can access the appdev-dom0 database from loon with the following command:</p>
<pre>
% psql -h appdev-dom0.msi.umn.edu -U softacctro softacct
</pre>
<p>
Using the above command this access is read only, full read-write access can be obtained by replacing the softacctro option with softacct.
</p>
<p>And you can access MSIdb from loon with the following command:</p>
<pre>
psql -h tern1.msi.umn.edu -U msiread msi
</pre>
<h3>DB Admin Notes</h3>
<p>Query used to build commands to grant readonly access to softacctro</p>:
<pre>
SELECT 'GRANT SELECT ON ' || relname || ' TO softacctro;'
FROM pg_class JOIN pg_namespace ON pg_namespace.oid = pg_class.relnamespace
WHERE nspname = 'public' AND relkind IN ('r', 'v');
</pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment