Question
· Feb 13, 2017

How to find UUIDs of an instance and database?

 

Hi,

First of all, do Cache instance and databases have UUIDs? If so, is there a simple way to obtain these from command line? 

Thanks,

Raghu

Discussion (7)0
Log in or sign up to continue

Thanks for quick response.

Now, I am trying to run the following code on a Linux box as follows (CACHE is the instance name):

"csession CACHE -U"%SYS" "w ##class(%SYS.System).InstanceGUID()" 

but it results in "<INVALID ARGUMENT>". Is this correct way of running objectscript code on Linux? Sorry if this comes across as a silly question but I am just getting familiar with Cache and its concepts.

Thanks,

Raghu

You can get an output from a Caché routine provided it do some output to its principal device (= stdout), e.g. (approach #1):

$ csession CACHE "##class(%SYSTEM.License).CKEY()"

Cache Key display:
Based on the active key file '/vol/cachesys/mgr/cache.key'

     LicenseCapacity =   Cache 2017.1 Enterpriser - Concurrent Users:1000000, Anything You Need
     CustomerName =      ZAO XX.XXX
     OrderNumber =       9876543210
     ExpirationDate =    10/15/2114
     AuthorizationKey =  3141592653592718281828662607004081
     MachineID =

     currently available =    9997
     minimum   available =      97
     maximum   available = 1000000
$

as there is no way to pass an arbitrary text from COS routine to OS directly. To bypass it, just incorporate into your shell script a calling sequence like this (approach #2):

#!/bin/bash
csession CACHE <<EOF >output.txt 
write ##class(%SYS.System).InstanceGUID()
halt
EOF

After calling it, you will get output.txt like this:

Node: tdb01.xxxxx.com, Instance: CACHE

USER>
8BCD407E-EE5E-11E4-B9C2-2EAEB3D6024F
USER>

(Missing 'halt' command causes an error). All you have to do is to parse an output. To avoid this, you may want to write a small wrapper in COS that will provide an output as you need it, than you'll be able to follow an approach #1.

HTH.