Elaboration of outgoing programmer(s) EOX activities: discussion of EOX processes and variations: background notes, explanations, considerations, and troubleshooting for end-of-expedition data processing.
The actual scripts to run are here.
...
When will you be done adding new data to the database?
Agree on a time, then stick to it: any Any new data applied after this point will not return to shore this cycle. To capture it would require an additional end-of-expedition data-processing cycle.
...
This process requires the expdp
and impdp
commands. These command-line data management tools are installed at the ODAs with the RDBMS software. They are not SQLPLUS commands. These "extract | transfer | load" (ETL) tools should be run from the Oracle OS account at the primary ODA via a terminal session. The utilities are database version specific. There is a parameter to tell the tools to behave compatibly with a specific RDBMS release (VERSION).
...
Windows SSH within a Windows Terminal is also very effective. Operating it under Command (cmd.exe) is also effective. The blue powershell terminal is functional until you Powershell terminal works fine as long as you do not resize the window or change font sizes--then the output sequencing get confusedthe font. The Powershell color scheme doesn't work well with some typical *nix terminal color choices.
Transfer schema cleanout
This script expunges TRANSFER UTIL_CLEANOUT_TRANSFER_NEW_TABLES expunges TRANSFER schema table content using a fast process known as TRUNCATE. The cleanout procedure is useful for TRANSFER schema data management. The script is no longer required to conduct the shipboard EOX process.
Retained to demonstrate code to cleanout a series of tables quickly. Is owned by the TRANSFER schema.
Executing a stored procedure
...
Monitoring execution progress. SQLDeveloper provides a "Monitor session..." facility that lets you know the process is still working. A positive feedback check is to use SQL to count the rows in the TRANSFER tables being updated. If the task was started within SQLDeveloper, menu item View > Task Progress offers some visual feedback on progress.
Environmental concerns. To avoid glitches, interruptions, downtime in the EOX process, it is best to run these processes at the ODA console. Doing so insulates the For procedures, it is useful to apply the dbms_output.put, put_line methods to output text to the console. Must establish "set serveroutput on" for the messages to be routed to the terminal.
Environmental concerns. To avoid glitches, interruptions, downtime in the EOX process, it is best to run these processes at the ODA console. Doing so insulates the activity from the multitude of other activities that occur at the end of an expedition, or within a port call.
Procedure invocation variant. A procedure may be invoked with either of these keywords: execute or call. The latter requires fewer keystrokes. Both generate an anonymous PL/SQL block to execute the specified procedure.
Specifying parameters. The The procedures are all written to take single-valued parameters. All are strings and must be single-quoted. If data is to be exported for multiple expeditions, the procedures must be invoked for each unique occurrence. The copy_descinfo_to_new() procedure does not require a parameter, this data model is not expedition specific.
Parameter prefixes. The prefix EXP is is only required for the parameter of copy_asman_catalog_to_new(). For all lims...() and ops...() procedures require the bare expedition identifier. The copy_descinfo_to_new() procedure does not require any parameter.
Transfer tables. The About the NEW_* tables owned by the TRANSFER schema.
- They have the same columns as their production namesakes.
- The tables are intended to be empty at the beginning of EOX.
- These tables do not have any indexes, constraints, or foreign key dependencies.
Why multiple exports?
- Redundancy.
- Ensures that content gets home that is not part of routine EOX/BOX handling, including:
- Location-specific configuration [LIMS analysis, components, constants, instrument, and user definitions.]
- DESCINFO raw workspaces that were precursors to DescLogik uploads into the LIMS schema.
- Log content (PITALOG).
- Useful to provide real content for development, demo, test, and training databases.
Troubleshooting Notes
Archive logging--This is typically not an issue for EOX, but is still a very real issue for BOX.
Oracle treats the About the BEAKER_* tables owned by the TRANSFER schema. These tables support the Moisture and Density container load process. They are not used in end-of-expedition processing.
Troubleshooting Notes
Archive logging
This is typically not an issue for EOX, but is still a potential issue for BOX.
Oracle treats the changes resulting from end-of-expedition processing just like any other transactions. Due to the size of these transactions it is possible (though unlikely) that EOX activities will exceed 20 GiB allocated for archive logging. When this occurs, the database blocks all activity until archive log space is freed. All attempts at new transactions will receive the message ORA-00257: archiver stuck
.
...
Monitor the generation of archive logs using the Enterprise Manager Console or the RMAN tool.
Export
...
Troubleshooting
Export fails with permission errors
The export [in step (5) of the short form] requires that the system and transfer schemas the user conducting the export must have permission from Oracle RDBMS and the ODA operating system OS to write files to the directory /u02/exports
.
This SQL verifies the existence of the directory named dmpdir. Inspection verifies whether it points to /u02/exports
.
...
configured and accepted export directories.
Review what those directories are by running this SQL.
Code Block |
---|
select * from dba_directories; |
This SQL creates the directory entry, if missing
...
Create a new directory if desired. Example.
Code Block |
---|
create directory dmpdir as '/u02backup/exportsexport'; |
The SQL grants operating system read, write access for the specified directory
...
Grant permission to use that directory by this kind of SQL.
Code Block |
---|
grant read, write on directory dmpdir to transfer, systemmy-test_user; |
The export fails with an ORA-39095
This indicates that disk space on the ODA export volume is exhausted. The volume is shared by several Oracle facilities and instances: trace logging, archive logging for production, test and other database instances. To clear the error, find files we do not need on that volume and remove them.
When this occurred at EOX 374, the DBA removed trace logs related to the OEMREPJR database instance to make sufficient space available.
These activities are driven by the MCS and DBA. Coordinate with both.
...
Work with the MCS and DBA as-needed to open space.
This script isn't working, why?
The underlying SQL for each procedure is viewable (and modifiable) under SQLDeveloper:
...
Something went wrong, I want to start over
Not a problem. The function of these scripts is to make a copy of data for backupTRANSFER schema copy scripts are designed to take read-only copies of the source tables. Clean out the target tables. Try again as often as needed. There is no irreversible damage being done by any of these activities. It is sufficient to begin again at step (2) of the short form.taking another copy.
The source data schemas are not modified in any way by this processcopy processes. The various stored procedures only copy from a source (LIMS, DESCINFO2, OPS, etc.) to the target TRANSFER schema.
Prior to 324, the cleanout method relied on Oracle delete. Oracle's guarantee of atomic, consistent, isolated, durable transactions translates to considerable overhead when millions of records are involved. The truncate
command bypasses this overhead, but does not guarantee atomicity, consistency, isolation, or durability.
Data cleanout
UTIL_CLEANOUT_TRANSFER_NEW_TABLES.
Conducts a fast and non-recoverable truncation of table content. Only applied on tables in the transfer
schema. DO NOT APPLY THE SAME TECHNIQUE on production tables as this command is not intended to process indexes, constraints, table statistics, and other table-related data objects that are affected by data removal.
The truncation command has been applied since expedition 324. Though overflow of the available archive logger space is still possible, use of the truncation command alleviates that issue for EOX processing.
Data copy architecture
COPY_LIMS_EXPEDITION_TO_NEW.
Copies data by expedition [not by project!] for sample, test, result and several other tables. The style is a series of insert into ... select * from ...
statements.
- The script does not check that the tables are empty.
- The script may be run multiple times.
- Records that match will only be copied once (changed as of expedition 324).
- When new records are identified, they are accumulated in the transfer tables.
Useful Utilities
How do I recreate a missing TRANSFER table?
Before we give you the commands, some background information:
...
As of Exp 398, this and related procedures ARE NO LONGER USED AT EOX. It is simpler to fully export the database and call it done. The scripts are historical artifacts, retained in hopes they might be convenience tools for transferring test data--but if not, we'll retire them.
Useful Utilities
How do I recreate a missing TRANSFER table?
Before we give you the commands, some background information:
- The TRANSFER schema tables are column-by-column mirrors of their production counterparts.
- The naming convention indicates the intended use of the table:
- NEW_tablename indicates data to be moved from ship and added to the shore warehouse.
- LEGACY_tablename indicates data copied from the shore warehouse for repeat presentation in the shipboard database.
- CONTBEAKER_tablename tablename indicates container data to be applied in the shipboard environment for the moisture and density measurement methods.
...
Code Block |
---|
create table transfer.NEW_SAMPLE as select * from lims.SAMPLE where 1=0; |
The idiom where 1=0
ensures ensures that only the table structure is created--no records are copied.
The current list of TRANSFER tables may be displayed via:
Code Block |
---|
connect transfer@limssodv
set pagesize 50000
select table_name from tabs order by table_name; |
The source table for any given entry may be found by dropping the prefix (NEW_, LEGACY_, CONT_). Source tables are in the schemas LIMS, OPS, DESCINFO2.
*nix to Windows Copy examples
...
Code Block |
---|
pscp oracle@db.ship.iodp.tamu.edu:/u02/exports/transfer*335* c:/Volumes/ozy/2hq/data_snapshots/ |
...
Are the copies you made any good? Are you sure?
Checksum tools read every byte of a file to generate a signature for the file. If the signatures differ between copies of a file, then the copies are not identical. The signatures should match, regardless of the platform used. These tools are particularly useful to verify transfers conducted over our (slow, less-reliable-than-i'd-like) satellite connection.
Code Block |
---|
Redhat$ md5sum *.dmpdp.bz2
Solaris> digest -a md5 -v transfer_741.dmpdp
md5 (transfer_323.dmpdp) = 9a043b6b899b6eddebc70f30e7df450c
DOS> md5sum transfer_323.dmpdp
9a043b6b899b6eddebc70f30e7df450c *transfer_741.dmpdp
MacOSX$ md5 transfer_741.dmpdp
MD5 (transfer_741.dmpdp) = 9a043b6b899b6eddebc70f30e7df450c |
TECHDOC Cumulus Content
TECHDOC is not brought home. No copy is needed. If it is required, the MCS will manage itis created--no records are copied. Only structure is copied. Not indexes, not constraints, not foreign keys, etc.
The current list of TRANSFER tables may be displayed via:
Code Block |
---|
connect transfer@limsjr
set pagesize 50000
select table_name from tabs order by table_name; |
The source table for any given entry may be found by dropping the prefix (NEW_, LEGACY_, BEAKER_). Source tables are in the schemas LIMS, OPS, DESCINFO2.
Labstation / Instrument Host Cleanup
...
The work can be scripted very effectively, but such scripts are also equally dangerous as the intent is data removal. Triggering them in the middle of an expedition would be a "bad thing".
DOCUMENT THOSE PROCEDURES HERE AS THEY ARE IDENTIFIED.
Compress the exports for transport
We no longer compress data for transport.
Example: a 60 GiB file was exported in 20 minutes. To compress the file would take another 8-12 hours. Don't bother. Just adds more work and another point for error.