f



Issues with writing to server-side log file.

Hello, on the database server running Oracle 9.2, I want to write to a log
file.  I unsuccessfully tried the following:

DECLARE
      f UTL_FILE.FILE_TYPE;
BEGIN
      f := UTL_FILE.FOPEN('d:\temp', 'log.txt', 'w');
END;
/

It says, 'ORA-29280: invalid directory path' even if that folder exists
and the permissions allow everyone to write to it.

Someone told me to create a directory object so I can grant permissions to
it, as follows:

CREATE OR REPLACE DIRECTORY dirobj as 'd:\temp';
GRANT READ,WRITE ON DIRECTORY dirobj to snakason;
CONN snakason/mypass@hedev2
DECLARE
      f UTL_FILE.FILE_TYPE;
BEGIN
      f := UTL_FILE.FOPEN(dirobj, 'log.txt', 'r', 5000);
END;
/

But now I'm getting this error "PLS-00201: identifier 'DIROBJ' must be
declared".  I'm guessing dirobj is not in scope of the PL/SQL block, but
how to I remedy that?  If I put those lines within the PL/SQL block, I get
errors.  Sorry, I'm an Oracle newbie so I don't what works or does not
work in a PL/SQL block.

0
seannakasone
2/6/2009 8:55:51 PM
comp.databases.oracle.misc 8436 articles. 1 followers. Post Follow

4 Replies
599 Views

Similar Articles

[PageSpeed] 1

On Feb 6, 2:55=A0pm, seannakasone <snaka...@flex.com> wrote:
> Hello, on the database server running Oracle 9.2, I want to write to a lo=
g
> file. =A0I unsuccessfully tried the following:
>
> DECLARE
> =A0 =A0 =A0 f UTL_FILE.FILE_TYPE;
> BEGIN
> =A0 =A0 =A0 f :=3D UTL_FILE.FOPEN('d:\temp', 'log.txt', 'w');
> END;
> /
>
> It says, 'ORA-29280: invalid directory path' even if that folder exists
> and the permissions allow everyone to write to it.
>
> Someone told me to create a directory object so I can grant permissions t=
o
> it, as follows:
>
> CREATE OR REPLACE DIRECTORY dirobj as 'd:\temp';
> GRANT READ,WRITE ON DIRECTORY dirobj to snakason;
> CONN snakason/mypass@hedev2
> DECLARE
> =A0 =A0 =A0 f UTL_FILE.FILE_TYPE;
> BEGIN
> =A0 =A0 =A0 f :=3D UTL_FILE.FOPEN(dirobj, 'log.txt', 'r', 5000);
> END;
> /
>
> But now I'm getting this error "PLS-00201: identifier 'DIROBJ' must be
> declared". =A0I'm guessing dirobj is not in scope of the PL/SQL block, bu=
t
> how to I remedy that? =A0If I put those lines within the PL/SQL block, I =
get
> errors. =A0Sorry, I'm an Oracle newbie so I don't what works or does not
> work in a PL/SQL block.

You need to submit  your directory name in CAPS and in single quotes:

SQL> CREATE OR REPLACE DIRECTORY dirobj as 'c:\temp';

Directory created.

SQL> GRANT READ,WRITE ON DIRECTORY dirobj to bing;

Grant succeeded.

SQL> CONN bing/*&*&*&*&*&*&*&*&*&
Connected.
SQL> set serveroutput on size 1000000
SQL> DECLARE
  2        f UTL_FILE.FILE_TYPE;
  3        filebuf varchar2(4000);
  4  BEGIN
  5                f :=3D UTL_FILE.FOPEN('DIROBJ', 'log.txt', 'R',
4000);
  6                utl_file.get_line(f, filebuf);
  7                dbms_output.put_line(filebuf);
  8                utl_file.fclose(f);
  9  END;
 10  /
Yadda yadda yadda

PL/SQL procedure successfully completed.

SQL>


David Fitzjarrell
0
ddf
2/6/2009 9:34:14 PM
Thanks it worked.

It needed to be in quotes and uppercase.

BTW, do you know how to show existing directory objects?


On Fri, 6 Feb 2009, seannakasone wrote:

> Hello, on the database server running Oracle 9.2, I want to write to a log
> file.  I unsuccessfully tried the following:
>
> DECLARE
>       f UTL_FILE.FILE_TYPE;
> BEGIN
>       f := UTL_FILE.FOPEN('d:\temp', 'log.txt', 'w');
> END;
> /
>
> It says, 'ORA-29280: invalid directory path' even if that folder exists
> and the permissions allow everyone to write to it.
>
> Someone told me to create a directory object so I can grant permissions to
> it, as follows:
>
> CREATE OR REPLACE DIRECTORY dirobj as 'd:\temp';
> GRANT READ,WRITE ON DIRECTORY dirobj to snakason;
> CONN snakason/mypass@hedev2
> DECLARE
>       f UTL_FILE.FILE_TYPE;
> BEGIN
>       f := UTL_FILE.FOPEN(dirobj, 'log.txt', 'r', 5000);
> END;
> /
>
> But now I'm getting this error "PLS-00201: identifier 'DIROBJ' must be
> declared".  I'm guessing dirobj is not in scope of the PL/SQL block, but
> how to I remedy that?  If I put those lines within the PL/SQL block, I get
> errors.  Sorry, I'm an Oracle newbie so I don't what works or does not
> work in a PL/SQL block.
>
>
0
seannakasone
2/6/2009 10:03:57 PM
seannakasone schreef:
> Thanks it worked.
> 
> It needed to be in quotes and uppercase.
> 
> BTW, do you know how to show existing directory objects?
> 
> 
> On Fri, 6 Feb 2009, seannakasone wrote:
> 
>> Hello, on the database server running Oracle 9.2, I want to write to a log
>> file.  I unsuccessfully tried the following:
>>
>> DECLARE
>>       f UTL_FILE.FILE_TYPE;
>> BEGIN
>>       f := UTL_FILE.FOPEN('d:\temp', 'log.txt', 'w');
>> END;
>> /
>>
>> It says, 'ORA-29280: invalid directory path' even if that folder exists
>> and the permissions allow everyone to write to it.
>>
>> Someone told me to create a directory object so I can grant permissions to
>> it, as follows:
>>
>> CREATE OR REPLACE DIRECTORY dirobj as 'd:\temp';
>> GRANT READ,WRITE ON DIRECTORY dirobj to snakason;
>> CONN snakason/mypass@hedev2
>> DECLARE
>>       f UTL_FILE.FILE_TYPE;
>> BEGIN
>>       f := UTL_FILE.FOPEN(dirobj, 'log.txt', 'r', 5000);
>> END;
>> /
>>
>> But now I'm getting this error "PLS-00201: identifier 'DIROBJ' must be
>> declared".  I'm guessing dirobj is not in scope of the PL/SQL block, but
>> how to I remedy that?  If I put those lines within the PL/SQL block, I get
>> errors.  Sorry, I'm an Oracle newbie so I don't what works or does not
>> work in a PL/SQL block.
>>
>>

Select * from all_directories

Shakespeare
0
Shakespeare
2/7/2009 10:40:14 AM
seannakasone schreef:
> Thanks it worked.
> 
> It needed to be in quotes and uppercase.
> 
> BTW, do you know how to show existing directory objects?
> 
> 
> On Fri, 6 Feb 2009, seannakasone wrote:
> 
>> Hello, on the database server running Oracle 9.2, I want to write to a log
>> file.  I unsuccessfully tried the following:
>>
>> DECLARE
>>       f UTL_FILE.FILE_TYPE;
>> BEGIN
>>       f := UTL_FILE.FOPEN('d:\temp', 'log.txt', 'w');
>> END;
>> /
>>
>> It says, 'ORA-29280: invalid directory path' even if that folder exists
>> and the permissions allow everyone to write to it.
>>
>> Someone told me to create a directory object so I can grant permissions to
>> it, as follows:
>>
>> CREATE OR REPLACE DIRECTORY dirobj as 'd:\temp';
>> GRANT READ,WRITE ON DIRECTORY dirobj to snakason;
>> CONN snakason/mypass@hedev2
>> DECLARE
>>       f UTL_FILE.FILE_TYPE;
>> BEGIN
>>       f := UTL_FILE.FOPEN(dirobj, 'log.txt', 'r', 5000);
>> END;
>> /
>>
>> But now I'm getting this error "PLS-00201: identifier 'DIROBJ' must be
>> declared".  I'm guessing dirobj is not in scope of the PL/SQL block, but
>> how to I remedy that?  If I put those lines within the PL/SQL block, I get
>> errors.  Sorry, I'm an Oracle newbie so I don't what works or does not
>> work in a PL/SQL block.
>>
>>

select obj.object_name,
         dir.os_path
  from sys.dir$ dir,
       all_objects obj
  where obj.object_id = dir."OBJ#"



Shakespeare
0
Shakespeare
2/7/2009 10:43:56 AM
Reply:

Similar Artilces:

Archive logs files accumulating on my Oracle log mode Database
>From what I understand is that an Oracle log mode Database is the recommended configuration for a production database. However, the problem we have is that Archive Logs files in the ..\RDBMS\ directory are accumulating daily which has implications when you have limited disk space. How should these Archive log files be maintained? ie when should they be deleted from the system? is there an automated procedure which will remove the log files on a weekly basis? I understand that there are two ways for performing a backup of the oracle database, 1) cold backup (requires the oracle database...

Oracle database instance shutdown without logging in log file
oracle database instance shutdown without logging in log file. we have Oracle 10g(10.2.0.1)(HP DL380) databse server from Windows 2003 R2 for test/simulation purpose, we found that its shutting down the database sometimes unusally without any error/warning message in the SID alert log file. we observerd that the OS service for oracle is not starting the datbase server completely. Just after hitting start icon inside the services panel it displays the status "Starting", instead of "Started" and database is not in the "Open" state. So the method adopted to start...

log file sync , log file parallel write
Hi , my top wait list shows 2 events , log file sync and log file parallel write in 1 hour. During this time , the db server created 370,594 bytes redo per second. the docs say that high value of both log file sync and log file parallel write indicates io problem . How can we decide whether below numbers are close to each other or not? If it is not possible to change the application and eliminate the unnecessary commits (such as sap) , how can lg file sync be decreased? Kind Regards Load Profile ~~~~~~~~~~~~ Per Second Per Transaction ...

log file sync vs log file parallel write
Hello all, While investigating performance problems in a database I discovered that the 'log file sync' wait event is almost always in the top 5. (I am looking at the statspack datat) Calculating the ratio of the average wait time of the 'log file sync' and the 'log file parallel write' gives a ratio of 10. Does someone know why this may happen? Regards Hans-Peter On 3 okt, 12:31, HansP <hans-peter.sl...@atosorigin.com> wrote: > Hello all, > > While investigating performance problems in a database I discovered > that the 'log file sync' ...

newbie: write content in a file (server-side)
Hi, I send from a client file content to my server (as bytes). So far so good. The server receives this content complete. Ok. Then I want to write this content to a new file. It works too. But in the new file are only the first part of the whole content. What's the problem. o-o Thomas Here's my server code: import socketserver class MyTCPServer(socketserver.BaseRequestHandler): def handle(self): s = '' li = [] addr = self.client_address[0] print("[{}] Connected! ".format(addr)) ...

log file sync vs log file parallel write probably not bug 2669566
This is a continuation of a previous thread about =91log file sync=92 and =91log file parallel write=92 events. Version : 9.2.0.8 Platform : Solaris Application : Oracle Apps The number of commits per second ranges between 10 and 30. When querying statspack performance data the calculated average wait time on the event =91log file sync=92 is on average 10 times the wait time for the =91log file parallel write=92 event. Below just 2 samples where the ratio is even about 20. "snap_time" " log file parallel write avg" "log file sync avg" &qu...

write file + input file + write file
Hi, I want to write some latex command to a file (file1), input the file at the end of the document. These command shall write to another file (file2) and at a second run I use the file2. Whatever I have tried nothing works and I don't known why. The goal is to save a set of special commands and run them at the end of the document, because they use some values which are only available at the end! Can anybody please help me with that? Thanks in advance! I should be something like: \begin{document} \usepackage{style} \input{file2} %file exists from a previous run \end{document} style.sty:...

log file sync vs log file parallel write probably not bug 2669566 #3
This is a continuation of a previous thread about =91log file sync=92 and =91log file parallel write=92 events. Version : 9.2.0.8 Platform : Solaris Application : Oracle Apps The number of commits per second ranges between 10 and 30. When querying statspack performance data the calculated average wait time on the event =91log file sync=92 is on average 10 times the wait time for the =91log file parallel write=92 event. Below just 2 samples where the ratio is even about 20. "snap_time" " log file parallel write avg" "log file sync avg" &qu...

log file sync vs log file parallel write probably not bug 2669566 #2
This is a continuation of a previous thread about =91log file sync=92 and =91log file parallel write=92 events. Version : 9.2.0.8 Platform : Solaris Application : Oracle Apps The number of commits per second ranges between 10 and 30. When querying statspack performance data the calculated average wait time on the event =91log file sync=92 is on average 10 times the wait time for the =91log file parallel write=92 event. Below just 2 samples where the ratio is even about 20. "snap_time" " log file parallel write avg" "log file sync avg" &qu...

Krb5 servers writing to old rotated log files
Hi folks, On all of the Debian squeeze servers with Kerberos (v1.8.3) that I manage, I've noticed that the Kerberos daemons start out writing to their designated log files, e.g. kdc.log, but once those log files are rotated they ignore the new empty ones and instead prefer to write only to the first rotated files, e.g. kdc.log.1. This is the case for both the krb5kdc and kadmin daemons. If I restart the Kerberos daemons manually, they start writing to the correct log files. But, the next day, after the log files have been rotated, the new ones are empty and the daemons are ...

redo log file on Oracle 11g physical database
Parameter 'LOG_FILE_NAME_CONVERT' definition is: " Specify the location of the primary database online redo log files followed by the standby location. This parameter converts the path names of the primary database log files to the path names on the standby database. If the standby database is on the same system as the primary database or if the directory structure where the log files are located on the standby system is different from the primary system, then this parameter is required. Multiple pairs of paths may be specified by this parameter. " As I understand, if the re...

Oracle Server will write continually to control files.
We have a Oralce 9.2 Standard database server with multiple database instances. Each instance has 2 control files, although in the same directory. Using a file monitor we find that the server will write a block of 8K to offset 24576 of the control files every 3 seconds. I wonder if this some kind of synchronization, locking, or heartbeat function in the database. The accumulated IO from the writes from a single database is not a problem, but the accumulation from multiple database is creating problem for our backup software (Veritas BackupExec with OFO). We figure that we can repartition t...

How to write shell script to export oracle 8.1.6 database to import oracle 10g database
Hi, I am trying to write or understand the conj process for export the data from oracle 8i to oracle 10g database. I have constraint that the previous loaded data into oracle10g should not be deleted or replace by newly imported database. Regards Nikhil ...

Writing a log file from an obey file
In message <51a5dbfe09news*@Torrens.org.uk> "Richard Torrens (News)" <News+15019@Torrens.org.uk> wrote: > Lua looks attractive, but it's a long learning curve for a single job! Here is the single job then: Write the following in a text file called "writelog": do local var,logfile,err = os.getenv,arg[1],"Cannot open " local log = assert(io.open(logfile,"a+"),err..logfile) log:write("\n", var "Sys$Time"," on ",var "Sys$Date","\n", var "cycle_No&...

Restore of database file and log file
Hi, I have a Sybase Adaptive Server Anywhere 7 database running. I have a database file that is dated june 12, 2003 I have the database log file from yesterday. The backupsoftware have not backed up the database file since june 12 because it did not back up open files. So, can i merge my database file frome june 12 and my logfile from yesterday and have all the changes since june 12 committed ? If, so how do i do it ? Can't see any tools in the Sybase Central that can help me out... This is a library database and my librarian is not happy at the moment..... ...

Increase in 'log file sync' waits while 'log file parallel write' remains unchanged
We have small 9.2.0.8 database on AIX, from time to time it experiences waits on 'log file sync'. I am unable to explain these waits: - There is no increase in the number or size of transaction - While average wait on 'log file sync' increases from 10ms to 124ms average wait on 'log file parallel write' does not change much - approx 0.05 ms. NORMAL PERIOD: Load Profile ~~~~~~~~~~~~ Per Second Per Transaction --------------- --------------- Redo size: 30,016.82 1,384.01 ...

Very high 'log file sync' wait time with no 'log file parallel write' wait time
Oracle 10.2.0.2 SE on Windows 2003 SP1 The following trace file section is from a very slow import session which is importing 9 Million rows into the database. COMMIT call count cpu elapsed disk query current rows ------- ------ -------- ---------- ---------- ---------- ---------- ---------- Parse 0 0.00 0.00 0 0 0 0 Execute 179802 4.90 474.73 0 0 0 0 Fetch 0 0.00 0.00 0 0 0 0 ------- ------ -------- ---------- --...

How to write debug info from CGI file into the standard log of iPlanet web server?
I would like to output debug information from cgi file into "errors" which is a log file for iPlanet web server. Like in JSP file, using application.log() which is method of the predefined object can output data to the webserver standard log. We don't need to open file handler. Is there any tcl package can do the same funcyionality? Thanks Johnson O.Yung wrote: > I would like to output debug information from cgi file into "errors" > which is a log file for iPlanet web server. Like in JSP file, using > application.log() which is method of the predefined objec...

Restoring Oracle 9.0.1 database from original files (server was rebuilt)
Here's my issue ... our database server was rebuilt but all the original files were backed up before the server was rebuilt. The server was shutdown correctly so I'm not worried about a bad shutdown but I've never done this before. It's on a Windows2000 box. I've reconfigured the server to the same way it was before, but I'm unsure which files and I should exclude and/or include to get the box running the way it was before. Can anyone point me in the right direction to an article that outlines how to do this? I'm more a developer than DBA, but I set up the orig...

moving oracle database server into a new server
Hi all I will be moving oracle from one Solaris server into another Solaris server, the IP address and box name will be changed. Oracle version is 8.1.7 and O/S is 5.8 on both servers ( just different O/S patch). Does any one know what I need to do in order to get oracle up and running again on the new server. I know that I will need to change the tnsnames.ora and listner.ora, but is there anything else that I need to do? Thanks Teresa Teresa wrote: > Hi all > > I will be moving oracle from one Solaris server into another Solaris > server, the IP address and box name will...

File Server Database Apps and SQL Server?
Like a lot of database developers, I often choose Jet for the back- end. I'm starting to worry about what will happen when Jet is deprecated. Ostensibly, Jet users like me must switch to SQL Server (or MSDE / SQL Express), but there's something I just don't understand. Without Jet, how will we create file server database applications? In other words, how will we create multi-user apps which use a file server to share data and don't require a database server? I've seen many discussions of Access vs. SQL Server, but I've never seen this question addressed head-on. I can ...

File size limit crossed when writing the logs to a file.
Hi all, I am invoking a 'C' program from a UNIX shell script and re-directing the output and error to a file. In this context i have a doubt regarding the file size. When i am redirecting the output to a file. Since all the files in UNIX have a specified upper limit for the file size. what happens if we are still trying to write the output to a file when the specified upper limit for the file size has crossed. In this case will the process which is writing logs to the file, gets killed or not. If it is killed, How do i handle this situation in the UNIX script. I forcast this situat...

detach database, attach database without log file
If I detach a database on a server, then attach the database with a single file only using the data file...will I lose any transactions that were in the original log file? There is a debate going on here at work where some people think that during the detach, transactions in the log file are saved to the data file. Thanks! Hi You will not loose any committed transactions. Uncommitted transactions will normally be rolled back rolled back even if you attached the log file!! If this did happen it would be indicated in the SQL Server log file. John "DBA" <kaylisse@yahoo.com> ...

How do I check which Oracle Patches are appplied to an Oracle DataBase Server
I would like to know if someone could help me with this topic, I'm traying to analize and chek which Oracle Patches are appplied to an Oracle DataBase Server >chek which Oracle Patches are appplied to an Oracle DataBase Server If they were applied with oPatch, then "opatch lsinventory" should show you what's there. If you did not use oPatch, then I have no clue. ;-) BD wrote: > >chek which Oracle Patches are appplied to an Oracle DataBase Server > > If they were applied with oPatch, then "opatch lsinventory" should show > you what's ther...

Web resources about - Issues with writing to server-side log file. - comp.databases.oracle.misc

Server-side scripting - Wikipedia, the free encyclopedia
... unfocused, scattered, unnecessary details. WikiProject Technology or the Technology Portal may be able to help recruit an expert. Server-side ...

Google Cloud Platform simplifies server-side development for iOS w/ ‘Mobile Backend Starter’
... Mobile Backend Starter that first debuted for Android developers back in June. Google says the application helps to simplify the server-side ...

Free Cooling: the Server Side of the Story
Servers that support higher inlet temperatures could significantly reduce or even eliminate the cooling costs of the data center. We received ...


[Update: Check Now] Play Store For Android Gets Search Bar With Hamburger Flip In Server-Side Update
Google is pushing out an update to the Play Store's Android interface that replaces the action bar with a standard search bar. Inside are the ...

Server-side update makes Siri a stickler for succinctness
Siri is already well known for her wit and willingness to joke, but a recent server-side update has given Apple's digital assistant the ability ...

Japanese RIAA wants server-side music DRM for mobile phones
The Recording Industry Association of Japan—the Japanese version of the RIAA— …

New BaaS platform aims to eliminate writing server-side code
... offering for desktop and mobile developers that's now leaving its beta phase. By removing the need for writing code on the server-side, Backendless ...

Dart improves async and server-side performance
... Team Today's release of the Dart SDK version 1.3 includes a 2x performance improvement for asynchronous Dart code combined with server-side ...

Customize Google Using Server-Side Scripts
Google's services have a lot of powerful features, but they can't offer all the options requested by users. A popular way to customize Google ...

Resources last updated: 2/16/2016 9:24:38 PM