Avatar of bkreynolds48
bkreynolds48

asked on 

pull string of words out of a file

I have an oracle trace file and want to pull the table name out of the file

FROM "table_name" is how it appears in the file.

I don't know if sed can do this I can't get awk to do this because the file wraps the text.
Oracle DatabaseUnix OS

Avatar of undefined
Last Comment
bkreynolds48
Avatar of Sean Stuber
Sean Stuber

can you post your trace file?  or at least a snippet you're trying to parse?
Avatar of bkreynolds48
bkreynolds48

ASKER

Select BEG_VERSION, EXT_VERSION, FIRST_DATE, FIRST_USER, IND_CHANGE,
 INT_VERSION, I_PROJECT, LAST_DATE, LAST_USER, PROJECT_CODE, PROJECT_NAME,
 PRV_VERSION, V_LAST_DATE
FROM
 SNP_PROJECT where I_PROJECT = :1

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        9      0.00       0.00          0          0          0           0
Execute    823      0.02       0.02          0          0          0           0
Fetch      823      0.05       0.05          0       1646          0         823
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total     1655      0.08       0.08          0       1646          0         823

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 100

Rows     Row Source Operation
-------  ---------------------------------------------------
 1  TABLE ACCESS BY INDEX ROWID SNP_PROJECT (cr=2 pr=0 pw=0 time=0 us cost=1 size=108 card=1)
 1   INDEX UNIQUE SCAN PK_PROJECT (cr=1 pr=0 pw=0 time=0 us cost=0 size=0 card
Avatar of bkreynolds48
bkreynolds48

ASKER

or it appears in the unformated file like....


Select BEG_VERSION, EXT_VERSION, FIRST_DATE, FIRST_USER, IND_CHANGE, INT_VERSION, I_PROJECT, LAST_DATE, LAST_USER, PROJECT_CODE, PROJECT_NAME, PRV_VERSION, V_LAST_DATE FROM SNP_PROJECT where I_PROJECT = :1

Avatar of Sean Stuber
Sean Stuber

which do you want to parse?

the trace file?
or the tkprof output?
Avatar of bkreynolds48
bkreynolds48

ASKER

the unformatted trace file

Select BEG_VERSION, EXT_VERSION, FIRST_DATE, FIRST_USER, IND_CHANGE, INT_VERSION, I_PROJECT, LAST_DATE, LAST_USER, PROJECT_CODE, PROJECT_NAME, PRV_VERSION, V_LAST_DATE FROM SNP_PROJECT where I_PROJECT = :1

ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of bkreynolds48
bkreynolds48

ASKER

so how do I run this and capture the output?
Avatar of Sean Stuber
Sean Stuber

you run it on the command line exactly as presented

only change will be you use your own trace file's name where I have "your_trace_file"

Avatar of bkreynolds48
bkreynolds48

ASKER

thanks much
Oracle Database
Oracle Database

Oracle is an object-relational database management system. It supports a large number of languages and application development frameworks. Its primary languages are SQL, PL/SQL and Java, but it also includes support for C and C++. Oracle also has its own enterprise modules and application server software.

81K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo