我想运行一个sqlcl命令,它导出每个应用程序,而不仅仅是一个应用程序。
顶点导出#工作得很好,但是如果我尝试使用尖顶导出-instance,它被声明为“导出所有应用程序”,它说应用程序导出需要一个应用程序id(数字)。
同样的错误发生在我尝试任何其他形式的顶点导出,而不仅仅是基本的输出。
此外,它似乎没有导出包,表,脚本等下的SQL车间。有什么不同的命令我可以用吗?
我的最终目标是从一个不同的工作区导入它,以防这改变了我应该如何导入它。
发布于 2022-01-04 08:26:15
可以用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"),并使用命令SCRIPT export_apps.js在sqlcl中调用它。
发布于 2022-04-07 09:17:45
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 workspacehttps://docs.oracle.com/en/database/oracle/sql-developer-command-line/21.3/sqcug/working-sqlcl.html
https://stackoverflow.com/questions/70571785
复制相似问题