How to switch user from the current user using shell script code
Hi Experts,
I have an requirement to login into a particular user from the shell script concurrent program. I do have credentials for that particular user. I want to login and run few commands from that particular user. Please let me know if there are any methods to login as a particular user using the username, password from shell script program.
Thanks a lot.
Thanks for your reply. However we cannot use su command from a shell script program. How to enter password from shell script program?http://tinyurl.com/3t7cwjh
Thanks,
Hussein
Similar Messages
-
Create an user from the existing user.
Hi All,
Recently i have created one user from the existing user in a different server.
Oracle version :10.2.0.1.0
I have granted the similar roles same as in production.
In Production:
SQL> select granted_role,grantee from dba_role_privs where grantee in ('TRADELOANS');
GRANTED_ROLE GRANTEE
RESOURCE TRADELOANS
CONNECT TRADELOANS
In Test:
SQL> select granted_role,grantee from dba_role_privs where grantee in ('TRADELOANS');
GRANTED_ROLE GRANTEE
RESOURCE TRADELOANS
CONNECT TRADELOANS
But the user complained that he is getting error like 'user lacks CREATE SESSSION privilege'. He also says he is able to connect to production but for the test he is getting that error
Can anybody let me know where i have done the mistake?
Regards
Arunarundba wrote:
Hi Kamran,
I listed the roles given to the user in my first post. I have granted connect and resource role to the user.
and it is same in production also. But the thing is why he is able to connect to production and not for test?
Regards
ArunSee the following demonstration:
SQL> create user t identified by t;
User created.
SQL> connect t/t
ERROR:
ORA-01045: user T lacks CREATE SESSION privilege; logon denied
Warning: You are no longer connected to ORACLE.
SQL> conn / as sysdba
Connected.
SQL> grant connect to t;
Grant succeeded.
SQL> conn t/t
Connected.
SQL> -
PERSG previous bet different from the current PERSG using info-type pa0000
Hi Friends,
Please guid me how get the PERSG previous bet different from the current PERSG
using info type pa0000.
Regards,
DurgaFolks,
even after having repaired the inbox folder under "properties" a few times, I still had some e-mails where the contents are different from the subject line.
In other words in the inbox there are two e-mails: one with subject line "abc", and another one with subject line "def".
When I display the e-mail with the subject line "abc", the contents are from the e-mail with the subject line "def" in the in-basket.
What else can be done to correct this problem?
Thanks and best regards.
Fred Kunz-Shirzad
Chemin Ronzeures 6A
1297 Founex VD
Switzerland
[email protected] -
I am based in India, how do i buy from the app store using an indian credit card? The app store is saying that my apple id is valid only for US purchases and that I need a US credit card!
snigdhachavan wrote:
so does this mean i cannot download anything from the app store.. ...
Not the US Store... if you are in India.
snigdhachavan wrote:
... i wanted to buy the Mac OS X Lion... how do i do the purchase?
http://www.apple.com/in/mac/app-store/ -
How to pick a message from a mail box using shell script
Hi
Can any one tell me how to pick a message from a mail box using shell script.
Thanks,
Suman.Hi Suman,
Can any one tell me how to pick a message from a mail box using shell script.Grep for the message and then either cut or awk for the text. . . Something like this:
ls -al /mail/directory | grep "$1"* | awk '{print $9}'
Jon emmons has working samples in his book on Oracle shell scripting . . .
Hope this helps . . .
Donald K. Burleson
Oracle Press author
Author of "Oracle Tuning: The Definitive Reference"
http://www.rampant-books.com/book_2005_1_awr_proactive_tuning.htm -
Get the last query from the current user
Is there a way to get the last query of the current user, so every query could be log with a database trigger?
Let's just say I execute:
DELETE xxxx;
I tried :
SELECT T.SQL_TEXT FROM V$SQLAREA T where ADDRESS=(SELECT prev_sql_addr FROM v$session where audsid=userenv('sessionid'));
But the result of this query is :
'SELECT T.SQL_TEXT FROM V$SQLAREA T where ADDRESS=(SELECT prev_sql_addr FROM v$session where audsid=userenv('sessionid'))'
Is there a way to execute a query that would return :
'DELETE xxxx'
ThanksYou could join SQL_ADDR in v$session with ADDRESS in v$sqlarea to determine the SID that executed that SQL statement last. Note that PREV_SQL_ADDR in v$session will indicate the previous SQL he executed. Though you would have to look at these tables very often to get all SQL statements issued. One note here, I think if a different user ran the SAME SQL with just bind var differences the SQL_AREA will only show the last userâs information that executed it.
BTW - it will show deletes also... -
How to have SAP pull the current user as of the document owner
Dear All,
We are using SAP88 PL21 US localization. When they create marketing document, they want to default the doc owner to the current user. Is there anyway we can setup in SAP? If we have to create UDV, where can I pull the current user code? Thanks.
Regards,
YuykaHi Yuka.......
This is Possible by using Data Ownership Authorization........
Please check this also......
http://forums.sdn.sap.com/thread.jspa?threadID=1033556
Regards,
Rahul -
Create User from the end user pages
I tried to create a user from a end user page and I get this error:
com.waveset.util.WavesetException: WorkflowServices.provision: no view
Anybody knows where the error is?
Thanks!
My workflow:
<!-- MemberObjectGroups="#ID#Top" createDate="Wed May 30 10:36:29 CEST 2007" extensionClass="WFProcess" id="#ID#48FDDE54A046A13F:-14C2A04D:112DBE4AB3D:-7FDA" name="PRUEBA" visibility="runschedule"-->
<TaskDefinition id='#ID#48FDDE54A046A13F:-14C2A04D:112DBE4AB3D:-7FDA' name='PRUEBA' lock='Configurator#1181667176671' creator='Configurator' createDate='1180514189312' lastModifier='Configurator' lastModDate='1181666876671' lastMod='129' taskType='Workflow' executor='com.waveset.workflow.WorkflowExecutor' suspendable='true' syncControlAllowed='true' execMode='sync' execLimit='0' resultLimit='0' resultOption='delete' visibility='runschedule' progressInterval='0'>
<Extension>
<WFProcess name='PRUEBA' maxSteps='0'>
<Activity id='0' name='start'>
<Transition to='activity1'/>
<WorkflowEditor x='88' y='120'/>
</Activity>
<Activity id='1' name='end'>
<WorkflowEditor x='457' y='89'/>
</Activity>
<Activity id='2' name='activity1'>
<ManualAction id='0' name='prueba' syncExec='true' itemType='wizard'>
<WorkItemName>
<ref>probando voy</ref>
</WorkItemName>
<FormRef>
<ObjectRef type='UserForm' id='#ID#48FDDE54A046A13F:-14C2A04D:112DBE4AB3D:-7FC5' name='PRUEBAForm'/>
</FormRef>
</ManualAction>
<Transition to='Create View'/>
<WorkflowEditor x='177' y='266'/>
</Activity>
<Activity id='3' name='Provision'>
<Action id='0' process='Provision'>
<Variable name='op' value='provision'/>
</Action>
<Transition to='end'/>
<WorkflowEditor x='380' y='305'/>
</Activity>
<Activity id='4' name='Create View'>
<Comments>Initialize a new view.</Comments>
<Action id='0' application='com.waveset.session.WorkflowServices'>
<Argument name='op' value='createView'/>
<Argument name='type' value='User'/>
<Argument name='viewId' value='User'/>
</Action>
<Transition to='Provision'/>
<WorkflowEditor x='247' y='416'/>
</Activity>
</WFProcess>
</Extension>
<MemberObjectGroups>
<ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
</MemberObjectGroups>
<Properties>
<Property name='editorOriginalName' value='PRUEBA'/>
</Properties>
</TaskDefinition>Hi gvivek99,
I have put a link in the �Anonymous User Menu�
<Field name='Test'>
<Display class='Link'>
<Property name='URL' value='user/anonProcessLaunch.jsp?newView=true'/>
<Property name='id' value='PRUEBA'/>
</Display>
</Field>This link start "PRUEBA" Workflow (see my first post).
This workflow call a ManualAction and open PRUEBAForm. In this form I request the accountID, firstname and lastname. But when I submit it, I get the next error:
com.waveset.util.WavesetException: WorkflowServices.provision: no view
<!-- MemberObjectGroups="#ID#Top" extensionClass="Form" id="#ID#48FDDE54A046A13F:-14C2A04D:112DBE4AB3D:-7FC5" lastMod="247" lastModifier="Configurator" name="PRUEBAForm"-->
<Configuration id='#ID#48FDDE54A046A13F:-14C2A04D:112DBE4AB3D:-7FC5' name='PRUEBAForm' lock='Configurator#1182147751359' creator='Configurator' createDate='1180518677968' lastModifier='Configurator' lastModDate='1182147451343' lastMod='247' wstype='UserForm'>
<Extension>
<Form name='PRUEBAForm' noDefaultButtons='true' objectLocationID='objectName=PRUEBAForm&isBegin=true&objectPath=0&objectType=UserForm'>
<Display class='EditForm'/>
<Field name='waveset.accountId'>
<Display class='Text'>
<Property name='title' value='_FM_ACCOUNT_ID'/>
<Property name='size' value='32'/>
<Property name='maxLength' value='128'/>
<Property name='required'>
<Boolean>true</Boolean>
</Property>
</Display>
</Field>
<Field name='global.firstname'>
<Display class='Text'>
<Property name='title' value='_FM_FIRSTNAME'/>
<Property name='size' value='32'/>
<Property name='maxLength' value='128'/>
</Display>
</Field>
<Field name='global.lastname'>
<Display class='Text'>
<Property name='title' value='_FM_LASTNAME'/>
<Property name='size' value='32'/>
<Property name='maxLength' value='128'/>
<Property name='noNewRow' value='true'/>
</Display>
</Field>
<Field name='global.fullname'>
<Expansion>
<cond>
<and>
<ref>global.firstname</ref>
<ref>global.lastname</ref>
</and>
<concat>
<ref>global.firstname</ref>
<s> </s>
<ref>global.lastname</ref>
</concat>
</cond>
</Expansion>
</Field>
<Field name='nextCancelButtons'>
<Field name=':variables.formButton' button='true'>
<Display class='Button'>
<Property name='label' value='Next'/>
<Property name='value' value='Submit'/>
<Property name='command' value='Save'/>
</Display>
</Field>
<Field name=':variables.formButton' button='true'>
<Display class='Button'>
<Property name='label' value='Cancel'/>
<Property name='value' value='Cancel'/>
<Property name='command' value='SaveNoValidate'/>
</Display>
</Field>
<Field name=':complete'>
<Default>
<s>true</s>
</Default>
</Field>
</Field>
</Form>
</Extension>
<MemberObjectGroups>
<ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
</MemberObjectGroups>
<Properties>
<Property name='editorOriginalName' value='PRUEBAForm'/>
</Properties>
</Configuration>Thanks -
Setting a variable from the output of a shell script
I would like to use the output of the shell script "pwd" to populate a variable that I will then use to concatenate the argument to another shell script.
Below is what I tried, but that didn't work.
Any help is greatly appreciated.
set currentDir to do shell script "pwd"
do shell script "open " & currentDir & "/somedir/somefile"Does an applescript always run from "/" or from the directory in which the applescript file is run?
From: http://developer.apple.com/technotes/tn2002/tn2065.html :
Q: What’s the default working directory for do shell script commands?
A: do shell script inherits the working directory of its parent process. For most applications, such as Script Editor, this is /. For osascript, it’s the working directory of the shell when you launched osascript. You should not rely on the default working directory being anything in particular. If you need the working directory to be someplace specific, set it to that yourself. -
How to get ORA errors in alertlog file using shell script.
Hi,
Can anyone tell me how to get all ORA errors between two particular times in an alertlog file using shell script.
ThanksHi,
You can define the alert log as an external table, and extract messages with SQL, very cool:
http://www.dba-oracle.com/t_oracle_alert_log_sql_external_tables.htm
If you want to write a shell script to scan the alert log, see here:
http://www.rampant-books.com/book_2007_1_shell_scripting.htm
#!/bin/ksh
# log monitoring script
# report all errors (and specific warnings) in the alert log
# which have occurred since the date
# and time in last_alerttime_$ORACLE_SID.txt
# parameters:
# 1) ORACLE_SID
# 2) optional alert exclusion file [default = alert_logmon.excl]
# exclude file format:
# error_number error_number
# error_number ...
# i.e. a string of numbers with the ORA- and any leading zeroes that appear
# e.g. (NB the examples are NOT normally excluded)
# ORA-07552 ORA-08006 ORA-12819
# ORA-01555 ORA-07553
BASEDIR=$(dirname $0)
if [ $# -lt 1 ]; then
echo "usage: $(basename) ORACLE_SID [exclude file]"
exit -1
fi
export ORACLE_SID=$1
if [ ! -z "$2" ]; then
EXCLFILE=$2
else
EXCLFILE=$BASEDIR/alert_logmon.excl
fi
LASTALERT=$BASEDIR/last_alerttime_$ORACLE_SID.txt
if [ ! -f $EXCLFILE ]; then
echo "alert exclusion ($EXCLFILE) file not found!"
exit -1
fi
# establish alert file location
export ORAENV_ASK=NO
export PATH=$PATH:/usr/local/bin
. oraenv
DPATH=`sqlplus -s "/ as sysdba" <<!EOF
set pages 0
set lines 160
set verify off
set feedback off
select replace(value,'?','$ORACLE_HOME')
from v\\\$parameter
where name = 'background_dump_dest';
!EOF
`
if [ ! -d "$DPATH" ]; then
echo "Script Error - bdump path found as $DPATH"
exit -1
fi
ALOG=${DPATH}/alert_${ORACLE_SID}.log
# now create awk file
cat > $BASEDIR/awkfile.awk<<!EOF
BEGIN {
# first get excluded error list
excldata="";
while (getline < "$EXCLFILE" > 0)
{ excldata=excldata " " \$0; }
print excldata
# get time of last error
if (getline < "$LASTALERT" < 1)
{ olddate = "00000000 00:00:00" }
else
{ olddate=\$0; }
errct = 0; errfound = 0;
{ if ( \$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
{ if (dtconv(\$3, \$2, \$5, \$4) <= olddate)
{ # get next record from file
next; # get next record from file
# here we are now processing errors
OLDLINE=\$0; # store date, possibly of error, or else to be discarded
while (getline > 0)
{ if (\$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
{ if (errfound > 0)
{ printf ("%s<BR>",OLDLINE); }
OLDLINE = \$0; # no error, clear and start again
errfound = 0;
# save the date for next run
olddate = dtconv(\$3, \$2, \$5, \$4);
continue;
OLDLINE = sprintf("%s<BR>%s",OLDLINE,\$0);
if ( \$0 ~ /ORA-/ || /[Ff]uzzy/ )
{ # extract the error
errloc=index(\$0,"ORA-")
if (errloc > 0)
{ oraerr=substr(\$0,errloc);
if (index(oraerr,":") < 1)
{ oraloc2=index(oraerr," ") }
else
{ oraloc2=index(oraerr,":") }
oraloc2=oraloc2-1;
oraerr=substr(oraerr,1,oraloc2);
if (index(excldata,oraerr) < 1)
{ errfound = errfound +1; }
else # treat fuzzy as errors
{ errfound = errfound +1; }
END {
if (errfound > 0)
{ printf ("%s<BR>",OLDLINE); }
print olddate > "$LASTALERT";
function dtconv (dd, mon, yyyy, tim, sortdate) {
mth=index("JanFebMarAprMayJunJulAugSepOctNovDec",mon);
if (mth < 1)
{ return "00000000 00:00:00" };
# now get month number - make to complete multiple of three and divide
mth=(mth+2)/3;
sortdate=sprintf("%04d%02d%02d %s",yyyy,mth,dd,tim);
return sortdate;
!EOF
ERRMESS=$(nawk -f $BASEDIR/awkfile.awk $ALOG)
ERRCT=$(echo $ERRMESS|awk 'BEGIN {RS="<BR>"} END {print NR}')
rm $LASTALERT
if [ $ERRCT -gt 1 ]; then
echo "$ERRCT Errors Found \n"
echo "$ERRMESS"|nawk 'BEGIN {FS="<BR>"}{for (i=1;NF>=i;i++) {print $i}}'
exit 2
fi -
How to Email Concurrent Program Output to Email using Shell Script
Hi All,
Have a Nice Day,
I have a tricky requirement and i was not able to achieve, let me explain my requirement
I have created a PLSQL Concurrent Program named "Approval Update". This will do update and it display the number of rows updated.
Now i need to take this concurrent program output and it needs to be send it to the person who submits this program as an email using shell scripts.
I have referred meta link note as well as some OTN posts but I was not able to achieve this.
Please help me to complete this As soon as possible, Thanks in advance for your help.
Let me know if you need more clarifications.
Regards,
CSKI don't have much idea in shell scripts all i want is, in my shell script i need to get the parent concurrent program output and that needs to be emailed to the intended person.
Please help to to get the shell script commands for this.I do not have any shell script to share, sorry! If you want the query to get the parent request_id so you can get the log/out file name/location from then please refer to:
REQUESTS.sql Script for Parent/Child Request IDs and Trace File IDs [ID 280295.1]
http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=FND_CONC_REQ_SUMMARY_V&c_owner=APPS&c_type=VIEW
http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=FND_CONCURRENT_REQUESTS&c_owner=APPLSYS&c_type=TABLE -- LOGFILE_NAME & OUTFILE_NAME
Thanks,
Hussein -
How to execute a transaction with a different user from the logged user?
Hello Experts!
I'm trying to find out a solution about this scenario: our users need to release a Purchase Order (ME28) and/or a Service Entry Sheet (ML85) in SAP from a WEB based application through TIBCO, but the requirement is to execute this operation with the same SAP User name of the user (with his authorization) and not with the TIBCO user that is logged to SAP.
Is there someone that could suggest me a real time solution and how to develop it? I really appreciate your contribute and I'm at your disposal for any further information.
Thank you very much!
AlessandroHi Rob!
Thank you for your help, but I can't apply this solution, because we need to execute the transaction with a specific user name and not a generic user, besides our user have different authorization, for example the user Mr. Rossi can release only his Purchase Order but not the PO of another user Mr. Bianchi. Moreover we need to see the PO released/modified from a specif user name. So this is our constraint.
Bye Ale. -
I only recently learned/read about SharePoint's JavaScript Client Object Model. I'm reading online trying to figure this out but not having much luck.
On newform.aspx (and dispform.aspx) I want to get the
current list,
the last item created, and it's attachments. I now the CAML query I need to get the last item created, but first I have to get the current list and I am not sure how to do that.
I tried this but it returns null:
SP.ListOperation.Selection.getSelectedList()Hi,
For your issue, you can get the list name from the new form url and retrieve the list last created item :
https://social.msdn.microsoft.com/Forums/office/en-US/b90a64f8-2255-41b0-9d91-78335dd4a4cf/get-list-name-from-list-url-through-javascript?forum=sharepointdevelopmentprevious
http://msdn.microsoft.com/en-us/library/office/hh185007(v=office.14).aspx
Best Regards,
Eric
Eric Tao
TechNet Community Support -
Custom workflow... creating a new user from the End User's point of view
Hello I am trying to design a new Request for the end user so that they are able to create a new user. I am having problems with my workflow at this point and keep getting the error "Missing view id." Below is my code please help me out... I am very new to this so be gentle.
P.S. All my fields are named with " view.waveset.* " where * is either accountId or firstname or any attribute I need to set
<Extension>
<WFProcess name='End User Create New User' maxSteps='0'>
<Activity id='0' name='start'>
<Transition to='Create View'/>
<WorkflowEditor x='33' y='5'/>
</Activity>
<Activity id='1' name='Create View'>
<Action id='0' application='com.waveset.session.WorkflowServices'>
<Argument name='op' value='createView'/>
<Argument name='id' value='$(accountId)'/>
<Argument name='type' value='User'/>
</Action>
<Transition to='Update View'/>
<WorkflowEditor x='107' y='81'/>
</Activity>
<Activity name='Update View'>
<Action process='Update View'>
<Argument name='type' value='User'/>
<Argument name='id' value='$(accountId)'/>
<Argument name='options'>
<map/>
</Argument>
</Action>
<Transition to='Provision'/>
</Activity>
<Activity id='2' name='Provision'>
<Action id='0' application='com.waveset.provision.WorkflowServices'>
<Argument name='op' value='provision'/>
<Argument name='user' value='$(view)'/>
<Argument name='options'>
<map/>
</Argument>
</Action>
<Transition to='end'/>
<WorkflowEditor x='296' y='83'/>
</Activity>
<Activity id='3' name='end'>
<WorkflowEditor x='393' y='5'/>
</Activity>
</WFProcess>
</Extension>I ran across the same error today. Since it's been over a month, I assume you've fixed it already or decided you didn't need it at all? What was your fix?
For me, I noted that in the sample directory, a similar "createView" call (in End User Anonymous Enrollment) also includes this argument:
<Argument name='viewId' value='User'/>
When I added that to my createView call, the "Missing view id" error went away, and the user are gets created.
I'm not entirely comfortable with the value specified, though; seems like view IDs should be more unique. I would have thought it should have been something like this instead:
<Argument name='viewId' value='User:$(accountId)'/> -
Unassign user from a OIM Group using API/Java Code
Hello OIMers,
Can you please tell me how should I Un-assign a group membership through code?
This is the case:
When the user is deleted from Active Directory, I want to Unassign the User from a group, assume the name of the group is "FullTime Employees".
Currently How I do this is Click on the User Profile in Admin Console then select Group Membership from drop down and then select unassign for that group.
Please tell me how should I do the above task programmatically, This would solve my problem.
Thanks everyone in advance.
Regards,
VSNHi all,
I am using the following api:
uintgroupf = (tcGroupOperationsIntf)tcUtilityFactory.getUtility(db, "Thor.API.Operations.tcGroupOperationsIntf");
uintgroupf.removeMemberUser(arg0, arg1);
arg0 - is group key............Can you tell me how should I fetch this Group Key??
Thanks.
Regards,
VSN
Maybe you are looking for
-
I just installed a 256gb Crucial M4 in the second bay. Cable hooked up, looks fine. Device manager shows the drive, lists it as working properly in location 1. However, it is not shown or listed in My Computer along with all the other drives. My
-
How to add a SS instead of a chart?
Coming from Appleworks where you could create a SS with a few clicks of mouse, how do you add a SS into pages and not just a chart? Regards Alfonso
-
Hello, I have a problem when it comes to sorting a datagrid with multiple fields. I have two fields A and B . B has numerical values . How can i sort B yet also change the data in A since they are dependent from each other? This is my datagrid <s:Dat
-
Help.... how can i see who is connected to my itunes
Hey, i am more then happy to allow people to connect to my playlist but i want to know how is it possible to know who is actually connected not just how manny people. Thank You
-
Scalling in SA - More than target qty
Hi, I am maintaining price scaling in Sch Agt. The steps I have followed. 1. Created Sch Agt for Mat-vendor. Entered Target quantity say 1000 2. Entered Net Price- ex-10USD. selected line and went to Item-> conditions. displayed PB00. 3. double click