- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2015 10:15 PM
Hi Folks
Any idea how to back up sys_attachment_doc records on a date range? The table list layout seems to time out every time it is being loaded, even with a simple script querying
var rec = new GlideRecord('sys_attachment_doc')
rec.addEncodedQuery("sys_created_onBETWEENjavascript:gs.dateGenerate('2015-10-02','00:24:00')@javascript:gs.dateGenerate('2015-10-02','00:54:00')");
rec.query();
if (rec.next()) {
gs.print(rec.sys_id + '\t' + rec.sys_created_on);
}
Any idea would be appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2015 10:58 PM
Hi George,
Thanks for getting back with the happy ending!
Consider marking your last post, mentioning export to xml, as the correct answer.
Best Regards
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2015 12:39 AM
Hi George,
Great.
As there is no index on sys_attachment_doc.sys_created_on a full table scan was required to get the date range, meaning because of the large number of records in the sys_attachment_doc table it is not feasible.
You could add an index on sys_attachment_doc.sys_created_on and a list view might succeed - and you could export from the list view.
Or perhaps you could create a database view across sys_attachment and sys_attachment_doc sys_id to sys_id which are indexed - then export from the db view.
Or have you already a working export?
Best Regards
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2015 01:28 AM
I did say:
"You could add an index on sys_attachment_doc.sys_created_on and a list view might succeed - and you could export from the list view."
However, I am not really convinced this is a solution, as if you partition the sys_attachment_doc by time, I suppose it is possible some chunks for a specific sys_attachment might end up in one export and other chunks in another.
Collecting the sys_attachment_doc chunks for sys_attachment seems better.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2015 05:45 AM
Hi George,
How did you get on?
Any Solution found?
If not, can you update with further questions.
If yes consider marking the question as answered, and marking replies as helpful as appropriate.
Best Regards
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2015 09:48 PM
Hi Tony
Apologies for the late response. Actually I end up raising an incident from ServiceNow HI who helped export email attachments via a series of xml files. This way I did not have to worry about the underneath attachment doc chunks.
Thanks a lot for the help.
Kind regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2015 10:58 PM
Hi George,
Thanks for getting back with the happy ending!
Consider marking your last post, mentioning export to xml, as the correct answer.
Best Regards
Tony