Trouble with Groups

I inherited some back end code. Most of it is written in PL/SQL. That's the part I like. The problem is that I cannot get the darn thing to run to completion without errors. The latest issue is with a file that is generated.

The developer uses the UTL_FILE built in package to create a file and write to it. That sounds reasonable. However the Oracle database is hosted on a UNIX server. So when it creates the file, the thing is owned by user oracle and by the oinstall group. I am not oracle. And I do not belong to the oinstall group.

Guess what? That means I cannot do anything with the file that got created by UTIL_FILE. I cannot view the file contents. I cannot delete the file. Nor can I move it. This is just no fun. What am I supposed to do? My first reaction was to just become a member of the oinstall group. However that raised some flags with the DBAs and system administrators. Although I agree this sounds wrong, what is a developer to do? I have put in a request for assistance with one of the DBAs. Hopefully help is on the way.

Mysterious Foreign Key Issue

I need to do a lot of unit tests of some database code soon. So I wrote a script that would reset all the data. This script had to remove a lot of records from some tables. I figured the quickest way to do that would be to truncate the tables. I carefully chose the order of the truncation to ensure that the tables with foreign key references would be chopped first.

When I ran my script, I kept getting an ORA-02266 error message. This is defined as "unique/primary keys in table referenced by enabled foreign keys". This seemed strange. This was happening even when there were no records in the foreign and primary key tables. At first I thought maybe some synonyms were resolving to the wrong tables. But even when I prefaced table names with their schemas, I got the error.

In the end I could not figure out what was going on. I replaced the TRUNCATE commands with DELETE statements. Those worked fine. Is this some sort of database error? Or maybe you just are not allowed to TRUNCATE tables with foreign key references. Who knows?