Sponsored Content
Top Forums Shell Programming and Scripting Removing section from tnsnames.ora Post 302958672 by RudiC on Sunday 25th of October 2015 05:24:03 AM
Old 10-25-2015
Might benefit from some fine tuning:
Code:
awk '
/^tns_alias2/   {getline
                 L+=gsub (/\(/, "") - gsub (/\)/,"")
                }

!L
L               {L+=gsub (/\(/, "") - gsub (/\)/,"")
                }

' file

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to capture the service name from tnsnames.ora and create connect string

ghkjkjoj (4 Replies)
Discussion started by: chetankelvin
4 Replies

2. Shell Programming and Scripting

Removing Duplicate Lines per Section

Hello, I am in need of removing duplicate lines from within a file per section. File: ABC1 012345 header ABC2 7890-000 ABC3 012345 Header Table ABC4 ABC5 593.0000 587.4800 ABC5 593.5000 587.6580 <= dup need to remove ABC5 593.5000 ... (5 Replies)
Discussion started by: petersf
5 Replies

3. UNIX for Dummies Questions & Answers

find tnsnames.ora in unix

Can we find out what is the location of tnsnames.ora file used by the hp unix. (3 Replies)
Discussion started by: Sudipshib
3 Replies

4. Solaris

maxuprc and maxusers - ORA-27300, ORA-27301, ORA-27302

Hi all, Am intermittently getting the following errors on one of my databases. Errors in file /oracle/HRD/saptrace/background/hrd_psp0_13943.trc: ORA-27300: OS system dependent operation:fork failed with status: 12 ORA-27301: OS failure message: Not enough space ORA-27302:... (1 Reply)
Discussion started by: newbie_01
1 Replies

5. Shell Programming and Scripting

sed: parsing tnsnames.ora

All: Can sombodoy help me out with a sed command? Assume I have the following: PRI = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.3.7)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = pri) ... (3 Replies)
Discussion started by: BeefStu
3 Replies

6. UNIX for Advanced & Expert Users

grep all ORA errors except one ORA error

Hi - I am trying to grep all "ORA" errors in a log files.I have to grep all ORA errors except one error for example ORA-01653.How can exclude that error in "grep" command? In following "grep" command I want to exclude "ORA-01653" error grep -i ORA alert.log >>/tmp/ora_errors.txt ... (7 Replies)
Discussion started by: Mansoor8810
7 Replies

7. Shell Programming and Scripting

Tnsnames.ora

Hi, I would like to modify, in script schell, the line right above (DESCRIPTION and check three cases : if line contain ".world" then line=line-".world" concat "," concat line if line dont contain ".world" then line=line concat "," concat line concat".world" else line=line Keep in... (10 Replies)
Discussion started by: elcaro
10 Replies

8. Shell Programming and Scripting

Removing sections from listener.ora

Hi, I am trying to write a script or command to add/remove a section from listener.ora file in the following example I would like: 1. to remove sid_alias2 sections 2. to add a new alias sections called sid_alias4, it can be placed after sid_alias3 sections $ cat listener.ora ... (18 Replies)
Discussion started by: ynixon
18 Replies

9. AIX

I cannot find dsn and TNSNAMES.ora on UNIX

Where can I find dsn and TNSNAMES.ora on UNIX AIX Thanks for contribution (3 Replies)
Discussion started by: digioleg54
3 Replies

10. Shell Programming and Scripting

Selecting section and removing match

I have a file with contents as shown in file.texi Would like to keep only the sections that have inlineifset till the empty line is reached. Finally replace the following string with a space @inlineifset{mrg, @opar{@bullet{} I had written the following command but it messed my file ... (6 Replies)
Discussion started by: Danette
6 Replies
CLUBAK(1)						     ClusterShell User Manual							 CLUBAK(1)

NAME
clubak - format output from clush/pdsh-like output and more SYNOPSIS
clubak [ OPTIONS ] DESCRIPTION
clubak formats text from standard input containing lines of the form "node:output". It is fully backward compatible with dshbak(1) but provides additonal features. For instance, clubak always displays its results sorted by node/nodeset. You do not need to use clubak when using clush(1) as all output formatting features are already included in. It is provided for other usages, like post-processing results of the form "node:output". Like clush(1), clubak uses the ClusterShell.MsgTree module of the ClusterShell library (see pydoc ClusterShell.MsgTree). INVOCATION
clubak should be started with connected standard input. OPTIONS
--version show clubak version number and exit -b, -c gather nodes with same output (-c is provided for dshbak(1) compatibility) -d, --debug output more messages for debugging purpose -L disable header block and order output by nodes -r, --regroup fold nodeset using node groups -s GROUPSOURCE, --groupsource=GROUPSOURCE optional groups.conf(5) group source to use -G, --groupbase do not display group source prefix (always @groupname) -S SEPARATOR, --separator=SEPARATOR node / line content separator string (default: :) -F, --fast faster but memory hungry mode (preload all messages per node) -T, --tree message tree trace mode; switch to enable ClusterShell.MsgTree trace mode, all keys/nodes being kept for each message element of the tree, thus allowing special output gathering --color=WHENCOLOR whether to use ANSI colors to surround node or nodeset prefix/header with escape sequences to display them in color on the terminal. WHENCOLOR is never, always or auto (which use color if standard output refers to a terminal). Color is set to [34m (blue foreground text) and cannot be modified. --diff show diff between gathered outputs EXIT STATUS
An exit status of zero indicates success of the clubak command. EXAMPLES
1. clubak can be used to gather some recorded clush(1) results: Record clush(1) results in a file: # clush -w node[1-7] uname -r >/tmp/clush_output # clush -w node[32-159] uname -r >>/tmp/clush_output Display file gathered results (in line-mode): # clubak -bL </tmp/clush_output 2. Another example, iterate over node* text files in current directory and gather characters count for all of them: # find -name "node*" -exec wc -c {} ; | awk '{ gsub("./","",$2); print $2": "$1 }' | clubak -bL node[1,3]: 7 node2: 9 SEE ALSO
clush(1), nodeset(1), groups.conf(5). BUG REPORTS
Use the following URL to submit a bug report or feedback: https://github.com/cea-hpc/clustershell/issues AUTHOR
Stephane Thiell, CEA DAM <stephane.thiell@cea.fr> COPYRIGHT
CeCILL-C V1 1.6 2012-03-28 CLUBAK(1)
All times are GMT -4. The time now is 07:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy