Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Any way to sort ps output based on STIME? Post 303039550 by newbie_01 on Wednesday 9th of October 2019 07:49:14 AM
Old 10-09-2019
Any way to sort ps output based on STIME?

Hi,

This is one of the thing that am looking for when I post the question on the ps wrapper. It has since been closed as it has taken me too long to post an example.

I have replaced some of the original content of the ps output.

uname -a = SunOS <hostname> 5.11 11.3 sun4v sparc sun4v

Code:
= This is the current output

$: ps -ef | grep pmon | grep -i abc | grep -v grep

     UID   PID  PPID   C    STIME TTY         TIME CMD
  oracle 27452 16899   0   Sep 15 ?           5:42 ora_pmon_abcd9
  oracle  9843 16899   0   Sep 15 ?           4:50 ora_pmon_abcd11
  oracle 28017 16899   0   Sep 26 ?           0:38 ora_pmon_abcd15
  oracle  6017 16899   0   Sep 15 ?           6:37 ora_pmon_abcd1
  oracle  8273 16899   0   Sep 15 ?           4:22 ora_pmon_abcd10
  oracle 29331 16899   0   Sep 15 ?           5:36 ora_pmon_abct1
  oracle  4154 16899   0   Sep 15 ?           4:33 ora_pmon_abct3
  oracle 24750 16899   0   Sep 15 ?           4:33 ora_pmon_abcd8
  oracle  5755 16899   0 06:28:27 ?           0:08 ora_pmon_abcd2
  oracle 23611 16899   0   Sep 15 ?           5:42 ora_pmon_abcd5
  oracle 27760 16899   0   Sep 21 ?           2:46 ora_pmon_abct11
  oracle 22935 16899   0   Sep 15 ?           5:17 ora_pmon_abcd3

= This is the current output that I am hoping to have. I just sorted the output manually below

     UID   PID  PPID   C    STIME TTY         TIME CMD
  oracle  8273 16899   0   Sep 15 ?           4:22 ora_pmon_abcd10
  oracle  4154 16899   0   Sep 15 ?           4:33 ora_pmon_abct3
  oracle 24750 16899   0   Sep 15 ?           4:33 ora_pmon_abcd8
  oracle  9843 16899   0   Sep 15 ?           4:50 ora_pmon_abcd11
  oracle 22935 16899   0   Sep 15 ?           5:17 ora_pmon_abcd3  
  oracle 29331 16899   0   Sep 15 ?           5:36 ora_pmon_abct1
  oracle 23611 16899   0   Sep 15 ?           5:42 ora_pmon_abcd5
  oracle 27452 16899   0   Sep 15 ?           5:42 ora_pmon_abcd9
  oracle  6017 16899   0   Sep 15 ?           6:37 ora_pmon_abcd1
  oracle 27760 16899   0   Sep 21 ?           2:46 ora_pmon_abct11
  oracle 28017 16899   0   Sep 26 ?           0:38 ora_pmon_abcd15
  oracle  5755 16899   0 06:28:27 ?           0:08 ora_pmon_abcd2

Can't find the right ps args to use. Not sure if there is one available tbh. Any way, hope I can get some suggestion on how to achieve the desired output that am after.

Thanks in advance.
This User Gave Thanks to newbie_01 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sort based on string lenght.

I'm not familiar with find. If i use find in a certain directory i want it to show based on hierarchy. find . type d fol1 fol1/subfol1 fol1/subfol1/subfol1 fol2 fol2/subfol2 i want it to show like this fol1/subfol1/subfol1 fol1/subfol1 fol1 fol2/subfol2 fol2 do i need to use... (5 Replies)
Discussion started by: ryandegreat25
5 Replies

2. Shell Programming and Scripting

Converting line output to column based output

Hi Guys, I am trying to convert a file which has a row based output to a column based output. My original file looks like this: 1 2 3 4 5 6 1 2 3 1 2 3 (8 Replies)
Discussion started by: npatwardhan
8 Replies

3. Shell Programming and Scripting

sort by based on multiple columns

Hi, Is there any way to sort a file in cshell by sort command, sorting it by multiple fields, like to sort it first by the second column and then by the first column. Thanks forhead (1 Reply)
Discussion started by: Takeeshe
1 Replies

4. Shell Programming and Scripting

Sort file based on column

Hi, My input file is $cat samp 1 siva 1 raja 2 siva 1 siva 2 raja 4 venkat i want sort this name wise...alos need to remove duplicate lines. i am using cat samp|awk '{print $2,$1}'|sort -u it showing raja 1 (3 Replies)
Discussion started by: rsivasan
3 Replies

5. Shell Programming and Scripting

sort based on the own pattern

Hi Everyone, # cat 1.pl #!/usr/bin/perl use strict; use warnings; my @test=("a","b","c","d"); print @test; # ./1.pl abcd if i want to sort the @test, based on my own partten, the output is "cbda", how to do? as i know perl sort i can use cmp and <=>, but how to do with my own... (7 Replies)
Discussion started by: jimmy_y
7 Replies

6. Shell Programming and Scripting

Sort and extract based on two files

Hi, I am having trouble sorting one file based on another file. I tried the grep -f function and failed. Basically what I have is two files that look like this: File 1 (the list) gh aba for hmm File 2 ( the file that needs to be sorted) aba 2 4 6 7 for 2 4 7 4 hmm 1 ... (3 Replies)
Discussion started by: phil_heath
3 Replies

7. Shell Programming and Scripting

Sort based on filenames

