Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Help on parsing Oracle RMAN output for string and print sections of a file Post 302966518 by newbie_01 on Saturday 13th of February 2016 02:33:31 AM
Old 02-13-2016
Help on parsing Oracle RMAN output for string and print sections of a file

Hi,

I need some advise on how to print 'sections' of the attached file. I am searching for some that says Marked Corrupt and print some lines after it.

At the moment I am running the command below:

Code:
sed -n -e '/Marked Corrupt/{N;N;p;}' rman_list_validate.txt

This gives me the following example output:

Code:
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN 
---- ------ -------------- ------------ --------------- ---------- 
572  OK     0              699          88960           8317955790709 
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN 
---- ------ -------------- ------------ --------------- ---------- 
582  OK     0              11871        107520          8317956333446 
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN 
---- ------ -------------- ------------ --------------- ---------- 
623  OK     3              1504         1792            8317956324498

Now I want to print out a 'full' section of where the Marked Corrupt is greater than 0. How do I do that?

So in the attached file, I want to be able to see the following example lines and excluding those where Marked Corrupt is 0.

Code:
 
... found some above here  ... 

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN 
---- ------ -------------- ------------ --------------- ---------- 
586  OK     5              2490         3328            8311568110013 
  File Name: /db/devq1/data/devq1_fin_cuaudit_a_01.dbf 
  Block Type Blocks Failing Blocks Processed 
  ---------- -------------- ---------------- 
  Data       0              0 
  Index      0              0 
  Other      0              838 
 
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN 
---- ------ -------------- ------------ --------------- ---------- 
623  OK     3              1504         1792            8317956324498 
  File Name: /db/devq1/data/devq1_fin_tdapp_a_01.dbf 
  Block Type Blocks Failing Blocks Processed 
  ---------- -------------- ---------------- 
  Data       0              13 
  Index      0              7 
  Other      0              268 

... and so on

Any advice much appreciated. Thanks.
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing file, yaml file? Extracting specific sections

Here is a data file, which I believe is in YAML. I am trying to retrieve just the 'addon_domains" section, which doesnt seem to be as easy as I had originally thought. Any help on this would be greatly appreciated!! I have been trying to do this in awk and mostly bash scripting instead of perl... (3 Replies)
Discussion started by: Rhije
3 Replies

2. Shell Programming and Scripting

Parsing of file for Report Generation (String parsing and splitting)

Hey guys, I have this file generated by me... i want to create some HTML output from it. The problem is that i am really confused about how do I go about reading the file. The file is in the following format: TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Discussion started by: umar.shaikh
8 Replies

3. UNIX and Linux Applications

Running RMAN backups from grid control but using oracle account with rsa keys vs a password ?

I'm a sysadmin trying to help out one of our DBA's setup the RMAN backups (Oracle 11g on rhel5 ) so they can schedule and control them from the OEM grid control. But we want the oracle user to use ssh keys instead of a password. I have the working rsa keys in place for the user but the GUI seems to... (0 Replies)
Discussion started by: samael00
0 Replies

4. Shell Programming and Scripting

Awk script to run a sql and print the output to an output file

Hi All, I have around 900 Select Sql's which I would like to run in an awk script and print the output of those sql's in an txt file. Can you anyone pls let me know how do I do it and execute the awk script? Thanks. (4 Replies)
Discussion started by: adept
4 Replies

5. Shell Programming and Scripting

Compare columns of multiple files and print those unique string from File1 in an output file.

Hi, I have multiple files that each contain one column of strings: File1: 123abc 456def 789ghi File2: 123abc 456def 891jkl File3: 234mno 123abc 456def In total I have 25 of these type of file. (5 Replies)
Discussion started by: owwow14
5 Replies

6. Shell Programming and Scripting

Help/advice parsing Oracle tnsping output

Hi, tnsping is an Oracle tool that is sort of like a ping command. Unfortunately it does not come with a tool that can be used to parse its output which is very frustrating. Example output of tnsping are as below: $: tnsping testp1 TNS Ping Utility for Solaris: Version 11.2.0.2.0 -... (3 Replies)
Discussion started by: newbie_01
3 Replies

7. Shell Programming and Scripting

Usage of disc group to kick off Oracle RMAN backup

Hi guys, i need a small help. I was writing an automation script for import utility of oracle datapump. I am getting stuck in one part of the shell script where i am doing a grep on one of the filesystem and if it is above threshold then it would kick off an oracle RMAN backup. Fyi. i am grepping... (3 Replies)
Discussion started by: sub
3 Replies

8. UNIX for Dummies Questions & Answers

How to get/print host string only from tnsping output?

Hello All, I am using Linux OS. My idea is get the host name when we do tnsping in oracle. output of : tnsping DOELO01 TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 15-OCT-2015 20:20:05 Copyright (c) 1997, 2011, Oracle. All rights reserved. Used parameter files:... (2 Replies)
Discussion started by: Ariean
2 Replies
man(1)							     Code::Blocks IDE man page							    man(1)

NAME
Code::Blocks - The open-source, cross-platform IDE SYNOPSIS
codeblocks [-h] [-ns] [-d] [--prefix <str>] [-p <str>] [--profile <str>] [--rebuild] [--build] [--target <str>] [--no-batch-window-close] [--batch-build-notify] [filename(s)...] DESCRIPTION
codeblocks launches the Code::Blocks IDE. Its various command-line arguments are listed below. OPTIONS
-h, --help Displays the list of accepted command-line arguments. -ns Do not display a splash screen on startup. The splash screen can be completely disabled in the program's environment options. -d Enable the debugging log. --prefix Specify an alternate path for Code::Blocks to find its shared files. -p, --profile Set which profile to use. If you set the profile to ask , Code::Blocks will display a list with all the known profiles to choose from. --rebuild Start a batch rebuild (i.e. "clean" and "build") job on the filenames passed as arguments. The filenames can be either projects or workspaces. --build Start a batch build (i.e. no "clean") job on the filenames passed as arguments. The filenames can be either projects or workspaces. --target Specify a single build target to build in the batch build (or rebuild) job. --no-batch-window-close When the batch job ends, the log window closes too. This option keeps it open until you manually close it. --batch-build-notify Display a message when the batch job finishes. EXAMPLES
Batch build myproject.cpp, only the "Debug" target and keep the batch job window open when finished: codeblocks --build --target="Debug" --no-batch-window-close myproject.cbp Batch rebuild everything in myproject.cpp: codeblocks --rebuild myproject.cbp AUTHOR
Yiannis "mandrav" Mandravellos (mandrav@codeblocks.org) HISTORY
2006 - Initial version 1.0 10 July 2006 man(1)
All times are GMT -4. The time now is 03:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy