RMAN exit problem from linux script..

Hi all
I am using 11.1.6.0 on linux centos ..below is the rman script (name is rmanbackup.sh) .
rman target / <<- EOF
sql 'alter system archive log current';
run {
backup current controlfile;
exit
EOF
echo "script complete for rman backup"
mkdir /home/oracle/backup_dir
cp /home/oracle/backup_dir /home/oracle/backup_dir1
when i execute this, rman exit from script without executing the last 3 operating system commands .
any help in this regard.

As Mseberg said, Please try to mark you questions as answered, here is the answer:
add *#!/bin/ksh* in your script ; also cp -r not cp
[oracle@wissem ~]$ cat rmanbackup.sh
#!/bin/ksh
rman target / <<- EOF
sql 'alter system archive log current';
run {
backup current controlfile;
exit
EOF
echo "script complete for rman backup"
mkdir /home/oracle/backup_dir
cp -r /home/oracle/backup_dir /home/oracle/backup_dir1
[oracle@wissem ~]$ ./rmanbackup.sh
Recovery Manager: Release 11.2.0.1.0 - Production on Sun Aug 28 17:00:11 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORAWISSE (DBID=3964208472)
RMAN>
using target database control file instead of recovery catalog
sql statement: alter system archive log current
RMAN> 2> 3>
Starting backup at 28-AUG-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=149 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 28-AUG-11
channel ORA_DISK_1: finished piece 1 at 28-AUG-11
piece handle=/home/oracle/app/oracle/flash_recovery_area/ORAWISSE/backupset/2011_08_28/o1_mf_ncnnf_TAG20110828T170014_75np001q_.bkp tag=TAG20110828T170014 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 28-AUG-11
RMAN>
Recovery Manager complete.
script complete for rman backup
[oracle@wissem ~]$ ls -rtl /home/oracle/backup_dir
total 0
[oracle@wissem ~]$ ls -rtl /home/oracle/backup_dir1/
total 4
drwxr-xr-x 2 oracle oinstall 4096 Aug 28 17:00 backup_dir
[oracle@wissem ~]$ ls -rtl /home/oracle/backup_dir1/backup_dir/
total 0
[oracle@wissem ~]$

Similar Messages

  • File Upload Problem from Linux to Windows and Windows to Linux

    Hi,
    I am a newbie in the flex environment.
    I have faced a problem for file upload from linux to windows and windows to linux
    And I have put crossdomain.xml file in root folder, still this problem is appear.
    Please help me, if anybody know the answer.
    Thanks and Regards,
    Senthil KUmar

    Hi Pauley,
    I thought you are moving from unix to windows. Now I got it.
    Make sure that the folder is shared and have necessary permissions. Please see few suggestions here:
    Re: NFS or FTP for file on Ip 10.x.y.z
    Regards,
    ---Satish

  • Printing format problem from Linux GUI

    Hi!
    We have configured Printer for Linux Clients with "U" access method and users are able to take print out through Linux GUI.  However, the printout is not in desired format.  For example, PO printout has rows, columns, lines, borders, etc. which are printed correctly through Windows Printer. But when we take printout from Linux, lines, borders, logos, etc. are not printed, and only raw printout is fired.
    I believe some ABAP development has to be done. Can anybody help in this regard please.
    Regards,
    Pankaj

    hi pranav,
    ABAP-ers usually create those program (smartforms or ALV list) using SAPGUI for Windows so if you switch print them using SAPGUI for Java it's going to be different either print out nor print preview.
    I used different technique so that my Linux client can print program (that had been created using SAPGUI for Windows) without changing any code on the program.
    ardhian
    http://sapbasis.wordpress.com

  • Runtime.getRuntime().exec problem with linux script.

    Hello,
    I try to start a script under Linux RedHat 9. This script must just create another file.
    I work with JDK 1.4.1_02b06.
    If I use the next command
    process = Runtime.getRuntime().exec("/temp/myScript.sh");
    This is not working. I script file is existing otherwise I receive an error. I don't understand why the script is not executed!
    I have check some other posts in this forum but I cannot find the solution.
    Thanks in advance for your help.
    Alain.

    Try running it with sh: Runtime.getRuntime().exec("sh /temp/myScript.sh");

  • Problem from shell script to java class

    Hello All,
    I have a shell script (P.sh) which is having the following code.
    . setEnv
    echo first param: $1;
    echo second param: $2;
    runClient Abc $1 $2
    If in Abc class I write the following code.
    System.out.println("Arg length " + args.length);
    It gives me Arg length as 1 even though on command line I write
    P.sh a b
    Why am I getting the error that is not getting the second argument?
    Hoping for a reply.
    Thanks and regards,
    Sachin

    it is java command written in a different fileI don't understand. Is it yet another script or a renamed java executable?

  • Duplicate database from Linux to sun

    Hi All,
    RMAN duplicate database from Linux 5.2 (Tikanga) to sun 5.9 is possible, please share link or doc.

    Thanks for reply.
    But confused to Capture ENDIAN_FORMAT
    1-
    uname -a gives below SUN OS detail,
    SunOS 5.9 Generic_122300-51 sun4u sparc SUNW,Sun-Fire-V490
    and in oracle i am getting below 4 records,so please help me which would be my SUN flavour from below list.
    PLATFORM_NAME ENDIAN_FORMAT
    Solaris[tm] OE (32-bit) Big
    Solaris[tm] OE (64-bit) Big
    Solaris Operating System (x86) Little
    Solaris Operating System (x86-64) Little
    2-
    uname -a
    Linux *** 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:15 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
    SQL> select platform_name, endian_format from V$TRANSPORTABLE_PLATFORM where platform_name like '%Linux%';
    PLATFORM_NAME ENDIAN_FORMAT
    Linux IA (32-bit) Little
    Linux IA (64-bit) Little
    Linux x86 64-bit Little
    please help me which would be my Linux flavour from above list.

  • How can you detect (from a script file) that javac found problems?

    The subject line says it all, but the background is:
    I have a script file (.bat, since am stuck on windoze for the moment) which is doing some compilation using javac.
    I would like to skip all subsequent activities in the script file after the call to javac if any file failed to compile.
    So, what can I use as a signal from javac that it found a problem?
    I initially tried detecting an exit code from javac that was non zero, but javac does not seem to emit such an exit coe when it objects to a file (it still returns with 0 as an exit code).
    The only remaining strategy that I can think of is to pipe javac's output to a file, and if there is any content in it then assume that it indicates an error and use that as a signal.
    This is suboptimal because it will give false signals for mere warnings, so if anyone has a better suggestion, please post

    You are right: it appears that javac does exit with an exit code of 1 if an error is detected in one of the files being compiled, at least on the windows jdk.
    To prove this, create an arbitrary java source file called HelloWorld.java, and create a msdos .bat file in the same directory that looks like
    @echo on
    javac  -Xlint:deprecation  HelloWorld.java
    :handleError
    @if not errorlevel 1 goto finalActions
    @echo ERROR DETECTED: compile.bat will TERMINATE PREMATURELY
    :finalActions
    @echo compile.bat now terminatedBy playing around with what you put in the source file (totally clean code, stuff that should compile but issue a warning, and garbage that should not compile) as well as with the exit code value detected by the .bat file, for instance trying
    @if not errorlevel 2 goto finalActions(see http://www.robvanderwoude.com/errorlevel.html if you need some documentation on error codes in dos bat files), I have determined the following as javac's behavior on windows:
    If code is pristine, exit code = 0.
    If code causes javac to emit a warning but is compilable, exit code = 0.
    If code cannot be compiled, exit code = 1.

  • Problem while calling concsub from shell script

    Hi All,
    I am facing problem when I am trying to run CONCSUB utility from shell script.The same works well when I try it from command line.The only prob I am facing from shell script is assigning values to temporary variables.
    This is how my script looks
    #!/bin/bash
    export PARM5="$5"
    export PARM6="$6"
    export PARM7="$7"
    echo "INTPARM5=\"$PARM5\""
    echo "INTPARM6=\"$PARM6\""
    echo "INTPARM7=\"$PARM7\""
    echo $FND_TOP/bin/CONCSUB $1 ONT 'Order Management Super User, Vision Operations (USA)' $3 WAIT=Y CONCURRENT ONT $PROGRAM "$INTPARM5" "$INTPARM6" "$INTPARM7"When I try to run the above shell based concurrent program it doesn't pass the parameters as expected and it errors out saying "Wrong number of arguments to call the procedure"
    I tried my luck from some of the previous posts ({thread:id=2360776} ),but to vain
    If anyone has any ideas,please suggest!!
    Thanks in advance!!
    Edited by: sandy on May 4, 2013 12:54 PM

    Here are your proofs
    Proocedure
       PROCEDURE abc(--p_errbuf            OUT   VARCHAR2,
                                                --p_errcode           OUT   VARCHAR2,
                                 p_order_no          IN    NUMBER DEFAULT NULL,
                                                p_customer_id       IN    NUMBER DEFAULT NULL,
                                 p_name              IN    VARCHAR2 DEFAULT NULL
          IS
                    v_cname    VARCHAR2(200);
               v_ordered_date DATE;
               v_order_number  NUMBER;
              v_order_type    VARCHAR2(200);
    BEGIN
                fnd_file.put_line(fnd_file.output, 'Begin Execution');
       SELECT DISTINCT ac.customer_name,
                    d.ordered_date ordered_date,
                    d.order_number order_number,
                    x.NAME order_type
            INTO   v_cname
               ,v_ordered_date
               ,v_order_number
               ,v_order_type
               FROM oe_order_headers_all d,
                    oe_transaction_types_tl x,
                    wsh_delivery_details b,
                    wsh_delivery_assignments c
                    ,ar_customers ac
              WHERE 1 = 1
                AND ac.customer_id = b.customer_id
                AND d.order_type_id = x.transaction_type_id
                AND x.LANGUAGE = 'US'
                AND b.released_status = 'B'
                AND b.source_header_id = d.header_id
                AND c.delivery_detail_id = b.delivery_detail_id
                AND d.order_number=NVL(p_order_no,d.order_number)
                AND ac.customer_id = NVL(p_customer_id,ac.customer_id)
             AND x.name=NVL(p_name,x.name)
                AND NOT EXISTS (SELECT 1
                                FROM wsh_delivery_details b
                               WHERE 1 = 1
                                      AND b.released_status != 'B'
                                      AND b.source_header_id = d.header_id)
                                       --BETWEEN ('1213794') and ('1213797'))
                AND rownum<2;
            INSERT INTO xxc_temp(customer_name,ordered_date,order_number,order_type) VALUES(v_cname,v_ordered_date,v_order_number,v_order_type);
            COMMIT;
             fnd_file.put_line(fnd_file.output, 'Order Number is' || v_order_number);
             fnd_file.put_line(fnd_file.output, 'Order Type is'   || v_order_type);
       END;Script
    #!/bin/bash
    set -x
    export PARM5="$5" 
    export PARM6="$6"
    export PARM7="$7"
    sqlplus -s $1 <<EOF
    set head off feed off serverout on size 1000000
    exec abc('$PARM5','$PARM6','$PARM7');
    exit
    EOFNow when I run the 'XX Order Detail CSV Report' I get the below log and no Output
    +---------------------------------------------------------------------------+
    Application Object Library: Version : 12.0.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    XXKES_PDF_TRANSFER module: XX Order Detail CSV Report
    +---------------------------------------------------------------------------+
    Current system time is 06-MAY-2013 05:05:56
    +---------------------------------------------------------------------------+
    + export PARM5=66432
    + PARM5=66432
    + export PARM6=
    + PARM6=
    + export PARM7=Mixed
    + PARM7=Mixed
    + sqlplus -s APPS/APPS
    +---------------------------------------------------------------------------+
    Executing request completion options...
    Output file size:
    0
    +------------- 1) PRINT   -------------+
    Disabling requested Output Post Processing.  Nothing to process.  The output of the request is zero byte.
    +--------------------------------------+
    Finished executing request completion options.
    +---------------------------------------------------------------------------+
    Concurrent request completed successfully
    Current system time is 06-MAY-2013 05:05:56
    +---------------------------------------------------------------------------+After the concurrent program executed I queried the table xxc_temp and here you see the data
    SQL> select * from xxc_temp;
    CUSTOMER_NAME
    ORDERED_D ORDER_NUMBER ORDER_TYPE
    A. C. Networks
    18-FEB-13        66432 MixedMy procedure fetches the data fro given set of i/p parameters but it doesn't give o/p coz it's a host based conc program.Please advise if there's a way to get the o/p in a host based conc program
    Thanks!!

  • Problem executing Unix script from Java...

    Hi there, I'm having trouble executing a unix script from a java program. The script receives multiple parameters and it seems that one of them ( or more ) is not well interpreted. When I run the script directly from a shell, the script executes without any errors. But, when I run the exact same script with the exact same parameters, it does not work.
    Here is the command to execute the script with all the parameters that is executed from the shell ( with success ) and also from the java program ( with errors ):
    /z/opus/dcap/intfu001.csh 'NODEBUG^NOTKPROF^NOSTACK' opus dcap JACQUES JACQUES '2625781' 'ORA$PIPE$001D00D70001' JOB^DEBUG^SINISIMU^STATPROD^DECTIDANC^81^503^4080^86^87^151^97^98^99 BUT^N^N^SPRI^0^13^24^3^J^05^N^19^19^19 >> /tmp/switcher8.999.null.pgm.test
    And here is my portion of code that executes the script:
    Runtime wShell = Runtime.getRuntime();
    Process wProc = wShell.exec(cmd_unix_final);
    wProc.waitFor();
    return wProc.exitValue();
    Please give me your thoughts on this!
    Thanks in advance!

    Ok.
    Let's proceed surgically, else we'll never solve or overcome anything.
    In the last your reply you wrote:
    the normal output is what I get when the script runs successfully, the script first prints a few things
    and then does stuff that takes at least 2 or 3 secondsWhat do you mean?
    -Finally have you got your script correctly executed?
    The stuffs you spoke of are really performed?
    If this is the case I can't see the prob.
    Is your concern only about exitValue() for it doesn't let you distinguish programmatically
    the success or failure of the script execution?
    Of course you surely already have a routine in your java code to handle
    exceptional situations of errors from the script.
    And the "normal output" is just what you must parse to detect those errors.
    Then who cares about exitValue() in this case?
    Don't invoke it, relay on the stdout and stderr of the script.
    -Or you get only a deceiving standard output
    that let you think the script execution went alright, while instead it didn't.
    In this case we have to investigate some other thing.
    I can't still exclude that the problem isn't related with the buffer size of the stdout
    allocated by the environment to the subprocess. You spoke of few things printed out.
    Be explicit. What's the size of the output you get?
    And is the "normal output" complete till the very last char
    or is it truncated from somewhere on?
    Also it's important that you hit a ps command after the java main process terminates
    (or simply when waitFor() returns) and see if the script subprocess hung up.
    As an alternative approach directly call your pro*C code from Java through JNI, instead of translating it.
    1. Exec.java
    public class Exec{
         static{
              System.loadLibrary("Exec");
         public static native void proCFunct();
         public static void main( String[] args){
              proCFunct();
    }2. javac Exec.java
    3. javah Exec
    4.Exec.c
    #include "Exec.h"
    JNIEXPORT void JNICALL Java_Exec_proCFunct(JNIEnv * a, jclass b){
         //here call the function that executes the script
    5. cc -G -I$JAVA_HOME/include -I$JAVA_HOME/include/solaris -I$YOUR_INCLUDES Exec.c -o libExec.so
    6. setenv LD_LIBRARY_PATH .
    7. java Exec

  • Rman of database under Linux from Windows server

    Dear colleagues! I need some help.
    I have Oracle database 10.2.0.1, which works under Linux CentOS. I've just set up rman, to backup this database to local linux partition. Now, i want to adjust rman, so it starts from Windows 2003 ( i've already install Oracle 10.2.0.1 client for Wondows 32-bit) server to backup this database to local Windows folder.Could you please answer, is it possible at all?
    When i try to perform rman from Windows manually i got this errors:
    channel t1: starting piece 1 at 29-APR-10
    released channel: t1
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of backup command on t1 channel at 04/29/2010 03:07:32
    ORA-19504: failed to create file "/u02/app/oracle/product/10.2.0/db_1/dbs/c:123
    bak"
    ORA-27038: created file already exists
    Additional information: 1

    1. You can run the backup from windows server 2003 which take the RMAN backup of your linux server. But this backup can only stored into your linux server.
    2. You can't store the backup set of linux server into windows server.
    Regards
    Asif Kabir
    -- mark your helpful post as correct/helpful.

  • Conditional Exit from the script

    Hi,
    I have to code the script like the below
    --Step 1
    begin
    If <Table1 doesnot exist> then
    Display "User Defined Error Message: Table1 doesnot exit"
    EXIT FROM THE SCRIPT(Below sql should not run)
    endif
    end
    --Step 2
    spool abc.txt;
    select "should not run" from Table1;
    spool off;Step 2 should not run if table1 doesnot exist.
    Can someone please tell how to conditionally exit the script.
    Thanks & Regards,C
    CDPrasad
    Edited by: cdprasad on Aug 12, 2010 1:35 PM
    Edited by: cdprasad on Aug 12, 2010 1:36 PM
    Edited by: cdprasad on Aug 12, 2010 1:38 PM
    Edited by: cdprasad on Aug 12, 2010 1:38 PM

    Hi,
    David is right; SQL*Plus is the wrong tool for this job.
    If you really want to to this in SQL*Plus, you can achieve a crude type of branching by using sub-sripts. Instead of an IF statement, you use START or @ to run one or another of those sub-scripts, based on a substitution variable, which in turn is set by a query.
    For example:
    --     abc.sql - Test if table1 exists, and
    --                     (1) if it exists, run abc_query.sql to do a query
    --                     (2) if it does not exist, run abc_error.sql to display an error message
    --     Preliminary query, to define next_script:
    COLUMN     next_script_col        NEW_VALUE next_script
    SELECT     CASE      COUNT (*)
             WHEN  0  THEN  'abc_error'
                       ELSE  'abc_query'
         END     AS next_script_col
    FROM     all_tables
    WHERE     table_name     = 'TABLE1'
    AND     owner          = 'SCOTT'
    --     Now that we know what to do, do it:
    @&next_scriptYou would run the above script (abc.sql) and it would decide whether to run the script containing you query, or the script that prints an error message.
    Why does table1 sometimes disappear? In a good database design, tables are permanent structures, and get dropped only when they are obsolete. Perhaps you should be TRUNCATing the table, not dropping it.

  • Urgent Problem in Executing perl script from shell script

    Hello,
    I've a shell script on one server (source) and a perl script on another (target).
    My perl script will check whether the directoryname, filename provided by shell script exists on the target server or not.
    My shell script is as follows:
    #! bin/bash
    cmd=`ssh user@target "perl /home/user/test_dir/validate_file.pl"`
    echo $cmd
    And my perl script uses a package CU_Functions.pm, which is in the same directory as the perl script on the target server.
    But when I invoke the perl script from shell script, I get the following error:
    Source:user> (db:ias10g12_mid_db) /home/user/perl
    $ sh /home/user/arcs/arcs_conn.sh
    user@target's password:
    Can't locate CU_Functions.pm in @INC (@INC contains: /local/perl-5.6.1/lib/5.6.1/i686-linux /local/perl-5.6.1/lib/5.6.1 /local/perl-5.6.1/lib/site_perl/5.6.1/i686-linux /local/perl-5.6.1/lib/site_perl/5.6.1 /local/perl-5.6.1/lib/site_perl .) at /home/user/test_dir/validate_file.pl line 13.
    BEGIN failed--compilation aborted at /home/user/test_dir/validate_file.pl line 13.
    Please let me know if I need to do any configurations prior to call the perl script.

    As for the Perl INC, I cannot recall the environment variable that sets that but the following example should work:
    ssh user@host "export ENV_VAR=/path/to/include/files:$ENV_VAR ; /full/path/to/script"

  • Migrating network from Linux to Apple

    I am new to the Apple world (first post ) and I would like advice on the best way to reconfigure my network from a Linux based "do-it-yourself" to an easier Apple happy network, reusing as much exsisting hardware as possible.  I have 150GB of media data excluding the many DVD's I want to digitize (this should easily exceed 500GB once completed) so it is available to all apple devices.  I have a 500GB HDD Mac mini, small USB 500GB HDD, Linux server with 2 x 500GB HDDs, my old gaming Windows PC with a 500GB HDD, and various apple products that access the media.  The mac mini will be the central Apple media computer but I want to back it up using Time Machine and need to store the movies on an external disk in a way that does not break the media sharing, like Apple TV.
    My questions are,
    1. Should I store the extra movies on the 500GB USB HDD and then use the Linux server as a SAMBA share for Time Machine, or vice versa?
    2. Given the hardware I have, how would you set-up the home network? 
    Again, my goals are to provide an immediate back-up (time machine) and a 3rd back-up that protects against fire, flood, or natural disaster.  I want to avoid issues where I am writing scripts again.  I am an engineer that is used to manually configuring all of this but am also getting older am having less patience.  This is what caused me to buy the Mac Mini in the first place. 
    Thank you in advance for detailed advice/discussion,
    -AR

    Hi,
    You should be OK to do this since export/import works well cross-platform, providing you are on roughly the same version of the database - I doubt that you would have any major problems from 9.2.0.4 to 9.2.0.7.
    If you are doing a full export/import and you are relying on the import to create tablespaces and datafiles, then you will need to make sure that your HP server has the same filesystem layout or you will get failures.
    What I have tended to do when doing migrations like this is to pre-create the database on the target server (i.e. create the database and all the tablespaces and datafiles) and then import the relevant user schemas (you might want a first pass which is a full import but without inserting data so that all users get created). Assuming that your database is in good shape and no user objects are owned by SYS or SYSTEM, it should be fine.
    Probably the best advice I can give is to make sure that you give yourself time to run through (i.e. practice) the migration a few times so that you are sure of the process before doing it 'for real'.
    Cheers,
    R

  • Unable to run admsi.pl from Linux console after 7305220 PATCH FOR R12.AD.A.

    Looks like they do not want you running admsi.pl directly from linux console sessions as of AD.A.6:
    my $DISPLAY= $ENV{'DISPLAY'};
    if(($DISPLAY eq "") || ($DISPLAY eq ":0.0")){
    print "Please set the DISPLAY variable and re-run this script\n";
    exit 1;
    I had to comment out the exit 1; line as xterm would only display xclock with DISPLAY=:0.0.

    Looks like they do not want you running admsi.pl directly from linux console sessions as of AD.A.6:
    my $DISPLAY= $ENV{'DISPLAY'};
    if(($DISPLAY eq "") || ($DISPLAY eq ":0.0")){
    print "Please set the DISPLAY variable and re-run this script\n";
    exit 1;
    I had to comment out the exit 1; line as xterm would only display xclock with DISPLAY=:0.0.

  • RMAN exited with return code '3' ?

    I get message bellow while oracle backup to the tape.
    (2960) Launching backup process
    (2960) Backup process failed: RMAN exited with return code '3'.
    (2960) nwora_nsrnmostart_rman: RMAN script execution is not successful. RMAN exited with return code '3'.
    There is no description for the code '3'. I think it is networker license problem but i am not sure.
    Any advice ?

    Thank you,
    yes i am. I have 10 clients and they are working fine.
    I think problem is that i have just one license of oracle module for windows. Another windows client is set and working. I can't find any documentation related to error code '3'.
    a test rman script is very simple:
    connect target sys/*****
    connect rcvcat rman/***@vas
    run {
    allocate channel d1 type 'sbt_tape';
    release channel d1;
    I get no errors in rman. It just stops at allocate channel d1 type 'sbt_tape';
    error is stored in NSR log file.

Maybe you are looking for