Utl_file simultaneous usage

i will use a stored procedure for db-logging in a file using utl_file (fopen/put_line/fflush/fclose)
- may i have problems with simultaneous calls to this procedure within different sessions or i must use some kind of locking ?

user605483 wrote:
i will use a stored procedure for db-logging in a file using utl_file (fopen/put_line/fflush/fclose)
- may i have problems with simultaneous calls to this procedure within different sessions or i must use some kind of locking ?Yes - but if you use text and "+write append+" to the file, your code is fairly thread safe.
The problem is with the file pointer in session A versus session B. Session B writes to the file. This does not advance the file pointer in session A. Thus when session A writes to the file, it overwrites the data just written by session B.
A write append automatically writes the data at the end of the file (the file pointer is moved to eof and the write happens). Write append is only valid for text files - not binary files (though you can likely simulate it, but it would not make much sense).
As writes to the same file is serialised (due to the file being opened in shared mode), there's no problem in both sessions doing a write append at the same time. (except for the performance issue of serialisation)
But the concept of writing log files from an Oracle RDBMS - that is just plain horrible. This is not the 80's anymore (despite us missing the music and hairstyles) and Oracle is not Cobol writing to ISAM files.
The correct place for logs is inside a plain Oracle SQL table - that can be indexed, partitioned. That can be read and filtered using SQL. That implements concurrency controls. That has Oracle security features. Forms part of the database backup strategy. Etc.
IMO there is no valid reason for storing PL/SQL processing logs externally. (a debate I've often had in the past with developers and one I have yet to lose)

Similar Messages

  • Simultaneous usage of LAN and WLAN

    Hi,
    I have a T61 running win2k.  The WLAN is managed by Intel Proset wireless.  I have been having problems running the LAN and WLAN simultaneously.  The WLAN connection drops off immediately if my LAN gets connected.  I have to disable/disconnect the LAN to make the WLAN work again.  I have observed this problem with a few other T61 laptops at my office.  Is this a known issue ?  What is the resolution ?  Thanks.

    Mine R61i with Vista can do that, but i can't seem to get it working in dual mode when using XP pro.

  • Boot camp and switching between OS's

    I haven't made a partition from Boot camp yet but am planning to for vista for certain apps which don't have a mac version. My question is that I was under the impression, from I think the WWDC Keynote, that the new boot camp would allow the user to switch between Windows and Mac OS X without restarting the computer, but through putting one side to sleep and then waking or booting up the other (it wouldn't allow them to run simultaneously but at least you wouldn't have to restart every time). As far as I can tell no one is able to do this yet. Are they still going to add this feature in to boot camp or Leopard? Or is it already there and I don't know where to look? Or am I just going bonkers and imagining things?

    I'm well aware that boot camp won't run two OS's simultaniously. But I was under the impression from a Keynote before it was released that the new bootcamp would allow you to switch between the two OS's _without restarting_. There are differences between simultaneous usage and switching without restarting. And no VMWare and Parallels will not cut it for what I will be doing (boot camp is a far better choice for my use). Just to clarify I can live with restarting to get to one side or the other but I'm just asking if it were possible in boot camp to switch between without restarting yet, as I remember being mentioned before Leopard was released.

  • Reentrant Help!

    Hi all! I hope everyone is well today,
    Just to start off, I'm running Labview 8.2 on XP. Because of my company's concerns I have added images of a simplified
    version of the vi that represents san example of what I'm trying to do.
    That being said, here's my dilemma:
    I am trying to call a subvi more than once simultaneously in my main vi. The only variable that will be shared is a single array, and it will only be read from, not written to, so there shouldn't be any data handling errors. The subvi that is to be called is set up as a reentrant, and the help file indicates that this is the proper method of handling this kind of repeated calling and simultaneous usage of a subvi. However, when I try to call the subvi a second time before the first call has finished executing, the second call will not execute until the first has finished. The help file indicated that this is what would happen if a subvi was called when it was NOT a reentrant. Can someone please help me trouble shoot this problem? I can't figure out if it is an incosistency in Labview or if I'm overlooking something! If this is not the proper method of calling a subvi more that once simultaneously, I'm more than willing to change my operations. Thanks,
    Ryan
    PS: To clarify, Reenrant.jpg is the "mainvi" here, and is the example of what I'm trying to do. Reentrant.jpg is the "subvi" that I'm trying to make simultaneous calls to.
    Attachments:
    Reentrant Execution.JPG ‏90 KB
    Reentrant.JPG ‏29 KB

    Valcon,
    Even if you label a vi re-entrant it will still follow all the flow control rules of labview.  So it will still wait for the error cluster, etc. to be passed out of the vi before moving on in the program.  In the context of your program there it won't change anything to make it reentrant, since your while loop is going to wait for all of its contents to execute before moving on to the next iteration.
    They way I like to handle this is instead of calling the reentrant vi in the normal way, call it by vi server.    Instead of plopping your subvi on the diagram like normal, open a vi reference to the vi and choose the run vi method.  Then instead of waiting for your vi to finish executing before moving on, it will launch the vi in a seperate thread and move on without waiting for it to finish executing. 
    -Devin
    I got 99 problems but 8.6 ain't one.

  • Portege R500 - Slim port Replicator II: Dual Monitor DVI & RGB together

    Is it possible to use a dual monitor setup on a slim port replicator II if I connect one monitor to the DVI-port and the other to the RGB-port?
    I have a Toshiba Portege R500 notebook.
    TIA

    Hi
    I didnt find any information regarding the Advanced Port Replicator II but I found some info about Advanced Port Replicator III and the simultaneous usage of RGB & DVI ports
    So the point is that this is possible *BUT ONLY* if notebook system unit _itself also support_ RGB & DVI simultaneous usage.
    regards

  • How to run desktop application

    Hi! I've programmed for years JSP, Servlets and Applets, but never a desktop application, so... my problem is that I don't have any idea on how to run it. I mean, of course I know how to run some application in my own desktop (java applicationname) but my doubt is, what I need to install in the client desktop or how must I do my package in order to run without the need for installing the SDK. Because, as I known, the "java.exe" comes with SDK, and of course, I don't think that I need to install de entire SDK in all my clients desktops in order to run my application.
    Any help will be very appreciated!

    You should give them the Java Runtime Environment. You will find a java.exe there too. E.g.
    C:\Program Files\Java\jre1.5.0_02
    The principle problems you will have to consider are:
    1.) How easy, and often, will you have to update your program? You might need to consider something like Java Webstart, for example.
    2.) What are the security considerations? If you need access to a database you will have difficulty keeping passwords secure. You may want to obfiscate code, for example.
    3.) If the applications are communicating with a central resource how will you deal with simultaneous usage. Coming from a web application background this is nothing new to you I guess but you may want to consider a J2EE application server, for example.
    4.) You need to consider whether you stick with what you know and develop an intranet approach to internal applications.

  • Accessing CC synced files

    Hello... I'm having trouble accessing my files from home, (mac). I was able to sync while on my in-class pc. I have logged in to my student, (CC) acct.
    I would like to ask if anyone knows... do I have to log out of my (CC) acct. once I have completed syncing? And log in on the computer I want to access the content from?
    This probably seems like a stupid question. But I don't think I logged out of my CC acct. before I locked my in-class pc. I did so because I planned to remote connect.
    Could that be it?

    Hello,
    Are you sure you are logged in to the same student account from your Home Mac as well.
    To check this, launch DW. Go to Menu: Help > Sign Out. It will show you the email account through which you are logged in.
    Creative Cloud does not allow simultaneous usage of CC products on more than 2 computers. So, if you are logged in on some other computer as well, you'll not be able to sign into CC on your Mac (at home).
    And for your second question: You DO NOT have to log out of CC to complete file sync. Files are automatically synced on the next computer when you log into CC, provided that you have turned file sync ON.
    Here's how to turn File sync ON:
    1. Launch the Creative Cloud desktop app.
    2. Click on the gear icon on the top left to display the drop down menu.
    3. Choose preferences.
    4. Select the Files tab.
    5. Choose the "Sync On" radio button.
    Hope this helps !
    Cheers,
    Subhadeep

  • Connection of two screens on PA3508E-1PRP port replicator

    Hello,
    Does somebody know if we can connect two screens on this port replicator ? and use with the "extend my desktop" option in Windows ?
    Thanks you
    Regards

    It seems you speak about the Toshiba Express Port-Replikator for Portg M400.
    In my opinion the Express Port-Replikator supports RGB & DVI simultaneous usage only if notebook system unit itself also supports RGB & DVI simultaneous usage.

  • Working on the same start routine

    Hi
    I just want to know if two people can work on the same start routine using includes at the
    same time.
    Thanks in advance.
    Regards,

    Hi Kate,
        In any case if you enter into update rules in change mode it gets locks by user. So you cant see the start routine or update routine /rules.
        In the Editor for Start/ Update Routine you dont have change display button like you have in SE38, because you select the mode before entering the routine. So after this event a lock object gets created in SM12.
         So you can delete lock object in SM12 then you can use. I think simultaneous usage is not possible.
    Thanks,
    Srinivas.

  • Can't Receive Call in EDGE while internet data is tranceiving

    I would like to know if anybody knows that the iPhone 3G cannot receive any call while your phone is in constant data streaming, transmitting and receiving data via the Internet in EDGE network. 3G network is fine, whenever a call comes in, the priority is the call and you can go online at the same time; however, EDGE can only do one at a time but does not prioritize voice call.
    I have figured today that while my phone is limited in EDGE network, when people call me, I don't have any indication of missed call nor incoming call. The caller hears couple rings and the call is then forwarded to the voice mail. This is problematic when a lot of people rely heavily on miss call caller ID rather than using voice mail. In case if you are using Google map, Youtube, and loading web pages while you are on the road with no 3G network, you don't even know people have called you.
    Apple should allow user to prioritize the data and voice in EDGE network, so that when there is an incoming call, it pauses the Internet data transfer and receive the voice call. Or allow user to use the Internet without being interrupted by voice call and go straight to voice mail box.
    I have called AT&T regarding to this issue, they quickly tested out my observation and reported to me that other phones such as Motorola VXX and iPhone 1st Generation in EDGE network were also experiencing the same problem I have described above.

    Wow!! Your rambling rant includes more classic fallacies than I've seen in 1 post - straw man, begging the question, non-sequitur, irrelevant conclusion, and probably more....
    snuz wrote:
    sure, you can go back after answering the call- it's just like switching windows/screens on your mac.
    But what AT&T is saying is that while talking on the phone you can be scrolling through the website at the same time.<snip>
    The premise for this is that the AT&T 3G network is using the new HSPDA/UMTS protocols which is built into the iPhone 2 (as tri-mode) along with the GSM/EDGE (as quad-mode). Unfortunately, not everyone has the 3G coverage, and is stuck with EDGE network service, and not being able to use the phone and programs simultaneously. AT&T's site says it's 3G is available in most metropolitan areas and is being expanded <snip>
    There is no advantage, even simultaneous usage, talking over the speaker phone or headset and browsing, texting or sing an APP, the AT&T network is incredibly slow. Their 3G is only 400-700 kbps, and their edge maxes out at 135 kbps. The coverage for 3G and tis service isn't fully available,
    Huh?. The ENTIRE POINT of this thread IS that Edge is incapable of simultaneous voice date whereas AT&T 3G is. NOT whether 3G is widely available. NOT 3G throughput. NOT whether simultaneous browsing and talking is really practical. The OP's problem was that while browsing on Edge, incoming calls don't get through. This doesn't happen with 3G. It does happen with Verizon and Sprint EDVO.
    And if you "read" the article instead of listening to the hype of the phone, in order to acheive the higher speeds of the iPhone downloads, the phone will switch between modes in order to get the best speeds. The phone will seamlessly switch between 3G and EDGE, but with Wi-Fi 'join' on, it may join onto a Wi-Fi network which with 802.11n, would produce the greatest download rates, compared to AT&T's 3G which can only max out at speeds of 400-700 kbps. This will drain the battery and with the noted 'limited number of charge cycles' the battery will need replacing fast.
    Again, no one is talking about throughput in this thread except you. You misrepresented what I previously posted and mistakenly claimed that 3G is incapable if simultaneous voice and data based on watching a TV commercial (amazing in itself) and are now trying to obfuscate that with completely irrelevant "facts" and jargonese,
    The advantage is for traveling overseas, where the Apple site is mis-leading, because the AT&T network is still a GSM netowrk, the data network is 3G, hence when traveling, there would be no need to 'switch' to a GSM mode in a GSM country. And, not all countries use GSM, some use CDMA, which would rule out the iPhone.
    You just keep piling on the irrelevant crapola.
    Since it is cheaper and easier to upgrade the CDMA networks to the HSPDA standard, and LG is releasing their HSPDA phone this month (GSM right now), undoubtedly Sprint and Verizon, if they haven't already added it, or are getting ready to launch it, will upgrade to HSPDA and faster than AT&T and T-Mobile can since they also have to add in the UMTS standard also.
    Who cares? The die is cast and Apple chose AT&T. Most (me included) would have preferred Verizon for both technical and business practices. The real future lies with 4G development anyway.
    Message was edited by: modular747

  • False language selected during Cloud App download is re-install safe?..

    Dear Sirs,
    Last week during installation of Adobe Creative Could Apps I've forgot to check Language settings in Download Manager and mistakenly installed US-English version of several Cloud Apps (instead of needed German). Will uninstall and following re-install with proper language settings so to say, license-safe? I mean, will I still keep the possibility to install Creative Cloud apps on the second computer?
    Second question is regarding simultaneous usage of Apps. You mentioned, that I'm not allowed to run the same application twice, but what about 2 different apps on 2 different computers (belonging to the same Adobe ID)? For example, Ai on my office desktop and Lightroom on the notebook? Or leave the desktop to process large video in Premiere and at the same time do some Photoshop/Lightroom work on the portable?
    Thanx a lot in advance,
    Maria

    Yes you can uninstall English and then install German using the Adobe Application Manager.
    You cannot run the software on two computers at the same time. This is part of Adobe's standard end-user-license-agreement (EULA), and is true for both the Creative Cloud and perpetual license (serial number) software. From the EULA FAQ http://helpx.adobe.com/x-productkb/policy-pricing/end-user-license-agreements-faq.html:
    Can I use my software on two computers?
    If you own, or are the primary user of, a single-user or volume license Adobe product that is installed on a computer at work, you can also install and use the software on one secondary computer of the same platform at home or on a portable computer. However, you may not run the software simultaneously on both the primary and secondary computers.
    No more than one user can use a single-user license Adobe product.

  • Printing : with layout in notepad??

    hi all,
    is it possible to create a layout in notepad to print a document.??if yes how??
    i have to create a program for a bill. But it has atleast 100 fields and is top be run daily, by different users simultaneously.. So can using smartfroms or SAP Scripts ctreate any problemz ( the printer settings might be different for differnet users) ? Regarding this issue, i heard we can create a layout in notepad for this bill which will not create any issues with any different printer settings or with simultaneous usage.. is this true??

    hi Suzie 
    Execute this Std program RSTXSCRP in SE38 to download the layout in Notepad
    Regards
    Deva

  • How to manage two OS Text files in UTL_FILE Package simultaneously?

    Hi
    I am using UTL_FILE Package in order to insert rows into my table from the OS text files.
    It inserts the row in one of the column in the table successfully.
    But when I change the code in following routine in order to insert two rows from the two OS text files, it fails and no row inserted in any column of the table.
    Could someone assist what changes I will do in the following script in order to insert the rows in both the columns of the table from the two different OS Text files simultaneously?
    The UTL_FILE_DIR parameter is set to * .
    I am using Oracle 8.1.7.
    Following is the procedure, which I am trying to insert the rows in two columns at a time:
    Regards
    Sharbat
    Declare                              
    l_file_handle1 UTL_FILE.FILE_TYPE;
    l_file_handle2 UTL_FILE.FILE_TYPE;                              
    l_buffer1 VARCHAR2(4000);
    l_buffer2 VARCHAR2(4000);                              
    BEGIN                              
    l_file_handle1 := UTL_FILE.FOPEN('c:\Test\Result', 'System_Name.txt', 'r', 4000);                              
    l_file_handle2 := UTL_FILE.FOPEN('c:\Test\Result',
    'Machine.txt', 'r', 4000);
    loop
    UTL_FILE.get_line(l_file_handle1,l_buffer1);
    UTL_FILE.get_line(l_file_handle2,l_buffer2);
    insert into test (Hostname,Machine) values(l_buffer1,l_buffer2);
    commit;
    end loop;
    exception
    when no_data_found then
    UTL_FILE.FCLOSE(l_file_handle1);
    UTL_FILE.FCLOSE(l_file_handle2);
    when others then
    if utl_file.is_open(l_file_handle1)
    then
    utl_file.fclose(l_file_handle1);
    end if;
    if utl_file.is_open(l_file_handle2)
    then
    utl_file.fclose(l_file_handle2);
    end if;
    end;

    I recommend you to post this here to get fast answer:
    PL/SQL
    Joel Pérez

  • UTL_FILE Usage

    I am working in the following Oracle environment:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0
    Unix: Solaris Sunsparc 10
    Oracle Financials: 12.1.3
    I defined a stored procedure seen below.  I am trying to create a CSV file and write it to a directory on my C: drive (ultimately in a UNIX directory)  I can't issue a CREATE DIRECTORY from within the stored procedure (or can I) so how do I specify the path to the directory c;\? What avialable paths do I have from Windows 2007?
    create or replace
    Procedure ZZAP_REMEDY_EXPORT_PROC
    (P_Folder_Name In Varchar2
    ,P_File_name In Varchar2 
    AS
    --    F := UTL_FILE.FOPEN('MYCSV','REMEDY_AP_EXPORT.CSV','w',32767);
    ---Declare
       Exp_A Exception;
       Errbuf Varchar2(120);
       V_Errloc VARCHAR2(120);Count number;
       Retcode Varchar2(120);
       Counter Number;
       F UTL_FILE.FILE_TYPE;
    Begin
        Counter := 0;
        F := Utl_File.Fopen('MYCSV','REMEDY_AP_EXPORT.CSV','w',32767);
    --    F := UTL_FILE.FOPEN('MYCSV','REMEDY_AP_EXPORT.CSV','w',32767);
        Loop
            Utl_File.Put(F,'123456');
            Utl_File.Put(F,',A' );
            Utl_File.Put(F,',1050 MAIN' );
            Utl_File.Put(F,',BRONX' );
            UTL_FILE.PUT(F,',NY' );
            Utl_File.New_Line(F);
            Exit When Counter = 10;
            counter := counter + 1;
        END LOOP;
        Utl_File.Fclose(F);
    Exception
    WHEN OTHERS THEN
       errbuf := 'Error:- ' || SQLCODE ||' '|| SUBSTR(SQLERRM, 1, 950) ;
       Fnd_File.Put_Line(Fnd_File.Log, 'Exception -> Err Code: ' || To_Char(Sqlcode) || '(' || Rtrim(Sqlerrm) || ') occured in procedure Inactivate item at location '|| V_Errloc);
       Retcode := 2;
    End Zzap_Remedy_Export_Proc;

    UTL_FILE can only create files on the database server.
    In SQL Developer, you can run a query, fetch the results, and then tell SQL Developer to write them to a CSV file on your local drive.  It's not obvious to me why you would want to do that, though, since obviously your code may be quite different from the code SQL Developer uses to write the file.  And it would seem easier to review the results of your query in SQL Developer rather than writing it to a separate file just to use some other tool to open the file.  Perhaps you want SQL Developer to write an XLS[X] file of results that you can then use Excel to view?
    Justin

  • Usage of UTL_FILE

    Hi Guys,
    I am new to UTL_FILE. I am using system user account. I wrote two stored procedures using this. Compilation is OK. But when I execute I have following error:
    SQL> exec write_file
    BEGIN write_file; END;
    ERROR at line 1:
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "SYS.UTL_FILE", line 98
    ORA-06512: at "SYS.UTL_FILE", line 157
    ORA-06512: at "SYSTEM.WRITE_FILE", line 9
    ORA-06512: at line 1
    Line 9 is
    9 lft_file_hdle := UTL_FILE.FOPEN(ls_file_path, ls_file_name, 'W');
    The Stored Procedure is:
    SQL> CREATE OR REPLACE PROCEDURE write_file AS
    2 lft_file_hdle UTL_FILE.FILE_TYPE;
    3 ls_bfr_line VARCHAR2(1000);
    4 ls_file_path VARCHAR2(75) := 'c:\';
    5 ls_file_name VARCHAR2(75) := 'Results_';
    6
    7 Begin
    8 ls_file_name := ls_file_name| |to_char(sysdate, 'dd-mm-yyyy')| |'.txt';
    9 lft_file_hdle := UTL_FILE.FOPEN(ls_file_path, ls_file_name, 'W');
    10 UTL_FILE.PUT_LINE(lft_file_hdle, 'abc');
    11 UTL_FILE.FCLOSE(lft_file_hdle);
    12 End;
    13 /
    Procedure created.
    1000 thanks in anticipation
    r@m@

    Define valid utl_file directories in init.ora e. g. for UNIX:
    utl_file_dir = /usr/oracle/utlfile/,/cqddata_10/exports/
    Separate them by commmas, include the last '/' after the path.
    You can check to see what directories are valid:
    SQL> select name, value from v$parameter where name like '%utl%';
    NAME
    VALUE
    utl_file_dir
    /usr/oracle/utlfile/, /cqddata_10/exports/
    null

Maybe you are looking for

  • File with pls extension opens with data modeler instead of sql developer

    Hello, I have both SQL Developer and Data Modeler installed as separate installations. If I  click in  the Windows File navigator on a file with the extension pls, the SQL Developer should open since the pls extension has been connected to SQL Develo

  • Tech Spec

    Hi guys, I want to know  how a Technical Spec looks like? I will be thankful if anyone can provide me with documents.What fields to be kept in it and what are the things that we include in it? Thanks in advance BR Gadwal

  • Image not displaying on a dynamic Table !

    Dear Friends, In my assignment, I would like to display the Status column of a table with different image as per the data received from backend system. Infact it is a dynamic table generation.  The code snippet is as below: IWDNodeInfo tabNode=wdCont

  • Constantly losing focus away from code view in CS6 OSX

    DW constantly loses focus away from the editing pane in code view, and instead seem to focus on another part of the interface.  Two big problems with this: When I expect to still be in code view, and the first thing I do is hit Delete, DW wants to DE

  • Changing an Admin's account password via ARD

    Greetings! I came across this posting on changing a user accounts password via ARD: http://discussions.apple.com/thread.jspa?messageID=2130579&#2130579 I tried Vespazzo Unix command in this thread: passwd (name of user) (new password) (new password)