实例操作查看实例信息,包括StartTime(时间精确到秒)、RunTime(s)、Status(实例状态)、InstanceID、实例所有者、Query(执行语句)。命令格式show p|proc|processlist|instances [from <startdate>] [to <enddate>] [-p <project_name>] [-limit <number> | <number>] [-all];
ls|list instances [from <startdate>] [to <enddate>] [-p <project_name>] [-limit <number> | <number>] [-all];show p、show proc、show processlist、show instances、ls instances和list instances命令等效。参数说明startdate、enddate:可选。返回从起始时间startdate到结束时间enddate期间用户提交的实例信息,startdate要小于enddate。不包含enddate当天提交的实例信息。格式必须为yyyy-mm-dd,精度为天。如果不指定,则返回用户当天提交的实例。project_name:可选。待查询实例所属的MaxCompute项目名称,需要具备目标MaxCompute项目的查看实例权限。如果不指定,则表示查询当前所处的MaxCompute项目。number:可选。指定返回实例的数量。依照时间排序,返回提交时间距离当前时间最近的number个实例信息。如果不指定number,则返回满足要求的所有实例信息。-limit <number>与number二者等效。-all:可选。返回MaxCompute项目中所有成员执行过的实例。如果不指定,则表示返回MaxCompute项目中当前用户执行过的实例。不配置number时,默认最大返回50条;如果配置了number,返回number个实例信息。使用示例示例1:查看当前MaxCompute项目下当前用户当天执行的所有实例信息。命令示例如下。show p;返回结果如下。StartTime RunTime Status InstanceID Owner Query
2021-09-14 11:43:04 0s Success 20210914**************3rw2 ALIYUN$****@test.aliyunid.com
2021-09-14 11:43:05 1s Success 20210914**************5t32 ALIYUN$****@test.aliyunid.com select date_sub(datetime '2005-03-01 00:00:00', 1);
2021-09-14 11:58:13 0s Success 20210914**************5pr2 ALIYUN$****@test.aliyunid.com
2021-09-14 11:58:15 1s Success 20210914**************5qgr ALIYUN$****@test.aliyunid.com select date_sub(date '2005-02-28', -1);
2021-09-14 12:02:15 1s Success 20210914**************h8o7 ALIYUN$****@test.aliyunid.com select date_sub('2008-03-01 00:00:00', 2);
2021-09-14 12:02:15 0s Success 20210914**************5t32 ALIYUN$****@test.aliyunid.com
2021-09-14 12:02:31 0s Success 20210914**************5pr2 ALIYUN$****@test.aliyunid.com
2021-09-14 12:02:32 0s Success 20210914**************euq2 ALIYUN$****@test.aliyunid.com select date_sub('2005-03-01 00:00:00', 2);
2021-09-14 13:35:42 0s Success 20210914**************1ms2 ALIYUN$****@test.aliyunid.com
2021-09-14 13:35:43 0s Success 20210914**************j8o7 ALIYUN$****@test.aliyunid.com select date_sub(getdate(),1);
2021-09-14 13:40:40 1s Success 20210914**************h3wz ALIYUN$****@test.aliyunid.com select date_sub(getdate(),0);
2021-09-14 13:40:40 0s Success 20210914**************9nm7 ALIYUN$****@test.aliyunid.com
12 instances示例2:查看当前MaxCompute项目下当前用户在指定时间段内执行的实例,并指定返回实例数量。命令示例如下。show instances from 2021-09-14 to 2021-09-15 -limit 10;返回结果如下。StartTime RunTime Status InstanceID Owner Query
2021-09-14 11:58:13 0s Success 20210914**************5pr2 ALIYUN$****@test.aliyunid.com
2021-09-14 11:58:15 1s Success 20210914**************5qgr ALIYUN$****@test.aliyunid.com select date_sub(date '2005-02-28', -1);
2021-09-14 12:02:15 1s Success 20210914**************h8o7 ALIYUN$****@test.aliyunid.com select date_sub('2008-03-01 00:00:00', 2);
2021-09-14 12:02:15 0s Success 20210914**************5t32 ALIYUN$****@test.aliyunid.com
2021-09-14 12:02:31 0s Success 20210914**************5pr2 ALIYUN$****@test.aliyunid.com
2021-09-14 12:02:32 0s Success 20210914**************euq2 ALIYUN$****@test.aliyunid.com select date_sub('2005-03-01 00:00:00', 2);
2021-09-14 13:35:42 0s Success 20210914**************1ms2 ALIYUN$****@test.aliyunid.com
2021-09-14 13:35:43 0s Success 20210914**************j8o7 ALIYUN$****@test.aliyunid.com select date_sub(getdate(),1);
2021-09-14 13:40:40 1s Success 20210914**************h3wz ALIYUN$****@test.aliyunid.com select date_sub(getdate(),0);
2021-09-14 13:40:40 0s Success 20210914**************9nm7 ALIYUN$****@test.aliyunid.com
10 instances示例3:查看另一MaxCompute项目下所有用户在指定时间段内执行的实例,并指定返回实例数量。命令示例如下。ls instances from 2021-09-14 to 2021-09-15 -p doc_test_dev -all -limit 10;返回结果如下。StartTime RunTime Status InstanceID Owner Query
2021-09-14 11:59:16 0s Success 20210914**************6pr3 ALIYUN$****@test.aliyunid.com
2021-09-14 11:59:20 1s Success 20210914**************6qgr ALIYUN$****@test.aliyunid.com select date_sub(date '2007-02-26', -1);
2021-09-14 12:02:19 1s Success 20210914**************h8o7 ALIYUN$****@test.aliyunid.com select date_sub('2009-03-01 00:00:00', 2);
2021-09-14 12:02:25 0s Success 20210914**************7t42 ALIYUN$****@test.aliyunid.com
2021-09-14 12:02:37 0s Success 20210914**************7pr2 ALIYUN$****@test.aliyunid.com
2021-09-14 12:02:40 0s Success 20210914**************emq2 ALIYUN$****@test.aliyunid.com select date_sub('2015-03-01 00:00:00', 2);
2021-09-14 13:35:42 0s Success 20210914**************1ms2 ALIYUN$****@test.aliyunid.com
2021-09-14 13:35:43 0s Success 20210914**************68o7 ALIYUN$kiki select date_sub(getdate(),1);
2021-09-14 13:45:40 1s Success 20210914**************73wz ALIYUN$kiki select date_sub(getdate(),0);
2021-09-14 13:45:45 0s Success 20210914**************9nm7 ALIYUN$dreak
10 instances示例4:查看另一MaxCompute项目下所有用户在当天执行的实例,并指定返回实例数量。命令示例如下。show p -p doc_test_dev -all 5;返回结果如下。StartTime RunTime Status InstanceID Owner Query
2021-09-14 12:02:40 0s Success 20210914**************emq2 ALIYUN$****@test.aliyunid.com select date_sub('2015-03-01 00:00:00', 2);
2021-09-14 13:35:42 0s Success 20210914**************1ms2 ALIYUN$****@test.aliyunid.com
2021-09-14 13:35:43 0s Success 20210914**************68o7 ALIYUN$kiki select date_sub(getdate(),1);
2021-09-14 13:45:40 1s Success 20210914**************73wz ALIYUN$kiki select date_sub(getdate(),0);
2021-09-14 13:45:45 0s Success 20210914**************9nm7 ALIYUN$dreak
5 instances