Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
[tersk02]:u/cd/greg> source /afs/slac/g/cd/soft/dev/script/ENVS.csh
[tersk02]:u/cd/greg> source /afs/slac/g/cd/soft/dev/script/aidaSetEnv.csh [DEV|PROD|LCLSDEV|LCLS]

Make sure you have TWO_TASK set appropriately:

Wiki Markup
\[tersk02\]:u/cd/greg> printenv TWO_TASK

DEV=AIDADEV@SLACPROD
PROD=AIDAPROD@SLACPROD
LCLSDEV=AIDA@MCCQA
LCLS=AIDA@MCCO

(See these defined in /afs/slac/g/cd/soft/ref/package/aida/common/script/aidaSetEnv.csh)

WHEN FIRST ADDING A NAME, USE "DEV". That will put the new name in AIDADEV. So you will then check that the AIDADEV network can get a value for that name (see below)

Then enter a sql interpreter like sqlplus. You give the Aida database on which you will be performing operations. On tersk this is:

...

You can also use emacs' sql-oracle mode. You'll need to ask an Oracle administrator for the password.

Adding a Name

First, find out the AIDA Server id number for which you'll be adding the name. To do that eithe rjust look in AIDA_SERVICES table yourself, or use the script show_services.

Second, add a row to AIDA_NAMES and AIDA_DIRECTORY to implement the new entity, per the schema defined in the Aida Schema. Effectively, do what is defined in /afs/slac/g/cd/soft/ref/package/aida/common/script/add_IA.sql or add_IAT.sql.

Management SQL scripts

This subsection describes the use of some of the many SQL scripts that you can find in /afs/slac/g/cd/soft/package/aida/common/script/.

...

Code Block
add_IA 5 XCOR:IN20:121 suml_m "/select suml_m from 
lcls_infrastructure.v_lcls_elements_report where epics_device_name = ''\&instance''"

...

Code Block
SQL> select n.instance, n.attribute, s.name, n.transform from 
aida.aida_names n, aida.aida_directory d, aida.aida_services s where 
n.instance like '&1' and n.attribute like '&2' and n.id = d.name_id and d.service_id = s.id;
SQL> commit;

...

Code Block
define I='YCOR:LI30:900'
define A='element.effective_length'
select n.instance, n.attribute, s.name, n.transform from 
AIDA.aida_names n, AIDA.aida_directory d, AIDA.aida_services s where 
n.instance like '&I' and n.attribute like '&A' and n.id = d.name_id and d.service_id = s.id;
SQL> commit;

...