My cold backup shell script not working

I have written a shell script for cold backup but. It says that line 42 has unexpected syntex error '{' and line 57 unexpected end of file. Please help
BKUP_DIR=/u03/backups/abu/nightly_backup
LOG_FILE=/u03/backups/abu/backup.log
ORACLE_HOME= /u01/app/oracle/product/10.2; export ORACLE_HOME
ORACLE_SID=SEED; export ORACLE_SID
PATH="$PATH:$ORACLE_HOME/bin";export PATH
# Execute the backup procedure
echo ymd=`date +%Y%m%d` >> $LOG_FILE
echo "Database BACKUP starting." >> $LOG_FILE
ORACLE_HOME=/u01/app/oracle/product/10.2; export ORACLE_HOME
ORACLE_SID=SEED; export ORACLE_SID
PATH="$PATH:$ORACLE_HOME/bin";export PATH
rman target=/ << EOF
shutdown immediate
EOF
if [ $? -eq 0 ]
then
mkdir -p ${BKUP_DIR} # make directory
echo "Database shut down.">> $LOG_FILE
else echo "not shutdown".>> $LOG_FILE
fi
if [ ! -d ${BKUP_DIR} ]
then
echo "Not a directory: ${BKUP_DIR}">> $LOG_FILE
exit 1
fi
echo "Previous Backup is being removed." >> $LOG_FILE
rm ${BKUP_DIR}/${ymd-${seed}.gz >>$LOG_FILE
echo "Cold backup being performed." >> $LOG_FILE
cp /u01/app/oracle/admin/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz #copying database files into new dir
cp /u02/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz
cp /u03/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz
echo "Cold backup of archive logs being performed." >> $LOG_FILE
mv /u01/app/oracle/product/10.2/dbs/arch/* ${BKUP_DIR}/$ymd-${cmsv}.gz
gzip ${BKUP_DIR}/$ymd-${cmsv}
echo "Restarting Database" >> $LOG_FILE
rman target=/ << EOF
startup
EOF
else
echo "Database will NOT start up." >> $LOG_FILE
fi
echo 'ymd='date +%Y%m%d' >> $LOG_FILE
echo "Database BACKUP has completed." >> $LOG_FILE
exit

I trying to write that script for our new production database. My script will create a folder automatically and will copy all database files into the folder. Now my script dont copy the files into the direcory that automatically create. I want my directory name with timestamp that i already speciy in my code. The scripts now generate an error that now such files or directory. I mean when it tries to copy files from source to destination folder. Please give me some suggestions.
if [ $? -eq 0 ]
then
mkdir -p ${BKUP_DIR} # make directory
echo "Database shut down.">> $LOG_FILE
else echo "not shutdown".>> $LOG_FILE
fi
if [ ! -d ${BKUP_DIR} ]
then
echo "Not a directory: ${BKUP_DIR}">> $LOG_FILE
exit 1
fi
echo "Previous Backup is being removed." >> $LOG_FILE
rm ${BKUP_DIR}/${ymd-${seed}.gz >>$LOG_FILE
echo "Cold backup being performed." >> $LOG_FILE
cp /u01/app/oracle/admin/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz #copying database files into new dir
cp /u02/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz
cp /u03/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gzecho "Cold backup of archive logs being performed." >> $LOG_FILE

Similar Messages

  • Cold backup shell scripts

    Could anyone please send me Shell script for taking Cold backups on solaris
    The script will be run and will start taking backup
    if possible Automatically it will Down and UP the Database
    Thanks
    Mark

    I'm sure that a short google search should find some example for you.
    Here some scripts :
    http://orafaq.com/scripts/
    http://www.dbasupport.com/oracle/scripts/Backup_Recovery/
    But, that would be better to google for more results :
    http://www.google.fr/search?q=oracle+script+backup&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:fr:official
    Nicolas.

  • Shell script not working

    Hi
    All,
    I have oracle 9i and 10g on unix. now i have 920.env and 1020.en file to set p respective enviornment.
    when I excecute this commnad
    . $HOME/920.env from the shell prompt it is working fine. and also same for 1020.env .
    Now same command . $HOME/920.env i am putting in shell script and trying to execute that script but it is not executing.
    i don't know what to do.
    Thank you
    vishal

    now as i understand that statement is executing but it's scope is only with in the script. when it complete it's execution all varialble reset to it's by defualt .profile so that statement in the script set variable with in the scope of the script only.
    Thanks for your help
    Vishal

  • Hardcode password in a do shell script not working

    I have been trying to solve something i have wanted to do for a long time, that is get a script that changes the ammount of time before the display goes to sleep. I tried GUi scripting but in system preferences the changes made to the slider did not stay. So i have now come onto a do shell script. Found below. I would prefer to just hardcode my password into it however this does not seem to work. Any ideas ?
    set exitflag to false
    try
    repeat until exitflag is true
    set {text returned:Sleeptime, button returned:sleepstate} to (display dialog "Minutes before display sleep" & return & "Between 1 and 180 mintues" & return & "Greater than 180 means never sleep" default answer "1" buttons {"Cancel", "OK"} default button 2)
    set Sleeptime to Sleeptime as number
    if Sleeptime is less than 1 then
    set exitflag to false
    else if Sleeptime is greater than 180 then
    set Sleeptime to 0
    set exitflag to true
    else
    set exitflag to true
    end if
    end repeat
    end try
    set Sleeptime1 to Sleeptime as string
    set Sleeptime1 to quoted form of Sleeptime1
    set psswd to quoted form of "XXXXX"
    do shell script "sudo pmset -a displaysleep " & Sleeptime1 password psswd
    set pete to do shell script "sudo pmset -g"
    set xx to text -2 thru -1 of pete
    if xx - Sleeptime = 0 then
    tell application "SEC Helper"
    show screen message "Worked:" & return & xx & " mintues"
    end tell
    else
    tell application "SEC Helper"
    show screen message "Failed!"
    end tell
    end if

    1) don't use 'sudo' in a 'do shell script'. It isn't necessary and will sometimes break.
    2) do not use 'sudo' in a 'do shell script'
    3) do not use... I'm sure you get the idea.
    It is not necessary to use 'sudo' in a 'do shell script' command. 'do shell script' itself takes care of the authentication element when you use 'with administrator privileges'. Therefore the appropriate way of doing this is:
    <pre class=command>do shell script "pmset -g displaysleep " & sleeptime1 with administrator privileges password psswd</pre>
    If you omit the 'password psswd' element the user will be prompted to authenticate using the standard system authentication dialog.
    The problem you're running into is that the 'password' parameter is only valid when you use 'with adminitrator privileges', and is therefore getting ignored in your current script.

  • Process Flow - User Defined object calling Unix Shell script not working

    Hi, I have a User Defined Object in a Process Flow with the following parameters :-
    Command: /usr/bin/ksh
    Parameter List:
    Result Code:
    Script: cd /shell_scripts
    ./dwh_get_datafile.sh param1 param2 param3
    Success Threshold: 0
    The script executes but it does not correctly interpret all the Unix commands within it e.g command such as FTP, DATE, GREP etc.
    In the job details I can see :-
    ./dwh_get_datafile.sh: date: not found
    ./dwh_get_datafile.sh: ftp: not found
    ./dwh_get_datafile.sh: grep: not found
    ./dwh_get_datafile.sh: rm: not found
    ./dwh_get_datafile.sh: ls: not found
    ./dwh_get_datafile.sh: awk: not found
    Anyone know what I have done wrong ?
    The script runs fine when run as a Unix script while logged into Telnet.
    Thanks.
    Paul

    The shell script is executed by the oracle user in the unix environment so make sure that the directorie where you can find the unix commands exists in the path for the oracle user in .profile as you can se in my example below.
    PATH=$PATH:$ORACLE_HOME/bin:$OWBHOME/bin:/ASW/ora_script:/local/bstat:/usr/bin:/opt/bin:/usr/local/bin; export PATH
    /JZ

  • Connect internal in shell script not working

    Oracle: 11.2.0.1 in AIX env
    I export ORACLE_SID and then try to connect internal but I get connected to idle instance. What am I missing???
    this block is in a .sh script
    export ORACLE_SID=ufms203
    $ORACLE_HOME/bin/sqlplus /nolog <<EOF
    connect / as sysdba
    WHENEVER SQLERROR EXIT;
    select instance_name from v$instance;
    OUTPUT *********************
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Mar 29 09:43:05 2011
    Copyright (c) 1982, 2009, Oracle. All rights reserved.
    SQL> Connected to an idle instance.
    SQL> SQL> SQL> select instance_name from v
    ERROR at line 1:
    ORA-01034: ORACLE not available
    Process ID: 0
    Session ID: 0 Serial number: 0
    Disconnected

    The instance is started:
    k801ora@jd1su143 in /a0143/d01/scripts : ps -ef | grep ufms203
    k801ora 8794340 1 0 12:32:46 - 0:00 oracleufms203 (LOCAL=NO)
    k801ora 8929434 1 0 09:33:52 - 0:00 ora_w001_ufms203
    k801ora 10248348 1 0 Mar 22 - 2:24 ora_pmon_ufms203
    k801ora 10359024 1 0 Mar 22 - 0:15 ora_gen0_ufms203
    k801ora 10379478 1 0 Mar 22 - 7:50 ora_vktm_ufms203
    k801ora 10399748 1 0 Mar 22 - 0:40 ora_dbw0_ufms203
    k801ora 10408158 1 0 Mar 22 - 1:19 ora_psp0_ufms203
    k801ora 10420478 1 0 Mar 22 - 0:16 ora_mman_ufms203
    k801ora 10428426 1 0 Mar 22 - 0:16 ora_diag_ufms203
    k801ora 10436840 1 0 Mar 22 - 0:17 ora_dbrm_ufms203
    k801ora 10440938 1 0 Mar 22 - 12:00 ora_dia0_ufms203
    k801ora 10445048 1 0 Mar 22 - 2:51 ora_ckpt_ufms203
    k801ora 10449134 1 0 Mar 22 - 0:38 ora_dbw1_ufms203
    k801ora 10453232 1 0 Mar 22 - 0:35 ora_dbw2_ufms203
    k801ora 10457330 1 0 Mar 22 - 0:35 ora_dbw3_ufms203
    k801ora 10461428 1 0 Mar 22 - 0:47 ora_lgwr_ufms203
    k801ora 10465530 1 0 Mar 22 - 0:04 ora_reco_ufms203
    k801ora 10469624 1 0 Mar 22 - 0:55 ora_smon_ufms203
    k801ora 10473726 1 0 Mar 22 - 4:42 ora_mmnl_ufms203
    k801ora 10477820 1 0 Mar 22 - 2:43 ora_mmon_ufms203
    k801ora 10485770 1 0 Mar 22 - 0:08 ora_q002_ufms203
    k801ora 10489864 1 0 Mar 22 - 0:07 ora_qmnc_ufms203
    k801ora 10506270 1 0 Mar 22 - 0:04 ora_q000_ufms203
    k801ora 10530842 1 0 Mar 22 - 0:04 ora_q001_ufms203
    k801ora 10588214 1 0 Mar 22 - 0:19 ora_smco_ufms203
    k801ora 11124888 10510484 2 09:54:04 pts/0 0:00 grep ufms203
    k801ora 11796592 1 0 09:35:19 - 0:00 ora_w000_ufms203
    k801ora 12431386 1 0 09:53:53 - 0:00 ora_w002_ufms203
    k801ora 12484794 1 0 12:32:41 - 0:11 oracleufms203 (LOCAL=NO)
    k801ora 16023576 1 0 12:32:04 - 1:12 oracleufms203 (LOCAL=NO)
    k801ora 16629976 1 0 09:25:21 - 0:00 ora_w005_ufms203

  • RMAN backup shell script

    Hi,
    I am trying to setup incremental backup shell script to run anutomatic every night. I am getting below errors when I run script. What am I missing here?
    oradev]/home/oradev ./RMAN_DEV_incr1.sh
    RMAN> exit
    ./RMAN_DEV_incr1.sh[13]: CONFIGURE: not found [No such file or directory]
    ./RMAN_DEV_incr1.sh[14]: CONFIGURE: not found [No such file or directory]
    ./RMAN_DEV_incr1.sh[15]: CONFIGURE: not found [No such file or directory]
    ./RMAN_DEV_incr1.sh[16]: run: not found [No such file or directory]
    ./RMAN_DEV_incr1.sh[17]: ALLOCATE: not found [No such file or directory]
    ./RMAN_DEV_incr1.sh[18]: CROSSCHECK: not found [No such file or directory]
    ./RMAN_DEV_incr1.sh[19]: BACKUP: not found [No such file or directory]
    ./RMAN_DEV_incr1.sh[20]: sql: not found [No such file or directory]
    ./RMAN_DEV_incr1.sh[21]: BACKUP: not found [No such file or directory]
    ./RMAN_DEV_incr1.sh[22]: BACKUP: not found [No such file or directory]
    ./RMAN_DEV_incr1.sh[23]: CROSSCHECK: not found [No such file or directory]
    ./RMAN_DEV_incr1.sh[24]: DELETE: not found [No such file or directory]
    ./RMAN_DEV_incr1.sh[25]: DELETE: not found [No such file or directory]
    ./RMAN_DEV_incr1.sh[26]: RELEASE: not found [No such file or directory]
    ./RMAN_DEV_incr1.sh: line 26: syntax error at line 27: `}' unexpected
    ==============
    Here is copy of my shell script:
    #!/bin/ksh
    # Declare your ORACLE environment variables
    export ORACLE_SID=DEV
    export ORACLE_BASE=/d01/oracle/DEV
    export ORACLE_HOME=/d01/oracle/DEV/db/tech_st/11.1.0
    export PATH=$PATH:${ORACLE_HOME}/bin
    # Start the rman commands
    rman target / msglog=/d01/RMAN/logs/rman_INCR_1_${ORACLE_SID}_${DATE}.log
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/d01/RMAN/autobackup_control_file%F';
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
    run {
    ALLOCATE CHANNEL RMAN_BACK_CH01 TYPE DISK;
    CROSSCHECK BACKUP;
    BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 1 DATABASE FORMAT '/d01/RMAN/databasefiles_%d_%u_%s_%T';
    sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
    BACKUP AS COMPRESSED BACKUPSET ARCHIVELOG ALL FORMAT '/d01/RMAN/archivelogs_%d_%u_%s_%T' DELETE INPUT;
    BACKUP AS COMPRESSED BACKUPSET CURRENT CONTROLFILE FORMAT '/d01/RMAN/controlfile_%d_%u_%s_%T';
    CROSSCHECK BACKUP;
    DELETE NOPROMPT OBSOLETE;
    DELETE NOPROMPT EXPIRED BACKUP;
    RELEASE CHANNEL RMAN_BACK_CH01;
    EXIT;
    EOF
    #

    Hi,
    You missed to redirect the rman command
    rman target / msglog=/d01/RMAN/logs/rman_INCR_1_${ORACLE_SID}_${DATE}.log <<eof
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/d01/RMAN/autobackup_control_file%F';
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
    run {
    ALLOCATE CHANNEL RMAN_BACK_CH01 TYPE DISK;
    CROSSCHECK BACKUP;
    BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 1 DATABASE FORMAT '/d01/RMAN/databasefiles_%d_%u_%s_%T';
    sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
    BACKUP AS COMPRESSED BACKUPSET ARCHIVELOG ALL FORMAT '/d01/RMAN/archivelogs_%d_%u_%s_%T' DELETE INPUT;
    BACKUP AS COMPRESSED BACKUPSET CURRENT CONTROLFILE FORMAT '/d01/RMAN/controlfile_%d_%u_%s_%T';
    CROSSCHECK BACKUP;
    DELETE NOPROMPT OBSOLETE;
    DELETE NOPROMPT EXPIRED BACKUP;
    RELEASE CHANNEL RMAN_BACK_CH01;
    EXIT;
    EOF
    #

  • Iphone 6 backup to iCloud not working

    Initially I had the issue where my phone was restoring from iCloud for 2 weeks and never finished. I was unable to do the upgrade to 8.1 because of this, so I canceled the restore and tried to do a backup to iCloud. I let it run (Estimating time remaining...) for a long time, like 30 minutes or something. Each time I tried this it would error off saying it couldn't finish the operation. One time it said it was going to take 2 days to complete the backup, but then it errors off as just mentioned. So I did a google search for "iPhone 6 backup to iCloud not working" and found a link to the forums for the incessant restore issue, it said to do a manual backup through iTunes, then immediately do a restore, then do the upgrade to 8.1.
    However, I still have the issue of the backup taking forever.
    Anyone encounter this issue and find a fix?
    Many thanks.

    I suggest you contact Apple Support.

  • HT1766 I backed up to my PC and attempted restore but I keep getting an error message that "iTunes could not restore the iPhone because not enough free space is available." I have a 32GB iPhone; only 13GB used!!!  HELP!  iCloud backup/restore did not work

    I backed up to my PC and attempted restore but I keep getting an error message that "iTunes could not restore the iPhone because not enough free space is available." I have a 32GB iPhone; only 13GB used!!!  HELP!  iCloud backup/restore did not work either! How can I resolve this problem to restore from back up.

    If you're not a developer then you really should not have upgraded.
    I'm unsure how you can fix this as you have already done a back-up on iOS 7 and apple don't support firmware downgrades.

  • Modify shell script to work with other folders

    i am trying to modify a shell script that sorts files in a course folder into sub folders by month. I have a shell script that works, but when i try to modify it for another course folder it quits working. can someone let me know what i am doing wrong?
    the working shell script:
    do shell script "
    for f in \"$HOME/Desktop/DWI Annual Report/\"*
    do if [ ! -d \"$f\" ]; then
    x=\"${f%%.*}\"
    i=$((${#x}-3))
    if [ -d \"$HOME/Desktop/DWI monthly/${f:$i:3}\" ]; then
    mv \"$f\" \"$HOME/Desktop/DWI monthly/${f:$i:3}\"
    fi
    fi
    done"
    the nonworking modified script:
    do shell script "
    for f in \"$HOME/Desktop/DOEP Annual Report/\"*
    do
        if [ ! -d \"$f\" ]; then
            x=\"${f%%.*}\"
            i=$((${#x}-3))
            if [  -d \"$HOME/Desktop/DOEP monthly/${f:$i:3}\" ]; then
                mv \"$f\" \"$HOME/Desktop/DOEP monthly/${f:$i:3}\"
            fi
        fi
    done"

    ok here is the applescript that works.
    property total_student : 1
    tell application "Finder"
      set master_path to alias "Users:macbook:Desktop:DWI Annual Report:Annual Report.xlsx"
      set filesWithDWI to get every file of folder ((path to desktop folder) & "DWI Annual Report" as string) whose name contains "DWI"
      repeat with f in filesWithDWI
      my transfer_data(f, master_path)
      end repeat
    end tell
    on transfer_data(child_path, master_path)
      tell application "Microsoft Excel"
      set child_book to (open workbook workbook file name (child_path as string))
      set child_doc to worksheet 1 of child_book
      set master to worksheet "sheet 1" of (open workbook workbook file name (master_path as string))
      set num to 15 --All lists start at index 12 or later, I'm putting 10 to be safe
      set students to {}
      tell child_doc --grab values from child document
      repeat until (value of cell (("A" & num) as string)) is 1
      set num to num + 1
      end repeat
      repeat until (value of cell (("B" & num) as string)) is ""
      set end of students to {namevalue of cell (("B" & num) as string)), driver_idvalue of cell (("C" & num) as string)), DOBvalue of cell (("D" & num) as string)), Ref_Recvalue of cell (("I" & num) as string)), pre_testvalue of cell (("J" & num) as string)), post_testvalue of cell (("K" & num) as string)), cert_idvalue of cell (("L" & num) as string))}
    set num to num + 1
      end repeat
      set startdate to range "C7"
      set classlocation to range "C11"
      set instructor to range "H7"
      end tell
      tell master
      set num to 7
      log (value of cell (("B" & num) as string))
      repeat until (value of cell (("B" & num) as string)) is ""
      set num to num + 1
      end repeat
      repeat with student in students
      set value of cell (("A" & num) as string) to total_student
      set value of cell (("B" & num) as string) to name of student
      set value of cell (("C" & num) as string) to driver_id of student
      set value of cell (("D" & num) as string) to DOB of student
      set value of cell (("H" & num) as string) to pre_test of student
      set value of cell (("I" & num) as string) to post_test of student
      set value of cell (("J" & num) as string) to cert_id of student
      set value of cell (("f" & num) as string) to startdate
      set value of cell (("E" & num) as string) to classlocation
      set value of cell (("G" & num) as string) to instructor
      set value of cell (("K" & num) as string) to Ref_Rec of student
      set num to num + 1
      set total_student to total_student + 1
      end repeat
      end tell
      save child_book
      close child_book
      save active workbook in master_path
      close active workbook
      end tell
    end transfer_data
    do shell script "
    for f in \"$HOME/Desktop/DWI Annual Report/\"*
    do
        if [ ! -d \"$f\" ]; then
            x=\"${f%%.*}\"
            i=$((${#x}-3))
            if [  -d \"$HOME/Desktop/DWI monthly/${f:$i:3}\" ]; then
                mv \"$f\" \"$HOME/Desktop/DWI monthly/${f:$i:3}\"
            fi
        fi
    done"
    It takes the class rosters and copies the information from the class roster to the annual report and then moves the file to the monthly  folder and files it in the appropriate months folder based on the last three letters of the file name.

  • Cold backup automated script

    Hi--
    Can any one provide me one cold backup script,,with that i need to delete 2 days old backup and need to put current backup in that mountpoint.
    Thanks in advance.

    user8683962 wrote:
    We are not using RMAN So what is preventing you from starting? The real value of rman will be when you have to recover, it will already know where all the necessary peices are and what needs to be done. Plus, it will take care of the housekeeping of deleting your old, obsolete backups.
    and Hot backups.....So you don't care if you lose any changes that occur between your cold backups?
    i want to take a cold backup of my database every day and delete need to delete 2 days old backup, so that i can maintain 2 backups(today's and yesterday's) in my hand... Again, rman will do this for you, and more, and much more simply
    for this can any one provide me a script to make it automate by adding to crontab.If someone else hasn't by the time I get back to my hotel room this evening, I'll post an rman solution. It is a waste of time to work on a non-rman solution.

  • Powershell unzip with shell.application not working when launched from windows service

    I have a deployment agent on a machine implemented as a windows service. Service is 32-bit and runs on windows server 2008R2 x64 SP1 with powershell V2. Powershell script requires elevation and to run under x64 because of dependency to powershell module
    'IIS Administration'. To achieve this, the service starts a cmd file which in turn launches powershell x64 console:
    C:\WINDOWS\sysnative\WindowsPowerShell\v1.0\powershell.exe "Start-Process C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell -ArgumentList '-ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File C:\Temp\EndJobCmd\Install.ps1' -Verb RunAs"
    This seems to work well. The problem I have is that the script has a sequence where it unpacks a zip file to a destination folder using shell.application, this works fine when triggered manually on the server or through the task scheduler, but when triggered
    from the service it does not extract any files at all (cannot see any errors thrown by the script but it seems to continue to execute as it logs a successful message to the event log after finishing).
    Unzip sequence looks like:
    $shell = New-Object -com shell.application
    $pkg = $shell.namespace($sourceFile)
    $installDir = $shell.namespace($targetDir)
    $installDir.Copyhere($pkg.items(), 20)
    Any advice greatly appreciated. I have searched some and seen a few people with similar issue but have yet to find a solution.

    If it's still actual, I managed to fix this with having CopyHere params equal 1564. 
    So in my case extract zip function looks like:
    function Expand-ZIPFile{
    param(
    $file, $destination
    $shell = new-object -com shell.application
    $zip = $shell.NameSpace($file)
    foreach($item in $zip.items())
    $shell.Namespace($destination).copyhere($item,1564)
    "$($item.path) extracted"
    1564 description can be found here - http://msdn.microsoft.com/en-us/library/windows/desktop/bb787866(v=vs.85).aspx:
    (4) Do not display a progress dialog box.
    (8) Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists.
    (16) Respond with "Yes to All" for any dialog box that is displayed.
    (512) Do not confirm the creation of a new directory if the operation requires one to be created.
    (1024) Do not display a user interface if an error occurs.

  • Shell Script not getting invoked in File adapter

    Hi all,
    Requirement:
    PI need to pick the file from source directory and send it to target directory using SFTP.
    I'm using SCP command for this purpose.
    When I run the shell script (with simple SCP command) from command prompt, script is working fine.
    Same script is called from PI File adapter but script is not getting invoked.
    In the communication channel logs, "Executed OS command" is available. There are no Error/Warning messages in the log.
    NFS transport protocol is used in the File communication channel.
    Complete directory path of the shell script is mentioned in File channel -> Run Operating System command after message processing.
    Even the following simple command is not working from PI receiver file channel:
    echo "Test file" >> /data/test.txt
    Please let me know if I'm missing out something.
    Thanks,
    Geetha

    Hi Geetha,
    I think the syntax u are using is not correct. Please follow the below syntax:
    /path/<script_name> %F
    for ex: /staging/Interface/XI/Script/FTPData %F
    use the above in the communication channel.
    %F should be after a space.
    FTPData is the script name
    /staging/Interface/XI/Script/ is the location where the script is present
    Cheers,
    Souvik
    Edited by: Souvik Chatterjee on Apr 14, 2011 3:38 PM

  • RMAN script not working

    Posting this:
    #!/bin/sh
    ORACLE_SID=DB_NAME
    ORACLE_HOME=/u01/app/oracle/product/ORA9208EE
    export ORACLE_SID ORACLE_HOME
    cd $ORACLE_HOME/bin
    ./rman <<EOF!
    connect target /
    run {
    change archivelog all crosscheck;
    backup database plus archivelog;
    exit;
    set this up under CRON and for some reason, its not firing...any ideas?
    Manual fire works.....cron doesnt......
    Cron does work as I set "mailx" and that sends me mail...
    thanks

    So if works in the shell just not in the cron?
    Sorry, I see the manual works.
    I agree with the profile comment
    Edited by: mseberg on Feb 4, 2011 11:37 AM
    At the top of mine I do this:
    #!/bin/bash
    # Name: db_rman_full.sh
    # Purpose: Database rman backup
    # Usage : db_rman_full <DBNAME>
    *. /u01/app/oracle/dba_tool/env/PRIMARY.env*
    and my PRIMARY.env looks like this:
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=/u01/app/oracle/product/11.2.0
    export ORACLE_SID=PRIMARY
    export ULIMIT=unlimited
    export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib
    export LIBPATH=$LD_LIBRARY_PATH:/usr/lib
    export TNS_ADMIN=$ORACLE_HOME/network/admin
    PATH=$ORACLE_HOME/bin:$ORACLE_BASE/dba_tool/bin:/bin:/usr/bin:/etc:/etc/X11/xserver/C:.
    export BACKUP_DIR=/u01/oradata/PRIMARY_cldbkp
    export PATH

  • Cold backup using script

    Dear all,
    I need a script to take cold backup of oracle database 10.2.0.3.0 .. such that if todays date is 28-oct-08.. then a folder with the name 28oct08 to be created in the backup location.then using the script user should login to the database shutdown the db and listener and make sure this is completely down and copy the complete oracle files and home location to the above mentioned folder in the server.. any links or points will help a lot ?
    Kai

    Kai, rather than write a script to perform a cold backup for whatever platform you are on I suggest you write a script to generate the cold backup script. The script can connect to the database, read various v$ and dba views such as dba_data_files to get the necessary data file information, and place the file names into OS copy commands. The resulting script should probably include steps to connect to and stop the database and to restart the database instance when it is complete.
    Be sure to include a copy of your control file and the spfile in your backup. You do not need to include the online redo logs in your manual cold backup.
    An alternate might be to run an rman backup while the database is in restricted session depending on how freely your site has given out the DBA role and/or restricted session privilege.
    HTH -- Mark D Powell --

Maybe you are looking for

  • Subtotal in Table Footer Appears in Body on the Next Page - Smartform

    Hi experts, I have a subtotal row in my table footer. It works find (appears correctly for each page). But when I check the body of the table, in page 2, there is a line with the subtotal amount from page 1, appearing in line 2. Do you guys know why

  • HT1688 So i realized that I deleted the standard Clock App on my

    I realized that I accidentally deleted the standard Clock App from my iphone..I was not aware that this app could even be deleted but one day, it was no longer on my phone! How can i get this app back?

  • Delete entry from Database table

    Hi, I configured one PCR scenerio in SPRO node -> business Packakes/ funtional packages-> Manager self service-> Personal Change request -> Group Change request scenerio. later I deleted that entry in backend, but still the same entry exist in db tab

  • How to bring the non-mandatory selection field in Portal

    Hi Expert,                I have created an query in Bex. when i run it one selection field is coming like Material, vendor etc, but in this selection field  all are option, non of them is mandatory. My problem is that when i am creating iview on tha

  • RE: (forte-users) AppletSupport on PC-NT lack ?

    yeah but actually I think applet support is only forte, isn't it ? -----Message d'origine----- De: kelsey.petrychynsasktel.sk.ca [mailto:kelsey.petrychynsasktel.sk.ca] Date: lundi 11 septembre 2000 18:17 À: Jean-Paul.Gabriellisema.fr Objet: Re: (fort