TWiki
>
LCG Web
>
LCGGridDeployment
>
LCGSoftware
>
DataManagementTop
>
DataManagementDocumentation
>
ChangeSeName
(revision 6) (raw view)
Edit
Attach
PDF
---+ Storage Element (SE) name change In case the FQDN of a SE changes, some entries need to be modified in the LFC databases. <br /> ---++ Oracle LFC In this section you describe how to the update with an Oracle LFC.<br /><br /> --- ---+++ Presentation of the script<br /> This is taken care of automatically by the =PL/SQL script update_sfn_path.sql=. It is not yet included in any =LFC= RPM, but can be found in the [[http://jra1mw.cvs.cern.ch:8180/cgi-bin/jra1mw.cgi//LCG-DM/scripts/change-se-name/][gLite CVS repository]] : * under LCG-DM/script/change-se-name This script is composed of two functions:<br /> * *update_host_name* (<span style="color: blue;">host_to_replace</span> varchar2, <span style="color: red;">host_name_replacing</span> varchar2) which allows replacing the Cns_file_replica.host column = <span style="color: blue;">host_to_replace</span> with <span style="color: red;">host_name_replacing</span>; * *update_sfn* (<span style="color: blue;">sfn_prefix_to_replace</span> varchar2, <span style="color: red;">sfn_prefix_replacing </span>varchar2, host_cond varchar2 default NULL) which allows replacing the Cns_file_replica.sfn column starts with <span style="color: blue;">sfn_prefix_to_replace <span style="color: black;">with </span></span><span style="color: red;">sfn_prefix_replacing<span style="color: black;">. An extra condition must be given is the host entry.</span><br /></span> --- ---+++ Installation of the script (to do only the first time)<br /> As it is a PL/SQL script, it needs to be compiled on the DB. To do so, launch a sqlplus command line and connect to the DB. Then type, @<path_to_plsql_script>/update_sfn_path.sql. <br /> ---+++ Example of usage<br /> ---++++ Updating the host name To change the host lxb5409.cern.ch to lxn1177.cern.ch, you need to do as follows:<br /><br /> <verbatim> sqlplus> set serveroutput on; sqlplus> set variable rescode varchar2(1000); sqlplus> exec :rescode:=update_host_name('lxb5409.cern.ch','lxn1177.cern.ch'); sqlplus>print rescode; </verbatim> The script should return rescode=SUCCESSFUL_UPDATE if the update has been done correctly. *Note:* with Oracle version > 10.2.0.4, =set variable rescode ...= doesn't work. Use =variable rescode ...= instead. ---++++ Updating the sfn entries There are two possible scenarii: <br /> * I want to replace all the sfns which *start with* srm://sc.cr.cnaf.infn.it/castor/cnaf.infn.it/grid/lcg/atlas/datafile with srm://storm-fe.cr.cnaf.infn.it/atlas/datafiles/. You need to use the script as follows: <verbatim> sqlplus> set serveroutput on; sqlplus> set variable rescode varchar2(1000); sqlplus> exec :rescode:=update_sfn('srm://sc.cr.cnaf.infn.it/castor/cnaf.infn.it/grid/lcg/atlas/datafile/','srm://storm-fe.cr.cnaf.infn.it/atlas/datafiles/'); sqlplus>print rescode; </verbatim> The script should return rescode=SUCCESSFUL_UPDATE if the update has been done correctly.<b><br /></b> *Note:* with Oracle version > 10.2.0.4, =set variable rescode ...= doesn't work. Use =variable rescode ...= instead. * I want to replace all the sfns which *start with* srm://sc.cr.cnaf.infn.it/castor/cnaf.infn.it/grid/lcg/atlas/datafile with srm://storm-fe.cr.cnaf.infn.it/atlas/datafiles/ *AND* which are located on host='DCTAPE_00' You need to use the script as follows: <verbatim> sqlplus> set serveroutput on; sqlplus> set variable rescode varchar2(1000); sqlplus> exec :rescode:=update_sfn('srm://sc.cr.cnaf.infn.it/castor/cnaf.infn.it/grid/lcg/atlas/datafile/','srm://storm-fe.cr.cnaf.infn.it/atlas/datafiles/','DCTAPE_00' ); sqlplus>print rescode; </verbatim> The script should return rescode=SUCCESSFUL_UPDATE if the update has been done correctly. *Note*: in the two previous scenarii, if you have already registered your new sfn, the script deletes the entry with the old sfn. *Note:* with Oracle version > 10.2.0.4, =set variable rescode ...= doesn't work. Use =variable rescode ...= instead. ---++ !MySQL LFC If you have a !MySQL LFC, you can do as follows:<br /> <verbatim> 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 </verbatim> If you have millions of entries then you need to limit the number of rows to update via limit and retype the command unitl you see *0 rows affected* <verbatim> 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/') limit 1000; Query OK, 1000 rows affected (0.01 sec) Rows matched: 32000 Changed: 1000 Warnings: 0 mysql> update Cns_file_replica set sfn = replace(sfn,'sfn://se01.cern.ch/old/path/','srm://new-se01.cern.ch/my/new/path/') limit 1000; Query OK, 1000 rows affected (0.01 sec) Rows matched: 32000 Changed: 1000 Warnings: 0 mysql> update Cns_file_replica set sfn = replace(sfn,'sfn://se01.cern.ch/old/path/','srm://new-se01.cern.ch/my/new/path/') limit 1000; Query OK, 0 rows affected (0.01 sec) Rows matched: 32000 Changed: 1000 Warnings: 0 </verbatim> <b><br /></b> *WARNING:* if the new files have already been registered in the LFC, you will get a unique violated constraint, to circumvent it, you need to delete the old entries first and then run the update command. <br /> --- ---++ Checks that you can perform afterwards * You can rerun the script and check that no entries have been left out. you should of course get that there are no entries to update * You can connect directly to the database and check that the HOST field of the main table returns the correct entry (same remark for the sfn column). <verbatim> select count(*) from Cns_file_replica where HOST='oldSE.cern.ch'; </verbatim> --- ---++ Troubleshooting In case the script complains about =NLS_XXXX= parameters, just unset all the =NLS_XXXX= environment variables before running the script : <verbatim> unset NLS_LANG unset ORA_NLS33 unset NLS_DATE_FORMAT </verbatim> --- ---++ Help ! In case of problems, contact helpdesk@ggus.org (remove the NOSPAM !) : your ROC will help you and contact the appropriate experts if needed. --- -- Main.SophieLemaitre - 06 Jul 2006
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r8
<
r7
<
r6
<
r5
<
r4
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r6 - 2008-04-02
-
SophieLemaitre
Log In
LCG
LCG Wiki Home
LCG Web Home
Changes
Index
Search
LCG Wikis
LCG Service
Coordination
LCG Grid
Deployment
LCG
Apps Area
Public webs
Public webs
ABATBEA
ACPP
ADCgroup
AEGIS
AfricaMap
AgileInfrastructure
ALICE
AliceEbyE
AliceSPD
AliceSSD
AliceTOF
AliFemto
ALPHA
Altair
ArdaGrid
ASACUSA
AthenaFCalTBAna
Atlas
AtlasLBNL
AXIALPET
CAE
CALICE
CDS
CENF
CERNSearch
CLIC
Cloud
CloudServices
CMS
Controls
CTA
CvmFS
DB
DefaultWeb
DESgroup
DPHEP
DM-LHC
DSSGroup
EGEE
EgeePtf
ELFms
EMI
ETICS
FIOgroup
FlukaTeam
Frontier
Gaudi
GeneratorServices
GuidesInfo
HardwareLabs
HCC
HEPIX
ILCBDSColl
ILCTPC
IMWG
Inspire
IPv6
IT
ItCommTeam
ITCoord
ITdeptTechForum
ITDRP
ITGT
ITSDC
LAr
LCG
LCGAAWorkbook
Leade
LHCAccess
LHCAtHome
LHCb
LHCgas
LHCONE
LHCOPN
LinuxSupport
Main
Medipix
Messaging
MPGD
NA49
NA61
NA62
NTOF
Openlab
PDBService
Persistency
PESgroup
Plugins
PSAccess
PSBUpgrade
R2Eproject
RCTF
RD42
RFCond12
RFLowLevel
ROXIE
Sandbox
SocialActivities
SPI
SRMDev
SSM
Student
SuperComputing
Support
SwfCatalogue
TMVA
TOTEM
TWiki
UNOSAT
Virtualization
VOBox
WITCH
XTCA
Welcome Guest
Login
or
Register
Cern Search
TWiki Search
Google Search
LCG
All webs
Copyright &© 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use
Discourse
or
Send feedback