搜索​​​​

清除过滤器
文章
姚 鑫 · 九月 24, 2022

第四十二章 使用多个 IRIS 实例(二)

# 第四十二章 使用多个 IRIS 实例(二) # 控制 `IRIS` 实例 `iris` 命令支持终端以外的许多功能,并以 `iris function instname arguments` 格式调用,其中 `instname` 是在安装期间选择的实例名称,参数取决于函数。 重要提示: `iris help` 命令显示所有命令函数和参数; `IRISHelp.html` 文件位于 `install-dir\Help` 目录中。 `iris` 命令的某些功能在本文档中没有列出,但在帮助显示中显示。 ```java C:\InterSystems\IRISHealth\bin>iris help usage: iris start [] to start instance , optionally using the specified .cpf file. An optional /EmergencyId=Username,Password can be used to start InterSystems IRIS in emergency mode. When the EmergencyId argument is supplied, the system starts up in emergency mode in which only the baseline databases are mounted and access to InterSystems IRIS is governed by InterSystems IRIS login using that username and password. Emergency mode is supplied to give access in the event that privileged users are not available or their password is forgotten. Emergency startup is only available from an administrator account. When InterSystems IRIS is started in emergency mode, the IRIS control service is not used. This means that if you log out of Windows, all the InterSystems IRIS processes will immediately exit. or: iris startnostu to start instance without running ^STU. or: iris stop to shut down instance . or: iris stopnoshut to shut down instance without running user shutdown routines. or: iris stopstart to shut down and restart instance . Note: An optional /nofailover argument can be specified for stop, stopnoshut, or stopstart to not trigger a mirror failover. or: iris force to force down instance . or: iris [ run OR console OR terminal ] to run InterSystems IRIS in programmer mode with [ no-device OR console OR terminal ] for $Principal. or: iris [ run OR console OR terminal ] to run InterSystems IRIS routine in application mode with [ no-device OR console OR terminal ] for $Principal. or: iris [ run OR console OR terminal ] to run InterSystems IRIS routine in in application mode with [ no-device OR console OR terminal ] for $Principal. or: iris runw [] to run InterSystems IRIS routine in application mode with no input/output device for $Principal using the optional namespace. When run from a batch script, iris will wait for the InterSystems IRIS process to terminate before returning. The exit code from the InterSystems IRIS process will be returned by iris. Note: An optional /Title="Title string" can specify the console or terminal title bar text. or: iris iristraystart to start IRISTray for instance . or: iris iristraystop to stop IRISTray for instance . or: iris licmanagerstop to stop licmanager running in instance . or: iris all [> outputfile] to list all installed instances. or: iris allw [> outputfile] to list (wide format) all installed instances. or: iris list [] [> outputfile] to list information about all installed instances or the specified instance. or: iris qlist [] [> outputfile] to display a quick list of information about all installed instances or the specified instance, in a format suitable for parsing in command scripts. The record for an instance contains fields separated by "^" (carats): Field 1: instance name Field 2: instance directory Field 3: version identifier Field 4: current status for the instance Field 5: configuration file name last used Field 6: SuperServer port number Field 7: WebServer port number Field 8: JDBC Gateway port number Field 9: Instance status (e.g., ok, warn, alert) Field 10: Product name of the instance Field 11: Mirror Member Type (e.g., Failover, Disaster Recovery) Field 12: Mirror Status (e.g., Primary, Backup, Connected) or: iris serverlist [> outputfile] to list information about all defined servers. Note: When [> outputfile] is present, output is redirected to the file instead of being displayed on the terminal. or: iris telnetstop to stop the InterSystems IRIS TELNET daemon. or: iris telnettrace to toggle the TELNET trace state. or: iris iristrmdstop to stop the InterSystems IRIS terminal daemon. Note: iris often displays error information in a message box. You can suppress the message box containing error information by adding "quietly" (without the quotation marks) as the final argument to the iris command. or: iris help [display] to show this help. If display is specified the help is displayed in a browser window. ``` IRISHelp.html ``` IRIS.EXE USAGE: iris start [] Starts InterSystems IRIS instance , optionally using the specified .cpf file. Note: An optional /EmergencyId=Username,Password can be used to start InterSystems IRIS in emergency mode. When the EmergencyId argument is supplied, the system starts up in emergency mode in which only the baseline databases are mounted and access to InterSystems IRIS is governed by InterSystems IRIS login using that username and password. Emergency mode is supplied to give access in the event that privileged users are not available or their password is forgotten. Emergency startup is only available from an administrator account. When InterSystems IRIS is started in emergency mode, the IRIS control service is not used. This means that if you log out of Windows, all the InterSystems IRIS processes will immediately exit. iris startnostu Starts instance without running ^STU. iris stop Shuts down instance . iris stopnoshut . Shuts down instance without running user shutdown routines. iris stopstart Shuts down and restarts instance . Note: An optional /nofailover argument can be specified for stop, stopnoshut, or stopstart. Specifying this option prevents triggering a mirror failover. iris force Forces down instance . iris [ run OR console OR terminal ] Runs InterSystems IRIS in programmer mode with [ no-device OR console OR terminal ] for $Principal. iris [ run OR console OR terminal ] Runs InterSystems IRIS routine in application mode with [ no-device OR console OR terminal ] for $Principal. iris [ run OR console OR terminal ] Runs InterSystems IRIS routine in in application mode with [ no-device OR console OR terminal ] for $Principal. iris runw [] Runs InterSystems IRIS routine in application mode with no input/output device for $Principal using the optional namespace. When run from a batch script, iris will wait for the InterSystems IRIS process to terminate before returning. The exit code from the InterSystems IRIS process will be returned by iris. Note: An optional /Title=”Title string” can specify the console or terminal title bar text. Examples: Run ^%SS in a console in the i181u instance: iris console i181u ^^%SS Run ^%SS in an InterSystems IRIS terminal in the i181u instance: iris terminal i181u ^^%SS Start ^%SS running in an InterSystems IRIS terminal in the i181u instance from a batch file (extra % required): iris terminal i181u ^^%%SS Run sub^test(“hello”) in an InterSystems IRIS terminal in the USER namespace of the IRIS instance i181u: iris terminal i181u sub^^test(\"hello\") USER Note: The namespace parameter only works if the login record for the user does not specify a namespace. If the user security record specifies a namespace, then it will override the namespace parameter. iris iristraystart Starts IRISTray for instance . iris iristraystop Stops IRISTray for instance . iris licmanagerstop Stops the licmanager process running in instance . iris all [> outputfile] Lists all installed instances. The status for each instance is indicated by: "dn" - InterSystems IRIS instance is not running "st" - InterSystems IRIS instance is starting or stopping. "up" - InterSystems IRIS instance is running on this machine " " - (blank) status unavailable. Instance is probably partly up without ^STU completing. Logins are disabled. iris allw [> outputfile] Lists all installed instances in wide format. iris list [] [> outputfile] Lists brief information about all installed instances, or the specified instance. The status for each instance is indicated by: "down" - InterSystems IRIS instance is not running "starting or stopping" - InterSystems IRIS instance is starting or stopping. "running" - InterSystems IRIS instance is running on this machine "Incomplete start or stop, logins disabled" " - Instance is probably partly up without ^STU completing. Logins are disabled. iris qlist [] [> outputfile] Display a quick list of information about all installed instances, or the specified instance, in a format suitable for parsing in command scripts. The record for an instance contains fields separated by "^" (carats): Field 1: instance name Field 2: instance directory Field 3: version identifier Field 4: current status for the instance Field 5: configuration file name last used Field 6: SuperServer port number Field 7: WebServer port number Field 8: JDBC Gateway port number Field 9: Instance status (e.g., ok, warn, alert) Field 10: Product name of the instance Field 11: Mirror Member Type (e.g., Failover, Disaster Recovery) Field 12: Mirror Status (e.g., Primary, Backup, Connected) iris serverlist [> outputfile] Lists information about all defined servers. Note: When [> outputfile] is present, output is redirected to the file instead of being displayed on the terminal. iris telnetstop Stops the InterSystems IRIS TELNET daemon. iris iristrmdstop Stops the InterSystems IRIS terminal daemon. iris help [display] Writes the help text to the terminal or, if display is specified, displays the help in a browser window. Error reporting: Return value: If the control command succeeds, it returns 0. Otherwise it usually returns 1 or some other non-zero value to indicate an error. You can check the return value by inspecting the ErrorLevel environment variable. Message box: iris often displays error information in a message box. You can suppress the message box containing error information by adding “quietly” (without the quotation marks) as the final argument to the iris command. This may be useful when running an unattended .bat script. For example: iris stop xxxx quietly if not errorlevel 0 … ``` `iris` 命令的行为因平台而异,如下表所述: ## `Unix®`、`Linux` 和 `macOS` 上的 iris 命令 **注意: `iris` 命令通常会在消息框中显示错误信息。可以通过安静地添加作为 `iris` 命令的最后一个参数来抑制此消息框,该命令以非交互方式运行该命令,并带有最少的对话框。此参数对其他命令也很有用,例如当想要关闭实例而无需确认命令时。** - `iris all` 列出所有已安装实例的摘要信息,每行一个实例,如下所述。 ```java C:\InterSystems\IRISHealth\bin>iris all Instance Version ID Port Directory ------------- ---------- ---- --------- up irishealth 2022.1.0.114.0 51773 c:\intersystems\irishealth ``` 注意:如果需要完整的信息,例如用于解析或报告目的,请使用 `iris list`。 ```java C:\InterSystems\IRISHealth\bin>iris list Instance 'IRISHealth' (Custom installation) directory: 'C:\InterSystems\IRISHealth' versionid: '2022.1.0.114.0' conf file: 'c:\intersystems\irishealth\iris.cpf' (SuperServer port = 51773, WebServer port = 52773) status : 'running, since Sun Sep 4 16:16:54 2022' Product : InterSystems IRISHealth ``` - `iris allw` 为每个实例列出与 `iris all` 相同的信息,而不包含长字段值。可能会产生超过 `80` 个字符的行。 ```java C:\InterSystems\IRISHealth\bin>iris allw Instance Name Version ID Port Directory ------------------------------- ---------------------------- ----- -------------------------------- up irishealth 2022.1.0.114.0 51773 c:\intersystems\irishealth ``` - `iris console instname [arguments]` 在操作系统命令窗口而不是`Terminal` 窗口中打开 `Terminal` 。同 `iris terminal` ![image](5F79276A5C594D8099232571CD0B79AD) - `iris force instname` 强制关闭实例。 ```java C:\InterSystems\IRISHealth\bin>iris force irishealth ``` - `iris help` [参数] 显示有关 `iris` 命令的最新信息。`start`, `stop`, `force` — 显示启动、停止和强制功能的特定功能帮助。 ```java C:\InterSystems\IRISHealth\bin>iris help force C:\InterSystems\IRISHealth\bin>iris help start C:\InterSystems\IRISHealth\bin>iris help stop ``` - `iris list [arguments]` 显示有关已安装 `IRIS` 实例的信息,如下所述。 `instname` — 可以选择指定 `IRIS` 实例名称以仅显示有关该实例的信息。例如,`iris list MyIRIS` 仅显示有关 `MyIRIS` 实例的信息。 ``` C:\InterSystems\IRISHealth\bin>iris list irishealth Instance 'irishealth' (Custom installation) directory: 'C:\InterSystems\IRISHealth' versionid: '2022.1.0.114.0' conf file: 'c:\intersystems\irishealth\iris.cpf' (SuperServer port = 51773, WebServer port = 52773) status : 'running, since Sun Sep 4 16:16:54 2022' Product : InterSystems IRISHealth ``` - `iris merge instname [arguments]` 将配置合并文件应用于实例,更新其 `CPF`(请参阅使用配置合并自动配置 `IRIS`)。 `merge-file [existing-CPF]` — 可以指定要应用的合并文件的位置,可以选择后跟目标 `CPF` 的位置。例如,`iris merge MyIRIS /tmp/merge.cpf` 将合并文件 `/tmp/merge.cpf` 应用于名为 `MyIRIS` 的实例。如果不带参数调用,则使用以下默认值: - 对于合并文件,默认值是 `ISC_CPF_MERGE_FILE` 环境变量的值。 - 对于现有的 `CPF`,默认是位于以下位置的 `iris.cpf` 文件: - 对于已安装的实例,安装目录。 - 对于容器,由 `ISC_DATA_DIRECTORY` 环境变量指定的目录;如果未使用持久 `%SYS` 和 `ISC_DATA_DIRECTORY`,则使用 `ISC_PACKAGE_INSTALLDIR` 环境变量指定的目录。 - `iris qall` 为每个实例列出与 `iris all` 相同的信息,除了长行被截断为 `78` 个字符外加一个终止波浪号 (`~`)。 ```java C:\InterSystems\IRISHealth\bin>iris qall ``` - `iris qlist` [参数] 与 `iris list` 类似,但有附加信息。每个实例的输出(如下所述)在一行中给出,字段由插入符号 (`^`) 分隔。 `instname` — 可以选择指定 `IRIS` 实例名称以仅显示有关该实例的信息。例如,`iris qlist MyIRIS` 仅显示有关 `MyIRIS` 实例的信息。 ```java C:\InterSystems\IRISHealth\bin>iris qlist irishealth irishealth^C:\InterSystems\IRISHealth^2022.1.0.114.0^running, since Sun Sep 4 16:16:54 2022^c:\intersystems\irishealth\iris.cpf^51773^52773^^^IRISHealth^^ ``` - `iris rename instname newname` 重命名实例。 - `iris restart instname [参数]` 重启实例;相当于 `iris stop instname restart` `nofailover` — 指定此可选参数以防止触发镜像故障转移。 - `iris start instname [参数]` 启动实例。 注意:系统可能会提示以“紧急模式”启动;如果是这样,请参阅紧急访问了解更多信息。 完整的`CPF` 路径 — 默认情况下, `IRIS` 从位于 `/mgr` 目录中的 `iris.cpf` 文件中读取某些设置。可以提供另一个 `.cpf` 文件的完整路径以供使用。 `nostu` — 启动指定的实例而不运行 `^STU`。 - `iris stat instname` 检索与 `irisstat` 实用程序相同的系统统计信息。 - `iris stop instname [参数]` 关闭实例。 `restart` — 关闭实例后启动实例。 `nofailover` — 指定此可选参数以防止触发镜像故障转移。 - `iris stopnoshut instname [参数]` 使用 `INTNOSHUT^SHUTDOWN` 关闭命名实例。 注意:只有实例所有者和 `irisusr` 可以在不登录终端的情况下运行 `INTNOSHUT^SHUTDOWN`。 `nofailover` — 指定此可选参数以防止触发镜像故障转移。 - `iris terminal instname [参数]` 打开实例的 `Terminal` 。 `B` — 允许系统管理员紧急登录终端。 `-b partition_size` — 指定进程的最大分区大小(以 `KB` 为单位)。 `"[label[+offset]]^routine"` — 指定要在用户模式下运行的 `ObjectScript` 程序的名称。除了指定的格式之外,还可以传递由字符串和/或数字文字组成的参数列表,以及省略的 (void) 参数,如下所示: - `"routine[([parameter-list])]"` - `"[label]^routine[([parameter-list])]"` - `"##CLASS(package.class).method[([parameter-list])]"` 其中,例如,参数列表以“字符串文字”的形式指定,`-+-000123.45600E+07`,省略的参数作为 `$Data(parameter)=0` 传递给目标。 **注意:空格和 `shell` 元字符必须以依赖于操作系统的形式引用。** `U` 命名空间 — 指定终端登录命名空间。 **注意:如果使用指定了启动命名空间的用户帐户启动 `IRIS`,则 `-U` 参数无效(请参阅用户帐户属性)。**
问题
j ay · 三月 22, 2023

如何使用java连接cache2016数据库

1、java如何连接cache2016数据库 2、java如何调用cache的函数 "Backup.General", "ExternalFreeze", Using the JDBC Driver | Using Java with InterSystems Software | InterSystems IRIS for Health 2023.1请参阅这个文档来使用jdbc 链接cache 数据库, Native SDK for Java | InterSystems IRIS for Health 2023.1 如果要调用任何的 cache 服务器端的代码,可以使用Native SDK for Java 使用方法请参阅上面的文档
公告
Claire Zheng · 六月 14, 2023

【视频】详细了解TrakCare 创新工具包( Innovation Toolkit)

Hi 开发者们, 欢迎观看视频,以了解 InterSystems TrakCare 创新工具包( Innovation Toolkit),该工具包可免费下载,使 TrakCare 用户能够快速访问标准 HL7® FHIR® 格式的数据,使记录系统成为转型系统: ⏯ TrakCare 创新工具包介绍 @ 2022 年全球峰会 🗣主持人:Eslam Farahat,InterSystems 产品经理 订阅InterSystems B站!
文章
jieliang liu · 十月 26, 2021

IRIS 2021 技术文档 First Look 29 技术概要:LDAP 和 InterSystems 产品

技术概要:LDAP 和 InterSystems 产品 目录 技术概要: LDAP 和 InterSystems 产品 1 设置 LDAP 身份验证 1 选择 InterSystems IRIS 实例 1 定义 LDAP 配置 1 选择新的 LDAP 域作为默认值 2 启用 LDAP 身份验证 2 为 LDAP 服务器安装安全证书 3 探索 LDAP 用户和组 4 User1: 操作员 4 User2: 管理者 5 User3: 开发者 5 自动创建用户 6 了解有关 LDAP 和安全的更多信息 6 技术概要:LDAP 和 InterSystems 产品 InterSystems IRIS®数据平台可以与 LDAP(轻量级目录访问协议,Lightweight Directory Access Protocol)服务器集成,从而可以无缝地使用这种流行技术对用户进行身份验证。通过 LDAP 提供授权也很容易。 当用户尝试登录 InterSystems IRIS 时,用户名和密码会被发送到 LDAP 服务器,以验证该用户是否存在。一旦用户的身份得到验证,LDAP 服务器就会向 InterSystems IRIS 发送关于用户属于哪些组的信息。这些组与 InterSystems IRIS 中的角色相对应,这些角色控制用户被授权执行什么操作,以及是否可以读取或写入内容。通过这种方式,InterSystems IRIS 在其安全策略的身份验证和授权方面都使用了 LDAP 技术。 按照本指南中的步骤,您可以连接到 LDAP 服务器,并探索它如何影响 InterSystems IRIS 中的安全。在这些练习中,您将配置 InterSystems IRIS 以与 Windows 活动目录(Active Directory)服务器集成。虽然也支持其他的 LDAP 服务器,但本文主要介绍如何使用活动目录(Active Directory)进行 LDAP 身份验证和授权。 要浏览所有的技术概要(First Look),包括下面描述的可以在免费的社区版(Community Edition)实例上执行的其他内容,请参见 InterSystems First Looks(《InterSystems 技术概要》)。 设置 LDAP 身份验证 在以 LDAP 用户登录并在 InterSystems IRIS 中探索基于 LDAP 的安全之前,需要完成以下操作: 选择 InterSystems IRIS 实例 定义 LDAP 配置 选择 LDAP 域作为默认值 在 InterSystems IRIS 中启用 LDAP 身份验证 为 LDAP 服务器安装安全证书 选择 InterSystems IRIS 实例 要使用该程序,您需要一个正在运行的 InterSystems IRIS 实例。您的选择包括多种类型的已授权的和免费的评估实例;该实例不需要由您正在工作的系统托管(尽管它们必须相互具有网络访问权限)。关于如何部署每种类型的实例的信息(如果您还没有可使用的实例),请参见 InterSystems IRIS Basics: Connecting an IDE(《InterSystems IRIS 基础:连接一个 IDE》)中的 Deploying InterSystems IRIS(部署 InterSystems IRIS)。 定义 LDAP 配置 InterSystems IRIS 使用 LDAP 配置来定义连接到 LDAP 服务器和搜索用户所需的信息。要创建和定义新的 LDAP 配置: 设置 LDAP 身份验证 在浏览器中打开您的实例的管理门户(Management Portal)。要使用的 URL 取决于您选择的实例类型;有关确定正确的 URL 的信息,请参见 InterSystems IRIS Basics:Connecting an IDE(《InterSystems IRIS 基础:连接一个 IDE》)中的 InterSystems IRIS Connection Information(InterSystems IRIS 连接信息)。 进入 Security LDAP Configurations(安全 LDAP 配置) 页面 (System Administration(系统管理) > Security(安全) > System Security(系统安全) > LDAP Configurations(LDAP 配置))。 点击 Create New LDAP configuration(创建新 LDAP 配置)。 在 Name(名称)字段中,输入 irisldap.com。 选择 Enabled(已启用) 复选框。 选择 LDAP server is a Windows Active Directory server(LDAP 服务器是一个 Windows 活动目录(Active Directory) 服务器) 复选框。 定义以下字段: +-----------------------------------------------------------------+---------------------------------------------------------------------------+ | 字段 | > 内容 | +=================================================================+===========================================================================+ | LDAP domain name(LDAP 域名) (仅限 Windows) | > irisldap.intersystems.com | +-----------------------------------------------------------------+---------------------------------------------------------------------------+ | LDAP host names(LDAP 主机名) | > irisldapdc1.irisldap.intersystems.com | +-----------------------------------------------------------------+---------------------------------------------------------------------------+ | LDAP username to use for searches(用于搜索的 LDAP 用户名) | - (Windows) sidLDAPQuery | | | | | | - (UNIX®) | | | | | | > CN=sidLDAPQuery,CN=Users,DC=irisldap,DC=intersystems,DC=com | +-----------------------------------------------------------------+---------------------------------------------------------------------------+ | LDAP username password(LDAP 用户名密码) | > 选择 Enter New Password(输入新密码), 然后输入密码为 Cach3L3arning | +-----------------------------------------------------------------+---------------------------------------------------------------------------+ | LDAP Base DN to use for searches(用于搜索的 LDAP 基础 DN) | > DC=irisldap,DC=intersystems,DC=com | +-----------------------------------------------------------------+---------------------------------------------------------------------------+ | LDAP Unique search attribute(LDAP 独特的搜索属性) | > sAMAccountName | +-----------------------------------------------------------------+---------------------------------------------------------------------------+ 选择 Use TLS/SSL encryption for LDAP sessions(将 TLS/SSL 加密用于 LDAP 会话)复选框。 选择 Use LDAP Groups for Roles/Routine/Namespace(将 LDAP 组用于角色/路由/命名空间)复选框。 选择 Allow Universal group Authorization(允许通用组授权)复选框。 点击 Save(保存)。 选择新的 LDAP 域作为默认值 一旦定义了 LDAP 服务器的 LDAP 配置,您需要将新的 LDAP 配置设置为默认的 LDAP 域。要将 LDAP 服务器设置为默认服务器: 从管理门户(Management Portal)主页,进入 System-wide Security Parameters(全系统安全参数) 页面 (System Administration(系统管理) >**Security(安全) > System Security(系统安全) > System-wide Security Parameters(全系统安全参数)**)。 从 Default security domain(默认安全域)下拉列表中选择 irisldap.com。 点击 Save(保存)。 启用 LDAP 身份验证 使用 LDAP 服务器只是 InterSystems IRIS 中可用的一种身份验证方法。不仅必须为 InterSystems IRIS 的整个实例启用 LDAP 身份验证,而且需要由 LDAP 用户访问的 InterSystems IRIS 的每个组件也必须启用 LDAP 身份验证。以下程序为实例和 InterSystems IRIS 安全所需的那些组件启用 LDAP 身份验证: 设置 LDAP 身份验证 从管理门户(Management Portal)主页,进入 Authentication/Web Session Options(身份验证/Web 会话选项) 页面(System Administration(系统管理)> Security(安全) > System Security(系统安全) > Authentication/Web Session Options(身份验证/Web 会话选项))。 选择 Allow LDAP authentication(允许 LDAP 身份验证)复选框。 点击 Save(保存)。 从管理门户(Management Portal)主页,进入 Web Applications(Web 应用程序)页面 (System Administration(系统管理) > Security(安全) > Applications(应用程序) > Web Applications(Web 应用程序))。 在这个页面上,您将为您在 InterSystems IRIS 中将要访问的管理门户(Management Portal)部分启用 LDAP 授权。因为管理门户(Management Portal)的其他部分没有启用 LDAP 授权,如果您试图探索这些其他部分,可能会被要求登录。 点击 /csp/sys 来显示用于配置 web 应用程序的页面。 在 Security Settings(安全设置) 部分,在 Allowed Authentication Methods(允许的身份验证方法)字段中选择 LDAP 复选框。 点击 Save(保存)。 一旦设置被保存,点击 Cancel(取消)以返回到 Web Applications(Web 应用程序)页面。 点击 /csp/sys/sec。这个 web 应用程序包含管理门户(Management Portal)的安全页面。 在 Security Settings(安全设置)部分,在 Allowed Authentication Methods(允许的身份验证方法)字段中选择 LDAP 复选框。 点击 Save(保存)。 一旦设置被保存,点击 Cancel(取消)以返回到 Web Applications(Web 应用程序) 页面。 点击 /csp/sys/op。这个 web 应用程序包含管理门户(Management Portal)的操作页面。 <span id="1.5_Installing_a_Security_Certificate_fo" class="anchor"></span>在 Security Settings(安全设置) 部分,在 Allowed Authentication Methods(允许的身份验证方法)字段中选择 LDAP 复选框。 点击 Save(保存)。 为 LDAP 服务器安装安全证书 LDAP 服务器采用 TLS 进行安全保护,因此您需要安装安全证书才能成功访问服务器。在将其标识为安全证书之前,您将创建一个包含所需证书内容的 .cer 文件。 创建 .cer 文件 要创建将作为安全证书安装的文件: 打开一个文本编辑器,如记事本,并创建一个新文件。 复制以下所有内容并将其粘贴到文本编辑器中的新文件中。新文件应该以 -----BEGIN CERTIFICATE-----开头,并以-----END CERTIFICATE-----结尾。 -----BEGIN CERTIFICATE----- MIIDuTCCAqGgAwIBAgIQO5hG2uC7G7ZBxcXt/J+z3TANBgkqhkiG9w0BAQsFADBv MRMwEQYKCZImiZPyLGQBGRYDY29tMRwwGgYKCZImiZPyLGQBGRYMaW50ZXJzeXN0 ZW1zMRgwFgYKCZImiZPyLGQBGRYIaXJpc2xkYXAxIDAeBgNVBAMTF2lyaXNsZGFw LUlSSVNMREFQREMxLUNBMB4XDTE4MDQwOTE0MDUzMloXDTIzMDQwOTE0MTUzMlow bzETMBEGCgmSJomT8ixkARkWA2NvbTEcMBoGCgmSJomT8ixkARkWDGludGVyc3lz dGVtczEYMBYGCgmSJomT8ixkARkWCGlyaXNsZGFwMSAwHgYDVQQDExdpcmlzbGRh cC1JUklTTERBUERDMS1DQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB AL/aNDJJNbzGh6tXG8+hmEEplb80UQMcIhLvoanz/RKKZXBBY68rO5pkYUwn/24g pryGy0OUjA997KKol5rdbXWzK7vUMuVSp0atw1m4vF9hmp1bpKBC60OXmV39Fqar ej1dkRl0ZXOmCexP8JqTyNwhpOLXvazzzvsNRr4ts9u1m6y9kFYecu4PRqtFCgoC T6rbgqz1Ew3VrhQHi0HWvq1sR2CngxdyG8AnlSo6nz3X/IrTwrw5lauNLfpsRda5 D5YfUpxYeqpONSUB650u9bC0l5eRWe8kS33Xr+u5Odkhy087I/zN+GK7xMGzxYMR OWNINIGRvlLuDRshKQl4gP0CAwEAAaNRME8wCwYDVR0PBAQDAgGGMA8GA1UdEwEB /wQFMAMBAf8wHQYDVR0OBBYEFM3Ofv4R/zkEgHkp4ayvTkAvxJikMBAGCSsGAQQB gjcVAQQDAgEAMA0GCSqGSIb3DQEBCwUAA4IBAQC8hhvc/+WsDeipNezBo+ovum2z 7q0fStr73Tj84cDGSyCmT2Q/h0qFvkfjtRd8AUBdG0qjhIB4VLVyWmrWDl1jAUcr 3AzygfO6UZjNRT+4c8r8R2xOhE3wJEJWibzXD9bPCtCkhYNJT6bi5PSRgUq+r9GU 探索 LDAP 用户和组 IHnAUmaQa+K+kNEpAvBfIeQ2ox9NPbtUfj/fswKpubWzZZc2udeU8SQLacl6tZMA tXgZPT6lQfoZU2WmDG1EnoC4Ji1++Sf6Ho2i6kxg1m6geyOPSsGPdsAVjYCqCjuZ pxjAsfZXV2juLyTBM51rrmV/Rqfougnikh4zhFRBrOHtMP71ZxCptMVz3RHe -----END CERTIFICATE----- 在您可以访问的目录中将该文件另存为 irisldap.cer。 在 Windows 上安装安全证书 如果您在 Windows 上运行 InterSystems IRIS,请完成以下步骤来完成安装您所创建的安全证书的过程。 使用 Windows 资源管理器(Explorer),双击在您保存文件的目录中的安全文件 irisldap.cer。 点击 Install Certificate(安装证书)。 选择 Local Machine(本地机器) 并点击 Next(下一步)。 点击 Yes(是) 以允许对您的设备进行更改。 选择 Place all certificates in the following store(将所有证书放入以下存储区)并点击 Browse(浏览)。 选择 Trusted Root Certification Authorities(受信任的根证书颁发机构)并点击 OK(确定)。 点击 Next(下一步)。 点击 Finish(完成)。 在 UNIX®上安装安全证书 如果您在 UNIX®上运行 InterSystems IRIS,请完成以下步骤来完成安装您所创建的安全证书的过程。 以 _system 用户身份登录管理门户(Management Portal)时,进入 Security LDAP Configurations(安全 LDAP 配置) 页面 (System Administration(系统管理) > Security(安全) > System Security(系统安全) > LDAP Configurations(LDAP 配置))。 从 LDAP 配置的列表中点击 irisldap.com。 在 TLS/SSL certificate file(TLS/SSL 证书文件)字段中,输入 irisldap.cer 的路径和文件名,这是您创建并保存的文件。 探索 LDAP 用户和组 现在您已经配置了您的 LDAP 连接并启用了 LDAP 身份验证,您可以使用 LDAP 服务器来登录 InterSystems IRIS。LDAP 服务器包含三个用户:user1、user2 和 user3。user1 属于 intersystems-Role-%Operator 组,user2 属于 intersystems-Role-%Manager 组,user3 属于 intersystems-Role-%Developer 组。每个组都授予属于 InterSystems IRIS 中相应角色的权限。例如,当 user1 通过 LDAP 服务器的身份验证成功时,将为其分配 %Operator 角色。 在本教程中,您将以所有三个用户的身份登录到 InterSystems IRIS,并根据与用户关联的角色探索可用的操作。当您作为一个有效的 LDAP 用户登录到 InterSystems IRIS 时,InterSystems IRIS 会自动创建用户,而不需要您事先手动添加用户。 User1: 操作员 要以 user1 的身份登录并探索 InterSystems IRIS: 如果您目前已登录到 InterSystems IRIS,请点击管理门户(Management Portal)左上角的 Logout(退出) 链接。 探索 LDAP 用户和组 使用以下凭证登录 InterSystems IRIS: 用户名:user1 密码:Password1 user1 是 intersystems-Role-%Operator 组的成员。基于这个组,当 user1 通过身份验证时,他们会被自动授予与 InterSystems IRIS 中 %Operator 角色相关的权限。 从管理门户(Management Portal)主页,进入 Databases(数据库) 页面 (System Operation(系统操作) > Databases(数据库))。user1 可以访问这个页面,因为他们已经被 LDAP 服务器授权,可以和与 %Operator 角色关联的页面进行交互。 在管理门户(Management Portal)主页上,请注意 System Administration(系统管理) 菜单已被禁用。 user1 不能访问此菜单,因为 %Operator 角色不包含适当的权限。 User2: 管理者 要以 user2 的身份登录并探索 InterSystems IRIS: 点击管理门户(Management Portal)左上角的 Logout(退出) 链接。 使用以下凭证登录 InterSystems IRIS: 用户名:user2 密码:Password2 user2 是 intersystems-Role-%Manager 组的成员。基于这个组,当 user2 通过身份验证时,他们会被自动授予与 %Manager 角色相关的权限。正如您将看到的,这些权限包括访问 user1 无法看到的页面。 从管理门户(Management Portal)主页,进入 Users(用户) 页面 (System Administration(系统管理) > Security(安全) > Users(用户))。请记住,user1 不能访问 System Administration(系统管理) 菜单。 从用户列表中点击 user1。 点击 Roles(角色) 标签。 请注意,%Operator 是分配给 user1 的唯一角色。 点击 Cancel(取消) 以返回到 Users(用户) 页面。 请注意,在用户列表中没有 user3 的条目。该用户将在 user3 登录时自动创建,此时 InterSystems IRIS 使用 LDAP 服务器对用户进行身份验证。 User3: 开发者 要以 user3 的身份登录并探索 InterSystems IRIS: 点击管理门户(Management Portal)左上角的 Logout(退出)链接。 使用以下凭证登录 InterSystems IRIS: 用户名:user3 密码:Password3 user3 是 intersystems-Role-%Developer 组的成员。基于这个组,当 user3 通过身份验证时,他们会被自动授予与 %Developer 角色相关的权限。 请注意,该用户可以访问 System Explorer(系统资源管理器)菜单,而不是 System Operation(系统操作)和 System Administration(系统管理)菜单。您可以看出,分配给 user3 的 %Developer 角色与分配给 了解有关 LDAP 和安全的更多信息 user1 和 user2 的角色具有不同的权限。这可以防止 user3 看到自己的用户配置文件,因为 Users(用户)页面是在 System Administration(系统管理)菜单下。 自动创建用户 您已经登录到 InterSystems IRIS,但没有先创建新用户。当在 LDAP 服务器上发现这些用户时,InterSystems IRIS 会自动创建这些用户。下面的程序演示了这个过程: 点击管理门户(Management Portal)左上角的 Logout(退出)链接。 使用以下凭证登录 InterSystems IRIS: 用户名:user2 密码:Password2 请记住,user2 拥有 %Manager 角色。 从管理门户(Management Portal)主页,进入 Users(用户) 页面 (System Administration(系统管理) > Security(安全) > Users(用户))。 在列表中找到 user3 并点击行中的 Delete(删除)。 此时,拥有 %Developer 角色的 user3 在 InterSystems IRIS 中不复存在。 点击管理门户(Management Portal)左上角的 Logout(退出)链接。 使用以下凭证登录 InterSystems IRIS: 用户名:user3 密码:Password3 因为 user3 仍然存在于 LDAP 服务器上,所以即使您刚刚在 InterSystems IRIS 中删除了用户帐户,您也能够以 user3 的身份重新登录到 InterSystems IRIS。 如果需要,您可以重新登录 InterSystems IRIS,以确认 user3 现在是一个用户。 a. 点击管理门户(Management Portal)左上角的 Logout(退出)链接。 b. 使用以下凭证登录 InterSystems IRIS: 用户名:user2 密码:Password2 c. 从管理门户(Management Portal)主页,进入 System Administration(系统管理) > Security(安全) > Users(用户)。user3 现在在列表中,尽管您之前删除了该用户账户。 了解有关 LDAP 和安全的更多信息 您可以使用以下参考资料来了解有关 LDAP 和其他安全概念的更多信息。 有关在 InterSystems IRIS 中使用 LDAP 的详细信息,请参见 LDAP Guide(《LDAP 指南》)。 有关 InterSystems IRIS 中基于角色的安全的介绍,请参见 First Look:Role-Based Access Control(《技术概要:基于角色的访问控制》)。
文章
Claire Zheng · 十一月 8, 2021

2021全球线上峰会划重点:计算的目的是洞察力,而不是数字

InterSystems 2021全球线上峰会精彩内容梳理:两个重磅论坛集中探讨Analytics(分析)的奥义,InterSystems数据平台与医疗行业的愿景分享!
文章
Claire Zheng · 二月 21, 2023

【GS22 视频】InterSystems IRIS数据平台与E级方程式赛车:速度、规模和安全性

速度、规模和安全性是我们真正热衷的领域,这也正是优秀的E级方程式赛车手所追求的。在InterSystems 2022年全球峰会上,InterSystems 数据平台产品管理总监Jeffery Fried 及其团队分享了InterSystems IRIS数据平台的新功能与产品规划。基于InterSystems IRIS数据平台,我们为用户构建优秀的“赛车”,内置的一系列非凡功能和高效周全的“维修技师”,确保“赛车手”能够在竞争激烈的赛道中心无旁骛地飞速向前!
文章
Qiao Peng · 三月 5, 2021

通过 SQL SELECT 显示 Global

这是一个第三方写的在 IRIS 2020.1 和 Caché 2018.1.3 上工作的代码示例 不会与新版本保持同步 也不会获得 InterSystems 支持提供的服务! Caché/Ensemble/IRIS 中的 Global 通常在 SQL 访问中是不可见的 本示例将展示如何克服此限制。Global 将呈现为一个表,其中包含它们的下标和存储的内容。 要查看的 global 通过一个静态 WHERE 条件传递给 SQL, 该条件需要 3 个参数: 名称 (必需) 开始下标 (可选) 结束下标 (可选) 只提供 global 名称将获得整个 global 的导出数据。还可以为 global 提供扩展引用,并且由于这是 SQL 表,因此各种附加条件都适用。 小心, 在 SQL 和 Caché/Ensemble/IRIS 之间进行正确引用可能是一个挑战。 示例:select * from zrcc_G.dump where zrcc_G.Dump('^|"CACHE"|Sample.PersonD',2,4)=1 ID Global Subscript Value 1 ^|"CACHE"|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 ^|"CACHE"|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 ^|"CACHE"|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"
文章
jieliang liu · 十月 27, 2021

