Lucas Fernandes · Dec 18, 2017 go to post

Yes, I have also tried this method (It is used in the CURRENT^%IS routine). But it does not return the changed size. Here it returns fixed 80 for column , even changed to 132.

Lucas Fernandes · Dec 19, 2017 go to post

Thanks Vitaliy Serdtsev, now I understand where the values are stored.With that I know the limitations in obtaining this data.

Lucas Fernandes · Jun 28, 2018 go to post

Thank you for helping Eduard Lebedyuk.
Lucas Scarduelli and I followed that idea.Just by contributing, we developed the following method:

ClassMethod disableJournaling(databaseDir As %String = "")
{
    #dim database As SYS.Database = ""
    #dim error As %RegisteredObject = ""
    #dim currentNamespace As %String = $namespace
    
    try {
        znspace "%SYS"
        
        set database = ##class(SYS.Database).%OpenId(databaseDir)
        do database.DisableJournaling()
        $$$ThrowOnError(database.%Save())
        
        znspace currentNamespace
    } catch error {
        znspace currentNamespace
        do error.Log()
    }    
}
Lucas Fernandes · Jul 23, 2018 go to post

So, I enabled the Network Activities view (In the Atelier: Window> Show View> Other> Atelier> Network Activities) and performed the project compilation.
I noticed that when the 'Failed to read' error occurs in the Network Activities view it displays a TimeOut error in this request:

<<<!!! Time:1532368945008 Server: cache201713 POST:/api/atelier/v1/ERP/action/compile?flags=ck Message:Error: java.net.SocketTimeoutException: Read timed out Total time:30057

This compilation, by terminal, lasts 10 minutes or more. I'm doing some testing to see if compile time is related. Because in namespace with few classes this does not happen, when I create an Atelier project of these.

Does your project last this build time by terminal?

Lucas Fernandes · Aug 16, 2018 go to post

I tried this method.But it seems that it returns from the current process, not from the referenced process.

%SYS>s p1 = ##class(%SYS.ProcessQuery).Open("P3276") w p1.GetCPUTime()
63,47
%SYS>s p2 = ##class(%SYS.ProcessQuery).Open("P7796") w p2.GetCPUTime()
63,47
%SYS>w ##class(%SYS.ProcessQuery).GetCPUTime()
63,47

%SYS>s p1 = ##class(%SYS.ProcessQuery).Open("P3276") w p1.GetCPUTime()
63,47
%SYS>s p2 = ##class(%SYS.ProcessQuery).Open("P7796") w p2.GetCPUTime()
78,47
%SYS>w ##class(%SYS.ProcessQuery).GetCPUTime()
78,47

%SYS>s p1 = ##class(%SYS.ProcessQuery).Open("P3276") w p1.GetCPUTime()
78,47
%SYS>s p2 = ##class(%SYS.ProcessQuery).Open("P7796") w p2.GetCPUTime()
78,47
%SYS>w ##class(%SYS.ProcessQuery).GetCPUTime()
78,47

Lucas Fernandes · Dec 13, 2018 go to post

If it is when you add Group By, it can be:

  •  your GCT.PA_Data is so big or untuned that you fail a connection timeout.
Lucas Fernandes · Mar 8, 2019 go to post

Thank you Eduard. That's what I was looking for. I also found the method that exports and imports the settings:

do ##class(%SYS.Portal.Resources).Export("CustomPortalResourcesExport.xml")

do ##class(%SYS.Portal.Resources).Import("CustomPortalResourcesExport.xml")

Lucas Fernandes · Nov 29, 2019 go to post

Thank you Evgeny and Benjamin for answering.

I used the method store procedure to solve this recursion problem.

Lucas Fernandes · Sep 5, 2019 go to post

Usually, I follow the order of indexes or column selectivity (this is a general rule in all databases). For large tables or complex queries, this can influence. However, it seems that the Caché SQL optimizer chooses the best query plan.

Lucas Fernandes · Sep 17, 2019 go to post

Maybe the "Next" method is missing.

Ex:

SET rs = ##class(%SQL.Statement).%ExecDirect(, "SELECT * FROM LISDB.ExternalUsers WHERE UserId = 83")

do rs.%Next()

write rs.%Get("Prefix")

If that doesn't work, put the command sequence you're running.

Lucas Fernandes · Jul 7, 2021 go to post

At Caché I usually use it:

SELECT Routine, Query FROM %Library.SQLCatalog_SQLCachedQueryInfo()

 Is there a difference?  

Lucas Fernandes · Jul 7, 2021 go to post

I also don't know the %SQL_Manager.CachedQueryTree() and I didn't find it in the Doc. I don't know if there's a difference.

Lucas Fernandes · Jul 27, 2021 go to post

In Caché I use this:

set path = ##class(Config.Databases).Open("USER").Directory
set database = ##class(SYS.Database).%OpenId($get(path))

do database.DisableJournaling()
set status = database.%Save()

do database.EnableJournaling()
set status = database.%Save()
Lucas Fernandes · Aug 12, 2021 go to post

You can try this using EmergencyId mode. Stop IRIS and start with the parameter:

Linux

iris start IRIS EmergencyId=user,password

Windows

iris start IRIS /EmergencyId=user,password

User and password can be anything. This will be used for login.

Once logged in as this user by the terminal, you can use the ^SECURITY routine in the %SYS namespace to change the password of _SYSTEM.

Documentation (Temporary):

EmergencyId Mode

^SECURITY

Lucas Fernandes · Aug 12, 2021 go to post

As @Danny.Wijnschenksaid, on Windows it needs to be /EmergencyId=.

There are a few more instructions in the Documentation,  like "Start a command prompt, running it as an administrator", etc.

Lucas Fernandes · Feb 25, 2022 go to post

I'm using Zabbix to monitor all IRIS status and it works great. Zabbix has alert features (Triggers) that communicate with me via email or communication channels (like slack) when an incident occurs. I collect status information, errors, performance, etc. I use SNMP protocol indicators and other indicators through ODBC, some created by me and others obtained through monitor collections.

Lucas Fernandes · Apr 11, 2022 go to post

You can also try rebuilding the Index Table or clearing Cached Queries. Portal uses cached query and in its code it uses Embedded SQL (&sql) - Doc.: There is no need for a cache for Embedded SQL, because Embedded SQL statements are replaced with inline code at compilation time.

Lucas Fernandes · Jul 15, 2022 go to post

You can review the 'UnknownUser' user's permissions. In the documentation it says that 'Embedded SQL' does not check permissions:

InterSystems SQL enforces privilege checking for ODBC, JDBC, Dynamic SQL, and the SQL Shell interface on InterSystems IRIS data platform. Embedded SQL statements do not perform privilege checking;

Or use an authenticated user with the proper permissions;

About privileges and users: Users, Roles, and Privileges

About authentication: Authentication and Authorization

Lucas Fernandes · Jan 23, 2023 go to post

Another suggestion,

If you use an exclusive Resource in your database (example %DB_<database-name>), you can use it as a reference. It is included in the .DAT and you can check it even with the database not created, just the physical file.

Example:

w ##class(SYS.Database).%OpenId("/usr/irissys/mgr/test1/").ResourceName

The SYS.Database class also gets other information, but nothing relevant for identification.

--

Or (perhaps not recommended) you can extract the original path directly from the .DAT, for example:

$ strings /usr/irissys/mgr/test2/IRIS.DAT | head -3
Cache DB
/usr/irissys/mgr/test1/
%DB_TEST1