Create File With (other) User Having Read Permission When Using Utl_file?
Dec 23, 2012
We have a requirement to create a file using UTL_FILE package. so we tried to generate the file in directory at UNIX level,for example "/tmp" which means when we executing the stored procedure which in turn calls UTL_FILE package and create a file say "a.txt". On checking the permission for "a.txt", it shows as follows
-rw-r----- oracle dba a.txt
this means read and write for oracle user, read for dba group and no permission for other user.
our requirement is to have the following privileges at UNIX level.
-rw-r--r-- oracle dba a.txt
Is it possible to do at oracle level since the file is owned by oracle user or at UNIX level (with out logging to oracle user)?
Environment: UNIX AIX 6.1 and Oracle 11.2.0.3
View 3 Replies
ADVERTISEMENT
Jul 23, 2010
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
PL/SQL Release 11.1.0.6.0 - Production
"CORE 11.1.0.6.0 Production"
Is there a way to read Excel file using UTL_FILE package ?
Like our usual method:
l_utlfile := utl_file.fopen(p_dir, p_filename, 'R',2000);
p_filename is event.xls
Or do we need to convert that file to .csv or .txt ?
View 5 Replies
View Related
Apr 26, 2013
I want to use UTL_FILE package to create OS file. How to resolve this error. Oracle11g under XP.
SQL> create directory my_dir as 'c: emp';
Directory created.
1 create or replace procedure test_1(md in varchar2)
2 is
3 file utl_file.file_type;
4 begin
5 file := utl_file.fopen(md,'abc.log','w');
6 utl_file.put_line(file,'EMPLOYE REPORT');
7 utl_file.fclose(file);
8* end;
SQL> /
Procedure created.
SQL> execute test_1('MY_DIR');
BEGIN test_1('MY_DIR'); END;
RROR at line 1:
RA-06510: PL/SQL: unhandled user-defined exception
RA-06512: at "SYS.UTL_FILE", line 98
RA-06512: at "SYS.UTL_FILE", line 157
RA-06512: at "SCOTT.TEST_1", line 5
RA-06512: at line 1
View 2 Replies
View Related
Nov 16, 2013
1. To create a read only user who can only query the views as well as db tables and views.
2. How to create such a read-only user. 3. I have taken a full expdp backup of the production and trying to import it on the pre-production.
I use impdp
system/password table_exists_action=replace full = y dumpfile=file_name.dmp remap_schema=SYSTEM:NEW_USER remap_tablespace=SYSTEM:NEW_USER ;
This can replace and import the tables but it can't replace and add the constraints , do I have to add some other parameter in the syntax if so what it should.
View 11 Replies
View Related
Jul 19, 2010
i am using oracle 10g enterprise edition.whether its possible to read international characters from the text file using the utl_file function..?
View 1 Replies
View Related
Oct 8, 2012
I have a requirement like give reaonly access on my stored procedure to another user , not even execute permission on that steored procedure.
let us know the command ?
View 10 Replies
View Related
Jan 19, 2011
I have 3 users in one schema. One user is having all the tables, packages,triggers etc and this is the super user.
I want to access all the tables, packages etc without prefix the username in other two users.
View 15 Replies
View Related
Nov 2, 2010
I have database in 9.2.0.3 on windows 2003 R2 one server and i have serve with 10.2.0.4 64 bit on windows 2008 R2 64 bits. I want to move database from 9.2.0.3 to new server on 10.2.0.4.
!)should i do the cold backup of 9.2.0.3 and then create db instance on new server and then use dimutility to create new instance and then run the patch upgrade.
!!) I would like to do export all schema and user permision (is if possible?)export and then import to new server?
View 2 Replies
View Related
Mar 21, 2013
i have to grant permission to a user on a package dbms_transaction.After i granted permission i am getting error:
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_TRANSACTION", line 88
ORA-06512: at line 1
View 7 Replies
View Related
Oct 1, 2012
Is it possible in oracle dbms for a user to have the permission to create a table but not have the permission to insert in, although the same user just created it?
View 6 Replies
View Related
Mar 11, 2013
I Got a scnario like a upload file contains
1.Header(Contains the File Name,Branch Name,MIS date)
2.Body(Customer Details)
3.Footer (File Name,Contians Total Number of Records and Number of Customers)
Like
CustomerDet_11-12-2013.csv,Chennai,11-12-2013
101,AAA,Savings,'M',10000
102,BBB,Current,'O',2000
103,CCC,Deposit Acct,'F',3000
CustomerDet_11-12-2013.csv,3,15000
How to handle this scnario through UTL_File
View 31 Replies
View Related
May 3, 2010
I have an application that creates files using the utl_file package. It works fine but one of the lines in the file should hold the number of bytes in the file (on a line formatted like 'FileSize: 2104'). Unfortunately this line is not the last line of the file and the lines that follow it are variable in length.
My approach therefore is as follows:
1. Write the 'FileSize: ' line during file creation.
2. Write the remaining lines of data to the file (but don't close it).
3. Use utl_fgetattr to find the file size.
4. Go back and find the 'FileSize' line I need to update, using get_line to read it into the buffer.
5. Append the filesize (plus the number of characters that the variable I use to store the filesize value) to the buffer string.
6. Write the line back to the file using put_line.
However I keep getting invalid file operation errors however I try to re-access the file...
PROCEDURE setUtlFileSize (pFileName IN VARCHAR2,
pFileHandle IN utl_file.file_type) IS
vbFileExists BOOLEAN;
viFileLen NUMBER;
viFileBlockSize NUMBER;
vsFileRecord VARCHAR2(2000);
[code].......
This gives me the following output.... (for two files)... currently I am using some generic exception handling just to show me the error.
File Length: 2106
File Position: 0
-29283,ORA-29283: invalid file operation
File Length: 497
File Position: 0
-29283,ORA-29283: invalid file operation
Process exited.
Two things here concern me: The File Position suggests that the current offset position is set to the start of the file... but since I had not closed or performed any other operation since the last put_line and fflush (which are used to add lines to the file) I had expected that the offset position would be the same as the file length?
Secondly: Even if the position had been reset to the start of the file I don't understand why the get_line gives me the oracle error.
View 1 Replies
View Related
Apr 21, 2011
I'm using
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
I'm creating a file using UTL_FILE.FOPEN and UTL_FILE.PUTF
But I don't know the file I created is in which encoding ASCII, UTF-8, EBCDIC etc.
1.) How can I create files in my desired encoding using UTL_FILE?
2.) Does UTL_FILE use database encoding? If yes then how to find out database encoding?
3.) Which encoding is used by UTL_FILE by default?
View 4 Replies
View Related
Apr 27, 2012
How to spool the Japanese characters in table using UTL_FILE. I tried with utl_file.fopen it's general,it's spooling. but i am not sure it this right way or not. in this case we need to change any character.
We can't see this characters in TOAD. Only possible in PLSQL developer
create table test1(name varchar2(1000),fname varchar2(1000))
insert into test1 values ('名を入力してください。','姓を入力してください。')
commit;
View 6 Replies
View Related
Jan 18, 2011
I want to extract data from a table and write into a txt file using UTL_FILE utility.I have written the below query. I am able to see query is returning data.But it is not creating file and writing data into it.
CREATE OR REPLACE DIRECTORY DOC_PATH AS '/apps/orarpt/SJDEV/utl'
CREATE OR REPLACE PROCEDURE xxcfi_outbound_test (errbuf OUT VARCHAR2,
retcode OUT VARCHAR2)
AS
CURSOR emp_cur
[code].....
View 1 Replies
View Related
Sep 12, 2011
User A contains tables, views, LOB's, types, procedures, triggers, sequences, indexes, synonyms. User B wants to have read-only privilege on the objects of User A.
I can provide select on privilege on tables and views. How about providing read-only privileges to other objects?
View 1 Replies
View Related
Oct 9, 2012
I am using an Oracle 8i database.We intend creating a dbms_job that would run every 5 minutes. The job executes a script that would use utl_file to read two text files (a header file and detail file) from a particular directory and load the data into temporary tables. The naming convention of the files are Parts_Master_DD/MM/YY HH:MI:SS and Parts_Stats_DD/MM/YY HH:MI:SS. Both files to be stored in the same directory.
If the file name was constant ie. Parts_Master, Parts_Stats I would not have a problem. However with each file name now going to be unique, how do I handle this using utl_file. To add to my dilemma, within an hour more than one set of files could be piped to the directory to be read into the database.
View 3 Replies
View Related
Jun 2, 2011
how to create script/steps that makes database read only to a particular user
View 2 Replies
View Related
Jun 5, 2012
I want to know what if any person don't know the password of SYS, can he create password file, becauase i dont know the password of sys users, generally login with '/ as sysdba',
View 4 Replies
View Related
Apr 16, 2013
I Created One Trigger as Follows
CREATE OR REPLACE TRIGGER TRIGGER1
BEFORE INSERT
ON table1
FOR EACH ROW
[code]......
Here , I Want To Insert The Data From My User To Test User . In This Situation When I Execute The Above Trigger It Shows The Error PL/SQL: ORA-00942: table or view does not exist
View 3 Replies
View Related
Jun 2, 2011
I will have to provide read/write access to an oracle user. What privileges should i grant to the user so as to enable the user to read from and write to the files?
View 2 Replies
View Related
Mar 5, 2011
I am often supplied with a list of numbers to query against & normally take the easy option of editing the file & placing the select on each line. Like so. what to do to loop this. The input file would just be the numbers in a flat file.
Select status from thetable where MPN=�01234567890�;
Select status from thetable where MPN=�12345678901�;
Select status from thetable where MPN=�23456789012�;
Select status from thetable where MPN=�34567890123�;
View 4 Replies
View Related
Sep 17, 2013
I have a requirement to load the csv into DB using oracle forms or pl/sql code, but the problem is they are asking to load the csv file which will not come in sequence every time.For Example: File1:col1 col2 col3 col4 file 2col3 col2 col4 col1 file 3col4 col2 col1 col3 Depending on the header we need to load the file,Can we load like this or not?
View 12 Replies
View Related
Mar 18, 2010
How can i read an HTML file from PLSQL.
View 12 Replies
View Related
Dec 12, 2012
How to create a procedure to read data from database and export it into .csv format without using utilities
View 15 Replies
View Related
Oct 1, 2013
Can we read .pkb file or any conversion procedure
View 2 Replies
View Related
Aug 30, 2013
I want to upload csv file from share location(another host) & store data in table
View 2 Replies
View Related
Jun 27, 2012
From a script how I can read a local file (where I have the sql client)?
I have an Oracle database on a server, and I connect from another machine with SQL Developer.I want to read a text file on my local machine ( where I run my script) to use the data in the script.I never want to read or write on the server.
Reading on internet i read about UTF_FILE package But what is not clear to me is, this is on the server or client ?Also some people says UTF_FILE can work both on client side and server side.Also I read about package text_io, but I think it is only for forms.
View 5 Replies
View Related
Jan 19, 2012
I need to create PROCEDURE to create user in oracle
CREATE OR REPLACE PROCEDURE "CREATE_USER_ORACLE8"
(
USER_ID in VARCHAR2,
PASSWORD in VARCHAR2,
ROLES in VARCHAR2,
nReturnCode OUT NUMBER
)
BEGIN
[code].......
Compilation errors for PROCEDURE NOG.CREATE_USER_ORACLE8
Error: PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following:
; is with authid deterministic parallel_enable as
Line: 9
Text: BEGIN
i want that the customer execute PROCEDURE (user_id,password,PROCEDURE )
View 5 Replies
View Related
Nov 16, 2011
I have a file studnet.txt in following order
JAMs|1231|PHYSICS
SAM|1232|PHYSICS
ALI|1233|CHEMISTRY
I want to read and write data from a file in | seprated mode. file READ and WRITE using Oracle Forms6i. I have a knowledge of file handling in C++ but not use it in Oracel Form before this.
View 5 Replies
View Related