This topic describes how to use commands to manage instances on the MaxCompute client.
Show Instances/Show P
SHOW INSTANCES [FROM startdate TO enddate] [number]; SHOW P [FROM startdate TO enddate] [number]; SHOW INSTANCES [-all]; SHOW P [-all]; SHOW P -p <project name>;
- Running: The instance is running.
- Success: Instance operation is complete.
- Waiting: The instance is waiting to run.
- Failed: The job failed, but data in the target table is not modified.
- Suspended: The instance is suspended.
- Cancelled: The instance is stopped.
- startdate and enddate: returns the instance information during the specified period (from startdate to enddate in the yyyy-mm-dd format. The parameters are optional. If they are not specified, information about instances submitted within three days is returned by default.
- number: specifies the number of instances to return. Information about N (specified by number) instances submitted at the time nearest to the current time is returned in chronological order. If it is not specified, information about all instances that meet the requirements is returned.
- -all: indicates that all instances executed in the current project are returned. A maximum
of 50 records can be returned by default. To run this command, you must have the LIST
permission on the project. You can use -limit number to show more records. For example, run
show p -all -limit 100to show 100 instance records in the current project.
- project name: indicates the name of a project. To use this parameter, your account must be a member of the project.
odps@ $project_name>show p; StartTime RunTime Status InstanceID Owner Query 2015-04-28 13:57:55 1s Success 20150428xxxxxxxxxxxxxxxxxx ALIYUNfirstname.lastname@example.org select * from tab_pack_priv limit 20; ... ... ... ... ... ... ... ... ... ... ... ...
- Queries the status of a specified instance, such as Success, Failed, Running, or Cancelled.
- If the specified instance is not created by the current user, an exception is returned.
instance_id: specifies the instance whose status you want to query. This parameter uniquely identifies an instance.
-- View the status of the instance with ID of 20131225123xxxxxxxxxxxxxxx. odps@ $project_name>status 20131225123xxxxxxxxxxxxxxx; Success
Only a project owner or the administrator is allowed to run this command.
top instance; top instance -all;
top instance: displays information about the running job submitted by the current account in the current project. The information includes InstanceID, Owner, Type, StartTime, Progress, Status, Priority, RuntimeUsage (CPU/MEM), TotalUsage (CPU/MEM), and QueueingInfo (POS/LEN).
top instance -all: displays all jobs that are running in the current project. A maximum of 50 records can be displayed by default. You can use -limit number to show more records.
odps@ $project_name>top instance;
statuscommand to check the instance status.
instance_id: uniquely identifies an instance. It must be the ID of a running instance. If the instance is not running, an error is returned.
-- Stop the instance with ID of 20131225123xxxxxxxxxxxxxxx. odps@ $project_name>kill 20131225123xxxxxxxxxxxxxxx;
desc instance instance_id ;
Obtains job information based on a specific instance ID. The information includes SQL, Owner, StartTime, EndTime, and Status.
instance_id: uniquely identifies an instance.
-- Query job information about the instance with ID of 20150715xxxxxxxxxxxxxxx. odps@ $project_name> desc instance 20150715xxxxxxxxxxxxxxx; ID 20150715xxxxxxxxxxxxxxx Owner ALIYUN$XXXXXX@alibaba-inc.com StartTime 2015-07-15 18:34:41 EndTime 2015-07-15 18:34:42 Status Terminated console_select_query_task_1436956481295 Success Query select * from mj_test;
instance_id: uniquely identifies an instance.
-- View the task running log of the instance with ID of 20170925161122379gxxxxxx. wait 20170925161122379gxxxxxx; ID = 20170925161122379g3xxxxxx Log view: http://logview.odps.aliyun.com/logview/?h=http://service.odps.aliyun.com/api&p=alian&i=201709251611223xxxxxxdqp&token=XXXXXXvbiI6IjEifQ== Job Queueing... Summary: resource cost: cpu 0.05 Core * Min, memory 0.05 GB * Min inputs: alian.bank_data: 41187 (588232 bytes) outputs: alian.result_table: 8 (640 bytes) Job run time: 2.000 Job run mode: service job Job run engine: execution engine M1: instance count: 1 run time: 1.000 instance time: min: 1.000, max: 1.000, avg: 1.000 input records: TableScan_REL5213301: 41187 (min: 41187, max: 41187, avg: 41187 ) output records: StreamLineWrite_REL5213305: 8 (min: 8, max: 8, avg: 8) R2_1: instance count: 1 run time: 2.000 instance time: min: 2.000, max: 2.000, avg: 2.000 input records: StreamLineRead_REL5213306: 8 (min: 8, max: 8, avg: 8) output records: TableSink_REL5213309: 8 (min: 8, max: 8, avg: 8)