I cannot figure out how to run a SQL script, or just a sqlplus query, from a shell script (bash or ksh). Basically, I need to su - oracle from root and run a query, then test the exit status. (3 Replies)
HI ALL
i have a requirement like this. i have to write a shell script to run a sql query. DB is oracle. once the query is run, the results of the query has to be published in a data file. can you please advice me how to go about it. i am absolutely new to shell scripts and this is a part of my job. (14 Replies)
Hi ALL,
I need an help in connecting to oracle database, executing a select query and printing it on the screen. Can any one please write a simple code or psuedo code and let me know.
select query returns multiple values( say select name from emp)
Thanks in advance
LM (1 Reply)
query sql using shell script, is it possible?
my friend told me to do a file.sql and link to my shell script, but can i query sql using shell script?
thanks in advance! (2 Replies)
Hi,
I have one SQL file prepared in UNIX and one script that is executing that.
In SQL i have Update and create queries.
I want to introduce conditions in SQL file (in UNIX) that if either of the create or update query failes whole transaction should be rollback.
I just have 1 create... (2 Replies)
Hi All,
I have a query with output below
select 'create synonym "'||TABLE_NAME||'" for '||Table_owner||'."'||table_name||'"'||chr(59) from user_synonyms;
==================
create synonym "RV_SBC_SIG" for WFCONTROLLER_TE."RV_SBC_SIG";
create synonym "AQM_TASK" for AWQM_TE."AQM_TASK";... (2 Replies)
Hi I would like to embed a sql query in my shell script.
Also, before any the sql query is executed, i would like to validate username and password. (1 Reply)
Hello All,
I'm trying to put together a shell script that will:
1. connect to an oracle database
2. execute a query
3. save the output to a csv file
I know that I can execute the sqlplus -s user/pass @dbsid and get logged in. What I would like to do is have my query in a separate text... (9 Replies)
Hi Experts,
Need your support.
Not able to use sql query alias in shell script.
Could you please help me in finding right way to use alias with sql query in shell script.
Below is the code i am using.
#!/bin/bash
sqlplus -s abc/abc@abc << EOF> bcd.csv
set trimspool on
select zone_id... (4 Replies)
Discussion started by: as7951
4 Replies
LEARN ABOUT OPENSOLARIS
getvol
getvol(1M) System Administration Commands getvol(1M)NAME
getvol - verifies device accessibility
SYNOPSIS
/usr/bin/getvol -n [-l label] device
/usr/bin/getvol [-f | -F] [-ow] [-l label | -x label] device
DESCRIPTION
getvol verifies that the specified device is accessible and that a volume of the appropriate medium has been inserted. The command is
interactive and displays instructional prompts, describes errors, and shows required label information.
OPTIONS
The following options are supported:
-n Runs the command in non-interactive mode. The volume is assumed to be inserted upon command invocation.
-l label Specifies that the label label must exist on the inserted volume (can be overridden by the -o option).
-f Formats the volume after insertion, using the format command defined for this device in the device table.
-F Formats the volume after insertion and places a file system on the device. Also uses the format command defined for this device
in the device table.
-o Allows the administrator to override a label check.
-w Allows administrator to write a new label on the device. User is prompted to supply the label text. This option is ineffective
if the -n option is enabled.
-x label Specifies that the label label must exist on the device. This option should be used in place of the -l option when the label
can only be verified by visual means. Use of the option causes a message to be displayed asking the administrator to visually
verify that the label is indeed label.
OPERANDS
The following operands are supported:
device Specifies the device to be verified for accessibility.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
1 Command syntax was incorrect, invalid option was used, or an internal error occurred.
3 Device table could not be opened for reading.
FILES
/etc/device.tab
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO attributes(5)NOTES
This command uses the device table to determine the characteristics of the device when performing the volume label checking.
SunOS 5.11 5 Jul 1990 getvol(1M)