infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Read Only Archives
Cloverleaf
Cloverleaf
Script for Cycling SMAT database
System
Originally posted by David Speare
We are upgrading to 6.1 does anyone have a cycle SMAT database script that they might share?
Find more posts tagged with
Clovertech
Comments
brent-fenderson
David, I'm sure everyone has some variation of the hcicyclesavemsgs.pl found in the contrib folder. Cycling smat is the same function. You''ll just need to manage the *.old.smatdb files.
Keith McLeod
If you disable all SMAT DB configurations, you can essentially continue to use your current form of cycling the saved messages. If you choose to use SMATDB, it appears that you must first configure in the site options and then in the process configuration within your network configuration tool select Automatic SMAT Cycling and establish a threashhold in KBytes. This appears to be the ruling configuration from my observations. It moves the SMATDB to SmatHistory under each process. The file will use a time stamp in its name.
You will probably need to query differently for daily stats if you were accustomed to cycling on a fixed period...
I am still exploring this new method and welcome others advice and feedback.
Peter Heggie
Can you move SMAT DB files from SmatHistory to another folder, and be able to search and display messages from that other folder? Or at least copy them back into SmatHistory for searching and viewing?
We want the older content to be backed up on another file system. So far, in just casual testing, we are unable to use the GUI Smat DB search & view functions on Smat DB files that are moved from SmatHistory to another folder. Maybe it is the way we are moving the files.
Does anyone know what each individual Smat DB file type is used for and how it should be treated?
smatdb
smatdb-shm
smatdb-wal
?
Peter
Keith McLeod
Looks like you are bound to this folder structure in order to use the SMATDB GUI. Of course you could make use of symbolic links to establish SMATDBs on a separate file system.
Peter Heggie
If we used symbolic links, then it would have to be done for SmatHistory folder itself?
I second the idea of having a webinar devoted to Smat DB, for someone to gather and distill all the knowledge and recommendations of using Smat DB and share them, and also allow questions and answers.
Keith McLeod
Another option would be to create a link at the process directory level.
Peter Heggie
We already have each site on another file system, with the soft link established under $HCIROOT. We wanted to have ~tertiary~ locations for very old smat files. We are reviewing our entire setup with our move to 6.1. Currently we use hcicyclesavemsgs to copy and compress SMAT files to ./Inboundsave, then run nightly scripts to move 15 day old SMAT files to a secondary location, and another nightly script to move 30 day old SMAT files to a tertiary location. Each of these locations is on a different file system. I'm not really sure what the value of this setup is - it pre-dated me here. I'm guessing it is because the older the file is, the less likely we will have to access it and that may help the company's data storage software/backup solution (ex: TMS) avoid backing up files. But thinking more about it, that idea is kind of weak - TMS or other solutions are pretty efficient, so the location should not matter.
Does anyone have any good reasons why anyone would need more than one backup location for SMAT databases?
jcobane1
I was playing with this a little bit in our DEV environment.
Peter Heggie
so did you manually (scripted) move or copy the SMAT DB files out of SmatHistory into your linked /logs folder?
jcobane1
We don't have the SMAT History turned on, so currently the cycle just creates the .old files in the exec/processes/xxx directory. The script runs the cycle save commands, then copies any .old files to the /logs/ddd directory (where ddd is the respective day of the week - Mon, Tue...). But the script could be modified to move the files from the SmatHistory folder, if needed.
Jim Cobane
Henry Ford Health
System
Originally posted by Alice Kazin
We are using the Smat Databases with Smat history enabled. However, we did not configure "automatic smat cycling" under the process configuration. We use a script to cycle save the smat files daily and compress them. We liked the idea of the cycled Smat files having a date time stamp. Then you don't have the issue of one ".old" file overlaying another.
Peter Heggie
Does your script move the SMat DB files to another directory outside of ./SmatHistory? If so, are you able to uncompress them and search them using the GUI?
System
Originally posted by Alice Kazin
Right now we are using SmatHistory. We are working on plan to move archved Smat database files to separate box. You can unzip the files in SmatHistory and search them with the SmatDatabase tool.
Keith McLeod
I just created a subdirectory under SmatHistory. It shows up in the GUI with check boxes. This leads me to believe that you could archive to either a subfolder or across file systems with a symbolic link. I would guess that your directory would have to at least be under the root of where the Smat GUI allows you to point to.
Peter Heggie
looks good - I tried the same thing, moved smat dbg files into the new sub folder and was able to search them using the GUI.
Not sure why I couldn't get it to work before.
Still don't know what the *-shm and *-wal files are for - I deleted them and was still able to search and display.
But this holds promise for flexibility.
jcobane1
Attached is our version of a hcicyclesavemsgs script. It is configured to handle the .old files as well as files under SmatHistory. You may find it helpful in creating your own version. Usage is simply to setsite prior to running the script, then run the script. We have this configured in cron to run for each site; when it moves the files, it prefixes them with the name of the site.
Hope this helps.
Jim Cobane
Henry Ford Health
Peter Heggie
thank you - I'll look at this. We would add something to only move files that are X days old.
Does it help to compress Smat DB files? Should we use SQLite vacuum command?
jcobane1
I don't think there would be any advantage to running the SQLite VACUUM command as you aren't really deleting any records from the SMATDB files. Compressing/zipping them with 'compress' or 'gzip' may save some space, but you would have to try it and see.
Jim Cobane
Henry Ford Health
Max Drown
Out of curiosity, (for those who aren't) how come you aren't using the built-in cycling combined with an archive tool for moving old data off the disk? It's much easier to manage. SMAT DB searches across files, so timed archives (ex. every day at 1am) are no longer needed.
Cloverleaf will watch log files and SMAT files and move them to the LogHistory and SmatHistory sub directories when they reach the specified file size. The Site Options contain settings for pruning these two sub-directories.
For example, set the processes to auto cycle logs and SMAT files at 10mb. Set the LogHistory options to only keep 100 files (the oldest file will automatically be deleted). Set the SmatHistory options to keep 90 days worth of data; data older than 90 dates is automatically deleted. Set your archive software to watch these directories and backup data off disk to wherever you'd like. Adjust the numbers to your needs.
This allows you to predict pretty accurately how much disk you'll need with older data archived off-disk. Using SMAT DB, it's very easy to search across multiple SMAT files.
jcobane1
Since we haven't upgraded to 6.1 yet, we don't have the SMAT DB to search across multiple SMAT saves. We like to keep a nice clean snapshot of each day, so cycling by size might not generate a save for the day if the file is not large enough; and setting it too low would create multiple files to search through (on file-based SMAT). A nice enhancement would be to allow a 'daily' auto-cycle, instead of just based on file size.
Hope that makes sense.
Jim Cobane
Henry Ford Health
System
Originally posted by Alice Kazin
We are also looking for a daily "auto cycle". We are gzipping our archived Smat database files and it makes a big difference.
Peter Heggie
Just another comment - We do want to keep 90 days worth of Smat data, but I'm not sure we want to search through all of it to retrieve messages that are only a few days old.
So I'm thinking about using the site options to specify archiving the Smat DB to /SmatHistory after one day and using a script to move and compress the Smat DB files to another file system after 7 days.
This gives us 7 days worth of Smat data to search through. If older data is desired, it would have to be manually copied back and uncompressed into /SmatHistory.
I am thinking that having 90 days worth of Smat data will require a much longer search time than 7 days worth of data. So that is why I'd like at least three different retention thresholds - 1 day, 7 days and 90 days.
If 7 days worth of data (approximately 100,000 messages per day), is searchable without appreciable delay, then I'll keep 7 days worth in /SmatHistory, and move older content somewhere else. And I'll have to set the archive to occur after 1 day, so that a script can easily find the files older than 7 days and move them.
Unless you can tell me that searching 90 days worth of data is not appreciably longer than 7 days worth.
Max Drown
Peter, I sent that on to R&D. Good ideas.
Peter Heggie
Thank you
And just to clarify - I think searching seven days, based on comments so far, will not be significantly longer than one day. So we will always select both the process directory and the SmatHistory sub-directory.
And to get the 'round-trip' or complete life-cycle view, we will frequently select all Smat DB files under the /exec/processes folder. Hopefully this will perform well.
So as long as we can uncompress and move files back into /SmatHistory, we can use scripts to move back and forth.
But it is a nice-to-have to get additional built-in functionality to help us move and/or compress to a true archive (non-searchable) directory.
Also, we expect to use this approach from Global Monitor, and hope to turn over searching and reporting functions to users that are not Cloverleaf administrators, so we would like to keep the process of selecting Smat DB Files as simple as possible.
Max Drown
Peter, here's the response from R&D.
Good Suggestions. I
Peter Heggie
That is exactly what I had in mind. Good to know about the compress result too!
thank you
System
Originally posted by Alice Kazin
Note: for SMAT DB, the compressed file is larger than the raw file. So no need to compress. I don't think this is correct.
From our experience, the compressed (gzipped) SmatDB file was smaller than the raw file.
Keith McLeod
Still learning the ins and outs of SMATDB.
Max Drown
Keith, that would be an excellent enhancement request to submit via Infor Xtreme. I have also passed the question on directly to R&D.
jcobane1
From Keith's post, it indicates there is a limit on the number of SQLite databases. Can you expand/explain what that limitation is? Is it the number of database files that you can search on via the tool? Am I going to have an issue if I have more than 59 database files for a given thread?
For example, if I am cycling the SMAT file for a thread based on size and I create more than 59 history files for that thread, I won't be able to search across all of them?
Any additional info is appreciated.
Thanks,
Jim Cobane
Henry Ford Health