Size: 3486
Comment: Add quiz questions page
|
Size: 5780
Comment: it's not always tables that are the problem.
|
Deletions are marked like this. | Additions are marked like this. |
Line 27: | Line 27: |
* EmailManagement | |
Line 36: | Line 37: |
* QuizQuestions | * ExtendedQuizQuestions |
Line 38: | Line 39: |
[[Anchor(usermanagement)]] === User Management === |
|
Line 39: | Line 42: |
=== Adding a User to Babase === | ==== Adding a User to Babase ==== |
Line 41: | Line 44: |
* Users can be added to babase, as well as a schema created, and permissions set, by completing the following steps using a SSH client. | 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 48: | Line 51: |
[[Anchor(deleteuser)]] ==== Deleting a User from Babase ==== ---- WARNING: The process described in this section deletes the user's personal schema. Be sure to examine the tables in the schema before deletion to be sure that nothing should be saved. A table may be transferred to another schema by the babase administrator with the following SQL command: {{{ ALTER TABLE someschema.sometable SET SCHEMA newschema;}}} ---- Users can be deleted from babase, and their personal schemas deleted as well, by running the following command on papio using a SSH client: {{{ babase-user-delete USERNAME}}} Be sure to peruse the output as it not only displays all the tables and other database objects deleted but may also contain error messages and descriptions of why the operation failed. Lines containing error messages and further information are are prefixed with 'ERROR:' and 'DETAIL:'. Errors are generally due to the user having explicit permissions to or ownership of objects that are not in their personal schema. These issues are resolved by connecting to the database in question (usually babase) as the database administrator and either using PPA's management features or directly issuing SQL commands. The SQL command to remove permissions from, say, a table is: {{{ REVOKE ALL ON TABLE sometable FROM someuser;}}} If the database object in question is not a table then change the word {{{TABLE}}} in the above command to kind of object in question. To reassign ownership of, say, a table to another user use the following SQL command: {{{ AlTER TABLE sometable OWNER TO anotheruser;}}} Again, if the database object in question is not a table then change the word {{{TABLE}}} in the above command to kind of object in question. Note that the user has a personal schema in each database, {{{babase}}}, {{{babase_test}}}, and {{{babase_copy}}}. The {{{babase-user-delete}}} command can succeed in deleting schemas from some databases and not others. If this occurs the command can be re-run once the situation which prevents schema deletion is rectified. In this case you may receive errors which say that schemas do not exist. These can be safely ignored. |
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.
[:BabaseChangelog:Babase 2.0 Changelog]
Programs
[:ProgramLinks:Generic Programs]
[:ProgramLinks:Babase's Bespoke Programs]
Protocols
[:DukeDMP:Duke's Data Management Protocol] -- Data Maintenance and Demography Update Protocols
- attachment:Princeton%20Data%20Management%20Protocol%20Babase%201.0 -- Data Maintenance and Demography Update Protocols. The attached protocol is for Babase 1.0. The revised protocol for Babase 2.0 is still under construction. The basis of data decisions (such as maturedates and dispersedates) will not change with Babase 2.0, but the table input order and upload procedure will differ.
[:DukeIDEP:Duke's Interaction Data Entry Protocol] -- Specific to Grooming, MCE, and Agonisms
Wiki Administration
Misc Links
[:TabbyTest:Tabby's test page]
SandboxPage -- Sandbox page for sharing code remotely
- [:WritingAComplexQuery]
User Management
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.
Deleting a User from Babase
WARNING: The process described in this section deletes the user's personal schema. Be sure to examine the tables in the schema before deletion to be sure that nothing should be saved. A table may be transferred to another schema by the babase administrator with the following SQL command:
ALTER TABLE someschema.sometable SET SCHEMA newschema;
Users can be deleted from babase, and their personal schemas deleted as well, by running the following command on papio using a SSH client:
babase-user-delete USERNAME
Be sure to peruse the output as it not only displays all the tables and other database objects deleted but may also contain error messages and descriptions of why the operation failed. Lines containing error messages and further information are are prefixed with 'ERROR:' and 'DETAIL:'.
Errors are generally due to the user having explicit permissions to or ownership of objects that are not in their personal schema. These issues are resolved by connecting to the database in question (usually babase) as the database administrator and either using PPA's management features or directly issuing SQL commands. The SQL command to remove permissions from, say, a table is:
REVOKE ALL ON TABLE sometable FROM someuser;
If the database object in question is not a table then change the word TABLE in the above command to kind of object in question.
To reassign ownership of, say, a table to another user use the following SQL command:
AlTER TABLE sometable OWNER TO anotheruser;
Again, if the database object in question is not a table then change the word TABLE in the above command to kind of object in question.
Note that the user has a personal schema in each database, babase, babase_test, and babase_copy. The babase-user-delete command can succeed in deleting schemas from some databases and not others. If this occurs the command can be re-run once the situation which prevents schema deletion is rectified. In this case you may receive errors which say that schemas do not exist. These can be safely ignored.
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 babase babase_test
- The ********* here would be the babase_admin password
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 babase_test babase
- When Backing up the DB, the 'help' directory can offer some direction
[YOU@papio ~]$ pg_dump --help