Kill session through batch file but with DELAY/SLEEP

respected forum members,
i have a database 9i release 2 on windows server 2003.
as we r working in a territory where load shedding (electricity failure) is big problem intervaly. as users r working so there computer shutdown while they are working when there is power failure.
about 250 sessions are opened in peak hours and i want to kill these sessions.
so i want to write a batch file which kill session but at the same time I WANT TO PUT DELAY IN THE BATCH FILE which delay for 2 seconds after killing 20 sessions.
can any body help me to write such a batch file which delays for 2 seconds after killing 20 sessions. HOW to insert DELAY/SLEEP in batch file.
thanks

I'm not sure I understand the point of this script. If the power fails and the server goes down, obviously all sessions will be killed. If the power fails and the client goes down leaving database sessions, you would generally want to enable dead connection detection or limit the idle time of a session in the profile so that Oracle can automatically kill those sessions. Manually killing sessions should be a last resort.
If you really want to write this sort of script, could the batch file simply call DBMS_LOCK.SLEEP to implement the delay? Or do you literally mean that you only want the delay to come from an operating system call?
Justin

Similar Messages

  • I am loading hierarachy through flat file but facing problem

    i am loading hierarachy through flat file but facing problem  when creating infopackage  still error coming  please suggest  details what are steps followed

    Hi,
    Follow the steps:
         Hierachy through flat file
         First create a flat file save as in .CSV format. Then close the file.
           Create info area in info object then info object catalog opens then create it then info object screen opens then another screen opens were you will give data type, length then select option hierarchy tab, then select it simply select the check box with hierarchies.
            Select attribute tab in that name, age, address, phone then activate it then come back to the main screen then select characters right click a small screen open then select info object then a small screen opens then create sales region and activate it.
         Then return back to the main screen then click characters right click on it then a small window opens then select info object option & create sales office and activate it.
         Then return to the main screen then select characters then the ID then the double click on it  then the other screen opens select hierarchy tab then select external chars in hierarchies then click on it then other screen opens then select find tab then give the sales region info object name and click continue then it finds the name.
         The name would be scroll on the other screen then the office should be find the same way as region then office would be scroll on the other screen then continue and activate it.
         Then come back to the main screen then go to info source option then it opens then create application component then it opens other screen then click continue it
         Then  create info source for master data then select  direct update option there give the name of the info object of  as ex; YID_AS2 then click  continue.
         Then the YID_AS@ could be seen in the main screen then right click on it. Then a small option opens then click assign data source option then other screen opens there it gives the empty space double click on it then PC file then click continue then another window opens click continue then again screen opens click continue again a pop up screen opens click continue.
         Then another screen opens there the attribute data source then activate it then select hierarchy activate it then the left side data structure/ hierarchy then click on it then it opens another screen then click hire maintenance button .
         Then give the hierarchy name (your wish) then go with continue then yes then save then go back to the main screen.
         Then maintain the flat file as node id, info object, node name, link name, parent no.
         Then info package creation then click on the flat file right clicks on it then a other screen opens then select attribute data source and then continue.
            Then other screen opens then select external data tab in .CSV then click 1 the enter preview then another screen opens then click then it shows the preview then schedule then start then monitor click on it  then it opens other screen then click on the master data then we can see the data then go back to the  main screen.
         Then select the flat file right click on it then it gives other screen then select hierarchy in that then click continue then it opens other screen then select hierarchy selection tab there you can see the file name then select the button of hierarchy.
         Then select External data then the file name in CSV then processing tab only psa option with update subsequently in data targets then the update it schedule start then the monitor then go to the main screen.
         Then go to info object then select the file id which you have given then double click on it then select hierarchy or text file then the contents then execute it.
         Create a transaction table , cube in a normal way. We can see the result in reports we have to give the hierarchy name in the properties of rows where we drag the characteristics id then we can see the records which we have entered man usally after executing the report.
    regards
    ashwin

  • Saving a file in Vi creates same file but with ~ added [SOLVED]

    Hi,
    I'm not sure if I pressed a key combination, but when I save a file in Vi I get another file that has the same name as the original file but with the ~ character added to the end of the filename.  For example, if I edit foo.txt and save it, then the original will be saved, but I'll also get a new file named foo.txt~.  Does anyone know how to fix this?
    Thanks!
    -nterpol
    Last edited by nterpol (2008-11-09 12:30:59)

    I think that the default backup settings (in /etc/virc if you use the basic vi package) changed with the recent upgrade to Vim 7.2.25.
    For information on file backup setting combinations, see :help backup-table in Vim.
    Edit:
    fwojciec wrote:http://thehumblecoder.wordpress.com/200 … kup-files/
    That article advocates disabling the use of swap files (:set noswapfile); however, I wouldn't recommend it. Whereas backup files are designated with a trailing tilde (~), swap files have names ending with .swp. The latter should be removed automatically when Vim exits (unless it is exited abnormally, such as when the user closes a terminal emulator without first quitting an instance of Vim that is running inside it).
    Last edited by ssjlegendx (2008-11-10 04:13:24)

  • Photoshop cs4 makes huge files - but with Aperture Whats the biggest file ?

    When editing w/Photoshop cs4 by adding layers and masks etc, This makes HUGE files - but with using Aperture alone, what's the biggest file size when editing a RAW file?? (??? _Kb ??? __ mgB ????)
    I think I heard -12kb. True ?_________ From what little I understand. Aperture changes the pixels once you have finished the editing. Or to put it another away, Aperture replaces the old or original pixels with the edited final pixels you prefer. IE -lighter darker. and with that said. is this still a RAW IMAGE?

    Hello, and welcome to the Discussions.
    It would seem that none of what you report hearing is accurate. A RAW file downloaded into Aperture, remains as the Master for this image, and is never changed -- that is why Aperture is said to utilize non-destructive editing. When editing in Aperture, only a small file of edit detail is saved, and no actual new version needs to be created until you Export for some purpose.
    When you send an image file from Aperture to Photoshop to be edited, it typically will be a version created as a TIFF file, although there are 4 choices in the Preferences -- TIFF, TIFF 16-bit, PSD, and PSD 16-bit. When finished editing, the image is Saved in PS, that file is available to Aperture, and the version created for sending to PS will change to reflect those changes made in PS.
    Aperture cannot send an edited RAW file to PS in this fashion, but you can Export the RAW Master, to later be opened in Photoshop.
    You should watch all the available online tutorials about Aperture, and possibly buy a book as well.
    Aperture may have trouble with super-sized images, but I have not had trouble with those in the range of 100 MB or less. Larger ones than that would likely be from scans and not from editing an image shot with your camera in Photoshop.
    Ernie

  • Kill Session through Script

    Hi ..
    any one can tell me how to kill session through Script in Oracle Open Script..?

    Do you mean how to stop the current virtual user or stop all the virtual users in the OLT session?
    I previously posted this on how one virtual user can stop itself.
    Re: How to stop single VU, java-code

  • Batch file processing with non-scripting app (Preview)

    Well I RTFM and spent MANY hours on macscripter et al, the answer is just not going to come to me. I have some RAW files in an obscure Canon format that is only recognized by Preview, which is not scriptable. I'm dealing with hundreds of files from a stop-motion animation project so batch-processing is a must.
    The Goal: Individually open several hundred RAW image files in Preview, then save them as .PICT files in a new directory.
    Automator doesn't want to play - it simply refuses to do this as a batch job, so I'm left with manipulating the UI through Applescript. Below is what about 10 hours of head-beating has produced:
    -- Start Finder tell block
    tell application "Finder"
    --Pick files to convert
    set SelectedFiles to (choose file with multiple selections allowed)
    set filesList to get every file of SelectedFiles
    --Begin repeat loop for every file in selection
    repeat with aFile in filesList
    set theFile to aFile as alias --Set theFile as current target
    tell application "Preview" --Open Preview, open the target file
    (activate) and (open theFile)
    end tell
    --Need to manually select "save as PICT", so this opens the prompt
    tell application "System Events"
    keystroke "s" using command down and shift down
    end tell
    --Buy some time for the conversion and save process
    --(there has GOT to be a better way!)
    delay 30
    end repeat --loop (with fingers crossed)
    end tell
    This is a HUGE advance from where I started, trying to repeat for "every file in folder..." which just ain't gonna work on my computer. But, it doesn't do anything beyond getting a list of input files. My output is below:
    tell application "Finder"
    choose file with multiple selections allowed
    {alias "Macintosh HD:Users:mark:Pictures:LEGOS:IMG_0126.CR2", alias "Macintosh HD:Users:mark:Pictures:LEGOS:IMG_0127.CR2", alias "Macintosh HD:Users:mark:Pictures:LEGOS:IMG_0128.CR2"}
    end tell
    Thanks, my head hurts now. (Why couldn't they just have ported REXX???)

    Hiroto, no I didn't have it checked. I don't know why I was able to get as far as I did but enabling access for assistive devices didn't change anything. I am able to emulate /almost/ any keystroke, except the up arrow, which normally allows me to move up in the "file type" selector button. The script below is ... functional ... except that it forces me to save each file as a 58MB uncompressed .tiff, and it refuses to respond to the "close front window" or 'keystroke "W" using command down' scripts. Getting through 300+ files this way will eat up my memory and hard drive in a matter of minutes. I suppose I could '$sh kill ####' from terminal if I could find the window process, but this is getting really hoaky!
    THIS SCRIPT OPENS AND SAVES FILES, BUT DISALLOWS ANY TYPE SELECTION OR CLEANUP
    set sFiles to (choose file with multiple selections allowed without invisibles)
    repeat with aFile in sFiles
    tell application "Preview" to run
    tell application "System Events" to tell process "Preview"
    tell application "Preview"
    activate
    open aFile
    delay 8
    tell application "System Events"
    keystroke "S" using {command down, shift down}
    delay 2 -- opens save as sheet
    repeat 7 times
    keystroke tab -- tab down to file selector (works fine)
    end repeat
    click down -- select button (doesn't do anything)
    delay 1
    keystroke up -- open file button menu (doesn't work)
    keystroke up -- select next menu item above (doesn't work)
    keystroke return -- shortcut to "save" button
    delay 10 -- wait for save
    keystroke "W" using command down -- close current window (doesn't work)
    end tell
    end tell
    end tell
    end repeat

  • DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER Error while running multiple instances of SSIS through batch files.

    I have an SSIS package which loads data from an Excel file into a SQL Database. This SSIS package is triggered by a batch file. 
    As part of a load test, I have created 20 batch files that run the same package for a different Excel file. 
    To have these batch files run together, I have created 2 master batch files, one to run them sequentially (using CALL) and the to run them parallely (using START). I do have any issues in both of them.
    But when I try to run 5 instances of the same batch file run concurrently (using START XYZ.bat 5 times) only 1 succeeds. CALL XYZ.bat 5 times has no issues. 
    Is it because during START, the Excel file is opened by 1 batch file and unavailable to the other 4 instances? If yes, then why doesn't SSIS throw an error when I run the package through BIDS keeping the Excel file opened? Is there something I can do to
    overcome a FAILURE?
    Nelton D'Souza MS BI Developer

    Yes, it seems that since you open the same file from multiple processes the error occurs due to the sharing violation.
    I guess you will get the error opening several Excel files from BIDS trying to read / write to it if you have two BIDS so it is consistent. Excel disallows multiple access paths by its design.
    Arthur My Blog

  • File to file but with append

    Hi experts,
    I have the following requirement :
    we will receive 5 files on a distant ftp server. We need to transfer these 5 files on PI ftp server but the requirement is to concat these 5 files in 1 before they arrive on the PI ftp server and they apply mapping on the final file.
    Is it possible during transfer of the 5 files on PI ftp server to make an append or something so that we have 1 file in final ?
    Thanks a lot in advance for your help.
    Kindly yours,
    Jamal

    HI ,
             Firstly you want to achieve your requirement before it reaches to PI FTP Server so not possible using PI.
             Yes, you can achieve it at FTP source server by running a Batchfile  written in Unix or Shell script or Windows commands ( depende on server) . This Batch file can be scheduled at particular interval at source FTP server to append 5 files into one file at regular interval.
    If you want to achieve the same after they reach to PI server. You can do above on PI server as well but does not involve PI technology at all.
    I hope it helps to guide you further.
    REgards,
    Anurag Garg

  • Active data Guard but with delay on applying redo logs

    Hello,
    A question: Active Data Guard gives the possibility of having a physical stand-by database open read-only, for instance for making 'up-to-date' reports.
    Data Guard also has the possibility to apply logs with delay, for instance with a delay of some hours. Every commit on primary database is applied to standby after the delay period.
    Can this delay be combined with Active Data Guard? This means that standby database is open read-only but with the delay... In case the delay is 2 hours, every report created on standby is ("up-to-date" minus 2 hours)...
    Thanks for your answer,
    Jan.

    Hello All,
    I answered my own question: indeed it is possible to activate 'real time apply' but with a delay in applying the logs. In EM-11 check the box "enable real time query" and apply. Nect go to thje tab "standby role properties" and change the value after "Apply delay" to for instance 30 minutes. Apply also.
    Log on on the primary, create a table, insert some rows and do some logswitches. Log in on the standby and check for the new table. Notice that after 30 minutes the switched logs are applied, even when you change the delay period within the 30 minutes. The information about the delay seems to be in the log, since it is possible to change the delay immediately after the logswitches to 3 minutes, drop the table and do some logswitches again. The logs with the 'create table' statement in it are NOT applied after 3 minutes, but still after 30 minutes. The drop of the table however is done after 3 minutes on the standby. So the 'delay' information is in the log sent over to the Stand-by!

  • Can I copy files – but with certain restrictions?

    I have just finished a large project, the archives of which involves about 5000 "base" files, stored on about 80 CDs and 50 DVDs, involving about 50,000 files in total. Each of the "base" files may have had up to 30 incremental versions. i.e. a certain text file may have undergone revision 23 times, and each revision was saved and archived to (probably) a different disk, with a different suffix – a, b, c and so on. But sometimes the suffix didn't change even though the file was edited. I might have done a bit more dust removal on an image and just overwrote the old file (already archived), and so the new one was archived on a different disk.
    I now have 130 disks from which I would like to extract all the files and collapse them to one large archive that will probably span about 20 disks by the time I delete some files not needed. That way I can easily search for all versions of, say, GB097, by going to the particular DVD that has the "G" files on it. Up would come:
    GB097
    GB097a
    GB097b
    GB097b-1
    GB097b-2
    GB097c
    ... and so on.
    This is what I would like to do:
    1. Grab the first archive disk, open every folder, and copy all the files to the one folder on a hard drive.
    2. Open the second disk and repeat step (1), but with these two provisos.
    (a) If a file is identical to a previously copied file (maybe I archived it twice), the file isn't copied. However...
    (b) If a file has the same name as a previously copied file, but the data within that file is different (i.e. I removed some dust from an image file, but left the name unchanged), I'd like that file to be copied with a numbered suffix, the same way that Trash treats identically named files.
    Any suggestions how I could do this?

    Back again. This is the Terminal output when run on my +Duplicates Copy+ folder:
    Last login: Thu May 20 13:28:30 on ttyp1
    Welcome to Darwin!
    jenny-pearces-imac-g5:~ Jenny$ chmod +x /Users/Jenny/Desktop/Bash\ Test\ Documents/BashTest.txt
    jenny-pearces-imac-g5:~ Jenny$ /Users/Jenny/Desktop/Bash\ Test\ Documents/BashTest.txt /Users/Jenny/Desktop/Duplicates\ copy/
    /Users/Jenny/Desktop/Bash Test Documents/BashTest.txt: line 1: ${filePaths${count}}: bad substitution
    /Users/Jenny/Desktop/Bash Test Documents/BashTest.txt: line 17: fileSum0=d41d8cd98f00b204e9800998ecf8427e: command not found
    /Users/Jenny/Desktop/Bash Test Documents/BashTest.txt: line 1: ${filePaths${count}}: bad substitution
    /Users/Jenny/Desktop/Bash Test Documents/BashTest.txt: line 17: fileSum1=d41d8cd98f00b204e9800998ecf8427e: command not found
    /Users/Jenny/Desktop/Bash Test Documents/BashTest.txt: line 1: ${filePaths${count}}: bad substitution
    /Users/Jenny/Desktop/Bash Test Documents/BashTest.txt: line 17: fileSum2=d41d8cd98f00b204e9800998ecf8427e: command not found
    jenny-pearces-imac-g5:~ Jenny$
    I'm not sure it's worth spending much more time on this. However, if you're prepared to keep posting, JJJ, I'll keep testing.
    *SCRIPT AFTER THE EDIT*
    #!/bin/bash
    declare -i count=0
    declare -a fileSum filePaths
    # Main folder can be declared on the command line or if not then use /testpix
    MainFolder="${1:-/testpix}"
    # Set the internal field separator to newline to preserve spaces in file paths
    IFS=$'\n'
    # Use 'find' to create a list of files within the folders.
    filePaths=( $( find "${MainFolder}" -type f \! -name ".*" ) )
    # Get an MD5 checksum for each file's combined content of both data and resource forks
    for file in ${filePaths[*]} ; do
    fileSum${count}=$( cat "${filePaths${count}}" "${filePaths${count}}/rsrc" | md5 | cut -d'=' -f 2)
    let count+=1
    done
    # For each file, check for a duplicate checksum and if found, move the matching file to the user's trash folder
    # Rename files with duplicate names by appending #XX
    for ((i=0;i<${count};i++)) ; do
    [ -z "${filePaths[${i}]}" ] && continue
    dupecount=1
    for ((j=0;j<${count};j++)) ; do
    [ -z "${filePaths[${j}]}" ] && continue
    if [ "${fileSum[${i}]}" = "${fileSum[${j}]}" -a ${i} -ne ${j} ] ; then
    mv "${filePaths[${j}]}" ~/.Trash && filePaths[${j}]='' && fileSum[${j}]=''
    elif [ $(basename "${filePaths[${i}]}") = $(basename "${filePaths[${j}]}") -a ${i} -ne ${j} ] ; then
    let dupecount+=1
    dirname=$(dirname "${filePaths[${j}]}")
    fullfilename=$(basename "${filePaths[${i}]}")
    extension="${fullfilename##*.}"
    filename="${fullfilename%.*}"
    until [ ! -e "${dirname}/${filename} #${dupecount}.${extension}" ] ; do
    let dupecount+=1
    done
    mv "${filePaths[${j}]}" "${dirname}/${filename} #${dupecount}.${extension}"
    filePaths[${j}]="${dirname}/${filename} #${dupecount}.${extension}"
    fi
    done
    done
    exit 0

  • Run sql query through batch file

    how to create a batch file so that on running the batch file,
    I should get into the database using username and password and create the table and insert values inside that table

    kindly, if you are using windows you can create 2 files as following:
    a.bat
    b.sql
    put the files under spacific folder for example d:\bat folder
    -first file a.bat will contain the following:
    sqlplus apps/apps@yourdb @d:\bat\B.sql
    exit
    -second file b.sql will contain any sql statments you want as following:
    create table a (a1 number, a2 varchar2(100))
    insert into a (a1,a2) values(1,'Test')
    commit
    exit;
    hope this help you
    Regards ...
    Edited by: shedo76 on 28/04/2012 03:14 ص

  • Multiple users using same files, but with different libraries

    My wife and I both have our own iPhone 3Gs. We also have separate user accounts on our MacBook Pro. We would like to share the music/video files that we've got stored on a network drive, but we don't want to have the same library file. We both have different tastes in music, so I'd prefer if our song ratings were separate, as well as the rest of the library info (namely "last played date"). Is there a way that we can keep separate library files, but also be able to have new song purchases on one library automatically added to the other?

    FryeX wrote:
    I have this in my controller:
    -(IBAction) setSize:(id)sender
    And it would be enough to get to the title of the button
    The sender param should be a pointer to the originating button, and you can use the button's tag property to id it. E.g.:
    -(IBAction) setSize:(id)sender {
    UIButton *button = sender;
    NSString *title = button.currentTitle;
    int tag = button.tag;
    NSLog(@"sender=%@, title=%@, tag=%d", sender, title, tag);
    - Ray

  • IMovie imports mp4 files but with distortion

    Haven't posted on here before but can't figure this one out.
    I have a Sony Handycam that records in mpeg2 format only.
    I used MPEG Streamclip (video converter) to convert the mpeg2(.mpg) files to mpeg4 (.mp4)
    format. I have no problem importing them in iMovie and they appear to have
    some strange distortion that looks like horizontal lines going through everything.
    I don't see this when I play the same converted file back in QuickTime.
    I already spent the $20 to get the mpeg2 codec from Apple, which irritated me and
    now I can't even work with the format I want.
    What should I do? Is this something that just isn't going to happen?

    Use MPEG Streamclip to convert your MPEG file to Apple Intermediate Codec for editing. After editing in iMovie, you can render in h.264.

  • A video I purchased through itunes is playing with delayed sound (audio and visual is not in sync) - very fustrating to watch!

    Recently purchased a brand new computer (windows 8 - with more than the minimum requirements to run itunes) and transferred my itunes library over.  After transferring everything i then purchased a new release video through the itunes store and it downloaded without any problems.  When I went to view the movie in itunes, it started fine but within a few seconds the sound and picture were out of sync.  I paused the video for a few seconds and then when i resumed play it was back in sync but only took a fw seconds for it to all fall out of sync again - very fustrating!
    The movie plays fine on my iphone...
    Is there anyway of fixing this?
    If not i will never be purchasing another movie through itunes!

    Hi there m.ho,
    You may find the troubleshooting steps in the article below helpful.
    Troubleshooting iTunes for Windows Vista or Windows 7 video playback performance issues
    http://support.apple.com/kb/TS1718
    -Griff W.

  • Running Commands Through Batch File...

    Dear All,
    Can anyone help me how to run commands including connecting to Sqlplus,create schema,grant user and alter user, grant dba alltogether through Batchfile..
    I have connected to sqlplus by using sqlplus "system/test@instance"
    but on including create tablespace new datafile'D:\app\Sreejesh\oradata\Tablespace\new.tbs' size 1024m autoextend on next 500m; it is not responding..
    Please advice..

    0d2ecaa8-3418-461c-bf28-ab1c801f10a0 wrote:
    Dear All,
    Can anyone help me how to run commands including connecting to Sqlplus,create schema,grant user and alter user, grant dba alltogether through Batchfile..
    I have connected to sqlplus by using sqlplus "system/test@instance"
    but on including create tablespace new datafile'D:\app\Sreejesh\oradata\Tablespace\new.tbs' size 1024m autoextend on next 500m; it is not responding..
    Please advice..
    Can you debug code that you cannot see?
    Neither can anyone else.

Maybe you are looking for

  • HP 8500 All-in-one printer - how can I print in black and white only (to save color ink)?

    I want to be able to select the option of printing in black and white only to save color ink.  How can I do that?

  • Inventory Org finalisation

    Hi Folks, Could some one explain bit detail about Inventory Master Org, Inventory Org and Sub Inventory Org. I need clear explanation related to finance as well Inventory. Regards Prasanth

  • No preview with placed tiff in Illustrator cc?

    While in Illustrator cc, when I place a tiff from Photoshop, the preview does not show up. I had this problem yesterday and I worked it out with help from this forum. So today I was placing images and everything was working perfect until I wanted to

  • Mail re-import after improper shut down? Leopard.

    Leopard mail. Improper account logout resulted in a force quit of mail. And now it has to reimport all the messages again. Its not that big of a deal for some users as its quick, but there are some who have tens-of-thousands of emails and it takes fo

  • FCP stops capture when clip reaches 9:24:24

    Hello bright heads! Need your help. Everytime FCP gives me an error msg "capture stopped due o the lack of disk space" when the clip has reached 9:24:24. All my hdd have more than 10gb free space. In settings capture is not limited to any time or siz