Sponsored Content
Full Discussion: Complex query
Top Forums Shell Programming and Scripting Complex query Post 302537201 by mohtashims on Thursday 7th of July 2011 11:10:00 AM
Old 07-07-2011
Question Complex query

A file whose location i am not aware of contains the below text
Code:
<url>jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(FAILOVER=on)(ADDRESS=(PROTOCOL=TCP)
(HOST=ngm2sn1p2-vip.mybank.net)(PORT=4001))(ADDRESS=(PROTOCOL=TCP)(HOST=ngm2sn2p2-vip.mybank.net)
(PORT=4001)))(CONNECT_DATA=(SERVICE_NAME=besttable)(FAILOVER_MODE=(TYPE=select)(METHOD=basic))(DELAY=180)(RETRIES=5)))</url>

I need to grep strictly for these two strings together "oracle:thin" and in the result just need to display "HOST=ngm2sn1p2-vip.mybank.net" "PORT=4001" for every entry found in any file and ignoring the duplicate entries for combined HOST and PORT.

Below is what i wish to extend in order to achieve the above.
Code:
find ./ -type f | xargs grep "oracle:thin"

Your help is appreciated.

Last edited by vbe; 07-07-2011 at 12:42 PM..
 

10 More Discussions You Might Find Interesting

1. Programming

Need help with complex SQL query (Sybase)

Hello, I have three tables. I need an SQL query (preferably Sybase) that will return all of the stringID values of table B where the following conditions exist: (1) B.intID = A.intID (2) B.intID != C.intID or (B.intID = C.intID and (C.v1 = 0 or C.v2... (2 Replies)
Discussion started by: chatieremerrill
2 Replies

2. Solaris

how to complex.h in C on SUN

Hi, The C code we've written work ok on Mac, but make a " segmentation fault" when running on SUN. One potential bug is complex.h because the complex.h in the lib/ is licensed by Apple. Does anybody know how to add in complex.h into lib/ on the SUN so we can deal with complex numbers in our code?... (3 Replies)
Discussion started by: xtong
3 Replies

3. Shell Programming and Scripting

add the output of a query to a variable to be used in another query

I would like to use the result of a query in another query. How do I redirect/add the output to another variable? $result = odbc_exec($connect, $query); while ($row = odbc_fetch_array($result)) { echo $row,"\n"; } odbc_close($connect); ?> This will output hostnames: host1... (0 Replies)
Discussion started by: hazno
0 Replies

4. Shell Programming and Scripting

Query Oracle tables and return values to shell script that calls the query

Hi, I have a requirement as below which needs to be done viz UNIX shell script (1) I have to connect to an Oracle database (2) Exexute "SELECT field_status from table 1" query on one of the tables. (3) Based on the result that I get from point (2), I have to update another table in the... (6 Replies)
Discussion started by: balaeswari
6 Replies

5. Web Development

Complex MySQL Query(s)

Hi all, I have a bit of an issue, I am working on a bit of a CMDB for a friend, it's to do with real estate. Anyway, this is my situation. I have a table which contains all the properties (forsale, sold, etc) in the DB named "property". Now, this is what I want to achieve, I wish to... (5 Replies)
Discussion started by: STOIE
5 Replies

6. Shell Programming and Scripting

Shell Script to execute Oracle query taking input from a file to form query

Hi, I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database. For instance: USER CITY --------- ---------- A CITY_A B CITY_B C ... (2 Replies)
Discussion started by: DevendraG
2 Replies

7. Shell Programming and Scripting

Complex string search query.

Hi, I wish to find the latest occurance of the below string in my log file. Once found, I need to search the below string after the above string and display this Request 331489 has passed or Request 331489 has failed I would like my query to be platform... (11 Replies)
Discussion started by: mohtashims
11 Replies

8. Shell Programming and Scripting

Complex variable

If I need the output as below, what syntax I should use. I use only korn shell. =========In file =========================== #!/usr/bin/ksn P1=cat P2=dog P3=bat for i 1 2 3 do echo $P$i # <---------- This line is the problem I face. What I should use. done ========= End of file... (5 Replies)
Discussion started by: kkakarot
5 Replies

9. Shell Programming and Scripting

Complex if then else

for i in $(condition ONE);do for e in $(CONDITION TWO);do if ; then command 1 command 2 command 3 else if ; then command 1 command 2 command 3 else if ; then ... (6 Replies)
Discussion started by: elilmal
6 Replies

10. Shell Programming and Scripting

Complex Query regarding folder size

Hi, I provide the path to a folder. I would like so drill in each folder inside the folder i gave and show me the size in human readable form du -sh <folder-name> of the top 8 folders with maximum sizes. For example: Path of the folder: "/opt/app/myapp" has these directories. ls... (2 Replies)
Discussion started by: mohtashims
2 Replies
asadmin-delete-jdbc-resource(1AS)				   User Commands				 asadmin-delete-jdbc-resource(1AS)

NAME
asadmin-delete-jdbc-resource, delete-jdbc-resource - removes the JDBC resource SYNOPSIS
delete-jdbc-resource --user admin_user [--password admin_password] [--host localhost] [--port 4848] [--secure|-s] [--passwordfile filename ] [--terse=false] [--echo=false] [--interactive=true] jndi_name Removes the JDBC resource. This command is supported in remote mode only. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --secure if true, uses SSL/TLS to communicate with the domain application server. --passwordfile file containing the domain application server password. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. --echo setting to true will echo the command line statement on the standard output. --interactive prompts you for the required options that are not already specified. OPERANDS
jndi_name name of the JDBC resource to be deleted. Example 1: Using the delete-jdbc-resource command asadmin> delete-jdbc-resource --user admin1 --password adminadmin1 --host pigeon --port 5001 sample_jdbc_resource Command delete-jdbc-resource executed successfully Where: sample_jdbc_resource is the resource that is deleted. EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-create-jdbc-resource(1AS), asadmin-list-jdbc-resources(1AS) J2EE 1.4 SDK March 2004 asadmin-delete-jdbc-resource(1AS)
All times are GMT -4. The time now is 04:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy