02-27-2006
Thanks, that helped. However, I am now getting the following error:
ERROR:
ORA-01034: ORACLE not available
ORA-27123: unable to attach to shared memory segment
SVR4 Error: 13: Permission denied
Enter user-name: SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon> ::= <username>[/<password>][@<connect_string>] | /
Enter user-name: SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon> ::= <username>[/<password>][@<connect_string>] | /
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
The user that the script is running as has permission to all of the Oracle directories. Anyone know what's wrong?
Thanks again for any help.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am writing a ksh script which will use sqlplus to run a sql and pass 2 variables as the SQL request. In the ksh script, I have 2 variables which are $min_snap and $max_snap holding 2 different numbers.
Inside the same script, I am using SQLPLUS to run an Oracle SQL script,... (6 Replies)
Discussion started by: rwunwla
6 Replies
2. Shell Programming and Scripting
Hi,
I am using sqlplus (called inside my ksh) to create a file which is mailed to the users as an xls.
There is one DESCRIPTION column which is currently coming as wrapped, but, the users want a new line for each of the fields present in the desricription column.
Below is an example -
... (11 Replies)
Discussion started by: Sree_2503
11 Replies
3. Shell Programming and Scripting
Hi,
trying this
===============================
Temp=`sqlplus -s user/passwd <<EOF
WHENEVER SQLERROR EXIT 1
set serverout on
set feedback off
set heading off
select nam from tabel1
where x=y;
EOF`
echo Temp>>$logfile
=================================
The select statement is... (2 Replies)
Discussion started by: amitkr
2 Replies
4. Shell Programming and Scripting
How do i get the value of the variable from the called script(script2) to the calling script(script1) in ksh ?
I've given portion of the script here to explain the problem.
Portion of Script 1
=============
-----
-----
tmp=`a.ksh p1 p2 p3`
if then
# error processing
fi
-----... (10 Replies)
Discussion started by: rajarkumar
10 Replies
5. Shell Programming and Scripting
Hi,
I'm trying to execute a job on the last day of every month, for which i'm using the following code in my Korn shell script :
if ];
then
echo allowed only on last day of month. Today is `date +%d` >t.stm
echo Tomorrow is `date +%d -d tomorrow` >s.stm
exit 0
fi
...
....... (7 Replies)
Discussion started by: devilsadvocate
7 Replies
6. Solaris
Hi All, I have the below simple script.
It runs just fine by itself when I manually invoke it.
But once I put it in the crontab with entry:
* * * * * /users/myuser/test.ksh >> /users/myuser/log/test.txt"
It does NOT print the returned value ($REMAIN) from the DB!?
The result in the... (3 Replies)
Discussion started by: steve701
3 Replies
7. Shell Programming and Scripting
Using ksh, I am using SQLPlus to execute a query with a filter using a string variable.
REPO_DB=DEV1
FOLDER_NM='U_nmalencia'
FOLDER_CHECK=$(sqlplus -s /nolog <<EOF
CONNECT user/pswd_select@${REPO_DB}
set echo off heading off feedback off
select subj_name
from subject
where... (5 Replies)
Discussion started by: nkm0brm
5 Replies
8. Shell Programming and Scripting
Hi,
I am new to shell script programming. I have written a ksh script to run the sql File placed in server directory and spool the output in destination directory.
Below Command:
$ORACLE_HOME/bin/sqlplus -s $ora_uid @$sqlfile_loc$testquery.sql > $opfiledirectory
It is generating the output... (6 Replies)
Discussion started by: Sumit Arora
6 Replies
9. Shell Programming and Scripting
Hi,
I am trying to write a script that calls an Oracle SQL file who in turns call another SQL file. This same SQL file has to be run against the same database but using different username and password at each loop.
The first SQL file is basically a connection test and it is supposed to sort... (2 Replies)
Discussion started by: newbie_01
2 Replies
10. UNIX for Beginners Questions & Answers
HI Team -
I'm running into a weird issue when trying to call a .ksh script.
In my shell script, I'm using the following command to call my environment file:
cd /hypbin/test
./_env.ksh
But it's saying not found. Permissions are set correctly, shebang is set but I'm unsure why it's not... (5 Replies)
Discussion started by: SIMMS7400
5 Replies
shmop(2) System Calls Manual shmop(2)
NAME
shmat(), shmdt() - shared memory operations
SYNOPSIS
DESCRIPTION
attaches the shared memory segment associated with the shared memory identifier specified by shmid to the data segment of the calling
process.
The segment is attached for reading if (shmflg is "true"; otherwise, it is attached for reading and writing. It is not possible to attach
a segment for write only.
If the shared memory segment has never been attached to by any process prior to the current call, shmaddr must be specified as zero and the
segment is attached at a location selected by the operating system. That location is identical in all processes accessing that shared mem-
ory object. Once the operating system selects a location for a shared memory segment, the same location will be used across any subsequent
and calls on the segment until it is removed by the operation of See exceptions for MPAS processes below.
If this is not the first call on the shared memory segment throughout the system, shmaddr must either be zero or contain a nonzero address
that is identical to the one returned from previous calls for that segment. Even if no processes are currently attached to the segment, as
long as the segment has been attached before, the same rule applies. See exceptions for MPAS processes below.
If the calling process is already attached to the shared memory segment, fails and returns regardless of what value is passed in shmaddr.
See exceptions for MPAS processes below.
detaches from the calling process's data segment the shared memory segment located at the address specified by shmaddr.
Exceptions for MPAS Processes
On Itanium(R)-based platforms, MPAS (Mostly Private Address Space) processes are not restricted to passing in zero or a fixed value to
calls to MPAS processes may pass in other addresses. The call may fail or succeed due to implementation dependent reasons. MGAS processes
have all the restrictions outlined above. In addition, an MGAS process may not assume that it can attach at the address that an MPAS
process can use to attach to the same segment.
An MPAS process may be able to attach to the same shared memory segment multiple times. Success or failure of such an operation is imple-
mentation dependent. Failure will be indicated by a return value of
An MPAS process should specify or flags in the call to These follow the same rules as such flags passed to shmget(2).
See the for details.
RETURN VALUE
returns the following values:
Successful completion.
n is the data segment start address of the attached shared memory segment.
Failure.
The shared memory segment is not attached. is set to indicate the error. The symbol is defined in the header No successful
return from will return the value
returns the following values:
Successful completion.
Failure.
is set to indicate the error.
ERRORS
If fails, is set to one of the following values.
[EACCES] Operation permission is denied to the calling process.
[EINVAL] shmid is not a valid shared memory identifier, (possibly because the shared memory segment was already removed using
shmctl(2) with or the calling process is already attached to shmid.
[EINVAL] shmaddr is not zero and the machine does not permit nonzero values, or shmaddr is not equal to the current attach
location for the shared memory segment.
[ENOMEM] The available data space is not large enough to accommodate the shared memory segment.
[EMFILE] The number of shared memory segments attached to the calling process exceed the system-imposed limit.
If fails, is set to one of the following values.
[EINVAL] shmaddr is not the data segment start address of a shared memory segment.
EXAMPLES
The following call to attaches the shared memory segment to the process. This example assumes the process has a valid shmid, which can be
obtained by calling shmget(2).
The following call to then detaches the shared memory segment.
SEE ALSO
ipcs(1), exec(2), exit(2), fork(2), ftok(3C), shmctl(2), shmget(2), privileges(5).
in
STANDARDS CONFORMANCE
shmop(2)