【问题标题】:Exporting all oracle apex applications using sqlcl使用 sqlcl 导出所有 oracle apex 应用程序
【发布时间】:2022-01-03 21:43:49
【问题描述】:

我想运行一个 sqlcl 命令来导出每个应用程序,而不仅仅是一个。

Apex export # 工作得很好,但是如果我尝试使用 apex export -instance 声明为“导出所有应用程序”,它表示应用程序导出需要一个应用程序 ID(数字)。

当我尝试任何其他形式的顶点导出而不是基本的导出时,也会出现同样的错误。

另外,它似乎不导出 SQL Workshop 下的包、表、脚本等。我可以使用其他命令来执行此操作吗?

我的最终目标是从不同的工作区全部导入,以防我改变导入方式。

【问题讨论】:

    标签: sql oracle import oracle-apex sqlcl


    【解决方案1】:

    可以在 sqlcl 中编写脚本并使用 SCRIPT 关键字调用它们。这是从工作区“TEST”导出一些应用程序的示例:

    ctx.write("Export for apex apps\n\n");
    ctx.write("start\n\n");
    
    var binds = {};
    var exportstmt;
    
    var objects = util.executeReturnList(
      "SELECT application_id FROM apex_applications WHERE workspace = 'TEST' and rownum < 3"
        ,binds);
    for (i = 0; i < objects.length; i++) {
        ctx.write( objects[i].APPLICATION_ID  + "\n");
        exportstmt =  'apex export ' + objects[i].APPLICATION_ID;
        ctx.write( exportstmt  + "\n");
        sqlcl.setStmt(exportstmt);
        sqlcl.run();
    }
    ctx.write("end\n\n");
    

    将上面的代码保存在一个文件中(例如“export_apps.js”)并在sqlcl中使用命令SCRIPT export_apps.js调用它。

    【讨论】:

      【解决方案2】:
      sql scott/tiger -- scott is the schema owner of apex workspace 
      select to_char(workspace_id) from apex_workspaces where workspace = 'MYWORKSPACE'; -- the id will be used to export
      
      
      apex export -workspaceid 1234567890 -- export all application in the workspace
      

      https://docs.oracle.com/en/database/oracle/sql-developer-command-line/21.3/sqcug/working-sqlcl.html

      https://docs.oracle.com/en/database/oracle/application-express/20.1/aeadm/exporting-from-a-command-line.html

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-10-06
        • 1970-01-01
        • 2020-07-31
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多