09-06-2001
more thoughts...
I thought about it a bit more and
here is what I'm thinking...
INICIO=$(sqlplus -s user/user@db1 << END
set head off
set feed off
set serveroutput on
declare mydate char(whatever_the_length);
begin
select to_char(min(create_dt) , 'HH24') from table_name where
trunc(create_dt)=trunc(sysdate-2);
dbms_output.put(mydate);
end;
/
END)
...this should simply write the result
of the select to stdout which should then
be assigned to INICIO. Note that I added
a few things to the sql and this gets rid
of the " | awk " redirection stuff.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can someone tell me how to execute sqlplus command.
I`m Executing:
sqlplus user/pasw @/report/output/new/PlatformOut_Cdrs.sql
the error is:
SQL*Plus: Release 9.2.0.5.0 - Production on Wed Aug 9 15:37:44 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
ERROR:... (3 Replies)
Discussion started by: Nel
3 Replies
2. Shell Programming and Scripting
How to execute a query which is stored in a variable.
Say for example :
v_source_query=”select count(*) from emp”
v_source_value=`sqlplus -S "$DATABASE_LOGIN" << EOF | tr '\n' ' '
set feed off
set pagesize 0
set head... (12 Replies)
Discussion started by: trupti_d
12 Replies
3. UNIX for Dummies Questions & Answers
hi all,
i was given by my supervisor a task to search for scripts which contain oracle sqlplus i.e "myusername/mypasswd @myDB" in every /home/userfolder, which are, all the scripts made by different user. I've done some find command to search string for sqlplus, but it may up too long to respond.... (8 Replies)
Discussion started by: Helmi
8 Replies
4. HP-UX
hi,
i need bash shell script run on the crontab(Unix tru64).
i have write my shell. it's using sqlplus command and connect to oracle db.
execute cron job when i have error messege: "sqlplus: command not found"
have you any suggestion? (4 Replies)
Discussion started by: Tlg13team
4 Replies
5. Shell Programming and Scripting
Hi folks
I use a Solaris 10 box with Bash shell.
I have here a script (it works!) to list all scripts in crontab which contains the string "sqlplus":
for i in $(ls `crontab -l | grep -v '#' | awk '{ print $6 }' | grep -v '^$'`); do grep -l 'sqlplus' "$i"; done
Is there a more elegant... (1 Reply)
Discussion started by: slashdotweenie
1 Replies
6. Ubuntu
I installed Oracle 10.2.1.0 in Ubuntu 10.10..my installation was well,i could even open isqlplus( http://ubuntu.ubuntu-domain:5560/isqlplus/workspace.uix ) and execute some queries..But,back in terminal when i try to login to sqlplus i am getting error (20 Replies)
Discussion started by: sandy0594
20 Replies
7. UNIX and Linux Applications
using sqlplus I want to execute a .sql script that has dbms_output statments in rhe script. I want to write the dbms_output statements from .sql file to a log file. is this possible. thanks
any help would be appreciated
:wall: (1 Reply)
Discussion started by: TRS80
1 Replies
8. Red Hat
Hi,
I am facing a strange issue when connecting to SQLPLUS via a shell scripts.
I am using Linux 2.6.18-274.18.1 and gbash shell.
When I connect to SQLPLUS through scripts then it throws TNS Time Out error ""sometimes"" and connects successfully other times.This is only happening when... (9 Replies)
Discussion started by: aashish.sharma8
9 Replies
9. Shell Programming and Scripting
Hi ,
i am new to unix i need a small clarification regarding this
sqlplus -s $USER_NAME/$PASSWD@$ORA_SID<< EOF >> SQL_CONN_LOG.log
In the above command what is the meaning of <<EOF>>
Thanks,
krishna. (2 Replies)
Discussion started by: rams_krishna
2 Replies
10. UNIX and Linux Applications
Hi all,
i face an error related to my server ""it's running server"" when i use sqlplus command
$ sqlplus
bash: sqlplus: command not found
the data base is up and running i just need to access the sqlplus to import the dump file as a daily backup.
i already check the directory... (4 Replies)
Discussion started by: clerck
4 Replies
LEARN ABOUT OPENDARWIN
fs_newcell
FS_NEWCELL(1) AFS Command Reference FS_NEWCELL(1)
NAME
fs_newcell - Changes the kernel-resident list of a cell's database servers
SYNOPSIS
fs newcell -name <cell name> -servers <primary servers>+
[-linkedcell <linked cell name>] [-help]
fs n -n <cell name> -s <primary servers>+
[-l <linked cell name>] [-h]
DESCRIPTION
The fs newcell command removes the Cache Manager's kernel-resident list of database server machines for the cell specified by the -name
argument and replaces it with the database server machines named by the -servers argument.
Each time the machine reboots, the Cache Manager constructs the kernel list of cells and database server machines by reading the local
/etc/openafs/CellServDB file. This command does not change the CellServDB file, so any changes made with it persist only until the next
reboot, unless the issuer also edits the file. The output of the fs listcells command reflects changes made with this command, because that
command consults the kernel-resident list rather than the CellServDB file.
This command can introduce a completely new cell into the kernel-resident list, but cannot make a cell inaccessible (it is not possible to
remove a cell's entry from the kernel-resident list by providing no values for the -server argument). To make a cell inaccessible, remove
its entry from the CellServDB file and reboot the machine.
If the -name argument names a DCE cell, then the -servers argument names DFS Fileset Location (FL) Server machines. The -linkedcell
argument specifies the name of the AFS cell to link to a DCE cell for the purpose of DFS fileset location.
CAUTIONS
Some commands, such as the aklog or klog.krb5 commands, work correctly only when the information is accurate for a cell in both the
CellServDB file and the kernel-resident list.
OPTIONS
-name <cell name>
Specifies the fully-qualified cell name of the AFS or DCE cell.
-servers <primary servers>+
Specifies the fully-qualified hostnames of all AFS database server machines or DFS Fileset Location (FL) Server machines for the cell
named by the -name argument. If FL Server machines are specified, the local machine must be running the AFS/DFS Migration Toolkit
Protocol Translator.
-linkedcell <linked cell name>
Specifies the name of the AFS cell to link to a DCE cell for the purpose of DFS fileset location.
-help
Prints the online help for this command. All other valid options are ignored.
EXAMPLES
The following example changes the machine's kernel-resident list of database server machines for the ABC Corporation cell to include the
machines "db1.abc.com" and "db2.abc.com":
% fs newcell -name abc.com -servers db1.abc.com db2.abc.com
The following example links the DCE cell "dce.abc.com" to the AFS cell "abc.com". The AFS client contacts the Fileset Location (FL) servers
"db1.dce.abc.com" and "db2.dce.abc.com" for fileset location information as it interprets a DFS pathname.
% fs newcell -name dce.abc.com
-servers db1.dce.abc.com db2.dce.abc.com
-linkedcell abc.com
PRIVILEGE REQUIRED
The issuer must be logged in as the local superuser root.
SEE ALSO
CellServDB(5), fs_listcells(1)
COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas
Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.
OpenAFS 2012-03-26 FS_NEWCELL(1)