検索

Article
· Août 3, 2020 3m de lecture

Global Scanning & Slicing

In most cases, a global used by default storage has just 1 subscript level that represents the IDKEY.
For an index-globals we may see 2 or more subscript levels.
Arrays, or parent-child relationships or persistent classes extending a base data class
are examples where we see more levels. Though all these globals are quite uniform.

And then we see globals not related to classes or tables like ^SPOOL, or ^ERRORS, or ^%SYS
where the structure depends on various levels of subscripts with special meaning.

Analysis of those non-conform globals is a challenge and just dumping
it doesn't necessarily help to understand the dependencies.

This example is oriented at the old joke:  "How do you eat an elephant?" ==> "Cut in thin slices !"

That's the offer:
By an SQL statement, you can display the structure of any global level by level.
You provide global name and the maximum level to display and get back the related  
subscripts, $Data of the node, the number of next subnodes   
and - if available - the content stored at that level.

example: SELECT * FROM rcc_G.scan where rcc_G.Scan('^%SYS',1)=1

Reference       Level	$D SubN  Value
^%SYS               0	10 25	 
("CSP")             1	10	 	 
("CSPAppSec")       1	1       64
("CacheTempDir")    1	1      "c:\intersystems\iris\mgr\iristemp\"
("DBRefByName")     1	10	 	 
("Ensemble")        1	11     "2020-04-25 18:37:18"
("ErrorPurge")      1	1      30
("FIPSMode")        1	1      0
("IRISTempDir")     1	1      "c:\intersystems\iris\mgr\iristemp\"
("JOURNAL")         1	11     0
("LANGUAGE")        1	10	 	 
("LASTSESSIONGUID") 1	1     "EÊcRù¢GM£ô"_$c(127)_"¹9¾ÒÆ"
("LOCALE")          1	10	 	 
("ModuleRoot")      1	10	 	 
("NLS")             1	10	 	 
("SERVICE")         1	10	 	 
("SSPort")          1	1     51773
("StreamLocation")  1	10	 	 
("SystemMode")      1	1     "TEST"
("TempDir")         1	1     "C:\InterSystems\IRIS\mgr\Temp"
("WebServer")       1	10	 	 
("bindir")          1	1     "c:\intersystems\iris\bin\"
("shutdownlogerrors") 1 1 0
("sql")             1	10	 	 
("sysdir")          1	1     "c:\intersystems\iris\mgr\"
("tercap")          1	10	 	 
26 lines

SELECT * FROM rcc_G.scan where rcc_G.Scan('^%SYS',2)=1

Reference                   Level	$D SubN   Value
^%SYS                           0	10 25  
("CSP")                         1	10 1  
("CSP","LastUpdate")            2	1        "65553,44452"
("CSPAppSec")                   1	1  0     64
("CacheTempDir")                1	1  0     "c:\intersystems\iris\mgr\iristemp\"
("DBRefByName")                 1	10 9 	 
("DBRefByName","CACHE")         2	1        "^^c:\intersystems\iris\mgr\cache\"
("DBRefByName","CACHEUSER")     2	1        "^^c:\intersystems\user\"
("DBRefByName","ENSLIB")        2	1        "^^c:\intersystems\iris\mgr\enslib\"
("DBRefByName","IRISAUDIT")     2	1        "^^c:\intersystems\iris\mgr\irisaudit\"
("DBRefByName","IRISLIB")       2	1        "^^c:\intersystems\iris\mgr\irislib\"
("DBRefByName","IRISLOCALDATA") 2	1        "^^c:\intersystems\iris\mgr\irislocaldata\"
   < 60 lines more >

