Load CMIP5 Add_Info to CERA

Fall 1: ADD_INFO aus XML repository holen und Laden

 lizard: ftp cmeta 2121
    login imdi/passwort
    cd /public/imdi/ADD_INFO
    prompt
    get add*.xml .

Format of XML

<ADD_INFO>
    <DATASET_GROUP_NAME>cmip5 output1 MPI-M MPI-ESM-LR decadal1970</DATASET_GROUP_NAME>
    <ENTRY_TYPE>additional_info</ENTRY_TYPE>
    <CREATION_DATE>2012-06-21</CREATION_DATE>
    <SUMMARY>...text</SUMMARY>
    <ADD_INFO_NAME>CIM_cmip5_output1_MPI-M_MPI-ESM-LR_decadal1970.xml</ADD_INFO_NAME>
    <ADD_INFO_DEST>cmip5qc1.dkrz.de:/gpfs_750/projects/QC/home/cmip5qc/export/CERA/2339677_MPILR_decadal1970/CIM_cmip5_output1_MPI-M_MPI-ESM-LR_decadal1970.xml</ADD_INFO_DEST>
    <SIZE>481433</SIZE>
    <FORMAT>XML</FORMAT>
</ADD_INFO>

ADD_INFO Metadaten laden

    xmlload -cmip5_add_info add_info.xml

files holen

scp </ADD_INFO/ADD_INFO_DEST/> .

file Laden

(mit LoadAttachment auf lizard)

setenv ORACLE_HOME /sw/rhel55-x64/oracle-client-11gR2/                                                                                 
setenv LD_LIBRARY_PATH $ORACLE_HOME/lib
# Kommandos generieren (sqlplus cera2_temp@pcera)
# select '/pf/k/k204012/Software/Oracle/LoadAttachment/LoadAttachment -entry '||entry_acronym||' -in '||entry_name||' -user dbput -pass xxxxx' from entry;

Fall 2: ADD_INFO aus atarrabi2 laden

Bugs/ToDo

Metadaten laden

/pf/k/k204038/Projekte/Atarrabi2/xmlload -atarrabi2_add_info myatarrabi2.xml

Blob Tabelle für add_info anlegen

(mit cera_attach.ManAttach)

FUNCTION CREATE_AND_LINK RETURNS BINARY_INTEGER
 Argument Name                  Type                    In/Out Default?
 ------------------------------ ----------------------- ------ --------
 ENTRY_ID                       NUMBER(15)              IN
 MY_USER                        VARCHAR2                IN
 TABLENAME                      VARCHAR2(30)            OUT

Die Funktion legt die Tabelle an und macht die nötigen Einträge in Storage, data_access und parameter.

Der Parameter my_user ist der User für den die Tabelle zum Schreiben geöffnet werden soll. Nicht leerlassen, falls nicht required bitte CERA2 eintragen (l_s_public)

Tabelle füllen

(cera_attach)

insert into cera_attach.A_00000000||entry_id|| (blob_id, upload_date, blob_size, upload_file_name, blob_data) values (
 1,  sysdate, 1247695, 'QCL3_TQA_2258752_20120705.txt',  (select qc_attachments from meta_select_std_doi_v2.qc_attach_tab where attach_id = 2312)); 
 z.B.
insert into cera_attach.A_000000002432159 (blob_id, upload_date, blob_size, upload_file_name, blob_data) values (
1,  sysdate, 4820299, 'QCL3_TQA_2339667_20120816.txt',  (select qc_attachments from meta_select_std_doi_v2.qc_attach_tab where attach_id = 2490));

cera2.progress auf complete setzen

update entry set progress_id = 1 where entry_id = ENTRY_ID;

cera2.distribution.size setzen

update distribution set data_size = <ADD_INFO/SIZE/> where entry_id = ENTRY_ID;

MadWiki: AddInfo (last edited 2012-08-27 14:30:42 by HansHermannWinter)