Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 
 

Incorrect utl_file permission umask tips

Oracle Database Tips by Donald BurlesonJune 15, 2015

Question:  I have a problem where creating a new file with utl_file.open creates improper permissions for the file.  When we run a PL/SQL stored procedure that creates a file using utl_file.open, the permissions are 644.   

However, when the same stored procedure is executed from inside an Oracle job, the resulting permission from utl_file are 600. I check that the umask for the oracle user is 022 so I would expect new files to have the default permission of 622.  Why does the file permission change from 622 to 600 when the utl_file is executed from a remote job?

Answer:  The file permission change from 622 to 600 when the utl_file is executed from a remote job because of the value of the default permission for the UNIX/Linux directory!

For example, if umask were un-set to a value of 000 (wide-open), the default permissions for the directory take over, and any new file would be created from utl_file.open with permissions of 600.

When creating file in batch (as when you called the PL/SQL procedure from a job), it's not only the umask that determines the final permissions for the new file!  There are three dimensions to creating a file from inside a job:

  • The umask (set to 022)

  • The owner of the directory (should be oracle)

  • The default permissions for the directory inode (should be 644)

You should check your directory inode permissions to make all files within the directory where the utl_file will create files has 664 permissions by default. For example if you are writing to /home/oracle you can issue the chmod command to change the default permissions for new files in the directory:

chmod 664 /home/oracle

Then, all files in that directory will be rw for the DBA group (the middle octet).


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.