系统实用类:SYS.Database中的查询FreeSpace可以用来在任何时候检查磁盘上的自由空间。

下面是在IRIS终端中的尝试方法(进入%SYS命名空间,然后运行它)。

zn "%SYS"
set stmt=##class(%SQL.Statement).%New()
set st=stmt.%PrepareClassQuery("SYS.Database","FreeSpace")
set rset=stmt.%Execute()
// 一次性显示所有
do rset.%Display()

输出结果示例如下。

*在命令执行的例子中,所有的数据库都放在同一个磁盘上,所以所有的磁盘空闲空间(DiskFreeSpace)返回相同的值。

0 0
0 92

我想安装Windows版本的管理门户引擎来创建Cache InterSystems数据库
我想为Cache InterSystems创建一个样本数据库,并想通过Cache Entity Framework Provider访问它。但是,我无法找到一个特定的管理门户引擎来创建数据库。

你能指导一下如何在Windows中安装管理门户吗?

I want to install Management Portal Engine for Windows to create Cache InterSystems DB

I want to create a Sample Database for Cache InterSystems and want to access it via Cache Entity Framework Provider. But, I cannot find a particular engine of Management Portal to create a database.

0 2
0 129
文章
· 四月 13, 2022 阅读大约需 7 分钟
用Globals 作为图数据库来存储和抽取图结构数据

image

这篇文章是对我的  iris-globals-graphDB 应用的介绍。
在这篇文章中,我将演示如何在Python Flask Web 框架和PYVIS交互式网络可视化库的帮助下,将图形数据保存和抽取到InterSystems Globals中。

建议

 

第一步 : 通过使用Python 原生SDK建立与IRIS Globals的链接

 #create and establish connection
  if not self.iris_connection:
         self.iris_connection = irisnative.createConnection("localhost", 1972, "USER", "superuser", "SYS")
                                     
  # Create an iris object
  self.iris_native = irisnative.createIris(self.iris_connection)
  return self.iris_native

 

第二步 : 使用 iris_native.set( ) 功能把数据保存到Globals 里     

#import nodes data from csv file
isdefined = self.iris_native.isDefined("^g1nodes")
if isdefined == 0:
    with open("/opt/irisapp/misc/g1nodes.csv", newline='') as csvfile:

 reader = csv.DictReader(csvfile)
 for row in reader:
    self.iris_native.set(row["name"], "^g1nodes", row["id"])

 #import edges data from csv file
 isdefined = self.iris_native.isDefined("^g1edges")
 if isdefined == 0:
    with open("/opt/irisapp/misc/g1edges.csv", newline='') as csvfile:
 reader = csv.DictReader(csvfile)
 counter = 0                
 for row in reader:
    counter = counter + 1
    #Save data to globals
    self.iris_native.set(row["source"]+'-'+row["target"], "^g1edges", counter)  

 

第三步: 使用iris_native.get() 功能把节点和边缘数据从Globals传递给PYVIS

 #Get nodes data for basic graph    
  def get_g1nodes(self):
        iris = self.get_iris_native()
        leverl1_subscript_iter = iris.iterator("^g1nodes")
        result = []
        # Iterate over all nodes forwards
        for level1_subscript, level1_value in leverl1_subscript_iter:
            #Get data from globals
            val = iris.get("^g1nodes",level1_subscript)
            element = {"id": level1_subscript, "label": val, "shape":"circle"}
            result.append(element)            
        return result

    #Get edges data for basic graph  
    def get_g1edges(self):
        iris = self.get_iris_native()
        leverl1_subscript_iter = iris.iterator("^g1edges")
        result = []
        # Iterate over all nodes forwards
        for level1_subscript, level1_value in leverl1_subscript_iter:
            #Get data from globals
            val = iris.get("^g1edges",level1_subscript)
            element = {"from": int(val.rpartition('-')[0]), "to": int(val.rpartition('-')[2])}
            result.append(element)            
        return result

 

Step4: Use PYVIS Javascript to generate graph data

