- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Extract data
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2003 08:07 PM
10-16-2003 08:07 PM
Extract data
I have a text mode program (run on unix shell)to monitor the db preformance , I would like to extract some data from this program, the program like these:
# dbmon ./ordb
DB MONITOR
Database: /usr/local/bin/db/ordb
1. System activities
2. Locking and Waiting Statistics
When I press "2" key , then go to the next screen
Locking and Waiting:
Type Usr Name Record Trans Schema
Lock 999 TOTAL... 254999 17 0
Wait 999 TOTAL... 0 0 0
Lock 0 root 0 0 0
Wait 0 root 0 0 0
What I want is to extract the data â Lock 999 TOTAL... 254999 17 0â .
My problem is I must manually press the â 2â key then to go to the next screen , I want the program can extract this data into a text file automatically and reqularly but no need to interactively to press any key , could suggest can can I do ?
I am not sure whether it is clear to understand , but I am very wellcome to answer if any point is
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2003 08:21 PM
10-16-2003 08:21 PM
Re: Extract data
--
1. Create a text file containing the line "2", and another line with whatever command you need to run to quit your program. Call this file (say) TWO.
2. Run your program, piping input from TWO and output to another file, say "OUT", using
"./ordb
3. Extract the line(s) you want with grep, using "grep Lock OUT|grep TOTAL"
--
Hope that helps
-- Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2003 08:43 PM
10-16-2003 08:43 PM
Re: Extract data
echo "2" | dbmon ./ordb | grep Lock | grep Total
This assumes you don't heve to press enter after the "2" (if you do, then make it "2\n") and that you don't need to do any extra typing to exit the application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2003 08:50 PM
10-16-2003 08:50 PM
Re: Extract data
Then it looks like this.
Call it ordbout.wrp
#/usr/bin/ksh
/usr/local/bin/db/ordb
EOF
That's it.
If you need more inputs to get more data or to quit programm you can put this input between the command call and the EOF. Each must be in a seperate line.
HTH
Roland
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2003 08:53 PM
10-16-2003 08:53 PM
Re: Extract data
echo 2 | dbmon ./ordb
For the extraction of the lines you need I would use grep.
Success
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2003 08:55 PM
10-16-2003 08:55 PM
Re: Extract data
your command must look like this
#/usr/bin/ksh
EOF
HTH
Roland
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2003 09:21 PM
10-16-2003 09:21 PM
Re: Extract data
I used the script you provide , but pop the error :
./dbmon: line 3: EOF: No such file or directory
./dbmon: line 4: 2: command not found
./dbmon: line 5: EOF: command not found
Could suggest what is the problem ? thx.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2003 09:31 PM
10-16-2003 09:31 PM
Re: Extract data
<< EOF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2003 10:00 PM
10-16-2003 10:00 PM
Re: Extract data
In the report , there are over 50 lines , but if I use Mark's method , it will export the first page to the output , is it passible to export all 50 lines to the report ? thx.
Locking and Waiting:
Type Usr Name Record Trans Schema
Lock 999 TOTAL... 254999 17 0
Wait 999 TOTAL... 0 0 0
Lock 0 root 0 0 0
Wait 0 root 0 0 0
..
..
..
..
..
..
.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2003 10:23 PM
10-16-2003 10:23 PM