SELECT * FROM rcc_G.scan where rcc_G.Scan('^ERRORS',37)=1 and id['Jour'

Reference                                            Level	$D	SubNodes	Value
(65588,1,"*STACK",1,"V","%00000","N","""JournalState""")	8	1	 0	       4
(65592,1,"*STACK",1,"V","%00000","N","""JournalState""")	8	1	 0	       4
(65592,2,"*STACK",1,"V","%00000","N","""JournalState""")	8	1	 0	       4

GitHub

Discussion (0)0
Connectez-vous ou inscrivez-vous pour continuer
Article
· Août 2, 2020 2m de lecture

Show Global by SQL SELECT

Globals in Caché / Ensemble / IRIS are normally invisible over SQL access
This example shows how to overcome this limit.
Globals are presented as content of a table with their subscripts and the stored content.
The global to view is passed to SQL by a static WHERE condition that
requires 3 parameters:

  • the global name (required)
  • the start subscript (optional)
  • the stop subscript (optional)

Just providing the global name results in a full global dump.
Globals may also be provided with the extended reference and as this is a SQL table all kinds of additional conditions apply.

Be careful. Correct quoting between SQL and Caché / Ensemble / IRIS could be a challenge

Example:
select * from zrcc_G.dump where zrcc_G.Dump('^|"SAMPLES"|Sample.PersonD',2,4)=1

ID	       Global	        Subscript	      Value
1	^|"SAMPLES"|Sample.PersonD	(2)	$lb("",792533244,"GlobaDynamics Holdings Inc.",64256,"C1787","Y5365","A5","A658","R1770","","Ironhorse,Alice D.","T3710","O3","I4011","W8367","557-37-6758",83059958205089661,"1841-01-02 00:00:00")
2	^|"SAMPLES"|Sample.PersonD	(3)	$lb("",862705606,"TeleLateral Associates",34553,"V8155","T8918","X9","V8732","K1167","","Eisenstien,Peter E.","H208","C8","Q2015","Q3357","702-46-8467",57275722714358892,"2020-06-23 13:27:18")
3	^|"SAMPLES"|Sample.PersonD	(4)	$lb("",677194559,"RoboSoft Group Ltd.",52738,"F4851","Z364","S8","O6888","O4367","","Eagleman,Clint C.","C8051","R6","V1659","C9814","664-33-8809",-53705244349891319,"2020-06-23 13:27:18")

select TOP 15 * from zrcc_G.dump where zrcc_G.Dump('^%SYS','"JOURNAL"')=1

ID	Global	       Subscript	         Value
1	^%SYS	("JOURNAL")	           0
2	^%SYS	("JOURNAL","ALTDIR")   "C:\InterSystems\IRIS\altjournal\"
3	^%SYS	("JOURNAL","CURDIR")   "C:\InterSystems\IRIS\mgr\journal\"
4	^%SYS	("JOURNAL","CURRENT")  "1^C:\InterSystems\IRIS\mgr\journal\20200801.009"
5	^%SYS	("JOURNAL","EXPSIZE")  0
6	^%SYS	("JOURNAL","LAST")     "1^C:\InterSystems\IRIS\mgr\journal\20200801.009"
7	^%SYS	("JOURNAL","LIFESPAN","FILE")	"2,2"
8	^%SYS	("JOURNAL","MAXSIZE")	 1073741824
9	^%SYS	("JOURNAL","PREFIX")   ""
10	^%SYS	("JOURNAL","PURGED","c:\intersystems\iris\mgr\journal\20191104.001")	"2019-11-07 17:38:30"
11	^%SYS	("JOURNAL","PURGED","c:\intersystems\iris\mgr\journal\20191104.002")	"2019-11-07 17:38:30"
12	^%SYS	("JOURNAL","PURGED","c:\intersystems\iris\mgr\journal\20191104.003")	"2019-11-07 17:38:30"
13	^%SYS	("JOURNAL","PURGED","c:\intersystems\iris\mgr\journal\20191104.004")	"2019-11-07 17:38:30"
14	^%SYS	("JOURNAL","PURGED","c:\intersystems\iris\mgr\journal\20191104.005")	"2019-11-08 08:39:47"
15	^%SYS	("JOURNAL","PURGED","c:\intersystems\iris\mgr\journal\20191105.001")	"2019-11-08 08:39:47"

GitHub

1 Comment
Discussion (1)0
Connectez-vous ou inscrivez-vous pour continuer
Article
· Juil 29, 2020 5m de lecture

SQL for ^ERROR Global

Standard error logs in IRIS / Caché / Ensemble are written global ^ERRORS.
As this piece dates back some decades back to previous millennium its structure
is far from the typical SQL storage structures.
The global is written by routine ^%ETN.int and the content becomes visible from
terminal command line by routine ^%ERN or in Mgmt Portal as Application Error Log.

It is just not available to SQL as there is no Class wrapped around.
For several reasons:

  • When it was designed it was good practice to have index like structures in the same globals as the data. If I say 'like', this means it is of no use for SQL.
  • As next the content of objects are going to deeper levels than the rest. As a consequence, the depth of subscripts (typically IdKey) varies from 3 to 11.

^ERRORS is independent in every namespace
It is structured by Day,SequenceByDay, Type, ItemName (Variable, OREF),Value
zrcc.ERRORStack covers this as SQL table.
Deeper content of the objects becomes visible by the included custom query.
The SQL procedure zrcc.ERRORStack_Dump(Day,Sequence) returns all available
content and presents subscripts and values as you see in global listing.

How to make best use of both components:

First:  find your day and sequence number using SQL

Example: SELECT * FROM zrcc.ERRORStack where item='$ZE'

    Day	 Seq	Stk Type	Item	Value
2020-07-02	1	 0	   V	  $ZE	<WRITE>zSend+204^%Net.HttpRequest.1
2020-07-07	1	 0	   V	  $ZE	<WRITE>zSend+204^%Net.HttpRequest.1
2020-07-15	1	 0	   V	  $ZE	<WRITE>zSend+204^%Net.HttpRequest.1
2020-07-20	1	 0	   V	  $ZE	<LOG ENTRY>
2020-07-26	1	 0	   V	  $ZE	<WRITE>zSend+204^%Net.HttpRequest.1

Then in SQL:     CALL zrcc.ERRORStack_Dump('2020-07-26',1)

Row count: 541 Performance: 0.026 seconds  6557 global references
Ref	                                Value

2020-07-26,1,"*STACK",0,"V","Routine")	zSend+204^%Net.HttpRequest.1
2020-07-26,1,"*STACK",1,"I")	1^S^^^0^
2020-07-26,1,"*STACK",1,"L")	1 SIGN ON
2020-07-26,1,"*STACK",1,"S")	
2020-07-26,1,"*STACK",1,"T")	SIGN ON
2020-07-26,1,"*STACK",1,"V","%dsTrackingKeys","N","""Analyzer""")	6
2020-07-26,1,"*STACK",1,"V","%dsTrackingKeys","N","""Architect""")	7
2020-07-26,1,"*STACK",1,"V","%dsTrackingKeys","N","""DashboardViewer""")	8
2020-07-26,1,"*STACK",1,"V","%dsTrackingKeys","N","""ResultSet""")	9
2020-07-26,1,"*STACK",1,"V","%objcn")	2
2020-07-26,1,"*STACK",3,"V","Task")	<OBJECT REFERENCE>[1@%SYS.Task]
2020-07-26,1,"*STACK",3,"V","Task","OREF",1)	142
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,0)	3671
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,1)	+----------------- general information ---------------
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,2)	| oref value: 1
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,3)	| class name: %SYS.Task
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,4)	| %%OID: $lb("13","%SYS.Task")
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,5)	| reference count: 5
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,6)	+----------------- attribute values ------------------
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,7)	| %Concurrency =
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,8)	4 <Set>
- - - 
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,53)	| EmailOutput =
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,54)	0
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,55)	| EndDate =
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,56)	""
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,57)	| Error =
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,58)	"<WRITE>zSend+204^%Net.HttpRequest.1"
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,59)	| Expires =
- - -
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,111)	| Status =
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,112)	"0 "_$lb($lb(5002,"POST to Server Failed",,,,,,,,$lb(,"%SYS",$lb("$^zSend+204^%Net.HttpRequest.1 +1","$^zPost+1^%Net.HttpRequest.1 +1","$^zSendData+20^FT.Collector.1 +1","$^zTransfer+12^FT.Collector.1 +1","$^zOnTask+3^%SYS.Task.FeatureTracker.1 +1","D^zRunTask+74^%SYS.TaskSuper.1 +1","$^zRunTask+54^%SYS.TaskSuper.1 +1","D^zRun+26^%SYS.TaskSuper.1 +1"))),$lb(6085,"ISC.FeatureTracker.SSL.Config","SSL/TLS error in SSL_connect(), SSL_ERROR_SSL: protocol error, error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed",,,,,,,$lb(,"%SYS",$lb("e^zSend+303^%Net.HttpRequest.1^1","e^zPost+1^%Net.HttpRequest.1^1","e^zSendData+20^FT.Collector.1^1","e^zTransfer+12^FT.Collector.1^1","e^zOnTask+3^%SYS.Task.FeatureTracker.1^1","e^zRunTask+74^%SYS.TaskSuper.1^1","d^zRunTask+54^%SYS.TaskSuper.1^1","e^zRun+26^%SYS.TaskSuper.1^1","d^^^0"))))/* ERROR #5002: Cache error: POST to Server Failed- ERROR #6085: Unable to write to socket with SSL/TLS configuration 'ISC.FeatureTracker.SSL.Config', error reported 'SSL/TLS error in SSL_connect(), SSL_ERROR_SSL: protocol error, error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed' */
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,113)	| SuspendOnError =
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,114)	0
2020-07-26,1,"*STACK",3,"V","Task","OREF",1,115)	| Suspended =
- - -
2020-07-26,1,"*STACK",6,"V","Status1")	1
2020-07-26,1,"*STACK",6,"V","Task")	<OBJECT REFERENCE>[1@%SYS.Task]
2020-07-26,1,"*STACK",6,"V","Task","OREF",1)	142
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,0)	3671
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,1)	+----------------- general information ---------------
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,2)	| oref value: 1
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,3)	| class name: %SYS.Task
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,4)	| %%OID: $lb("13","%SYS.Task")
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,5)	| reference count: 5
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,6)	+----------------- attribute values ------------------
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,7)	| %Concurrency =
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,8)	4 <Set>
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,9)	| DailyEndTime =
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,10)	0
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,11)	| DailyFrequency =
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,12)	0
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,13)	| DailyFrequencyTime =
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,14)	""
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,15)	| DailyIncrement =
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,16)	""
2020-07-26,1,"*STACK",6,"V","Task","OREF",1,17)	| DailyStartTime =
- - - 
2020-07-26,1,"*STACK",12,"V","%00000","N","""JournalState""")	12
2020-07-26,1,"*STACK",13,"I")	13^Z^ETNERRB^%ETN^0
2020-07-26,1,"*STACK",13,"L")	13 ERROR TRAP S $ZTRAP="ETNERRB^%ETN"
2020-07-26,1,"*STACK",13,"S")	S $ZTRAP="ETNERRB^%ETN"
2020-07-26,1,"*STACK",13,"T")	ERROR TRAP

541 row(s) affected

GitHub

16 Comments
Discussion (16)2
Connectez-vous ou inscrivez-vous pour continuer
Discussion
· Juil 28, 2020

Why migrate from Caché to IRIS

I'm working with clients planning migrate from Caché to IRIS and I want to summary advantages to go to IRIS. I think is:

  1. IntegratedML - AutoML - Agile machine learning
  2. IAM - InterSystems API Manager
  3. Interoperability
  4. Advanced Reports (JReport)
  5. Cloud Manager/Docker and DevOps support
  6. ZPM - Package manager
  7. Native API - Node.js, Python, Java and .NET interoperability
  8. Core based license x user based license
  9. InterSystems Support and new features
  10. Improved management and monitoring features

Can you help me to think or detail these 10 topics?

12 Comments
Discussion (12)5
Connectez-vous ou inscrivez-vous pour continuer
Article
· Juil 27, 2020 2m de lecture

ZPMshow, a helper for tired fingers

The offer of ZPM is growing daily and the short names and
acronyms of the offer are sometimes hard to understand and
also hard to type with my lazy fingers.

So I decided to have

  • a listing with the descriptions from the repository,
  • split in short junks to avoid backscroll,
  • controlled forward / backward scrolling,
  • the option to select my packages by number,
  • to install or uninstall with limited typing.

