Alexander Pettitt · Oct 5, 2023 go to post

So testing shows the old way was better in this case.

Failure
iris session ${INST} -U %sys << EOF

w "stopping the mirror 1 is sucess: " zw ##class(SYS.Mirror).StopMirror("MIRROR")

h

EOF

%SYS>

%SYS>
stopping the mirror 1 is sucess: "0 "_$lb($lb(2050,,,,,,,,,$lb(,"%SYS",$lb("e^Shutdown+7^MIRRORMGR^2","e^zStopMirror+4^SYS.Mirror.1^1","e^^^0"))))/* ERROR #2050: Mirror configuration not loaded */

%SYS>
Sucess
$ iris session ${INST} -U %sys << EOF
>
> zw ##class(SYS.Mirror).StopMirror("MIRROR")                                  <
> h
> EOF


%SYS>

%SYS>
stopping the mirror 1 is sucess: 1

%SYS>

Same either way :(
iris session ${INST} -U %sys '##class(SYS.Mirror).StopMirror("MIRROR")' ;echo $?
0
Alexander Pettitt · Oct 5, 2023 go to post

Thanks for this example.
I had used:

iris session ${INST} -U %sys << EOF

w "stopping the mirror 1 is sucess: " zw ##class(SYS.Mirror).StopMirror("PMIR") h
EOF
Alexander Pettitt · Oct 4, 2023 go to post

An easy way is setup Operating System–Based Authentication
in %sys
^SECURITY
12) System parameter setup
2) Edit authentication options
Allow O/S authentication? Yes   

This allows scripts like this

iris session ${INST} -U %sys << EOF

w "stopping the mirror 1 is sucess: " zw ##class(SYS.Mirror).StopMirror("MIRROR") h
EOF
Once an IRIS LDAP account exists it does not appear to be different local account.

You can do this too:
iris session [instance] -U [namespace] tag^routine

Alexander Pettitt · Sep 26, 2023 go to post

The only way to get an estimate I can think of is running the compact against a SAN snapshot on similar hardware.
The free blocks could be anywhere in the file and that plays a big role.

Here are some numbers:
Current Size: 2332950 MB
Freespace at end of file: 300 MB
Total freespace: 8957 MB
Blocks Scanned: 10850564
It took 1 hour 44 minutes

The truncation was almost instant.

Alexander Pettitt · Sep 10, 2023 go to post

First my experience is on IRIS.DATs that were 2Tb is size and experience will vary widely since where the free space is is what matters.

There are two different compacts:
Compact globals in a database
Compact free space in a database
If all you want to do is compact free space things are easier.
Do it in small steps with ^DATABASE
Current Size: 2307950 MB
Total freespace: 8564 MB
Freespace at end of file: 18 MB

Target freespace at end of file, in MB (18-8564):200

One great feature is you can cancel if you need to.
Press 'Q' to return, 'P' to pause, 'C' to cancel:

Truncation can be done in the same way in steps.

If you have one I suggest that you do this on your DR instance, move to DR and then do it on what was production.

If you are using 8k blocks for IRIS you should start thinking about the 32Tb limit for 8k databases.
You need to run an integrity check after you are done.

If you wanted to run compact globals that is much more complex.

If the underlying storage does deduplication you should make sure you have extra space at that layer.

Alexander Pettitt · Aug 18, 2023 go to post

AIX 7.3 TL1 defaults to OpenSSL 3.x
$oslevel -s ; openssl version ; uptime
7300-01-02-2320
OpenSSL 3.0.8 7 Feb 2023 (Library: OpenSSL 3.0.8 7 Feb 2023)
  08:58AM   up 72 days,  11:32,  16 users,  load average: 7.04, 8.57, 9.52

Alexander Pettitt · Jul 26, 2023 go to post

I ran your code against a production snapshot and got:
elapsed: 7365.54051
w count
57434071

and

elapsed: 10925.91166
w count
43841315

As you pointed this is a problem in approach.

This is on enterprise hardware so that is not the issue.

I did change your code to use a second subscript ^XXX("YYY",sub)

as an example of a better approach
w $Order(^XXX("YYY",""),-1)
57435810

Alexander Pettitt · Jul 6, 2023 go to post

I think this is only true for locksiz=0 which is the default.

If you set it to a value that is what it is.

Alexander Pettitt · Jun 12, 2023 go to post

Can you give an example?

Do you mean something like this?

iris session ${INST} -U %sys << EOF
w "stopping the mirror 1 is sucess: " zw ##class(SYS.Mirror).StopMirror("MIRROR") h
EOF
Alexander Pettitt · Jun 7, 2023 go to post

If you don't know Mac/Linux you would have to deal with learning both.
If you are doing code development connecting from a Windows workstation it might be easier to connect to a locally installed instance and takes less hardware.

Alexander Pettitt · Jun 7, 2023 go to post

Have you tried using the console version of task manager?

I would do that first.

If you have another Ensemble instance you could figure out where the in the system tasks are stored using journalling and making a change to a task.

Once you know where the task is stored to just kill or change the associated global.

Alexander Pettitt · Jun 5, 2023 go to post

There are several major steps:
Mount the LUN or LUNs as a filesystem
Have the required namespace
Mount the CACHE.DAT in Cache. Look at ^DATABASE
Have the required global mappings.


My suggestion is to install another instance of Cache on the server.
That way you might be able to update the cache.cpf using the one from the old server as a template.

This is a pretty complex task.

Alexander Pettitt · Jun 5, 2023 go to post

AIX 7.3 TL 1 and later has OpenSSL 3.X

From the linked IBM page AIX 7.3 TL1 was released six months ago.
$oslevel -s
7300-01-02-2320
$openssl version
OpenSSL 3.0.8 7 Feb 2023 (Library: OpenSSL 3.0.8 7 Feb 2023)

Alexander Pettitt · May 26, 2023 go to post

Easiest way would be look in the cconsole.log in the instance directory.

ccontrol qlist has information about the current mirror state on that server but you need a before and after to know if there was a failover.

Alexander Pettitt · Apr 6, 2023 go to post
Set file=##class(%File).%New("[path/filename]")
Write file.Size
Do file.Open("AWS")
Do file.WriteLine("This is a second line of text")
Write file.Size
do file.%Save()
set file = "" // Close file

This works for me

Alexander Pettitt · Mar 21, 2023 go to post

Not sure how critical the notifications are in your use case but there have been some massive SMS gateways outages.

An on premise SMS device would also send messages when the connection to the internet down.

Alexander Pettitt · Jan 23, 2023 go to post

As a guess you have more mirrored datasets then expected. I have seen User get mirrored for example.
What does this show on the primary?
d ^MIRROR -> 1) Mirror Status -> 1) List mirrored databases
 

If both TESTTC01 and TESTTC02 existed before starting, your refresh process is also overly complicated.
You should be able to shutdown TESTTC01 & TESTTC02, copy the file from TESTTC01 to TESTTC02, start TESTTC02 and do a Activating and Catching Up Mirrored Databases. If you have a backup or snap of the file you don't even need to shutdown TESTTC01.

Alexander Pettitt · Jan 23, 2023 go to post

d ^MIRROR on the primary shows the data of the target mirrors so the data is available.

The documentation topic is here.

%SYSTEM.Mirror can give you information but only about the instance you run it on.

w $SYSTEM.Mirror.GetMemberStatus()
        Primary