<script type="text/javascript">
    // initialize global variables.
    var edges;
    var nodes;
    var network;
    var container;
    var options, data;
  
    // This method is responsible for drawing the graph, returns the drawn network
    function drawGraph() {
        var container = document.getElementById('mynetwork');
        let node = JSON.parse('{{ nodes | tojson }}');
        let edge = JSON.parse('{{ edges | tojson }}');
     
        // parsing and collecting nodes and edges from the python
        nodes = new vis.DataSet(node);
        edges = new vis.DataSet(edge);

        // adding nodes and edges to the graph
        data = {nodes: nodes, edges: edges};

        var options = {
            "configure": {
                "enabled": true,
                "filter": [
                "physics","nodes"
            ]
            },
            "nodes": {
                "color": {
                  "border": "rgba(233,180,56,1)",
                  "background": "rgba(252,175,41,1)",
                  "highlight": {
                    "border": "rgba(38,137,233,1)",
                    "background": "rgba(40,138,255,1)"
                  },
                  "hover": {
                    "border": "rgba(42,127,233,1)",
                    "background": "rgba(42,126,255,1)"
                 }
                },

                "font": {
                  "color": "rgba(255,255,255,1)"
                }
              },
            "edges": {
                "color": {
                    "inherit": true
                },
                "smooth": {
                    "enabled": false,
                    "type": "continuous"
                }
            },
            "interaction": {
                "dragNodes": true,
                "hideEdgesOnDrag": false,
                "hideNodesOnDrag": false,
                "navigationButtons": true,
                "hover": true
            },

            "physics": {
                "barnesHut": {
                    "avoidOverlap": 0,
                    "centralGravity": 0.3,
                    "damping": 0.09,
                    "gravitationalConstant": -80000,
                    "springConstant": 0.001,
                    "springLength": 250
                },

                "enabled": true,
                "stabilization": {
                    "enabled": true,
                    "fit": true,
                    "iterations": 1000,
                    "onlyDynamicEdges": false,
                    "updateInterval": 50
                }
            }
        }
        // if this network requires displaying the configure window,
        // put it in its div
        options.configure["container"] = document.getElementById("config");
        network = new vis.Network(container, data, options);
        return network;
    }
    drawGraph();
</script>

 

第五步: 从app.py 主文件调用上面的代码

#Mian route. (index)
@app.route("/")
def index():
    #Establish connection and import data to globals
    irisglobal = IRISGLOBAL()
    irisglobal.import_g1_nodes_edges()
    irisglobal.import_g2_nodes_edges()

    #getting nodes data from globals
    nodes = irisglobal.get_g1nodes()
    #getting edges data from globals
    edges = irisglobal.get_g1edges()

    #To display graph with configuration
    pyvis = True
    return render_template('index.html', nodes = nodes,edges=edges,pyvis=pyvis)    

下面是关于此项目的 介绍视频:

0 0
0 151
问题
· 四月 27, 2022
如何更改主键?

Hi, 请问如何更改表(有数据)上的主键?谢谢!

答:

如果数据已经存在,那么这是一项必须重视的任务,特别是如果存在继承或父/子关系,因为这将导致你的数据存储方案的改变。

最简单的方法是通过一个中间(临时)表来实现。

创建一个具有相同结构的新类,但有一个新的主键。
使用SQL(不是合并命令)将数据从旧的类中移到它里面。
删除旧类中的数据/索引,然后改变其中的主键。
使用合并命令,将数据从新类移到旧类中。
删除带有数据的新类。
重建索引(如果有的话)。

几个有用的链接:
MERGE

0 1
0 74

请问cahce中所有的数据库访问都是通过cache server完成的吗,比如使用终端访问数据库、studio开发的应用、使用第三方库使用代码都是先访问cache server,然后通过cache server对数据进行存取的吗?使用studio开发的应用程序也是跑在cache server中吗? 如果是的话studio开发的应用程序(比如web程序)如何跟cache server分开部署呢?

0 4
0 128

一个实例中可创建的最大命名空间数量为2048个。这个上限不可修改。

一个实例中可创建的最大数据库数量(包括远程数据库)为15998个。这个上限也不可修改。

一个实例中可创建数据库的总数量还有其他因素制约:

1. 数据库路径信息总量最大为256KB,也就是所有数据库的路径字符加起来不能多于256KB。设置的路径越长,可创建的数据库数量越少。
计算公式:最大数据库数量=258048/(平均数据库路径长度+3)

2. 镜像的数据库一个按两个算。也就是创建一个镜像的数据库,相当于创建了2个非镜像数据库。

更多细节请参考在线文档:
https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=GS...

0 0
0 132

大家好, 在本文中,我比较了 Gartner 最新DBMS 魔力象限中的主要领先数据库产品的功能。 请见按现有功能数量排序的列表。 1. InterSystems IRIS 2020.3 - 60 个功能 (https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls) 2. Oracle Database 21c - 54 个功能 (https://docs.oracle.com/en/database/oracle/oracle-database/index.html) 3.

0 0
0 165
问题
· 九月 13, 2021
怎么获取Caché的CDC数据?

1.Caché数据库有没有办法配置然后用sql读取数据库实时变化的数据,类似于mssql那样?我看了可以写类去读取global获取journal的值,但是怎么用sql读呢?

2.不行的话,那用什么方式可以读取到journal日志文件,并输出日志文件的内容?

先谢谢大家了!!!

0 7
0 303
文章
· 十一月 9, 2021 阅读大约需 1 分钟
翻译文章--通过ODBC用Appeon PowerBuilder连接IRIS

https://www.appeon.com/products/powerbuilder

Appeon PowerBuilder 是一个企业级开发工具,可以用来建立数据驱动的商业应用程序和组件。它是Appeon产品套件之一,同时提供了开发C/S、Web、移动和分布式应用程序的工具。

在这篇文章中,我将展示通过使用ODBC用Appeon PowerBuilder连接Caché的步骤。

步骤1 :
确保在安装IRIS时选择ODBC驱动程序选项。

0 0
0 116