Differences between revisions 2 and 16 (spanning 14 versions)
Revision 2 as of 2007-07-17 15:49:52
Size: 629
Editor: pool-71-111-214-197
Comment: add user to babase info
Revision 16 as of 2007-09-24 19:51:36
Size: 4102
Editor: biodhcp-185-86
Comment: new interact data protocol page
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
=== Babase Technical Information ===
Line 3: Line 4:
== Adding a User to Babase == These links are primarly of interest to the Babase support staff.
Line 5: Line 6:
 * Users can be added to babase, as well as a schema created, and permissions set, by completing the following steps in an SSH window.  * [:RankerProgram:Ranker Program] -- The ranker program is used to develop and input Baboon social ranks.
 * [:BabaseVPN:The Babase VPN] -- The Babase Virtual Private Network is available to those people who have a Unix Login on Papio. It is primarly used to run the ranker program.
 * [:PsionFormat:The Psion Data Format] -- The Psions are handheld data collection devices. They output their data in a custom format.
==== Programs ====
 * [:ProgramLinks:Generic Programs]
 * [:ProgramLinks:Babase's Bespoke Programs]

==== Protocols ====
 * [:DukeDMP:Duke's Data Management Protocol] -- Data Maintenance and Update Protocols
 * [:DukeIDEP:Duke's Interaction Data Entry Protocol] -- Specific to Grooming, MCE, and Agonisms
==== Wiki Administration ====
 * BabaseWikiAdminGroup
 * BabaseWikiEditorsGroup
 * DatasetStatus
 * DatasetStatusTable


==== Misc Links ====
 * [:TabbyTest:Tabby's test page]
 * SandboxPage -- Sandbox page for sharing code remotely
 * MultiPartyInteractionDevelopment

=== Adding a User to Babase ===

 * Users can be added to babase, as well as a schema created, and permissions set, by completing the following steps using a SSH client.
Line 7: Line 32:
PGPASSWORD=********* babase_user_add username babase_readers}}} PGPASSWORD='*********' babase-user-add USERNAME babase_readers}}}
Line 11: Line 36:
 * It is very important that the user immediately change their password using pHpPgadmin's password change option.  * It is very important that the user immediately change their password using PPA's password change option.

=== Backing up the Database or Schemas ===

 * When Backing up the DB, the 'help' directory can offer some direction
{{{
[YOU@papio ~]$ pg_dump --help}}}

=== Restoring the Database or Schemas ===

 * If you are going to want to restore tables within the schema:
{{{
[YOU@papio ~]$ pg_dump --file YOURBACKUP.sql --host=localhost --format=c schema=fecal --user YOU babase}}}
 
 * after the backup file is created, it is useful to be able to look at the file to ensure you have the correct search path (the tables are getting put in the correct place ie. your schema) one way to do this is to view what the command is doing by having the output displayed in your unix window
{{{
[YOU@papio ~]$ pg_restore --host=localhost --file=/dev/stdout --user YOU YOURBACKUP.sql}}}
 * you can also save this information into a file, rather than having it just display in your unix window
{{{
[YOU@papio ~]$ pg_restore --host=localhost --file=YOURRESTORE.sql --user YOU YOURBACKUP.sql}}}
 * you can then just read the output within the window as well as having saved it for restore use

{{{
[YOU@papio ~]$ less YOURRESTORE.SQL}}}

 * the output on your screen will then resemble the text below:
{{{CREATE SCHEMA schemaname1;


SET search_path = schemaname1, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;}}}

 * If you desire for the data to be restored to a different location, you can use the emacs application to edit the text of YOURRESTORE.sql.
{{{
[YOU@papio ~]$ emacs -nw YOURRESTORE.sql}}}
 * IT IS IMPORTANT YOU NOT USE EMACS WITHOUT KNOWLEDGE OF HOW TO EXIT OUT OF IT!!!!!!!
 * After changing the first search path in the file, it should look like the following
{{{CREATE SCHEMA schemaname1;


SET search_path = schemaname2, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;}}}
 * the PSQL terminal should then be used for the restore, at which point the tables from your schema will be created in the schema specified in the search path
{{{
[YOU@papio ~]$ psql --dbname=babase --user=YOU --host=localhost < YOURRESTORE.sql}}}
 * If you enter the previous command without the '< YOURRESTORE.sql', you will be prompted with "babase>" This is just another front end for babase, and any queries could also be performed here, just for future reference.

