Perl Scripting -  Is it an alternative to shell scripting?

Hi all,
I am new to Oracle. I am trying to learn the basic concepts
I read that PERL is a server side scripting language.
I understand the purpose of shell scripts. I come across terms PERL shell scripts.
I understand PERL interpreter comes with UNIX.
1. So, is scripting using PERL an alternative to shell scripting? or
Does it have a different purpose?
2. If an alternative, then when would PERL scripting be better than shell scripting or vice versa ?
3. If an alternative, can PERL be exclusively used replacing shell scripting or as mentioned in my 2nd question used based on the application.
Your reply will be truly appreciated.
Thanks!

A hypothetical question: If a unix had PERL
installation can I use it replacing the unix shell
scripting for carrying out day to day DBA tasks? You
mentioned it is not done that way but theoretically
can it be done?
Yes, if you are proficient with Perl, you can use perl to script DBA scripts. Perl is more powerful than shell script. So there's nothing Perl can't do that shell can, there are many things Perl can, regular shell can't.
The limitation is some company has tight policy on installing non-default software on servers, especially production high security servers.
If not for carrying out day to day DBA tasks using
PERL scripting is there any other reason for why PERL
may come installed or can be installed in a UNIX
flavor?
Like said, Perl has many useful functions and modules. With DBD/DBI module and string processing power (Regular Expression etc), Perl is very popular tool for dataloading scripts as well as phyton.
Perl and Phyton are also heavy used for CGI application and much more.

Similar Messages

  • Mount script for ext2 - mixing applescript and shell script

    Hello
    i want to do a .app using the ScriptEditor to get my external usb-disc mounted.
    I tried ExtFS Manager before, but was not as happy with it.
    so the basic idea is some kind of mixture of apple script and bash-shell script, but im not sure how to combine it.
    shell script:
    #!/bin/sh
    sudo kextload /Library/Extensions/ext2fs.kext
    mkdir ~/usb_music/
    sudo mount -t ext2 -o nosuid,w,m=777,user /dev/disk1s5 ~/usb_music/
    sudo chmod a+rwx ~/usb_music/
    apple-script:
    on run
    try
    do shell script ""
    end try
    end run
    any ideas how to get it combined and working ?
    best regards
    fidel
    MacBookPro 15,4" 1,83 GHz   Mac OS X (10.4.8)  

    is there a way to implement it in a way that normal users can work with sudo to mount the drive ?
    kextload requires superuser privileges, so at some point some part of your script is going to need to run with elevated privileges.
    It is possible to configure sudo to allow non-admins to run any other commands. You could either allow non-admins to to run kextload or, preferably, allow them to run your shell script.
    man sudoers will give you the details on how to configure sudo to do this, which might be as simple as:
    <pre class=command>ALL  ALL=(ALL) /usr/local/bin/myscript</pre>
    This will allow all users to run /usr/local/bin/myscript as root.

  • How to excute a power shell script to remote machine using power shell script folder path and script name

    Hi,
    Let say, I have 3 parameters.
    1. Script FolderPath (Remote path for e.g \\RD101\ScriptSharedFolder     Here RD101 is one server)
    2. Script Name(StopAllService.ps1)
    3. Server Name (RD45)
    I want to execute a powershell scritp in my local machine(Test1)  and in that script I want to pass the above three parameters.Now I want to excute the StopAllService.ps1 script into RD45 server. But the script is available in RD101 machine.
    So What I want to here How can we do this ? I have script name and script folder path and target execution server name.
    Pls giude me or give me the script.
    By
    A Path Finder..
    JoSwa 
    If a post answers your question, please click &quot;Mark As Answer&quot; on that post and &quot;Mark as Helpful&quot;
    Best Online Journal

    Hi,
    You got 2 solutions for your problem:
    1- If you have permission to run scripts in the remote computer without specifying your credential,
    then, the first reply solve your problem.
    2- If you have permission to run scripts in the remote computer
    having to specify your credential, l then,
    my solution solves your problem.
    If the remote computer requires signed scripts only, you need signed script. Period. Or are you trying to break remote computer security?
    If you need signed script, there's no psdrive that'll circumvent such requirement.
    The problem is that the execution policy is set to "RemoteSigned". Using the URL explicitly tags that script as being from a remote source, and the policy blocks it.  The PSDrive provides a local reference for the script.  It does not
    sign the script but the local drive reference may prevent it from being blocked for being from a remote source. I'll test that later.
    Script signing is not and should never be considered a security measure. It is easily circumvented by running the script using powershell.exe, and using the -ExecutionPolicy parameter to override whatever the local execution policy setting is. 
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • Shell scripting for oracle DBs

    looking for good source for shell scripting for oracle DBs

    Just buy 'Classic Shell Scripting' and 'the Unix Desktop Reference' both published by O'Reilly and you have it all.
    But if you want a platform agnostic scripting language use Perl. Comes with Oracle.
    However both bash and kornshell are a lot easier compared to Perl.
    Sybrand Bakker
    Senior Oracle DBA

  • Can any one tell me how can i call a shell script from pl/sql

    i like to call shell script from pl/sql procedure.
    can any one suggest how can i do this

    Have you not mastered in asking the same kind of question ?
    First do write a script...
    no one will spoon feed you.
    How can i call a shell script from procedure
    How to call Shell Script from pl/sql block
    -Sk

  • Unix shell Script Help

    Hi,
    I am not to familiar with shell scripting. And i need a shell script that would look for a certain filename (eg: ASN*.txt) in a directory(Eg:data) and if it does find that, it calls a concurrent program(Eg: abc.xyz) and once this is called and procedure excutes successfully, I take the file and move it to another directory(Eg:archive)
    Any help would be aprreciated.
    Thanks,
    Ja

    You bet.
    http://steve-parker.org/sh/sh.shtml
    http://heather.cs.ucdavis.edu/~matloff/UnixAndC/Unix/CShellII.html
    and about 300,000 more hits on Google

  • Oracle declare function in shell script

    Please tell me oracle declare function now able to run in shell script?
    I am calling in shell script like @/myscript.sql it is not working properly, reset update and other oracle command is working fine in shell script.

    I am running below code.
    #!/bin/sh
    sqlplus system/manager@prod_db <<ENDOFSQL
    update apps.fnd_concurrent_queues set node_name = 'host1', target_node ='host1' where node_name='host3';
    update apps.fnd_concurrent_queues set node_name = 'host2', target_node ='host2' where node_name='host4';
    commit;
    DECLARE
    VALUE BOOLEAN;
    l_node_id number;
    BEGIN
    select node_id into l_node_id from fnd_nodes where NODE_NAME = 'host5';
    VALUE := fnd_profile.save ('NODE_TRUST_LEVEL', 3, 'SERVER',l_node_id,null,null);
    END;
    ENDOFSQL
    Below ERROR i am getting after running above code via shell script with oracle user
    SQL>
    0 rows updated.
    SQL>
    0 rows updated.
    SQL>
    Commit complete.
    SQL> SQL> DECLARE
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at line 5

  • Calling shell script from sql procedure

    Hi gurus
    Is it possible
    1)to call a shell script from sql procedure
    2)that shell script has to return one value
    3)and again sql procedure(calling shell script) has to capture the return value.
    please help me to write this script

    You may NOT have EXECUTE privilege/ permissions on the DBMS_PIPE package. Check with your DBA.
    Using DBMS_PIPE may not be that simple to implement. Just making a call to DBMS_PIPE procedure will not do anything. It will NOT trigger anything on the UNIX side.
    . You will also need to :
    1.     Write a job (ie CRON) at UNIX side which will keep read the incoming pipe for new messages, Unpack the message and get the command to be executed at the UNIX side -- There will be a lot of work involved here + DBA presence/activity is also required.
    As Justin has pointed out, try and use HOST command which is very simple or try and use Java.
    Shailender Mehta

  • I need a shell script code

    hi,
    Anybody can give me a code of shell script..
    i am new to shell script.
    i have a pl sql procedure
    1. it runs everyday at a particlar time
    2. i need to send an email to 3 managers.
    3. email message contains the query output of the table that is updated
    can anybody help
    thanks

    <ul><li>What shell are you using? Try "echo $SHELL" from your Linux prompt.</li>
    <ul><li>If the answer is Bash, have you done any homework on Bash Scripting at all?
    <ul><li>(If the answer is "no", please refer to the above link for information on how to script in Bash, phrased much more clearly than I ever could alone.)</li></ul></li>
    <li>Ditto Csh</li>
    <li>Ditto Sh</li></ul></li>
    <li>Have you read the man pages for your shell? If not, they're a good place to learn about your shell's abilities and functions and how to use them.</li>
    <li>What mail program do you plan to use?
    <ul><li>Have you read the man page or documentation on that program?</li>
    <li>If you do not know what mail programs you have at your disposal, have you tried using the "apropos mail" or "whatis mail" commands to find any such programs?
    <ul><li>If you've looked for and want more help finding mail programs, then what platform of Linux are you running? If you don't know, get in touch with the administrators of the system and ask.</li></ul></li></ul></li>
    <li>Are you familiar with "cron"?<ul><li>If not, "man cron" from your Linux prompt. Cron will run commands and scripts on a schedule as you seem to need.</li></ul></li>
    </ul>

  • Shell scripting

    Hi,
    I dont know about shell scripting .since iam involved in the database administration side i dont know have much knowledge in unix shell scripting.
    so, wat part does this shell scripting taked in database administration.so wat are all the things which i should get familiar to gain good knowledge in shell scripting.
    so kindly provide me some docs/metalink IDS which will enrich my knowledge in shell scripting.
    As a DBA upto wat level i should be good in shell scripting

    Hi;
    I dont know about shell scripting .since iam involved in the database administration side i dont know have much knowledge in unix shell scripting.
    As a DBA upto wat level i should be good in shell scriptingI belive atleast you have to learn until u can write some control or backup script or when you see some scripts you can understand what they are doing. There is no level or limitation to say "My information enough".
    For instance i can type some scripts here but when i go some client they have wirtten and run scripts which can has more than 300-500 line scripts. Its mean its depend your workaround and company or clients needs&requests.
    so, wat part does this shell scripting taked in database administration.so wat are all the things which i should get familiar to gain good knowledge in shell scripting.You can type many scripts as:
    For backup
    For check tablespace status
    For check alert log error
    For compiling invalid objects
    and so on.
    so kindly provide me some docs/metalink IDS which will enrich my knowledge in shell scripting.I suggest check first Hussein Sawwan previous greatest post about similar topic:
    Shell Script
    Shell Script
    Also check below search:
    http://forums.oracle.com/forums/search.jspa?threadID=&q=shell+scripting&objID=c3&dateRange=all&userID=&numResults=15
    Hope it helps
    Regard
    Helios

  • Shell script for mail conf

    Hi all,
    DB oracle 10g
    solaris,
    It is new env ....we are not having grid configuration ....
    Please any one provide to me a script for monitoring threshold limits like >90% critcal alert ....I have written a sql script but I am unable write shell script .......my requirement is I want to call sql script (tbsthershold.sql) these alerts are configure to mail to dba group through shell script when ever tablespace reaches thershold....
    please help me out if any one having any shell scripts.... for that
    thanks,
    kk

    Hi all,
    DB oracle 10g
    solaris,
    It is new env ....we are not having grid configuration ....
    Please any one provide to me a script for monitoring threshold limits like >90% critcal alert ....I have written a sql script but I am unable write shell script .......my requirement is I want to call sql script (tbsthershold.sql) these alerts are configure to mail to dba group through shell script when ever tablespace reaches thershold....
    please help me out if any one having any shell scripts.... for that
    thanks,
    kk

  • Which .bash does "do shell script" commands use?

    The "do shell script" command uses the Bourne shell "sh". But I am curious to know which .bash it uses to define the shell environment variables.
    I ran into a problem installing a third-party unix program which required new environment variables to be defined in order to execute. Defining these variables and executing this program from the terminal worked fine.
    But executing it within a "do shell script" command in an Applescript - the program died silently because the environment variables it required were not defined in the shell Applescript uses. It appears to invoke a new shell which does not inherit the environment variables defined in your home user shell.
    (I found this out by 'do shell script "set"' which listed the environment variables Applescript knows about - the ones I defined for the third-party program were not listed).
    A "brute force" way of fixing this is to pass the environment variables directly:
    do shell script "export THIRDPARTY_ENVVAR=blah; /usr/sbin/thirdpartyprogam"
    This works but not exactly elegant, particularly when you need to pass a number of variables.
    So - any better ways to do this? Can I edit the .bash Applescript uses, and where is it?
    Thanks.

    Another option that might work for you... if you are saving/distributing your AppleScript as an "Application bundler" is to group all your shell env. variables and other commands into a separate shell script file. Then include the shell script inside your app bundle. Locate the shell script at runtime and run that with "do shell script".
    For example, create "myShellScript.sh"
    #!/bin/sh
    export THIRDPARTY_ENVVAR=blah
    # ... more variable declarations..
    /usr/sbin/thirdpartyprogam
    # ... more shell commands...
    Store the shell script file inside your AppleScript bundle's Contents -> Resources folder (remember to make the shell script executable). Then your AppleScript can find your shell script at runtime and execute it like this:
    set ssPath to quoted form of POSIX path of (path to resource "myShellScript.sh")
    set stdout to do shell script ssPath
    Steve

  • Applescript: display dialog while doing shell script

    Hello there,
    I'm making an applescript app for my company, and had  a question.
    The functionallity of the app is working great, but there is a certain step which can take up to several minutes.
    This can give the user the feeling that nothing is happening and things are stuck.
    Is there a possibility to display a dialog as long as the action (shell script) is running?
    Something along the lines of "Now performing action X. please wait...)
    Thanks for your thoughts!
    Grtz

    With regular AppleScript you can start the shell script in the background (see do shell script in AppleScript) and then put up a dialog, although you would have to periodically check to see if the shell script is finished.  In Lion, the AppleScript Editor has a Cocoa-AppleScript template that you can use (kind of a wrapper application that lets you use various Cocoa methods without having to use Xcode), in which case you could put up an indeterminite progress indicator and then do the shell script.
    AppleScript Studio is deprecated as of Snow Leopard, but there are some AppleScriptObjC in Xcode tutorials at MacScripter.  An additional source of information and templates is macosxautomation, but they seem to be having some server problems at this time.  I also have a Progress Window template application example, it can be downloaded here.

  • 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...

  • Executing shell script using OSLinetoken fetchlet

    Hii,
    I do have a requirement. I need to use a shell script in the OSLineToken fetchlet. In response metric i will be checking whether the directory exists or not on the server. In order to check the existence of the directory, i have created a shell script. But how can i relate its result with the Response metric? The shell script is as follows:
    Shell Script:
    if test -d $1 ; then
    echo "DIR exist"
    else
    echo "false"
    fi
    The Response metric for the same will be:
    <QueryDescriptor FETCHLET_ID="OSLineToken">
         <Property NAME="command" SCOPE="GLOBAL">
              sh {dir_name where the shell script is uploaded}/{shell script file name} {dir_name_parameter} </Property>
         <Property NAME="startsWith" SCOPE="GLOBAL">em_result=</Property>
         <Property NAME="delimiter" SCOPE="GLOBAL">|</Property>
    </QueryDescriptor>
    Please suggest what is the use of em_result here?
    once the existence of the directory is checked, if it up then i need to call another shell script in order concatenate the contents of all the files with extension .log(this will be the parameter of shell script). Get the output from shell script and display it into custom management plug-in. As i am using cat *.log>>consolidatefile command to concatenate the data, i need to read consolidatefile file from the server and return this concatenated file data into plug-in. Again, how can i read the content of consolidatefile file in EMF? I will be creating another matric for this purpose say "read_content". the querydesciptor of the same will be as follows:
    <QueryDescriptor FETCHLET_ID="OSLineToken">
         <Property NAME="command" SCOPE="GLOBAL">
              sh {dir_name where the shell script is uploaded}/{shell script file name} {dir_name_parameter} {extension of the files to concatenated} </Property>
         <Property NAME="startsWith" SCOPE="GLOBAL">em_result=</Property>
         <Property NAME="delimiter" SCOPE="GLOBAL">|</Property>
    </QueryDescriptor>
    I am not sure which all properties to be used in this case..I have seen multiple sample files some of them uses perbin, scriptsdir but some of them does not..The related pdf also does not say anyhting about such kind of properties. Please suggest.
    I hope the explaination of the problem is not so cumbersome. Please let me know if you have any query to understand.
    Thanks,
    AS

    If you notice, localScriptsDir is a directory within scriptsDir. If you package your plug-in up and deploy it through the UI, any scripts you create will go into %scriptsDir%/emx/<target_type>. So localScriptsDir just specifies that directory for you. You don't need it but then in the command paramater you'll have something like:
    sh %scriptsDir%/emx/yourtargettype/yourscript...
    So whether you specify it in the command or another property (localScriptsDir) doesn't really matter.
    You can create your own properties in the QueryDescriptor. Just make sure you have the correct scope specified and it should be fine (options for scope are described in the Enterprise Manager DTD section of the Extensibility Guide).
    Metric collection isn't really meant for dynamic specification of input parameters. I can think of a few solutions:
    1) Create a target instance for each log directory. When you create the instance, the directory is specified. If you need to monitor a different directory, you can just create another instance. Upside is that it's flexible and scalable, and also, when you get an error you'll know exactly which directory it is based on which instance throws the error. Downside is that you have to have a separate instance for each directory.
    2) If the log directories are well known and finite (and won't change names), hardcode them into the target metadata. Have a different metric collect for each log directory, so you'll have as many metrics as log directories you want to monitor. Even if the names of the directories are different, you can use instance properties to map them, so if you know there will always be 5 log directories you want to monitor, you can have 5 instance properties to map the names into the metrics, although this won't work if you don't have the same number each time. Upside is that there is only a single target instance. Downside is that it's not as flexible.
    3) Use a job rather than a target type to find out this information. You could create a new job type which scans the logs for information and have the directory as an input parameter to the job. You could have this job on a repeating schedule to duplicate the effect you are trying to get out of creating a target type. The upside is that you can start the job whenever you want from the UI and specify exactly which directory whenever you run it. The downside is that the job system is centered on the OMS rather than the agent, so every time it runs it will have to contact the agent to do the work. In the case of the target type, the agent acts autonomously without contact from the OMS.
    There are probably other options, but these are the quick ones off the top of my head.
    Chris

Maybe you are looking for