Skip to content
Snippets Groups Projects
Select Git revision
  • ad1fefa1f93be80a21494b296539582175ba1e52
  • master default protected
  • L2SS-1914-fix_job_dispatch
  • TMSS-3170
  • TMSS-3167
  • TMSS-3161
  • TMSS-3158-Front-End-Only-Allow-Changing-Again
  • TMSS-3133
  • TMSS-3319-Fix-Templates
  • test-fix-deploy
  • TMSS-3134
  • TMSS-2872
  • defer-state
  • add-custom-monitoring-points
  • TMSS-3101-Front-End-Only
  • TMSS-984-choices
  • SDC-1400-Front-End-Only
  • TMSS-3079-PII
  • TMSS-2936
  • check-for-max-244-subbands
  • TMSS-2927---Front-End-Only-PXII
  • Before-Remove-TMSS
  • LOFAR-Release-4_4_318 protected
  • LOFAR-Release-4_4_317 protected
  • LOFAR-Release-4_4_316 protected
  • LOFAR-Release-4_4_315 protected
  • LOFAR-Release-4_4_314 protected
  • LOFAR-Release-4_4_313 protected
  • LOFAR-Release-4_4_312 protected
  • LOFAR-Release-4_4_311 protected
  • LOFAR-Release-4_4_310 protected
  • LOFAR-Release-4_4_309 protected
  • LOFAR-Release-4_4_308 protected
  • LOFAR-Release-4_4_307 protected
  • LOFAR-Release-4_4_306 protected
  • LOFAR-Release-4_4_304 protected
  • LOFAR-Release-4_4_303 protected
  • LOFAR-Release-4_4_302 protected
  • LOFAR-Release-4_4_301 protected
  • LOFAR-Release-4_4_300 protected
  • LOFAR-Release-4_4_299 protected
41 results

sql

  • Open with
  • Download source code
  • Download directory
  • Your workspaces

      A workspace is a virtual sandbox environment for your code in GitLab.

      No agents available to create workspaces. Please consult Workspaces documentation for troubleshooting.

  • Jorrit Schaap's avatar
    SW-41: measure and log several sql procedures to see where the time is spend.
    Jorrit Schaap authored
    ad1fefa1
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    -------------------------------------
    SQL script update procedure
    -------------------------------------
    To update the .sql files in this directory, follow the following steps.
    
    SOURCE = directory of the root of your checkout
    
    * Build and install this package ("ResourceAssignmentDatabase"):
        mkdir -p ~/build/gnu_opt && cd ~/build/gnu_opt
        cmake -DBUILD_PACKAGES=ResourceAssignmentDatabase $SOURCE
        make -j 8 install
    * Add its paths to your environment:
        source ~/build/gnu_opt/installed/lofarinit.sh
    * Go back to this source dir
        cd $SOURCE/SAS/ResourceAssignment/ResourceAssignmentDatabase/sql
    * Regenerate the .sql files
        ./create_add_notifications.sql.py
        ./create_add_virtual_instrument.sql.py
    
    -------------------------------------
    Database creation procedure (test system)
    -------------------------------------
    To create a fresh and empty RADB, follow the following steps.
    
    * Obtain credentials. Login as lofarsys@scu199 and:
    * Copy *.sql to scu199 and go there:
        scp *.sql scu199:
        ssh scu199
    * Obtain/adjust the relevant credentials. As lofarsys:
        cat ~/.lofar/dbcredentials/radb.ini
    * Stop any services interacting with the radb:
        supervisorctl -p 123 stop ra_services:
    * If you want a NEW database, create one (see radb.ini for the relevant parameters):
        (see create_database.sql)
    * Reinitialise the database (see radb.ini for the relevant parameters):
        psql -h $DBHOST $DATABASE -U $DBUSER -f create_and_populate_database.sql -W
    * Ignore all NOTICES.
    * Stop any services interacting with the radb:
        supervisorctl -p 123 start RA_Services: