Shell Script Resource-Timeout error
Hi!!
I have an issue with the Shell Script Resource, the problem is as follows:
When I created a user in this resource and appears a error message:
com.waveset.util.WavesetException: An error occurred adding user 'user01' to resource 'Shell Script'. com.waveset.util.WavesetException: Script failed waiting for "_,)#+(:" in response "" com.waveset.util.WavesetException: Script processor timed out with nothing to read and the following unprocessed text: "".
I added the timeout property = 300 000 in my shell script is as follows:
<ResTypeAction restype='Shell Script' timeout='300000'>
but it doesn't work.
I had the IDM 8 with the patch 4 but the problem beging when I did upgrade to patch 4 to 6.
Does anyone knows what could be the problem.
Thanks in advance!
Hello!
That isn't the problem the test connection works fine but when I try provisioning a user the shell script execute some instructions, in the shell script I need to set the timeout property in order to give more time to finish execute the instructions before the script execute the following command.
I tested the timeout property in the shell script and work to fine for IDM 8 patch 4 I upgrade to patch 10 and stopped to work.
Does anyone knows What could be the rigth way to set the timeout property in a resource action for shell script resource?
Thanks...
Similar Messages
-
Configuring Shell Script Resource
I am trying to configure a Shell Script Resource on my IDM Instance (8.1)
So far, I only wish to "Test the Configuration", just to make sure that the IDM is able to CONNECT successfully to the Unix Machine, before I proceed to configure the Resource Handlers and Scripts.
Whenever I press the "*Test Configuration*" button, I keep getting this error :
Test connection failed for resource(s):
java.lang.IllegalStateException: Error attempting to decrypt: Input length not multiple of 8 bytes
I have searched everywhere online (even Google), but can't find a solution, or even a REASON for this problem (((reenter the password on Resource Parameters page and save it. Test the connection. If error still there post the stack trace from app server log here.
-
Configuring Shell Script Resource on IDM
Hi all,
I am in the process of configuring a Shell Script Resource on my IDM system.
I used the Shell-Script-Resource-Object.xml (which is provided by IDM in the Samples folder).
So far, everything worked fine. I set up the parameters, tested the "Test Configuration" button, and it was successful.
The next phase is to proceed with the basic tasks (such as : create user, update user, delete user, etc)
This is where my problem lies.
The IDM manuals do not say anything about how this should be done. Neither do any of Sun's reference material (perhaps, I'm looking in the wrong place??)
I know that the "Resource Actions" should contain the scripts themselves. But, there's no mention of how those scripts should be configured.
The scripts themselves reside on the UNIX machine, which is where they should be. But, how should I invoke them?
Any help will be much appreciated.
ThanksOK.
I created an entirely new script, which allows me to CAPTURE the data (parameters) from IDM, and use them to create a new user.
It worked (or, it seemed to work).
In IDM, i got the following error :
*Error detected: [Adding account to hosts and creating quotas]&amp;amp;amp;#xD;&amp;amp;amp;#xA;Default shell for netpasswd is /usr/alt/uadm2/bin/nologin. This can be changed later.&amp;amp;amp;#xD;&amp;amp;amp;#xA;Default shell for sui-dev is /usr/alt/uadm2/bin/nologin. This can be changed later.&amp;amp;amp;#xD;&amp;amp;amp;#xA;Default home path for sui-dev is /home. This can be changed later.Default shell for ssl3 is /usr/alt/uadm2/bin/nologin. This can be changed later.&amp;amp;amp;#xD;&amp;amp;amp;#xA;Default shell for sui-test is /usr/alt/uadm2/bin/nologin. This can be changed later.&amp;amp;amp;#xD;&amp;amp;amp;#xA;Default home path for sui-test is /home. This can be changed later.[Adding user to groups]&amp;amp;amp;#xD;&amp;amp;amp;#xA;[Creating home directory]&amp;amp;amp;#xD;&amp;amp;amp;#xA;DUMMY - ssh -2 -l root sui-dev "/usr/alt/uadm2/libexec/mkhome sui-dev /users1/u1/mjerome 44444 500 550 mjerome"&amp;amp;amp;#xD;&amp;amp;amp;#xA;DUMMY - ssh -2 -l root sui-test "/usr/alt/uadm2/libexec/mkhome sui-test /users1/u1/mjerome 44444 500 550 mjerome"&amp;amp;amp;#xD;&amp;amp;amp;#xA;[all done].*
Result Code = 120.
Error
*com.waveset.util.WavesetException: An error occurred adding user 'mjerome' to resource 'Unix Administration'. com.waveset.util.WavesetException: Error detected: . com.waveset.util.WavesetException: Error detected: [Adding account to hosts and creating quotas]
Default shell for netpasswd is /usr/alt/uadm2/bin/nologin. This can be changed later.
Default shell for sui-dev is /usr/alt/uadm2/bin/nologin. This can be changed later.
Default home path for sui-dev is /home. This can be changed later.Default shell for ssl3 is /usr/alt/uadm2/bin/nologin. This can be changed later.
Default shell for sui-test is /usr/alt/uadm2/bin/nologin. This can be changed later.
Default home path for sui-test is /home. This can be changed later.[Adding user to groups]
[Creating home directory]
DUMMY - ssh -2 -l root sui-dev "/usr/alt/uadm2/libexec/mkhome sui-dev /users1/u1/mjerome 44444 500 550 mjerome"
DUMMY - ssh -2 -l root sui-test "/usr/alt/uadm2/libexec/mkhome sui-test /users1/u1/mjerome 44444 500 550 mjerome"
[all done]. com.waveset.util.WavesetException: Result Code = 120.*
From what is written there, I could see that the user was INDEED created. (Just to be sure, I checked my Unix machine. And, yes, the user was created)
However, I keep getting the above error in IDM.
I can't figure out any explanation besides the fact that, perhaps, this is because I do not have a RESULT HANDLER script in place yet.
Could this be it? -
I am using version 7.0 and I'm trying to setup a resource using the Shell Script resource type. I am having issues with a few things:
1. How do I let the system know there was an error in the shell script? No matter what exit code I use in the Actions I have configured for the resource, the system thinks everything was successful. Relatedly, how can I send back an error message - where can I view it?
2. How do I send back multiple values for an attribute? When 'GetUser' is called, it is parsed by 'GetUser AttrParse', I haven't been able to successfully send back mutiple values for an attribute. I have tried semicolon separating the attributes so that I can comma separate the multi-values for an attribute. I have also tried pipe.
3. When I setup a new resource with the shell script resource type, the 'Test Configuration' button calls a unix command that checks for a bunch of unix commands that have nothing to do with what I will be doing in my shell script. Is there a way to change the test?I found a way to send back multiple values for an attribute. Instead of using the collectCsvHeader and collectCsvLines AttrParse tokens as the resource reference guide says, I use str and skip tokens to parse the line. These tokens take delimiters and terminators for the line which allows me to send back multiple values for an attribute.
Line being parsed looks like this:
TEST USER, ,MN,People; /home/simtestusr; /bin/sh; 8888888888; simtestusr; 888; group1, group2; host1, host2, host2; ;
<AttrParse name='UnixShellScript GetUser AttrParse' >
<str name='gecos' trim='true' term=';'/>
<skip len='1'/>
<str name='homedir' trim='true' term=';'/>
<skip len='1'/>
<str name='shell' trim='true' term=';'/>
<skip len='1'/>
<str name='accountId' trim='true' term=';'/>
<skip len='1'/>
<str name='uid' trim='true' term=';'/>
<skip len='1'/>
<str name='uidnumber' trim='true' term=';'/>
<skip len='1'/>
<str name='groups' multi='true' delim=',' trim='true' term=';'/>
<skip len='1'/>
<str name='hostnames' multi='true' delim=',' trim='true' term=';'/>
<skipToEol/>
<MemberObjectGroups>
<ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
</MemberObjectGroups>
</AttrParse>
Also, SUN is telling me that the exit code problem (#1) may be fixed in sp2 for 7.0, I'm waiting to find out when it will be released.
I still don't have an answer for #3. -
How to engage Shell Script resource action in an Active Sync workflow.
A little background, at my organization I have IDM set up simply to recognize changes in LDAP and transmit those changes, via active sync, to AD. We don't yet use the IDM interface to make any changes to users, instead we use external interfaces that we have written to make changes to LDAP which then get picked up via Active Sync and synchronized to AD. However, in addition to AD, there are several other resources that we would like to gradually wrap into this active sync workflow via native and custom resource adapters. Currently I am working on a simple Shell Script resource to manage Linux home directories. I have written all the necessary code and created the resource itself within IDM. This all seems to work, I can create, delete, disable, etc.. users in our Linux environment from the IDM interface.
Here is the problem, I would like to integrate the creation, deletion, enabling, disabling, etc.. of users into the same Active Sync workflow that engages whenever a change is made to LDAP. This way, whenever a user is created in LDAP (and consequently AD), that user will be granted a home directory in Linux. Unfortunately it seems that Shell Script Resources are not enabled for Active Sync. Any ideas on how one might accomplish this?
Thanks in advance.Thank you for the prompt reply. Funny thing is that I have been banging my head on this problem for a couple weeks now (this is my first attempt at real customization ... ). I finally got desperate and decided to reach out for help. After I posted this message I came to a realization that ended up solving the problem for me, go figure.
For anyone in my place I can relate what I ended up doing, simple as it was. Keep in mind, of course, that this is a highly customized environment that I am working in so the specifics probably wont apply. What I basically did, is I found an LDAPCreateUserProcess form that gets invoked when Active Sync is run. For all I could tell, this simply processed the new attributes that came through Active Sync and related them to their llighthouse / AD counterarts. But I noticed a line like this:
<Field name="waveset.resources">
<Expansion>
<filterdup>
<appendAll>
<ref>waveset.resources</ref>
<s>AD</s>
</appendAll>
</filterdup>
</Expansion>
</Field>
and simply added the name of my shell script resource under the <s>AD</s> line. That was it.
Anyway, thanks bobm53, I can now get on with my life :-) -
Shell Script Adapter - getting errors while configuring
Hi,
I am trying to configure a shell script adapter for one of my AIX resource.
the following are the values I gave to test the configuration
1. host
2. tcp port (22)
3. login user
4. password
5. login shell prompt (#)
6. connection type SSH
with these values, I tried to test the configuration, I get the following errors,
Test connection failed for resource(s):
Shell Script: Failed to find 'useradd' in the path '/usr/bin /etc /usr/sbin /usr/ucb /home/eumusr/bin /usr/bin/X11 /sbin . /usr/local/bin' Shell Script: Failed to find 'usermod' in the path '/usr/bin /etc /usr/sbin /usr/ucb /home/eumusr/bin /usr/bin/X11 /sbin . /usr/local/bin' Shell Script: Failed to find 'userdel' in the path '/usr/bin /etc /usr/sbin /usr/ucb /home/eumusr/bin /usr/bin/X11 /sbin . /usr/local/bin' Shell Script: Failed to find 'groupadd' in the path '/usr/bin /etc /usr/sbin /usr/ucb /home/eumusr/bin /usr/bin/X11 /sbin . /usr/local/bin' Shell Script: Failed to find 'groupmod' in the path '/usr/bin /etc /usr/sbin /usr/ucb /home/eumusr/bin /usr/bin/X11 /sbin . /usr/local/bin' Shell Script: Failed to find 'groupdel' in the path '/usr/bin /etc /usr/sbin /usr/ucb /home/eumusr/bin /usr/bin/X11 /sbin . /usr/local/bin'
is this a privilege issue?
please let me know so that I can get the appropriate privilege from my sysadm to proceed further.
thanks.Hi, thanks for your response.
I got sudo access as root to the AIX resource.
Initially, NOPASSWD was set for my sudo privilege. using that I tried configuring the adapter, but I got errors like "Script failed waiting for "ASSWORD:" in response ",)#+(:" . I looked at the forums and was informed that I would need to 'UN-SET' the NOPASSWD attribute. I got that attribute un-set . but now I get the error
WLP_SmartScript_Original: Failed to find 'groupadd' in the path '/usr/bin /etc /usr/sbin /usr/ucb /home/eumusr/bin /usr/bin/X11 /sbin . /usr/local/bin' WLP_SmartScript_Original: Failed to find 'groupmod' in the path '/usr/bin /etc /usr/sbin /usr/ucb /home/eumusr/bin /usr/bin/X11 /sbin . /usr/local/bin' WLP_SmartScript_Original: Failed to find 'groupdel' in the path '/usr/bin /etc /usr/sbin /usr/ucb /home/eumusr/bin /usr/bin/X11 /sbin . /usr/local/bin'
Not sure why Sun should check this. these commands are not part of AIX. right? can you please tell me where I am going wrong? -
Unix Shell Script -- ORA-00905 error in pl/sql
Below is my unix shell script .... in which i am trying to caluclate difference between time stamps ..... i am getting a severe error when i run --- ORA-00905: missing keyword ( included it bottom of this post )
please look into this and let me know where to correct ....
much appreciated in adv
~~~~~~~~~~~~~~~~~~~~~START of Script~~~~~~~~~~~~~~~~~~~~
#!/bin/ksh
export readTime checkTime timeDiff
# Get initial Time
readTime=`sqlplus -s scott/tiger@database <<EOF
whenever sqlerror exit 1
set escape off
set head off
set verify off
select SYSTIMESTAMP from dual;
EOF
`
echo "readTime value is : $readTime"
# Get end of time
checkTime=`sqlplus -s scott/tiger@database <<EOF
whenever sqlerror exit 1
set escape off
set head off
set verify off
select SYSTIMESTAMP from dual;
EOF
`
echo "value of checkTime : $checkTime"
# calculate time diff
timeDiff=`sqlplus -s scott/tiger@database <<EOF
whenever sqlerror exit 1
set escape off
set head off
set verify off
select CAST(TO_DATE('$time2','''YYYY\/MM\/DD:HH24:MI:SS'''))-CAST(TO_DATE('$VAR1','YYYY-MM-DD:HH24:MI:SS')) from dual;
EOF
`
echo "value of timeDiff : $timeDiff"
~~~~~~~~~~~~~~~~~OUTPUT here ~~~~~~~~~~~~~~~~~~~~~~~
readTime value is :
02-DEC-05 12.07.53.779328 AM -06:00
value of checkTime :
02-DEC-05 12.07.54.013613 AM -06:00
value of timeDiff : 02-DEC-05 12.07.54.013613 AM -06:00','''YYYY\/MM\/DD:HH24:MI:SS'''))-CAST(TO_DATE('
ERROR at line 2:
ORA-00905: missing keywordYou didn't specify if you want a total time for a portion of a shell script, or the whole script in general. If you only want to know the time of the whole shell script, just reference the linux/unix built-in variable ${SECONDS}. This variable is reset for each PID.
I usually add these lines to the bottom of long running shell scripts (just before an exit code):
~~~~~~~~~~~~~~~~~~~~~~~~~
((TIME = ${SECONDS} / 60))
echo "Script ran for ${TIME} minutes. (${SECONDS} seconds total.)
~~~~~~~~~~~~~~~~~~~~~~~~~
Like I said, ${SECONDS} starts ticking from 0 when you start the script, so no need to export the variable, just reference it. The nice part is that you don't have to bother getting into sqlplus and hit the database. -
JSP calling a shell script (permission denied error)
HI there,
I am trying to execute a shell script command from JSP, and I am pretty close to getting it done. The actual shell comnmand I am trying to run
"scp test.txt somebody@somedomain:~/directory1/test.txt"
is working fine when I run it from the shell command line (when I am logged in as that somebody)
However, when I try to execute this script with the following JSP code (by accessing the JSP file from the browser, I get a permission denied error). The JSP file is set to 777 permission, and I have been trying lots of stuff with not much luck for a few days now .....
any input is much appriciated
<%@page language="java"%>
<%@page import="java.io.BufferedReader"%>
<%@page import="java.io.File"%>
<%@page import="java.io.InputStreamReader"%>
<%@page import="java.io.StringReader"%>
<%@page import="java.io.File"%>
<%@page import="java.io.FileInputStream"%>
<%@page import="java.io.FileReader"%>
<%@page import="java.io.Writer"%>
<html>
<body>
<%
String osName = System.getProperty("os.name");
out.write(osName+"<br>");
String s = null;
String cmd1 = "scp test.txt somebody@somedomain:~/directory1/test.txt";
out.write("Execing \"" + cmd1 + "\"<br>");
File workDir = new File("/export/home/web/admintool/web/javatest");
try {
Process p1 = Runtime.getRuntime().exec(cmd1, null, workDir);
int exitValue = p1.waitFor();
if (exitValue == 0){
BufferedReader stdInput = new BufferedReader(new InputStreamReader(p1.getInputStream()));
while ((s = stdInput.readLine()) != null) {
out.write(s + "<br>");
else {
BufferedReader stdErr = new BufferedReader(new InputStreamReader(p1.getErrorStream()));
while ((s = stdErr.readLine()) != null)
out.write(s + "<br>");
out.write("exit value is" + exitValue + "<br>");
catch (Exception e) {
System.out.println(e);
} %>
</body></html>Doesn't matter what perms the JSP has.
The servlet container and web server must allow it to runtime.exec, for one, which is insecure and dangerous. Talk to your admin if you want that and they may sandbox it for you.
The next thing is that the JSP will run as the web server -- so the file to exec must be set as 777 or 755 with the web server uid in the same group as the owner (share gid). -
Shell Scripting Resources && Conditional
Hiya folks.
I'm looking for a great shell scripting site. Or a book. The Apple Mac Dev Centre is ... well she ain't workin for me.
For instance, I'm looking for some leadership on a conditional, which those docs won't show me:
troubleshooting=false
*if [$troubleshooting==1]; then*
* echo $troubleshooting*
* echo $nameStart*
* echo $myDate*
* echo $newFName*
* echo $mSource*
* echo $mTarget*
fi
How do I trip this conditional?
CheersHow do you set a boolean?
Everything in a shell variable is a string. Some of those strings may look like numbers, but as far as the variable is concerned they are strings. There are no boolean variables. It is all in how you interpret the strings in your variable.
I'll have to check up on the syntax for bash.
You could read, reread, read and read "man bash". But I know it is not easy to actually figure out how to use the stuff the man page tells you, or even what they really mean when they use various terms. A book with examples helps, but there is magic hidden in the man page that sometimes takes ages and heavy use of shell scripting to figure out, and I've found that no one book will clearly explain every trick that can be done with shell scripts.
I prefer to have spaces in there, but not around parens of any kind. I wish languages would be the same that way. Heh.
And I like to have spaces around equal signs in assignments, but Bourne based shell scripts have their own rules. That is just the way it is.
The syntax for the 'if' command is
if list; then list; [ elif list; then list; ] ... [ else list; ] fi
where "A list is a sequence of one or more pipelines separated by one of the operators ...". "A pipeline is a sequence of one or more commands separated by the character |".
In the original Bourne shell (which ran in 64kilobytes of memory for code, data, and stack space) all expressions were handed by an external program 'test'. So your 'if' statement would have originally been
if test $troubleshooting = 1; then
fi
Someone figured out that Unix filenames do not care what characters make up their name, so a hardlink was created between /bin/test and /bin/[
ls -li /bin/test /bin/[
57880389 -r-xr-xr-x 2 root wheel 46720 Jun 17 2009 /bin/[
57880389 -r-xr-xr-x 2 root wheel 46720 Jun 17 2009 /bin/test
You will notice that 57880389 (the file's inode) is identical for both 'test' and '['.
So when you wrote
if [$troubleshooting==1]; then
the shell first processed the line and performed variable substitution, so the 'if' line converts to
if [false==1]; then
now the shell processes the 'list' of pipelines/commands following the 'if' statement. So a command is the first white space separate token, which is "[false==1]", so the shell looked in all the PATH directories looking for a file with the name "[false==1]" and did not find anything.
However, if you white space separate the command in the 'list' from its arguments, then the shell can figure out what the first command is, invoke that command, and pass its arguments to the command.
Now shells have more than 64kilobytes of memory to work with, and so the [[ ... ]] syntax was invented as a way to indicate that the expression was to use the shell built-in evaluation code. And I think bash eventually decided that it would do the /bin/[ program code evaluation as a built-in as well.
But since you can also say
if myprogram --opt --opt arg arg arg; then
fi
the shell must still be able to tell the difference between [ or [[ as expression evaluation operators, and a legal file with the name /home/me/bin/[myprogram, or $HOME/bin/[[myprogram, so it cannot assume that [ or [[ always start an expression evaluation. -
Automator and "Run Shell Script" error
First, if I'm in the wrong place with this- sorry. Figured this was an OS kind-of thing.
I recently migrated to a new iMac ... I brought along an Automator script; I've been using it for years to perform a little rsync backup to an USB HDD. It's 'never' given me any problems ... until now!
"*Run Shell Script*" encountered an error .. but alas, the system log is devoid of messages ... and the verbose log I have running indicates that all the files are copied/backed-up ... I would love any input on this that might help me get back on the feet. .....
*Here's what my Shell Script Looks like:*
Shell Option: /bin/bash
Pass Input: to stdin
rm -dfr '/Volumes/Backup HD/*********'
rm -dfr '/Users/***********/Library/Logs/Profile_Backup.log'
rsync -rltv /Users/******** '/Volumes/Backup HD/' > /Users/*******/Library/Logs/Profile_Backup.log
(I'm sure there's way to only sync the changed stuff between backups ... but I've simply preferred the fresh copy approach).
*I do however note this in my logs when I open Automator:*
12/14/10 3:15:46 PM [0x0-0x42042].com.apple.automator.Backup[464] Application Stub: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers.@Tony T1
Thanks, I'll certainly adjust the log file as suggested
In troubleshooting the problem I went the terminal route - and issued each command ... during the rsync process I was getting an error ... turns out when it was syncing the SyncServices folder it was encountering a copy of the keychain ... which had root permissions - naturally rsync was not able to copy the file (personally I have no idea why the keychain would be being sync'd with anything)!
I removed the file from the sync ... I'm still doing some "debugging" to correct the problem-
Again, thanks for the assist! -
Shell script adapter and passwords
Does anyone know how to get a password into a shell script resource adapter?
I've set up the "password" attribute in my resource adapter's schema, expecting at least to see the encrypted password in in $WSUSER_password, but it's always empty. Other attributes I add to the resource scheme show up in the scripts as shell variables just fine.
Side question - the Solaris resource adapter, which looks a lot like the shell script adapter, doesn't even have a password in its schema map, yet it seems to set passwords just fine. What's up with that?
The ShellScriptResourceObjects55.xml example doesn't seem to deal with passwords at all.Hi,
Have you been able to resolve this issue?
I am currently working on configuring a Shell Script Resource on my IDM system.
I am still in the "*Create User"* stage of things (I haven't even begun working with the other Actions : Get User, Get All Users, Delete User, Update User)
After a month-long period of trial-and-error, and a lot of headaches, I finally succeeded in Creating a new user on my Unix Machine, without any errors
Except for one thing : for some reason, the user I create is not being given a password!
A first, I configured the "Attribute Mapping" page to include a "Password" attribute. This did not work.
Then I removed the password from there (I figured that when I input the user's basic information on the IDENTITY tab in IDM, then the password gets automatically passed to the Unix machine).
Still, this did not work.
The funniest thing is : I am not getting any errors. The user is created on my Unix machine. And, also, in my My-SQL database.
The problem is : when I try to log into that same Unix machine as the user, it does not work, because......of course.....*.there is NO PASSWORD*.
What could be the problem? -
Shell Script- Force Quit Multiple Selections?
https://discussions.apple.com/message/25279344#25279344
Thanks to Red for providing this below as it works great for single applications, but if I throw in it multiple selections allowed
how can I separate each selection for force quitting? I'm a total newb to shell script with a decent skill level in applescripting. I'd love to see how this an be implemented.
set theItem to (choose from list theapps) as text
if theItem is false then error -128 -- or exit repeat (Cancel)
do shell script "killall " & quoted form of theItemset theItems to ((choose from list theapps with multiple selections allowed) as list)
if (theItems as text) is "false" then
else if (theItems as text) is not "false" then
set results to (every item of theItems)
repeat with eachItem in results
do shell script "killall " & quoted form of (eachItem as text)
end repeat
end if
TW actually after comparing it looks very similar! The reason why I used the false statement as text is I kept getting:
--> false
end tell
tell current application
do shell script "killall 'false'"
--> error "No matching processes belonging to you were found" number 1
and it was my workaround that didn't return any error at all. Looking at it a bit more the false was returning that error because I had it "as list". Thanks again for helping me learn how to simplify the workflow some more!
Message was edited by: CyX SenZe -
Shell script connection issues
I'm after some advice.
In our development enviroment we pull data from a content database using a shell script by setting the ORACLE_SID within the script and
we then check we can connect. Like our production environment our content and 'normal' database reside on the same server and under these conditions
everything works OK.
ORACLE_SID=$TARGET_DB
DB_CONNECT=`sqlplus -s $USER/$PASS <<EOF
whenever sqlerror exit failure
whenever oserror exit failure
select 1 from dual;
EOF`
However I now have access to a test content database with full production data but it resides on a different server. I can tnsping the other database and connect form the unix prompt with sqlplus user/pwd@newdb. However my shell script now gives
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
SVR4 Error: 2: No such file or directory
The same also occurs if I do the same manually at the UNIX prompt.
Unfortunately I don't currently have access to a DBA so I am on my own (although I do have full access to both database and operating system on the development box).
Thanks in advance,
SteveSteve,
Everything is normal. Using ORACLE_SID is limited to local -IPC/Bequeath- connections on the same server.
Assuming you don't want two different methods to connect, you'd best set up an IPC connection in your tnsnames.ora to connect to the local database ,
using ((PROTOCOL=IPC)(KEY=<whatever you used in listener.ora>)), and use the normal tns connection for the remote database.
In that case you can use the @<servicename in tnsnames.ora> all the time.
Alternatively you can replace @<servicename> by
set TWO_TASK=<servicename>
sqlplus ... <without @...>
Hth
Sybrand Bakker
Senior Oracle DBA -
Shell Script: Timeout and return error if Sqlplus hangs
Shell Script: Timeout and return error if Sqlplus hangs
Dear all,
This morning, our production database hung with lots of ORA-600 and 7445. The issue has been escalated to Oracle Tech support but my monitoring script which tries to make a connection every 5 mins to the database to see if its up, did not alert me. The reason is that, it connected to the database and hung, never came out to report an error and so I never got alerted until a user called me.
Can any one tell me how I can exit from the sqlplus block if I dont get a response in x seconds? This sqlplus block is being called with in a shell script.
Any help is highly apprciated.I don't know of anything built into any shell scripting language that would do this, no. I'm not a Perl programmer, but I have a vague recollection that Perl may have something useful here.
From the "separate thread" part of my comment, though, you could certainly spawn a separate thread (thread 2), have thread 2 wait a period of time, then look for a message from thread 1 and throw an error if the message hadn't been sent. I don't know that I'd be for writing multi-threaded shell scripts, though. The heartbeat also gives you a layer of redundancy so that something is monitoring the monitor in case that process stops working.
Justin -
How to execute power shell script file inside DSC script resource
Hi,
How to execute /call powershell scirpt file inside DSC script resource , some thing like below and capture the status of execution.
Node $AllNodes.NodeName
Script ExecuteSQLDeploy
#SetScript = {powershell.exe .\SQLDeploy.ps1 "param1" "param2" "param3" "param4" "param5" }
#TestScript= {powershell.exe .\SQLDeploy.ps1 "param1" "param2" "param3" "param4" "param5 }
#GetScript= { return $true;}
BasawarajThanks for reply.
Now i am able to execute the power shell script with DSC. I am getting no error when i run , but the script logic wrote inside ( deploying sql incremental changes ) not working . I am using SQLCMD in the powershell script to deploy sql
changes . Can you please elaborate on "script is compatible with DSC" , the script
should not contain write-host cmdlet.... etc something like that.
Copying recursively from ****************************** to ************************** succeeded.
Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
An LCM method call arrived from computer ************ with user sid **********************************************
[V-BAKANT]: LCM: [ Start Set ]
[V-BAKANT]: LCM: [ Start Resource ] [[Script]ExecuteSQLDeploy]
[V-BAKANT]: LCM: [ Start Test ] [[Script]ExecuteSQLDeploy]
[V-BAKANT]: LCM: [ End Test ] [[Script]ExecuteSQLDeploy] in 0.1110 seconds.
[V-BAKANT]: LCM: [ Start Set ] [[Script]ExecuteSQLDeploy]
[V-BAKANT]: LCM: [ End Set ] [[Script]ExecuteSQLDeploy] in 0.3010 seconds.
[V-BAKANT]: LCM: [ End Resource ] [[Script]ExecuteSQLDeploy]
[V-BAKANT]: LCM: [ End Set ]
[V-BAKANT]: LCM: [ End Set ] in 0.8810 seconds.
Operation 'Invoke CimMethod' complete.
Time taken for configuration job to complete is 0.923 seconds
Basawaraj
Maybe you are looking for
-
What is the provisioning feature in the settings under, general>profile? It says something about "provisioning". What does that mean and what does it do?? (It's on my 5th generation iPod touch, black, iOS 6.1.3
-
I am trying to connect to an HP 4155A parameter analyzer through the NI GPIB-USB-HS controller. I have installed the latest version of NI-VISA. When I do a scan in MAX it says that it cannot find any instruments on the controller. I have double ch
-
ITunes still not syncing correctly with iPhoto 9.4.3
Since upgrading to version 9.4.x, iTunes hasn't been syncing correctly with iPhoto. There were duplicated events/albums, missing photos, photos not appearing in the same order on iOS devices as they do in iPhoto, etc. With each version upgrade since
-
Syntax error after 6.20 SP53
Hello, we get a syntax error in previously error-free BSP pages after basis support package SP53 6.20. The line with error is <yhr_pd_pm:button onClick="return fSubmitNewWindow('<%=<l_mgr_detail>-act_ioper%>', '<%=l_selval%>')" text
-
[solved] -bash: ./test: Permission denied
hello every one I have created a test file: #!/bin/sh echo "hello, this is a test" ls then chmod +x test ./test and the result is -bash: ./test: Permission denied pleas help me no shell scrips work!!! Last edited by hsn (2009-09-08 08:05:16)