Hi, Gurbeer,

CORB is great at such jobs: http://developer.marklogic.com/search?q=corb.  
Testing in a lower tier helps to validate the intended outcome and extrapolate 
how long the job is expected to take in prod.  CORB is a Java process.  You get 
to configure the number of threads.  Tune it to utilize available system 
resources and shorten the maintenance window.  Foremost, profile and optimize 
the code that will modify the documents -this isn't in response to your code, 
but just general guidance.  Since this is a write op, this should probably be 
the only process that is writing to the database.  And, as always, backup 
before you kick the job off and have a plan to rollback.

-Brent

From: [email protected] 
[mailto:[email protected]] On Behalf Of Singh, Gurbeer
Sent: Wednesday, October 03, 2012 5:58 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Need advice for Production Update

Hi ,

We need to update huge amount of XML/xhtml  and it's a production  data.

Let me explain you process

We have a submission form, through which we submit document to Marklogic, 
Submission form contains Meta data. There is structural change in Submission 
form meta data. We need to update these meta data of all documents in ML
One way is design a JOB which will resubmit all these documents with new meta 
data ..but it's a long process

I tried below query in CQ  for one document and it worked, just want to know, 
is it safe to play like this


xquery version "1.0-ml";

import module namespace 
config="http://www.makrlogic.com/morganStanley/delivery/ui/lib/searchConfig.xqy";
 at "/lib/searchConfig.xqy";
import module namespace search="http://marklogic.com/appservices/search"; at 
"/MarkLogic/appservices/search/search.xqy";
declare namespace fwp="http://morganstanley.com/firmwidePolicy";;
declare namespace xhtml="http://www.w3.org/1999/xhtml";;

declare  variable $TAXONOMY_DOC :="/topicMaps/CCid.xml";

let $query:=
cts:and-query((cts:directory-query("/policies/", "infinity"),
cts:element-value-query(xs:QName("fwp:ccid"),"1N41")))

let 
$newnode:=fn:doc($TAXONOMY_DOC)/firmwidePolicy/CCid[@code="1N41"]/fwp:divisions

for $uri in cts:uris((), (), $query) where $uri eq 
"/policies/otherDocs/1549333_doc.xhtml" (: we will not use where clause :)

return
xdmp:node-replace(fn:doc($uri)/xhtml:html/xhtml:head/fwp:divisions,$newnode)


~Gurbeer
________________________________
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or 
views contained herein are not intended to be, and do not constitute, advice 
within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and 
Consumer Protection Act. If you have received this communication in error, 
please destroy all electronic and paper copies and notify the sender 
immediately. Mistransmission is not intended to waive confidentiality or 
privilege. Morgan Stanley reserves the right, to the extent permitted under 
applicable law, to monitor electronic communications. This message is subject 
to terms available at the following link: 
http://www.morganstanley.com/disclaimers. If you cannot access these links, 
please notify us by reply message and we will send the contents to you. By 
messaging with Morgan Stanley you consent to the foregoing.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to