Download your SR content from MOS

Franck Pachot's picture

You may want to keep track of your Oracle Service Requests offline. Or simply be able to read them as simple text. Here is a simple way to download all of them to a simple text file.

First, it is easy to get a list of the Service Requests as an Excel file. Just list them on the GUI. You may choose:

  • The Support Identifiers (CSI) on the right
  • Only SR where you are primary contact or all of them, with the ‘person’ icon
  • Include closed SRs with the red check icon
  • The columns: View -> Columns -> Show all

And then View -> Export to XLS

The service_requests.xls is actually in XML format which is easy to parse, but you can also convert it to CSV. Here I have saved it to service_requests.csv

Then with AWK and LYNX installed here is how to get each SR into text:

awk -F";" 'NR>1{gsub("[()/?%*:|. \\" q qq "]","_");print "lynx -dump -accept-all-cookies -auth=: " q "" $2 "&print=true&sysmsg=true&sortBy=Newest%20on%20Top" q "> " q $9 "_" $2 "_" $1".txt" q '} q="'" qq='"' service_requests.csv | sh -x

The ideas is to build the file name from the contact ($9), the SR number ($2), and the subject ($1 after translating some characters to ‘_’). And then download using the url used for the ‘print’ view. The authentication is easy with -auth=ID:PASSWD the argument where you pass your Oracle SSO login username and password. Just replace and with yours.

Note that you should not try to run that in parallel or you will get ‘The user has already reached the maximum allowed number of sessions’.

To prevent automated spam submissions leave this field empty.