IRIS 2021 技术文档 First Look 34 技术概要:InterSystems IRIS Native API for Python

技术概要:InterSystems IRIS Native API for Python 目录 技术概要: InterSystems IRIS Native API for Python 1 InterSystems IRIS 存储结构简介 1 探索 IRIS Native for Python 1 用前须知 2 安装 Native API 包 2 IRIS Native 应用程序 2 运行练习 3 确认管理门户(Management Portal)中的变更 3 了解有关 IRIS Native 的更多信息 3 技术概要:InterSystems IRIS Native API for Python 本技术概要(First Look)指南解释了如何使用 InterSystems IRIS Native 功能从 Python 应用程序访问 InterSystems IRIS® globals。IRIS Native 还允许您运行 ObjectScript 方法、函数和例程。在本文中,您将首先连接到 InterSystems IRIS。然后您将在 InterSystems IRIS 中设置和检索一个 global 节点的值,并在另一个 global 节点上进行迭代。您还将调用 InterSystems IRIS 类方法。所有这些活动都将在 Python 3 应用程序中执行。 为了让您体验 IRIS Native,而又不陷入细节的困境,本次探索特意设计得很简单。这些活动被设计成只使用默认设置和功能,这样您就可以熟悉功能的基本原理,而不必处理那些离题或过于复杂的细节。当您把 IRIS Native 引入您的生产系统时,您可能需要做一些不同的事情。请确保不要把这种对 IRIS Native 的探索与真实的情况相混淆! 本文档末尾提供的参考资料将使您对在生产中使用 IRIS Native 的情况有一个很好的了解。 要浏览所有的技术概要(First Look),包括可以在 InterSystems IRIS 免费的评估实例上执行的那些,请参见 InterSystems First Looks(《InterSystems 技术概要》)。 InterSystems IRIS 存储结构简介 InterSystems IRIS 提供了一种易于使用的方法来将数据存储在持久化多维数组中。global 是存储在物理 InterSystems IRIS 数据库中的命名多维数组。在应用程序中,globals 到物理数据库的映射基于当前命名空间,命名空间提供一个或多个物理数据库的逻辑统一视图。例如,要使用一个名为* ^Settings* 的 global 将值 "Red "与键 "Color "关联起来,请使用 InterSystems IRIS Basics:Connecting an IDE(《InterSystems IRIS 基础: 连接一个 IDE》)中的为您的实例描述的程序打开 InterSystems 终端(InterSystems Terminal),并输入以下代码: set ^Settings("Color")="Red" 您可以利用 globals 的多维特性来定义一个更复杂的结构: set ^Settings( "Auto1 ", "Properties ", "Color ") = "Red " set ^Settings( "Auto1 ", "Properties ", "Model ") = "SUV " set ^Settings( "Auto2 ", "Owner ") = "Mo " set ^Settings( "Auto2 ", "Properties ", "Color ") = "Green " 有关 globals 的更多信息,请参见 Using Globals(《使用 globals》)。 探索 IRIS Native for Python 现在,您已经准备好实验 IRIS Native 了。下面的简短演示向您演示了如何在一个简单的 Python 应用程序中使用 IRIS Native。 想试试 InterSystems Native API for Python 的在线视频演示吗?请查看 Python QuickStart(Python 快速入门)! 探索 IRIS Native for Python 用前须知 要使用这个程序,您需要一个正在运行的 InterSystems IRIS 实例和一个使用 Python 3 和 PIP 实用程序以及您喜欢的 Python IDE 的系统。(在 Windows 系统中,确保 Python 解释器包含在您的 PATH 环境变量中)。您对 InterSystems IRIS 的选择包括多种类型的已授权的和免费的评估实例;该实例不需要由您正在工作的系统托管(尽管它们必须相互具有网络访问权限)。关于如何部署每种类型的实例的信息(如果您还没有可使用的实例),请参见 InterSystems IRIS Basics: Connecting an IDE(《InterSystems IRIS 基础:连接一个 IDE》)中的 Deploying InterSystems IRIS(部署 InterSystems IRIS)。使用同一文档中的 InterSystems IRIS Connection Information(InterSystems IRIS 连接信息)和 Python IDE 中的信息,将 Visual Studio 连接到您的 InterSystemsIRIS 实例。 安装 Native API 包 在运行示例 Python 程序之前,您需要使用 PIP 包管理器来安装 irisnative 包,您可以从 https://github.com/intersystems/quickstarts-python/tree/master/Solutions/nativeAPI_wheel 下载。 如果您的本地系统上安装了 InterSystems IRIS,wheel 文件已经安装在子目录 install-dir dev python 中,其中 install-dir 是 InterSystems IRIS 实例的安装目录, Python 3 包的名称 (.whl 文件) 包括 cp34。 要安装 wheel 文件,在命令行中输入命令 pip install irisnative-1.0.0 whl file,其中 irisnative-1.0.0 whl file 是您的 Python 版本和操作系统对应的 wheel 文件。例如,如果您在 Linux 上使用 Python 3,请使用 irisnative-1.0.0-cp34-abi3-linux_x86_64.whl。 IRIS Native 应用程序 现在您已经创建了项目,接下来您将创建一个小的应用程序,演示 Native API 的一些功能。 在您的 IDE 中,在 IRISNative 目录中创建一个新的源文件,将该文件保存为 IRISNative.py。 将以下代码粘贴到 IRISNative.py 中,将 InterSystems IRIS 实例的连接信息替换为 kwargs 中的值。您可以指定所示的 USER 命名空间,也可以选择在实例上创建的另一个命名空间: import irisnative # Modify connection info based on your environment ip = "127.0.0.1 " port = 1972 namespace = "USER " username = " _SYSTEM " password = "SYS " # create database connection and IRIS instance connection = irisnative.createConnection(ip,port,namespace,username,password) dbnative = irisnative.createIris(connection) print( " [1. Setting and getting a global ] ") # setting and getting a global # ObjectScript equivalent: set ^testglobal( "1 ") = 8888 dbnative.set(8888, "testglobal ", "1 ") # ObjectScript equivalent: set globalValue = $get( ^testglobal( "1 ")) globalValue = dbnative.get( "testglobal ", "1 ") print( "The value of testglobal is ", globalValue) print() print( " [2 Iterating over a global ] ") # modify global to iterate over # ObjectScript equivalent: set ^testglobal( "1 ") = 8888 # ObjectScript equivalent: set ^testglobal( "2 ") = 9999 dbnative.set(8888, "testglobal ", "1 ") dbnative.set(9999, "testglobal ", "2 ") Iter = dbnative.iterator( "testglobal ") print( "walk forwards ") 了解有关 IRIS Native 的更多信息 for subscript, value in Iter.items(): print( "subscript= {}, value={} ".format(subscript, value)) print() print( " [3. Calling a class method ] ") # calling a class method # ObjectScript equivalent: set returnValue = ##class(%Library.Utility).Date(5) returnValue = dbnative.classMethodValue( "%Library.Utility ", "Date ", 5) print(returnValue) # close connection connection.close() 示例代码分为三个部分: 第一部分展示了如何设置一个 global 的值以及稍后如何检索它。这部分里面执行的命令等同于 ObjectScript 的 SET 和 GET 命令。 第二部分展示了如何迭代 global 的子节点,类似于 ** $ORDER** ObjectScript 函数。 第三部分展示了如何使用 IRIS Native 从您的 Python 应用程序调用 ObjectScript 类方法。 注意: ObjectScript中的 Globals 以插入符号( ^)开头。在使用 InterSystems IRIS Native API 的 Python 应用程序中,这不是必需的。 运行练习 现在您已经准备好运行演示应用程序了。如果示例执行成功,您应该会看到带有示例代码结果的打印输出: [1. Setting and getting a global ] The value of testglobal(1) is 8888 [2.Iterating over a global ] walk forwards subscript=1, value=8888 subscript=2, value=9999 [3. Calling a class method ] Jan 30, 2018 确认管理门户(Management Portal)中的变更 接下来,使用以下程序在管理门户(Management Portal)中确认您的结果: 使用 InterSystems IRIS Basics:Connecting an IDE(《InterSystems IRIS 基础:连接一个 IDE》)中为您的实例描述的 URL,在浏览器中打开您的实例的管理门户(Management Portal)。 <span id="3_Learn_More_About_IRIS_Native" class="anchor"></span>如果您不在代码指定的命名空间中,请切换到该命名空间。 导航到 Globals 页面(System Explorer(系统资源管理器) > Globals)。您应该会看到示例代码中创建的 testglobal global。点击 View(查看)来查看其内容。您应该会看到 global 的两个节点: ^testglobal(1) = 8888 和 ^testglobal(2) = 9999。 了解有关 IRIS Native 的更多信息 有关 IRIS Native、globals 和 InterSystems IRIS 的更多信息,请参见:Using the Native API for Python(《使用 Native API for Python》) 了解有关 IRIS Native 的更多信息 Using Globals(《使用 Globals》)
文章
Qiao Peng · 三月 5, 2021

Global 扫描和切片

Global 扫描和切片 这是一个在 IRIS 2020.1 和 Caché 2018.1.3 上工作的代码示例 不会与新版本保持同步 也不会获得 InterSystems 提供的支持服务! 大多数情况下,默认存储使用的 global 只有 1 个表示 IDKEY 的下标级别。 对于索引 global,可能有 2 个或更多下标级别。 数组、父子关系或扩展了基础数据类的持久化类 是具有更多下标级别的示例。 但所有这些 global 都非常统一。 我们还能看到与类或表无关的 global,例如 ^SPOOL、^ERRORS 或 ^%SYS 其中的结构取决于各个级别的具有特殊含义的下标。 分析这些不一致的 global 是一个挑战,而只是把它的内容导出来不一定有助于理解依赖关系。 本示例的原理就像那个古老的笑话:“如何吃一头大象?” ==>“切成片吃!” 以下是实现的功能: 通过一条 SQL 语句,您可以逐级显示任意 global 的结构。 您提供 global 名称和要显示的最大级别,即可获得相关下标、节点的 $Data、后面的子节点数量以及在该级别存储的内容(如果有的话)。 示例:**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 很棒的文章,辛苦乔老爷!
文章
Michael Lei · 六月 26, 2022

从Web 应用端用代码实现OAuth2 和基础认证、鉴权和审计

在这篇文章中,我将解释如何通过使用CSP Web应用程序以及启用/禁用和认证/取消认证任何Web应用程序的代码来进行认证、授权和审计。 在线 Demo -- https://dappsecurity.demo.community.intersystems.com/csp/user/index.csp (SuperUser | SYS) 推荐大家看下这个视频: https://www.youtube.com/watch?v=qFRa3njqDcA 应用层 从认证开始 认证可以验证任何试图连接到InterSystems IRIS®的用户或其他实体的身份。正如人们常说的,认证是你如何证明你是你所说的人。 有许多不同的方法可以对用户进行认证;每一种方法都被称为认证机制。InterSystems IRIS支持一系列的认证机制: Kerberos — Kerberos协议被设计用来在不安全的网络上为服务提供安全认证。Kerberos使用Ticket来验证用户,避免了在网络上交换密码。 Operating System–Based — 基于操作系统的认证使用操作系统对每个用户的身份认证来识别该用户对InterSystems IRIS的身份。 Instance Authentication — 通过实例验证,InterSystems IRIS提示用户输入密码,并将所提供的密码的哈希值与它所存储的值进行比较。 Lightweight Directory Access Protocol (LDAP) — 通过轻量级目录访问协议LDAP,InterSystems IRIS根据LDAP服务器中的信息对用户进行认证。 Delegated Authentication — 委托认证提供了一种创建自定义认证机制的方法。应用程序开发人员完全控制委托认证代码的内容。 我使用实例验证,对于用户的创建,我们可以使用以下objectscript命令: &sql(CREATE USER TestUser IDENTIFY BY demo) 创建 TestUser 和 demo 密码 审计Auditing 在创建用户记录时,也通过使用以下objectscript命令添加到审计数据库中: Do $SYSTEM.Security.Audit("%System","%Security","UserChange","User:TestUser | Password:demo","Audit Log inserted from Data_APP_Security") 请参考审计相关的文档 (Auditing Guide) : https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=AAUDIT 授权Authorization 一旦认证完成,我们需要创建角色并授予角色以权限,然后将角色与用户联系起来(授权)。我们将分三步来做这件事 第一步 : 通过使用以下objectscript命令创建角色,我们正在创建ReadWrite角色 &sql(CREATE ROLE ReadWrite) 第二步: 在表上授予SELECT,UPDATE,INSERT权限,我们将scw.Patient表的权限分配给ReadWrite角色。 &sql(GRANT SELECT,UPDATE,INSERT ON scw.Patient TO ReadWrite) 第三步: 给用户授予角色,我们给TestUser用户分配ReadWrite角色 &sql(GRANT ReadWrite To TestUser) 启用/禁用Web应用 我们可以通过使用以下objectscript代码启用或禁用Web应用程序 New $Namespace Set $Namespace = "%SYS" Set App = ##class(Security.Applications).%OpenId("/terminal") Set App.Enabled=0 Do App.%Save() 这里"/终端 "是我们应用程序的名称。应用程序可以通过设置 "App.Enabled "为0来禁用,通过设置值为1来启用 认证/取消 Web 应用 我们可以通过使用以下objectscript代码来设置认证 New $Namespace Set $Namespace = "%SYS" Set App = ##class(Security.Applications).%OpenId("/terminal") Set App.AutheEnabled=0 Do App.%Save() 这里"/终端 "是我们应用程序的名称。认证可以通过使用"App.AutheEnabled" 属性来设置. 可以设置以下数值 property AutheEnabled as Security.Datatype.Authentication [ InitialExpression = 64 ]; Authentication and Session mechanisms enabled (CSP Only). Bit 2 = AutheK5API Bit 5 - AutheCache Bit 6 = AutheUnauthenticated Bit 11 = AutheLDAP Bit 13 = AutheDelegated Bit 14 = LoginToken Bit 20 = TwoFactorSMS Bit 21 = TwoFactorPW 谢谢 源代码:https://openexchange.intersystems.com/package/Data_APP_Security
文章
Botai Zhang · 一月 26, 2021

利用Intersystems IRIS医疗版数据平台内置多模型整合医院信息查询业务解决方案

利用Intersystems IRIS医疗版数据平台内置多模型整合 医院信息查询业务解决方案 概述: 随着医院信息化建设的逐步完善,医院子系统越来越多,系统间接口越来越多,同时接口费用不断增加,管理工作变得越来越复杂。其中,查询类业务接口根据业务类型分化,数量也是逐步递增,带来接口量大、开发工作繁重、代码冗余、维护困难等等问题。针对这一困境,我们利用Intersystems IRIS数据平台内置多模型整合医院信息查询业务解决方案。该应用程序可通过内置模型应用完成查询业务,大大缩小开发、维护、实施等项目关键运转周期。 应用链接:HealthInfoQueryLayer 关键应用:IRIS for Health、REST API、ObjectScript、Globals 、SQL、DATA LOOKUP TABLES 应用程序采用模型及应用介绍: 1.采用模型 1.1. Globals (key-value) Globals是可以在IRIS数据库中存储和管理的稀疏多维数组。您可以使用ObjectScript和本机API处理Globals。 工具: https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GGBL_MANAGING 应用: 应用程序根据Globals的键值对、访问速度快的特性。应用在本次程序的Rest分派类与BP流程管理中取值应用,解决了频繁取值速度慢、实现在查找表前端页面配置操作,如:存储了SQL模型、服务配置信息等等。 1.2. SQL访问 InterSystems IRIS通过 ObjectScript、REST API及JDBC提供对数据的SQL访问. 工具: https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=GSQL_smp 应用: 在查询业务中,三方系统不配合接口改造,导致接口实现困难问题。此时,我们采用IRIS内嵌模型ObjectScript、REST API及JDBC来实现对数据的SQL访问,来建立业务接口。 1.3. Object访问 通过ObjectScript、REST API,InterSystems IRIS提供了在Globals 存储和更改对象实例的途径。 文档: https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=PAGE_multimodel_object 应用: 在整个交互过程中,直接操纵InterSystems IRIS对象。ObjectScript类定义通常用作创建对象(例如患者,科室或医护人员)的模板。 建立应用案例(此应用程序以患者为例) 2.1应用搭建: 2.1.2基本环境 IRIS版本信息:IRIS for Windows (x86-64) 2020.1 (Build 215U) Mon Mar 30 2020 20:14:33 EDT [HealthConnect:2.1.0] IRIS具有JAVA、JDBC环境 可采用PostMan进行测试 2.1.2安装步骤 ①建立Rest服务 新建Web应用程序→配置分派类→配置权限。 该步骤可见图片:应用程序运行情况/webaplication(Query).png及webaplication(role).png ②配置SQL-JDBC 建立SQL连接,连接测试数据库Mysql,导入测试jhip_patient_info.sql ③配置查找表 Global-^Ens.LookupTable中查找表文件导入 ④导入代码 导入ApplicationCode中的代码,编译,打开Production, 注意:修改BO配置信息(DNS)、配置JavaGateway等 2.2应用流程 2.3应用测试 可采用Postman工具(其他工具也可以)进行测试验证 Postman可导入Query.postman_collection.json,更改IP、端口号信息、URL进行测试。 2.4应用总结 本应用程序以查询患者为案例,采用IRIS中REST API、ObjectScript、Globals 、SQL内置多种模型实现医院信息查询业务。如果有需要可根据此方案丰富业务满足需求。 最后,如果您认可此解决方案,请在系统间多模型数据库竞赛中为该应用程序投票。 投票链接:投票链接 应用程序名称:HealthInfoQueryLayer 点击Vote投票即可。 感谢各位! 集成平台应用典型案例 感谢您的分享
公告
Claire Zheng · 二月 15, 2023

2023 年 2 月 15 日 – 警报:在 Windows 平台上使用大页共享内存

InterSystems 纠正了一个可能导致 InterSystems IRIS® 和 Caché 无法在 Windows 上利用大页共享内存的问题,即使这些产品得到的信息是已分配到了大页内存。这会对系统性能产生不利影响。 该问题是由于 Windows 10 中的一个更改引起的,该更改需要 InterSystems IRIS® 和 Caché做相应的修改。请注意,此问题还会影响所有基于 InterSystems IRIS® 或 Caché 的 InterSystems 产品。以下版本的 Windows 会出现此问题: Windows 10(版本 1703 及以上) Windows 11 Windows Server 2019 Windows Server 2022 Windows Server 2016 不受影响。 作为参考,此问题的更正标识为 RJF533。此更正将包含在所有未来的 InterSystems IRIS® 和 Caché 发行版中。该更正也作为受支持产品版本的补丁提供。 InterSystems 建议采取以下措施以避免潜在的严重系统性能下降: 对于使用大页内存的系统,推迟升级到受影响的 Windows 版本,直到实施更正。 对于已经运行受影响的 Windows 版本并使用大页内存的系统,在任何有计划的系统负载增加之前实施更正。 InterSystems 通常建议使用大页内存以提高性能。有关更多信息,请参阅在 Windows和memlock上配置大页内存的文档部分。 如果您对此警报有任何疑问或需要更正的临时分发,请联系全球响应中心(WRC)。
文章
Frank Ma · 六月 13, 2022

使用IRIS IntegratedML(一体化机器学习)预测孕产妇风险的Web应用

孕产妇风险可以通过一些医学界众所周知的参数来测量。这样,为了帮助医学界和计算机系统,特别是人工智能,科学家Yasir Hussein Shakir发布了一个非常有用的数据集,用于训练检测/预测孕产妇风险的机器学习(ML)算法。这份出版物可以在最大和最知名的ML数据库Kaggle上找到,网址是 https://www.kaggle.com/code/yasserhessein/classification-maternal-health-5-algorithms-ml. 关于数据集 由于缺乏怀孕期间和怀孕后的孕产妇保健信息,许多孕妇死于怀孕问题。这在农村地区和新兴国家的中下层家庭中更为常见。在怀孕期间,应时刻注意观察,以确保婴儿的正常成长和安全分娩 (来源: https://www.kaggle.com/code/yasserhessein/classification-maternal-health-5-algorithms-ml). 数据是通过基于物联网的风险监测系统,从不同的医院、社区诊所、孕产妇保健机构收集而来。 Age(年龄): 妇女怀孕时的年龄,以岁为单位。 SystolicBP (收缩压): 血压的最高值(mmHg),这是怀孕期间的另一个重要属性。 DiastolicBP(舒张压): 血压的较低值(mmHg),这是怀孕期间的另一个重要属性。 BS(血糖): 血糖水平是以摩尔浓度为单位,即mmol/L。 HeartRate(心率): 正常的静息心率,单位是每分钟的心跳次数。 Risk Level(风险等级): 基于前边的属性所预测的孕期风险强度水平。 从Kaggle获取孕产妇的风险数据 来自Kaggle的孕产妇风险数据可以通过Health-Dataset(健康数据集)应用程序加载到IRIS表中: https://openexchange.intersystems.com/package/Health-Dataset. 要做到这一点,在你的module.xml项目中,设置依赖关系(Health Dataset的ModuleReference): Module.xml with Health Dataset application reference <?xml version="1.0" encoding="UTF-8"?> <Export generator="Cache" version="25"> <Document name="predict-diseases.ZPM"> <Module> <Name>predict-diseases</Name> <Version>1.0.0</Version> <Packaging>module</Packaging> <SourcesRoot>src/iris</SourcesRoot> <Resource Name="dc.predict.disease.PKG"/> <Dependencies> <ModuleReference> <Name>swagger-ui</Name> <Version>1.*.*</Version> </ModuleReference> <ModuleReference> <Name>dataset-health</Name> <Version>*</Version> </ModuleReference> </Dependencies> <CSPApplication Url="/predict-diseases" DispatchClass="dc.predict.disease.PredictDiseaseRESTApp" MatchRoles=":{$dbrole}" PasswordAuthEnabled="1" UnauthenticatedEnabled="1" Recurse="1" UseCookies="2" CookiePath="/predict-diseases" /> <CSPApplication CookiePath="/disease-predictor/" DefaultTimeout="900" SourcePath="/src/csp" DeployPath="${cspdir}/csp/${namespace}/" MatchRoles=":{$dbrole}" PasswordAuthEnabled="0" Recurse="1" ServeFiles="1" ServeFilesTimeout="3600" UnauthenticatedEnabled="1" Url="/disease-predictor" UseSessionCookie="2" /> </Module> </Document> </Export> Web Frontend and Backend Application to Predict Maternal Risk Go to Open Exchange app link (https://openexchange.intersystems.com/package/Disease-Predictor) and follow these steps: 使用Clone/git 把repo拉到任一本地目录中: $ git clone https://github.com/yurimarx/predict-diseases.git 在该文件夹中打开Docker 终端并运行: $ docker-compose build 运行IRIS容器: $ docker-compose up -d 进入管理门户执行查询,训练AI模型: http://localhost:52773/csp/sys/exp/%25CSP.UI.Portal.SQL.Home.zen?$NAMESPACE=USER 创建用于训练的VIEW(视图): CREATE VIEW MaternalRiskTrain AS SELECT BS, BodyTemp, DiastolicBP, HeartRate, RiskLevel, SystolicBP, age FROM dc_data_health.MaternalHealthRisk 使用视图创建AI模型: CREATE MODEL MaternalRiskModel PREDICTING (RiskLevel) FROM MaternalRiskTrain 训练模型: TRAIN MODEL MaternalRiskModel 访问 http://localhost:52773/disease-predictor/index.html ,使用 Disease Predictor(疾病预测器)前端进行疾病预测,如下: 幕后工作 预测孕产妇风险疾病的后端类方法 InterSystems IRIS允许你执行SELECT,使用之前创建的模型进行预测。 Backend ClassMethod to predict Maternal Risk /// Predict Maternal Risk ClassMethod PredictMaternalRisk() As %Status { Try { Set data = {}.%FromJSON(%request.Content) Set %response.Status = 200 Set %response.Headers("Access-Control-Allow-Origin")="*" Set qry = "SELECT PREDICT(MaternalRiskModel) As PredictedMaternalRisk, " _"age, BS, BodyTemp, DiastolicBP, HeartRate, SystolicBP " _"FROM (SELECT "_data.BS_" AS BS, " _data.BodyTemp_" As BodyTemp, " _data.DiastolicBP_" AS DiastolicBP, " _data.HeartRate_" AS HeartRate, " _data.SystolicBP_" As SystolicBP, " _data.Age_" AS age)" Set tStatement = ##class(%SQL.Statement).%New() Set qStatus = tStatement.%Prepare(qry) If qStatus'=1 {WRITE "%Prepare failed:" DO $System.Status.DisplayError(qStatus) QUIT} Set rset = tStatement.%Execute() Do rset.%Next() Set Response = {} Set Response.PredictedMaternalRisk = rset.PredictedMaternalRisk Set Response.Age = rset.Age Set Response.SystolicBP = rset.SystolicBP Set Response.DiastolicBP = rset.DiastolicBP Set Response.BS = rset.BS Set Response.BodyTemp = rset.BodyTemp Set Response.HeartRate = rset.HeartRate Write Response.%ToJSON() Return 1 } Catch err { write !, "Error name: ", ?20, err.Name, !, "Error code: ", ?20, err.Code, !, "Error location: ", ?20, err.Location, !, "Additional data: ", ?20, err.Data, ! Return 0 } } 现在,任何web应用都可以进行预测并显示结果。请在预测疾病应用程序的前端文件夹中查看源代码。
文章
Jingwei Wang · 十一月 29, 2022