It runs with do ^zpmshow

A snapshot from the screen:

USER>d ^zpmshow

1 analyzethis 1.1.4 -- not github --
2 apps.rest 1.0.0 -- no descripition --
3 bitmap-adoption 1.0.3 Bitmaps for nonstandard IDs
4 blocksexplorer 2.2.1 -- not github --
5 bondar-nav 1.0.1 -- no descripition --
6 cache-fast-json 1.0.3 produce pretty JSON output for
Cache + Ensemble
7 classexplorer 1.21.3 -- no description --
8 contest-rest-template 1.0.3 -- no description --
9 csvgen 1.1.6 -- no description --
10 declarative-os 1.0.2 -- no description --
11 delete-helper 1.0.1 -- no description --
12 document-template 1.0.0 -- not github --
13 dsw 2.1.51 -- no description --
14 ecp-job 1.0.1 Multi-Line in Terminal Command
15 excel-light 1.0.0 Light weight Excel download

action (i[nstall),u[ninstall],n[ext],b[back],q[quit]):i package number: 6
6 cache-fast-json 1.0.3 produce pretty JSON output for
Cache + Ensemble
OK (y,n): y
zpm install cache-fast-json

[cache-fast-json] Reload START
[cache-fast-json] Reload SUCCESS
[cache-fast-json] Module object refreshed.
[cache-fast-json] Validate START
[cache-fast-json] Validate SUCCESS
[cache-fast-json] Compile START
[cache-fast-json] Compile SUCCESS
[cache-fast-json] Activate START
[cache-fast-json] Configure START
[cache-fast-json] Configure SUCCESS
[cache-fast-json] Activate SUCCESS

1 analyzethis 1.1.4 -- not github --
2 apps.rest 1.0.0 -- no description --
3 bitmap-adoption 1.0.3 Bitmaps for nonstandard IDs
4 blocksexplorer 2.2.1 -- not github --
5 bondar-nav 1.0.1 -- no description --
6 cache-fast-json 1.0.3 produce pretty JSON output for
Cache + Ensemble
7 classexplorer 1.21.3 -- no description --
8 contest-rest-template 1.0.3 -- no description --
9 csvgen 1.1.6 -- no description --
10 declarative-os 1.0.2 -- no description --
11 delete-helper 1.0.1 -- no description --

 

GitHub

Video

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer