I added some functionality to register (and report) not only the global names but also the class name (using that global). Thanks Dale for the idea.

[Update is available via GitHub, link in the post above]

Here also is some sample output -

Data Usage Report
===========================

Database file size used: 1
Journal file size used: 0
Journal space used: 325108

Globals growth
----------------------
Ens.MessageBodyD                                                                     .007
Ens.MessageHeaderD                                                                   .02
Ens.MessageHeaderI                                                                   .003
Ens.Util.LogD                                                                        .004
ITest.Proxy.s0.AddressD            ITest.Proxy.s0.Address.cls                        .004
ITest.Proxy.s0.PersonD             ITest.Proxy.s0.Person.cls                         .003

Journal Profile
----------------------
Ens.ActiveMessage                                                                    26184
Ens.BusinessProcessD                                                                 3308
Ens.BusinessProcessI                                                                 1456
Ens.Configuration                                                                    424
Ens.JobRequest                                                                       132
Ens.JobStatus                                                                        112
Ens.MessageBodyD                                                                     19508
Ens.MessageHeaderD                                                                   34624
Ens.MessageHeaderI                                                                   89540
Ens.Queue                                                                            37996
Ens.Runtime                                                                          50920
Ens.Suspended                                                                        100
Ens.Util.LogD                                                                        10404
Ens.Util.LogI                                                                        12248
ITest.Proxy.s0.AddressD            ITest.Proxy.s0.Address.cls                        16096
ITest.Proxy.s0.PersonD             ITest.Proxy.s0.Person.cls                         8624

Globals remaining after purge
----------------------
ITest.Proxy.s0.AddressD            ITest.Proxy.s0.Address.cls                        .004
ITest.Proxy.s0.PersonD             ITest.Proxy.s0.Person.cls                         .003

Thanks for clarifying Dmitry.

In this case, if people can't view the images then just replacing the Terminal images with text, will not be enough as their meaning and relevance is accompanied by the related Journal contents screenshots. And I don't think it makes sense to start replacing all of that with text as well. So for now I will leave this post as is. The essence anyway is written up in the body of the post, and the images are just for illustration and/or emphasis.

I will though take this into consideration and for future posts prefer text over Terminal images.

Regarding using non-journaled databases I just wanted to point out that  this approach was taken by us (InterSystems) internally for certain Ensemble globals.

See this from the 2015.1 Ensemble Release Notes. For each Ensemble database another non-journaled database is created, with a naming convention of <myDatabase>ENSTEMP.

For example:

This database will hold specific data (that used to be in CACHETEMP).

Indeed the release note also mentions the mirroring implication.

This was done mainly for security considerations (as mentioned in the post above).

[Internally one can see JGM092 and JGM097 for details]

I can do this Dmitry, but I am wondering why this is needed.

If this is in order to be able to copy & paste code, then in this post's case, the code pasted from terminal is either simple SETs, which have no meaning outside the context of the post's basic example, or if they are sample commands, then they appear elsewhere in the post where they can be copied from.

If there is another reason please let me know.

Thanks.

William, for more info about using OS authentication see here from the docs. Specifically see also there a note regarding Kerberos on Windows and using Domain users. This might play better for you with your locked-down installation as OS authentication is not on by default (system-wide).

Assuming you want to use OS Authentication - you need to first make sure this on system-wide:

Then make sure it is on for the service (%Service_Console is this case):

And that you have a Caché User with the same name as the OS User (and that of course has the relevant authorization):

Then you should be able to run without having to authenticate separately to Caché.

For example opening the Terminal without getting prompted for login:

[ As opposed to the behavior without OS authentication enabled:

]

Hope this helps.

Thanks Dmitry.

Indeed the focus here was on finding the possible globals you would want to dive deeper into regarding why they are taking up relatively a lot of journal space, and thinking of ways to mitigate that.

When I get a chance I planned to follow-up with another post on ways to avoid journaling for such globals (though not always is that an option). Stay tuned...

Thanks Luca.

Note this is not instead of run-time monitoring and alerting.

This is intended for a one-time run (though could be iterative) at development/testing phase. In order to help plan the required disk-space (and validate proper purging). For this I thought something Ensemble-specific, as well as growth process-oriented (capture, run, capture, compare, report) was beneficial. In real-time production phase of course one would put into place the more generic core monitoring functionalities, and would have no use of this framework.

Hi Jon,

I'm not sure this is exactly what you were looking for but you should be aware of the %XML.DataSet class.

With this class you can run an SQL query (for example returning all the instances of your class, or filter out some subset of it) and get the results in XML format (including the metadata of the result).

See more details in the docs.

Here's a sample run:

 
SAMPLES&gt;set dataset=##class(%XML.DataSet).%New()
 
SAMPLES&gt;write dataset.Prepare("SELECT TOP 5 ID, Name, DOB FROM Sample.Person WHERE Name %STARTSWITH ?")
1
SAMPLES&gt;write dataset.Execute("b")
1
SAMPLES&gt;do dataset.XMLExport()
&lt;SQLResult&gt;
&lt;s:schema id="DefaultDataSet" xmlns="" attributeFormDefault="qualified" elementFormDefault="qualified" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"&gt;
  &lt;s:element name="DefaultDataSet" msdata:IsDataSet="true"&gt;
    &lt;s:complexType&gt;
      &lt;s:choice maxOccurs="unbounded"&gt;
        &lt;s:element name="SQL"&gt;
          &lt;s:complexType&gt;
            &lt;s:sequence&gt;
              &lt;s:element name="ID" type="s:long" minOccurs="0" /&gt;
              &lt;s:element name="Name" type="s:string" minOccurs="0" /&gt;
              &lt;s:element name="DOB" type="s:date" minOccurs="0" /&gt;
            &lt;/s:sequence&gt;
          &lt;/s:complexType&gt;
        &lt;/s:element&gt;
      &lt;/s:choice&gt;
    &lt;/s:complexType&gt;
    &lt;s:unique name="Constraint1" msdata:PrimaryKey="true"&gt;
      &lt;s:selector xpath=".//SQL" /&gt;
      &lt;s:field xpath="ID" /&gt;
    &lt;/s:unique&gt;
  &lt;/s:element&gt;
&lt;/s:schema&gt;
&lt;diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;
&lt;DefaultDataSet xmlns=""&gt;
  &lt;SQL diffgr:id="SQL1" msdata:rowOrder="0"&gt;
    &lt;ID&gt;3&lt;/ID&gt;
    &lt;Name&gt;Bush,Sam K.&lt;/Name&gt;
    &lt;DOB&gt;1932-05-05&lt;/DOB&gt;
  &lt;/SQL&gt;
  &lt;SQL diffgr:id="SQL2" msdata:rowOrder="1"&gt;
    &lt;ID&gt;53&lt;/ID&gt;
    &lt;Name&gt;Basile,Rhonda B.&lt;/Name&gt;
    &lt;DOB&gt;2001-07-18&lt;/DOB&gt;
  &lt;/SQL&gt;
  &lt;SQL diffgr:id="SQL3" msdata:rowOrder="2"&gt;
    &lt;ID&gt;66&lt;/ID&gt;
    &lt;Name&gt;Bachman,Julie M.&lt;/Name&gt;
    &lt;DOB&gt;1959-10-11&lt;/DOB&gt;
  &lt;/SQL&gt;
  &lt;SQL diffgr:id="SQL4" msdata:rowOrder="3"&gt;
    &lt;ID&gt;102&lt;/ID&gt;
    &lt;Name&gt;Bach,Mo N.&lt;/Name&gt;
    &lt;DOB&gt;1936-01-17&lt;/DOB&gt;
  &lt;/SQL&gt;
  &lt;SQL diffgr:id="SQL5" msdata:rowOrder="4"&gt;
    &lt;ID&gt;116&lt;/ID&gt;
    &lt;Name&gt;Braam,William V.&lt;/Name&gt;
    &lt;DOB&gt;1983-03-06&lt;/DOB&gt;
  &lt;/SQL&gt;
&lt;/DefaultDataSet&gt;
&lt;/diffgr:diffgram&gt;
&lt;/SQLResult&gt;