Hi All, When i give ls -ltr my filenames looks like this: Filename Pattern: Abc_Def_mmddyyyyHHmm.csv $ ls -ltr Jun 05 04:30 Abc_Def_060520111245.csv Jun 05 08:40 Abc_Def_071220121458.csv Jun 06 03:30 Abc_Def_071220111458.csv Jun 06 04:25 Abc_Def_060620110439.csv Jun 07 04:37... (12 Replies)
Discussion started by: HemaV
12 Replies

8. Shell Programming and Scripting

Sort based on numbers

I have a file which has the following data :- how can I sort the data in descending order . My files may have the first column with 1 to 10000 numbers .I need to arrange them in descending order . Thanks (2 Replies)
Discussion started by: lazydev
2 Replies

9. Shell Programming and Scripting

Sort based on certain value in a column

Hi, i need to sort content of files based on a specific value. An example as below. Input1.txt Col_1 SW_MH2_ST ST_F72_9S SW_MH3_S6 Col_2 SW_MH3_AS7 ST_S15_9CH SW_MH3_AS8 SW_MH3_ST Col_3 ST_M93_SZ ST_C16_TC (12 Replies)
Discussion started by: redse171
12 Replies

10. UNIX for Beginners Questions & Answers

Sort based on one column

Hi All , I am having an input file like this Input file 7 sks/jsjssj/ddjd/hjdjd/hdhd/Q 10 0.5 13 dkdkd/djdjd/djdjd/djd/QB 01 0.5 ldld/dkd/jdf/fjfjf/fjf/Q 0.5 10 sjs/jsdd/djdkd/dhd/Q 01 0.5 21 kdkd/djdd/djdd/jdd/djd/QB 01 0.5 dkdld/djdjd/djd/Q 01 0.5 ... (9 Replies)
Discussion started by: kshitij
9 Replies
OCF_HEARTBEAT_ORACLE(7) 					OCF resource agents					   OCF_HEARTBEAT_ORACLE(7)

NAME
ocf_heartbeat_oracle - Manages an Oracle Database instance SYNOPSIS
oracle [start | stop | status | monitor | validate-all | methods | meta-data] DESCRIPTION
Resource script for oracle. Manages an Oracle Database instance as an HA resource. SUPPORTED PARAMETERS
sid The Oracle SID (aka ORACLE_SID). (required, string, no default) home The Oracle home directory (aka ORACLE_HOME). If not specified, then the SID along with its home should be listed in /etc/oratab. (optional, string, no default) user The Oracle owner (aka ORACLE_OWNER). If not specified, then it is set to the owner of file $ORACLE_HOME/dbs/*${ORACLE_SID}.ora. If this does not work for you, just set it explicitely. (optional, string, no default) ipcrm Sometimes IPC objects (shared memory segments and semaphores) belonging to an Oracle instance might be left behind which prevents the instance from starting. It is not easy to figure out which shared segments belong to which instance, in particular when more instances are running as same user. What we use here is the "oradebug" feature and its "ipc" trace utility. It is not optimal to parse the debugging information, but I am not aware of any other way to find out about the IPC information. In case the format or wording of the trace report changes, parsing might fail. There are some precautions, however, to prevent stepping on other peoples toes. There is also a dumpinstipc option which will make us print the IPC objects which belong to the instance. Use it to see if we parse the trace file correctly. Three settings are possible: - none: don't mess with IPC and hope for the best (beware: you'll probably be out of luck, sooner or later) - instance: try to figure out the IPC stuff which belongs to the instance and remove only those (default; should be safe) - orauser: remove all IPC belonging to the user which runs the instance (don't use this if you run more than one instance as same user or if other apps running as this user use IPC) The default setting "instance" should be safe to use, but in that case we cannot guarantee that the instance will start. In case IPC objects were already left around, because, for instance, someone mercilessly killing Oracle processes, there is no way any more to find out which IPC objects should be removed. In that case, human intervention is necessary, and probably _all_ instances running as same user will have to be stopped. The third setting, "orauser", guarantees IPC objects removal, but it does that based only on IPC objects ownership, so you should use that only if every instance runs as separate user. Please report any problems. Suggestions/fixes welcome. (optional, string, default instance) clear_backupmode The clear of the backup mode of ORACLE. (optional, boolean, default false) shutdown_method How to stop Oracle is a matter of taste it seems. The default method ("checkpoint/abort") is: alter system checkpoint; shutdown abort; This should be the fastest safe way bring the instance down. If you find "shutdown abort" distasteful, set this attribute to "immediate" in which case we will shutdown immediate; If you still think that there's even better way to shutdown an Oracle instance we are willing to listen. (optional, string, default checkpoint/abort) SUPPORTED ACTIONS
This resource agent supports the following actions (operations): start Starts the resource. Suggested minimum timeout: 120. stop Stops the resource. Suggested minimum timeout: 120. status Performs a status check. Suggested minimum timeout: 5. monitor Performs a detailed status check. Suggested minimum timeout: 30. Suggested interval: 120. validate-all Performs a validation of the resource configuration. Suggested minimum timeout: 5. methods Suggested minimum timeout: 5. meta-data Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5. EXAMPLE
The following is an example configuration for a oracle resource using the crm(8) shell: primitive example_oracle ocf:heartbeat:oracle params sid=string op monitor depth="0" timeout="30" interval="120" SEE ALSO
http://www.linux-ha.org/wiki/oracle_(resource_agent) AUTHOR
Linux-HA contributors (see the resource agent source for information about individual authors) resource-agents 1.0.3 07/05/2010 OCF_HEARTBEAT_ORACLE(7)
All times are GMT -4. The time now is 02:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy