User Tools

Site Tools


mbstring extension must be loaded in order to run mPDF
neuroimagen:xnat_db_edits

Manipular directamente la base de datos de XNAT

Por obvias razones esto es bastante peligroso. Asegurate de tener backup antes de nada

[root@brick01 ~]# su - xnat
Last login: Mon Oct 11 01:00:01 CEST 2021
-------- freesurfer-linux-centos7_x86_64-7.2.0-20210720-aa8f76b --------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME   /usr/local/freesurfer/7.2.0-1
FSFAST_HOME       /usr/local/freesurfer/7.2.0-1/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR      /usr/local/freesurfer/7.2.0-1/subjects
MNI_DIR           /usr/local/freesurfer/7.2.0-1/mni
FSL_DIR           /usr/local/fsl
 
-bash-4.2$ psql nxnat
psql (9.2.24, server 10.16)
WARNING: psql version 9.2, server version 10.0.
         Some psql features might not work.
Type "help" for help.
nxnat=>  SELECT * FROM wrk_workflowdata WHERE wrk_workflowdata_id=3581;
 executionenvironment_wrk_abstractexecutionenvironment_id | comments | details | justification | description | src |    TYPE     | category |     data_type      |     id      | externalid | current_step_launch_time | current_step_id |  sta
tus  | create_user | pipeline_name | next_step_id | step_description |       launch_time       | percentagecomplete | jobid | workflowdata_info | wrk_workflowdata_id | scan_id 
----------------------------------------------------------+----------+---------+---------------+-------------+-----+-------------+----------+--------------------+-------------+------------+--------------------------+-----------------+-----
-----+-------------+---------------+--------------+------------------+-------------------------+--------------------+-------+-------------------+---------------------+---------
                                                          |          |         | auto-archive  |             |     | WEB_SERVICE | DATA     | xnat:mrSessionData | XNAT_E00141 | Test3      |                          |                 | Comp
lete |             | Transferred   |              | Complete         | 2020-05-16 07:32:06.711 |                    |       |              3041 |                3581 | 
(1 ROW)
 
nxnat=>  DELETE FROM wrk_workflowdata WHERE wrk_workflowdata_id=35381;
DELETE 1

delete, bulk mode

nxnat=> SELECT column_name FROM information_schema.columns WHERE TABLE_NAME='wrk_workflowdata';
                       column_name                        
----------------------------------------------------------
 executionenvironment_wrk_abstractexecutionenvironment_id
 comments
 details
 justification
 description
 src
 TYPE
 category
 data_type
 id
 externalid
 current_step_launch_time
 current_step_id
 STATUS
 create_user
 pipeline_name
 next_step_id
 step_description
 launch_time
 percentagecomplete
 jobid
 workflowdata_info
 wrk_workflowdata_id
 scan_id
(24 ROWS)
 
 
nxnat=>  SELECT * FROM wrk_workflowdata WHERE id='XNAT5_E00478';
 executionenvironment_wrk_abstractexecutionenvironment_id | comments | details |  justification  | description | src |    TYPE     | category |      data_type      |      id      | externalid | current_step_launch_time |    current_step_id
    |       STATUS       | create_user |                                   pipeline_name                                    | next_step_id |                                   step_description                                   |       launc
h_time       | percentagecomplete | jobid | workflowdata_info | wrk_workflowdata_id | scan_id 
----------------------------------------------------------+----------+---------+-----------------+-------------+-----+-------------+----------+---------------------+--------------+------------+--------------------------+-------------------
----+--------------------+-------------+------------------------------------------------------------------------------------+--------------+--------------------------------------------------------------------------------------+------------
-------------+--------------------+-------+-------------------+---------------------+---------
                                                          |          |         | standard upload |             |     | WEB_SERVICE | DATA     | xnat:petSessionData | XNAT5_E00478 | facehbi    |                          |                   
    | Complete           |             | Transferred                                                                        |              | Complete                                                                             | 2020-12-14 
10:36:38.784 |                    |       |              6701 |                7353 | 
                                                     1262 |          |         |                 |             |     | PROCESS     | DATA     | xnat:petSessionData | XNAT5_E00478 | facehbi    | 2020-12-14 10:36:48      | LAUNCH_PIPELINES  
    | Complete           |             | xnat_tools/AutoRun.xml                                                             |              | Launch auto-run pipelines                                                            | 2020-12-14 
10:36:39     | 100.0              |       |              6702 |                7354 | 
                                                          |          |         |                 |             |     | PROCESS     | DATA     | xnat:petSessionData | XNAT5_E00478 | facehbi    |                          |                   
 
...
...
...
 
nxnat=>  SELECT STATUS FROM wrk_workflowdata WHERE id='XNAT5_E00478';
       STATUS       
--------------------
 Complete
 Complete
 Failed (Dismissed)
 Failed
 Complete
 Complete
 Complete
 Complete
 Complete
 Complete
 Complete
 Failed
 Failed
 Failed
 Failed
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
 Running
nxnat=>  DELETE FROM wrk_workflowdata WHERE id='XNAT5_E00478' AND STATUS='Running';
DELETE 335
nxnat=>  SELECT STATUS FROM wrk_workflowdata WHERE id='XNAT5_E00478';
       STATUS       
--------------------
 Complete
 Complete
 Failed (Dismissed)
 Failed
 Complete
 Complete
 Complete
 Complete
 Complete
 Complete
 Complete
 Failed
 Failed
 Failed
 Failed
 Failed
 Failed
 Failed
 Failed
 Failed
 Failed
 Failed
 Failed
 Failed
 Failed
 Failed
 Failed
 Failed (Dismissed)
 Failed
(29 ROWS)
 
nxnat=>  DELETE FROM wrk_workflowdata WHERE id='XNAT5_E00478' AND STATUS='Failed';
DELETE 18
nxnat=>  SELECT STATUS FROM wrk_workflowdata WHERE id='XNAT5_E00478';
       STATUS       
--------------------
 Complete
 Complete
 Failed (Dismissed)
 Complete
 Complete
 Complete
 Complete
 Complete
 Complete
 Complete
 Failed (Dismissed)
(11 ROWS)
neuroimagen/xnat_db_edits.txt · Last modified: 2021/10/11 08:24 by osotolongo