配置 DSN

在Windows配置DSN 确认InterSystems ODBC客户端驱动已安装 InterSystems IRIS ODBC驱动会随着InterSystems IRIS安装包默认安装。 如果没有随着InterSystems IRIS安装,请由此下载驱动,下载后执行.exe文件进行安装。 定义DSN(Data Source Names) 打开Administrative Tools 打开ODBC Data Sources Administrator(32-bit 或者 64-bit) 选择‘System DSN’,点击右边 ‘Add’,弹出‘Create New Data Source’窗口。 选择一个InterSystems IRIS 安装版本的ODBC驱动,点击‘Finish’ 如下图所示,输入驱动名称,IP地址,端口号(使用超级服务端口号),命名空间,用户名和密码。 然后点击 'Test Connection' 进行连接测试 在Linux配置DSN 确认InterSystems ODBC客户端驱动已安装 InterSystems IRIS ODBC驱动会随着InterSystems IRIS安装包默认安装。 如果没有随着InterSystems IRIS安装,请先安装ODBC驱动 Linux 点击下载ODBC驱动 创建一个文件夹,例如/usr/irisodbc,存放刚刚下载的.tar文件 解压.tar文件,执行ODBCinstall安装脚本,irisodbc.ini会被创建: # tar xvf ODBC-2022.1.0.209.0-lnxrharm64.tar.gz # ./ODBCInstall Mac 执行以下命令安装unixODBC brew install unixODBC 配置DSN - 根据InterSystems IRIS服务器修改odbcinst.ini文件的配置信息 [ODBC Data Sources] User = User Userunixodbc = Userunixodbc ​ [User] Driver = /isc/iris/bin/libirisodbc35.so Description = IRIS ODBC driver Host = localhost Namespace = IRISAPP UID = username Password = pws Port = 51773 Protocol = TCP Query Timeout = 1 Static Cursors = 0 Trace = off TraceFile = iodbctrace.log Authentication Method = 0 Security Level = 2 Service Principal Name = iris/localhost.domain.com ​ [Userunixodbc] Driver = /isc/iris/bin/libirisodbcur6435.so Description = IRIS ODBC driver Host = localhost Namespace = IRISAPP UID = username Password = pws Port = 51773 Protocol = TCP Query Timeout = 1 Static Cursors = 0 Trace = off TraceFile = iodbctrace.log Authentication Method = 0 Security Level = 2 Service Principal Name = iris/localhost.domain.com 您好,问下配置sqlsever的odbc应该怎么配置呢 您是在什么环境配置呢?windows的话,照着上面的截图配置,Linux的话需要安装配置unixODBC。 linux下,自己安装了unixODBC,安装之后配置了DSN,在页面中怎么才能选择到自己安装配置的DSN呢
文章
姚 鑫 · 七月 14, 2022

第五章 使用嵌入式 Python (二)

# 第五章 使用嵌入式 Python (二) ## 在 Python 脚本文件 (.py) 中 还可以使用 `irispython` 命令执行 `Python` 脚本。 考虑 `Windows` 系统上的文件 `C:\python\test.py`,其中包含以下代码: ```python # print the members of the Fibonacci series that are less than 10 print('Fibonacci series:') a, b = 0, 1 while a < 10: print(a, end=' ') a, b = b, a + b # import the iris module and show the classes in this namespace import iris print('\nInterSystems IRIS classes in this namespace:') status = iris.cls('%SYSTEM.OBJ').ShowClasses() print(status) ``` 可以从命令行运行 `test.py`,如下所示: ```python C:\InterSystems\IRIS\bin>set IRISUSERNAME = C:\InterSystems\IRIS\bin>set IRISPASSWORD = C:\InterSystems\IRIS\bin>set IRISNAMESPACE = USER C:\InterSystems\IRIS\bin>irispython \python\test.py Fibonacci series: 0 1 1 2 3 5 8 InterSystems IRIS classes in this namespace: User.Company User.Person 1 ``` 在基于 `UNIX` 的系统上,使用 `export` 而不是 `set`。 ```python /InterSystems/IRIS/bin$ export IRISUSERNAME= /InterSystems/IRIS/bin$ export IRISPASSWORD= /InterSystems/IRIS/bin$ export IRISNAMESPACE=USER /InterSystems/IRIS/bin$ ./irispython /python/test.py Fibonacci series: 0 1 1 2 3 5 8 InterSystems IRIS classes in this namespace: User.Company User.Person 1 ``` 注意:如果运行 `import iris` 并看到一条消息说 `IRIS_ACCESSDENIED`,请启用 `%Service_Callin`。在管理门户中,转至 `System Administration > Security > Services`,选择 `%Service_CallIn`,然后选中启用服务框。 # 在 IRIS 类的方法中 可以使用 `Language` 关键字在 `IRIS` 类中编写 `Python` 方法。然后,可以调用该方法,就像调用用 `ObjectScript` 编写的方法一样。 例如,使用 `Python` 编写的具有类方法的以下类: ```python Class User.EmbeddedPython { /// Description ClassMethod Test() As %Status [ Language = python ] { # print the members of the Fibonacci series that are less than 10 print('Fibonacci series:') a, b = 0, 1 while a < 10: print(a, end=' ') a, b = b, a + b # import the iris module and show the classes in this namespace import iris print('\nInterSystems IRIS classes in this namespace:') status = iris.cls('%SYSTEM.OBJ').ShowClasses() return status } } ``` 可以从 `ObjectScript` 调用此方法: ```python USER>set status = ##class(User.EmbeddedPython).Test() Fibonacci series: 0 1 1 2 3 5 8 InterSystems IRIS classes in this namespace: User.Company User.EmbeddedPython User.Person USER>write status 1 ``` 或来自 `Python`: ```python >>> import iris >>> status = iris.cls('User.EmbeddedPython').Test() Fibonacci series: 0 1 1 2 3 5 8 InterSystems IRIS classes in this namespace: User.Company User.EmbeddedPython User.Person >>> print(status) 1 ``` ## 在 SQL 函数和存储过程中 还可以通过在 `CREATE` 语句中指定参数 `LANGUAGE PYTHON` 来使用 `Embedded Python` 编写 `SQL` 函数或存储过程,如下所示: ```python CREATE FUNCTION tzconvert(dt DATETIME, tzfrom VARCHAR, tzto VARCHAR) RETURNS DATETIME LANGUAGE PYTHON { from datetime import datetime from dateutil import parser, tz d = parser.parse(dt) if (tzfrom is not None): tzf = tz.gettz(tzfrom) d = d.replace(tzinfo = tzf) return d.astimezone(tz.gettz(tzto)).strftime("%Y-%m-%d %H:%M:%S") } ``` 该代码使用 `Python datetime` 和 `dateutil` 模块中的函数。 以下 `SELECT` 语句调用 `SQL` 函数,将当前日期/时间从东部时间转换为协调世界时 (`UTC`)。 ```sql SELECT tzconvert(now(), 'US/Eastern', 'UTC') ``` 该函数返回如下内容: ```sql 2021-10-19 15:10:05 ```