This page will be used to store codes, protocols, and procedures for use by the Data Managers.

Babase Technical Information

These links are primarly of interest to the Babase support staff.

  • [:RankerProgram:Ranker Program] -- The ranker program is used to develop and input Baboon social ranks.

  • [:BabaseVPN:The Babase VPN] -- The Babase Virtual Private Network is available to those people who have a Unix Login on Papio. It is primarly used to run the ranker program.

  • [:PsionFormat:The Psion Data Format] -- The Psions are handheld data collection devices. They output their data in a custom format.

Programs

  • [:ProgramLinks:Generic Programs]

  • [:ProgramLinks:Babase's Bespoke Programs]

Protocols

  • [:DukeDMP:Duke's Data Management Protocol] -- Data Maintenance and Update Protocols

  • [:DukeIDEP:Duke's Interaction Data Entry Protocol] -- Specific to Grooming, MCE, and Agonisms

Wiki Administration

Adding a User to Babase

  • Users can be added to babase, as well as a schema created, and permissions set, by completing the following steps using a SSH client.

PGPASSWORD='*********' babase-user-add USERNAME babase_readers
  • The ********* here would be the babase_admin password
  • The Username selected will become not only the babase username and temporary password but also the schema name.
  • It is very important that the user immediately change their password using PPA's password change option.

Backing up the Database or Schemas

  • When Backing up the DB, the 'help' directory can offer some direction

[YOU@papio ~]$ pg_dump --help

Restoring the Database or Schemas

  • If you are going to want to restore tables within the schema:

[YOU@papio ~]$ pg_dump --file YOURBACKUP.sql --host=localhost --format=c schema=fecal --user YOU babase
  • after the backup file is created, it is useful to be able to look at the file to ensure you have the correct search path (the tables are getting put in the correct place ie. your schema) one way to do this is to view what the command is doing by having the output displayed in your unix window

[YOU@papio ~]$ pg_restore --host=localhost --file=/dev/stdout --user YOU YOURBACKUP.sql
  • you can also save this information into a file, rather than having it just display in your unix window

[YOU@papio ~]$ pg_restore --host=localhost --file=YOURRESTORE.sql --user YOU YOURBACKUP.sql
  • you can then just read the output within the window as well as having saved it for restore use

[YOU@papio ~]$ less YOURRESTORE.SQL
  • the output on your screen will then resemble the text below:

{{{CREATE SCHEMA schemaname1;

SET search_path = schemaname1, pg_catalog;

SET default_tablespace = ;

SET default_with_oids = false;}}}

  • If you desire for the data to be restored to a different location, you can use the emacs application to edit the text of YOURRESTORE.sql.

[YOU@papio ~]$ emacs -nw YOURRESTORE.sql
  • IT IS IMPORTANT YOU NOT USE EMACS WITHOUT KNOWLEDGE OF HOW TO EXIT OUT OF IT!!!!!!!
  • After changing the first search path in the file, it should look like the following

{{{CREATE SCHEMA schemaname1;

SET search_path = schemaname2, pg_catalog;

SET default_tablespace =

;

SET default_with_oids = false;}}}

  • the PSQL terminal should then be used for the restore, at which point the tables from your schema will be created in the schema specified in the search path

[YOU@papio ~]$ psql --dbname=babase --user=YOU --host=localhost < YOURRESTORE.sql
  • If you enter the previous command without the '< YOURRESTORE.sql', you will be prompted with "babase>" This is just another front end for babase, and any queries could also be performed here, just for future reference.

DataManagement (last edited 2024-06-20 14:58:32 by JakeGordon)

Wiki content based upon work supported by the National Science Foundation under Grant Nos. 0323553 and 0323596. Any opinions, findings, conclusions or recommendations expressed in this material are those of the wiki contributor(s) and do not necessarily reflect the views of the National Science Foundation.