Size: 4140
Comment:
|
← Revision 98 as of 2024-06-20 14:58:32 ⇥
Size: 4148
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
This page will be used to store codes, protocols, and procedures for use by the Data Managers. | This page is used to store codes, protocols, and procedures for use by the Data Managers. |
Line 3: | Line 4: |
Line 6: | Line 6: |
* [: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. |
* [[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. * [[UserManagement|User Management]] * [[DukeOITTools|Duke OIT Tools]] * [[FirewallTools|Firewall Tools]] * [[BabaseChangelog|Babase 2.0 Changelog]] * [[SysAdmin|Systems Administration]] -- Info about how to do some common administrative tasks for our VM and our backup units. |
Line 10: | Line 16: |
* [:ProgramLinks:Generic Programs] * [:ProgramLinks:Babase's Bespoke Programs] * [:Changelog:Babase 2.0 Changelog] |
* [[ProgramLinks|Babase's Bespoke Programs]] |
Line 15: | Line 19: |
* [:DukeDMP:Duke's Data Management Protocol] -- Data Maintenance and Update Protocols * [:DukeIDEP:Duke's Interaction Data Entry Protocol] -- Specific to Grooming, MCE, and Agonisms |
* [[attachment:2023_07_03 Behav_GrpMovement Data Management Protocols.pdf|Behavioral and Group Movement Data Management Protocol]] (last updated 2023-07-03) -- Protocol for maintenance of interaction data, focal sampling data, GPS/SWERB data, male ranks, dartings, and predation and human disturbance data. Also known as the "Duke Protocol". * [[attachment:Census_and_Reproductive_Data_Management_Protocol.pdf|Census and Reproductive Data Management Protocol]] (last updated 2023-03-31) -- Protocol for Data Checking and the Demography/Reproduction Update * [[attachment:Data Storage.pdf]] -- See attachment for information on how data that come from the field are stored * [[attachment:Electronic Data Handling.pdf]] -- See attachment for information on how electronic data are processed * [[attachment:Paper Data Handling.pdf]] -- See attachment for information on how paper data are processed * [[GeneticTableForms|Forms for adding new data to the genetics tables]] |
Line 22: | Line 31: |
* EmailManagement | |
Line 25: | Line 34: |
* [:TabbyTest:Tabby's test page] | * [[TabbyTest|Tabby's test page]] |
Line 27: | Line 36: |
* MultiPartyInteractionDevelopment | * RankerDiffs * TheJeanneAndSusanAttachmentPage * [[WritingAComplexQuery]] * ExtendedQuizQuestions * [[attachment:Historic Agonism Summary.xls]] |
Line 29: | Line 42: |
=== Adding a User to Babase === | === Copying the Babase Schema === The babase-copy-babase-schema Unix program copies the entire babase schema, including data, table definitions, validation, and everything else, from one database to another. All existing data, table definitions, validation, etc is deleted from the babase schema in the target database. You must be logged in to papio and at the Unix prompt to run the program. |
Line 31: | Line 45: |
* 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 |
The following example copies the babase schema from the babase database to the babase_test database. The first database ({{{babase}}}) is the database to copy from, the second ({{{babase_test}}}) the database to copy into. |
Line 60: | Line 48: |
[YOU@papio ~]$ less YOURRESTORE.SQL}}} | PGPASSWORD='*********' babase-copy-babase-schema YOURADMINNAME babase babase_test }}} * The ********* here would be the password of YOURADMINNAME |
Line 62: | Line 52: |
* the output on your screen will then resemble the text below: {{{CREATE SCHEMA schemaname1; |
The next example copies the babase scheme from the babase_test database to the babase_database. The program will not copy into the babase database unless the {{{-f}}} (force) flag is given. |
Line 65: | Line 54: |
{{{ PGPASSWORD='*********' babase-copy-babase-schema -f YOURADMINNAME babase_test babase }}} * When Backing up the DB, the 'help' directory can offer some direction |
|
Line 66: | Line 59: |
SET search_path = schemaname1, pg_catalog; | {{{ [YOU@papio ~]$ pg_dump --help }}} === Killing a Process in PPA === Log in to phpPgAdmin as an administrator, then select the babase database. |
Line 68: | Line 65: |
SET default_tablespace = ''; | There is a tab along the top of the browser window with a button for Processes. Click this button. |
Line 70: | Line 67: |
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. |
You will see a list of ongoing processes (queries, usually). Click the "Cancel" button next to whichever process you want to kill. You may have to click cancel on the process you are killing a couple of times. It might tell you that the function has failed, but you can ignore that; it's an error in phpPgAdmin, not with Postgres. |
This page is 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.
Ranker Program -- The ranker program is used to develop and input Baboon social ranks.
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.
The Psion Data Format -- The Psions are handheld data collection devices. They output their data in a custom format.
Systems Administration -- Info about how to do some common administrative tasks for our VM and our backup units.
Programs
Protocols
Behavioral and Group Movement Data Management Protocol (last updated 2023-07-03) -- Protocol for maintenance of interaction data, focal sampling data, GPS/SWERB data, male ranks, dartings, and predation and human disturbance data. Also known as the "Duke Protocol".
Census and Reproductive Data Management Protocol (last updated 2023-03-31) -- Protocol for Data Checking and the Demography/Reproduction Update
Data Storage.pdf -- See attachment for information on how data that come from the field are stored
Electronic Data Handling.pdf -- See attachment for information on how electronic data are processed
Paper Data Handling.pdf -- See attachment for information on how paper data are processed
Wiki Administration
Misc Links
SandboxPage -- Sandbox page for sharing code remotely
Copying the Babase Schema
The babase-copy-babase-schema Unix program copies the entire babase schema, including data, table definitions, validation, and everything else, from one database to another. All existing data, table definitions, validation, etc is deleted from the babase schema in the target database. You must be logged in to papio and at the Unix prompt to run the program.
The following example copies the babase schema from the babase database to the babase_test database. The first database (babase) is the database to copy from, the second (babase_test) the database to copy into.
PGPASSWORD='*********' babase-copy-babase-schema YOURADMINNAME babase babase_test
- The ********* here would be the password of YOURADMINNAME
The next example copies the babase scheme from the babase_test database to the babase_database. The program will not copy into the babase database unless the -f (force) flag is given.
PGPASSWORD='*********' babase-copy-babase-schema -f YOURADMINNAME babase_test babase
- When Backing up the DB, the 'help' directory can offer some direction
[YOU@papio ~]$ pg_dump --help
Killing a Process in PPA
Log in to phpPgAdmin as an administrator, then select the babase database.
There is a tab along the top of the browser window with a button for Processes. Click this button.
You will see a list of ongoing processes (queries, usually). Click the "Cancel" button next to whichever process you want to kill. You may have to click cancel on the process you are killing a couple of times. It might tell you that the function has failed, but you can ignore that; it's an error in phpPgAdmin, not with Postgres.