Please post the shell script you ran and a few lines of sample input data (with anything confidential changed).
What version of unix are you using? What shell?
I am using solaris 10 and bash as it is very friendly shell.
if i use the one with
">example.sql"
output file is empty..
my sed does not support -i option too.
I could manage to do it by using function feature of MS Excel at last, thanks for help.
I have to query a DB2 database, and sometimes they take a long time to produce results. Can I run these queries in the background, and if so, where will the results appear? (1 Reply)
Can anyone help..
I have a .dat file which contains 5 columns of data. I need to select one row containing just 3 of the columns. I'm not sure how to select a single row? I then need perform arithmetic on on two out of the three columns and display the output in a new column.
For example..
... (1 Reply)
Hi,
I new to Unix and scripting. Following is my requirement. Can someone tell me whether its possible or not. Also please let me know how to proceed further if this is possible.
List of queries are stored in a file. For example, I have to run a query like this:
Select * from &XYZ where... (0 Replies)
Hi ,
I used the below script to get the sql data into csv file using unix scripting.
I m getting the output into an output file but the output file is not displayed in a separe columns .
#!/bin/ksh
export FILE_PATH=/maav/home/xyz/abc/
rm $FILE_PATH/sample.csv
sqlplus -s... (2 Replies)
dear all,
i want to insert string in file to mysql i just want how to do that cause i am poor in sql languages ...
so this file like this
DATA.txt
doni|student|westjava|123412|lombok|
iwan|student|westjava|1234412|utankayu|
rio|student|westjava|12342|cempedak|
so i want insert DATA.txt to... (2 Replies)
Hi All,
I have a file queries.txt as follows :
SELECT COLUMN1 FROM SCHEMA2.TABLE1 MINUS SELECT COLUMN1 FROM SCDEMA2.TABLE2;
SELECT COLUMN2 FROM SCHEMA2.TABLE1 MINUS SELECT COLUMN2 FROM SCDEMA2.TABLE2;
SELECT COLUMN3 FROM SCHEMA2.TABLE1 MINUS SELECT COLUMN3 FROM SCDEMA2.TABLE2;
SELECT... (2 Replies)
Dear community,
could someone help me to join 2 queries into one?
Basically it's the same query with different clauses (please notice the FIELD3 filters and related counters into the subquery):
SELECT A.FIELD1,A.FIELD2,A.FIELD3
FROM
TABLE A
INNER JOIN
(
SELECT FIELD1,... (3 Replies)
Hi All,
I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise.
Eg :
Select 'Query 1 output' from dual;
Select 'Query 2 output' from dual;
I want to... (3 Replies)
Discussion started by: Rokkesh
3 Replies
LEARN ABOUT DEBIAN
rlm_sql_log
rlm_sql_log(5) FreeRADIUS Module rlm_sql_log(5)NAME
rlm_sql_log - FreeRADIUS Module
DESCRIPTION
The rlm_sql_log module appends the SQL queries in a log file which is read later by the scripts/radsqlrelay Perl program.
The purpose of this module is to de-couple the storage of long-term accounting data in SQL from "live" information needed by the RADIUS
server as it's running. If you are not using SQL for simultaneous login restrictions (i.e. "sql" is not listed in the "session" section of
"radiusd.conf"), then this module allows you to log SQL queries to a file, and then process them at your leisure.
The benefit of this approach is that for a busy server, the overhead of performing SQL qeuries may be significant. Also, if the SQL data-
bases are large (as is typical for ones storing months of data), the INSERTs and UPDATEs may take a relatively long time. Rather than
slowing down the RADIUS server by having it interact with a database, you can just log the queries to a file, and then run those queries on
another machine, or at a time when the RADIUS server is typically lightly loaded.
If the "sql" module is listed in the "session" section of "radiusd.conf", then a similar system can still be used. In that case, one data-
base would be used to maintain "live" session information. That database would be small, fast, and information would be deleted from it
when a user logs out. A second database would store long-term accounting information, as described above.
LIMITATIONS
This module only performs the dynamic expansion of the variables found in the SQL statements. No operation is executed on the database
server. (this would be done later by an external program) That means the module is useful only with non-"SELECT" statements.
CONFIGURATION
The main configuration items to be aware of are the path of the log file and the different SQL queries.
path An entry named "path" sets the full path of the file where the SQL queries are recorded. (this variable is run through dynamic
string expansion, and can include FreeRADIUS variables to create a dynamic filename)
Accounting queries
When a accounting record is processed, the module searches a config entry keyed by the Acct-Status-Type attribute present in the
packet. For example, the SQL to be run on an accounting start must be named "Start" in the configuration for the module. Other usual
values for Acct-Status-Type are "Stop", "Alive", "Accounting-On", etc. See the VALUEs for Acct-Status-Type in the dictio-
nary.rfc2866 file.
Post-Auth query
An entry named "Post-Auth" sets the query to run during the post-authentication stage. This query is mainly used to log sessions
where there may not be a later accounting packet.
modules {
...
sql_log {
path = "${radacctdir}/sql-relay"
acct_table = "radacct"
postauth_table = "radpostauth"
sql_user_name = "%{%{User-Name}:-DEFAULT}"
Start = "INSERT INTO ${acct_table} ..."
Stop = "UPDATE ${acct_table} SET ..."
Alive = "UPDATE ${acct_table} SET ..."
Post-Auth = "INSERT INTO ${postauth_table} ..."
}
...
}
accounting {
...
sql_log
...
}
post-auth {
...
sql_log
...
}
SECTIONS
accounting, post-auth
FILES
/etc/raddb/radiusd.conf
SEE ALSO radsqlrelay(8), radiusd(8), radiusd.conf(5)AUTHOR
Nicolas Baradakis <nicolas.baradakis@cegetel.net>
28 May 2005 rlm_sql_log(5)