Storage Element (SE) name change
In case the FQDN of a SE changes, some entries need to be modified in the LFC databases.
This is taken care of automatically by the
update-LFC-after-SE-renamed.pl
script.
It is not yet included in any
LFC
RPM, but can be found in the
gLite CVS repository
:
-
LCG-DM
module
- under
script/change-se-name
Note : the script only supports Oracle as a database backend for the moment. You should run the script from any LFC front end node.
Requirements
To run the
update-LFC-after-SE-renamed.pl
script, the following packages need to be installed :
-
perl
-
perl-DBI
-
perl-DBD
(for Mysql or Oracle)
Note : if using
Mysql
>= 4.1,
perl-DBD-mysql
>= 2.9003 should be used.
Note2 : the script only supports Oracle as a database backend for the moment.
Example for Oracle
Note: You can get the necessary connection paramenters in the file /opt/lcg/etc/NSCONFIG.
The
dummy
option only shows the SQL statements that will be executed in the LFC database. But no change will actually be made.
./update-LFC-after-SE-renamed.pl --db LFC_SID --user lfc_user --pwd XXXXX
--oldSE se01.cern.ch --newSE new-se01.cern.ch
--oldPath sfn://se01.cern.ch/old/path --newPath srm://new-se01.cern.ch/my/new/path/ --dummy
...
SQL : UPDATE Cns_file_replica SET host='new-se01.cern.ch' WHERE fileid=989 and sfn='sfn://se01.cern.ch/old/path/dteam/directory1/file1'
SQL : UPDATE Cns_file_replica SET sfn='srm://new-se01.cern.ch/my/new/path/dteam/directory1/file1' WHERE fileid=989 and sfn='sfn://se01.cern.ch/old/path/dteam/directory1/file1'
...
Dummy run completed. 343 rows to change.
We recommend that you redirect the output to a file in case the number of rows to update is very large. If the number of
rows to change is large the real operation can take quite some time, obviously.
./update-LFC-after-SE-renamed.pl --db LFC_SID --user lfc_user --pwd XXXXX
--oldSE castorgrid.cern.ch --newSE castor.cern.ch
--oldPath sfn://se01.cern.ch/old/path --newPath srm://new-se01.cern.ch/my/new/path/
Update complete. 343 rows changed.
Example for Mysql
The
update-LFC-after-SE-renamed.pl
script has not been ported to
MySQL yet.
But the following will work, unless the new files have already been registered in the LFC with the new host/path :
mysql> use cns_db
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> update Cns_file_replica set sfn = replace(sfn,'sfn://se01.cern.ch/old/path/','srm://new-se01.cern.ch/my/new/path/') ;
Query OK, 38 rows affected (0.01 sec)
Rows matched: 2107 Changed: 38 Warnings: 0
mysql> update Cns_file_replica set host = replace(host,'se01.cern.ch','new-se01.cern.ch') ;
Query OK, 38 rows affected (0.01 sec)
Rows matched: 2107 Changed: 38 Warnings: 0
WARNING: This will not work if the new files have already been registered in the LFC !
Checks that you can perform afterwards
Troubleshooting
In case the script complains about
NLS_XXXX
parameters, just unset all the
NLS_XXXX
environment variables before running the script :
unset NLS_LANG
unset ORA_NLS33
unset NLS_DATE_FORMAT
Help !
In case of problems, contact
helpdesk@ggusNOSPAMPLEASE.org (remove the NOSPAM !) : your ROC will help you and contact the appropriate experts if needed.
--
SophieLemaitre - 06 Jul 2006