ORA-01031 Creating a View on a Table Accessed via a Role
This example shows that you cannot create a view on a table which you access via a role. It was tested on Oracle 11. First I created a role:SQL> create role andrews_role 2 /Role created....
View ArticleAFTER DELETE Triggers do not Run After a Truncate
In this example, I want to show that Oracle does not execute an AFTER DELETE trigger after doing a TRUNCATE. I tested it on Oracle 11.2. First I created a table:SQL> create table tab1 (my_name...
View Article_single_process Initialization Parameter
The _single_process initialization parameter allows you to start an instance in single process mode. As it begins with an underscore, you should only use it when Oracle tell you to. When I tried it on...
View ArticleORA-01511, ORA-01512 and ORA-27037
This was run on an Oracle 11 database. I used dbca to create a database recently and, by mistake, I put redo03a.log in the wrong directory (ent_red01 with a zero instead of ent_redo1 with an o). dbca...
View ArticleTRUNCATE TABLE SYS.AUD$ Gives ORA-00942
I saw that the SYSTEM tablespace in an Oracle 11.2 database was getting quite big so I checked the size of SYS.AUD$: C:\Users\AJ0294094>sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on...
View ArticleGlobal_Names and ORA-02085
This was tested on Oracle 9. I created 2 database links to the same target database: SQL> conn / as sysdbaConnected.SQL> create database link any_name.world 2 connect to link_schema 3...
View ArticlePRAGMA AUTONOMOUS_TRANSACTION
I tested this on Oracle 11.2. If you update a table in SQL*Plus then update it again with a different value in a PL/SQL block, the second update replaces the first: SQL> create table tab1 as 2...
View ArticleORA-00065
For those of you still on Oracle 9, here is a summary of bug 3368245. It caught me out on a few occasions until I looked it up on Metalink. If you are using a server parameter file, setting fixed_date...
View ArticleSoundex
I found a booklet called Introduction to SQL Version 1.0, printed in 1985 and 1989. It was written by a certain Lawrence Ellison and described a function called SOUNDEX, which I had never heard of...
View Articlesqlplus -prelim
If all the available processes in a database are used up, you will get an ORA-00020 when you try to login. The best way round this is to get some people to log out. However, this may not be possible...
View ArticleHow I Copied Triggers from one Database to Another
(This happened on Oracle 11.2.) In an earlier example, I started to look at doing a full expdp and impdp. I'm not sure why, but the Data Pump import produced a number of errors. There were well over...
View ArticleORA-00361
This was tested on an Oracle 9 database. One way to relocate redo log groups is to drop members in one location and recreate them in another. However, if your redo log group only has one member and you...
View ArticleGROUP BY and ORDER BY
In 1997, I was sent on a 1 day Introduction to Oracle course. The lecturer said that if you used a GROUP BY, you could not assume that the results would be returned in order. If you wanted to make...
View ArticleFAST Refresh of Materialized View Returns ORA-12004
I tried to do a FAST refresh of a materialized view in Oracle 11.2 but it failed with an ORA-12004: SQL> begin 2 dbms_mview.refresh('ebase.m_gridpoint2',method=>'F'); 3 end; 4 /begin*ERROR...
View ArticleORA-00031, ORA-03113 and ORA-03114
This was tested on Oracle 11.2. I had a session in the middle of a long-running operation: SQL> conn user1/user1Connected.SQL> exec dbms_lock.sleep(3600); I tried to kill it like this but Oracle...
View ArticleThe USER Keyword
Here are a couple of examples with the USER keyword, which I tested on Oracle 11.2. You can use it after the SHOW command or in a SELECT statement as follows. It returns the name of the user running...
View ArticleWrap Utility
This is an example using the wrap utility, which allows you to hide stored code. Software suppliers can use it to prevent customers stealing their PL/SQL. First I created a table: SQL> create table...
View ArticleSHUTDOWN TRANSACTIONAL
If you run this command, Oracle waits until all users have committed or rolled back any outstanding transactions before closing the database. To test this out in Oracle 12.1, I tried to close a...
View ArticleTaking a Datafile Offline in NOARCHIVELOG Mode
I was reading a colleague’s copy of Oracle RMAN 11g Backup and Recovery by Robert Freeman. It said that you could not take a datafile offline if the database was in NOARCHIVELOG mode. I don’t know much...
View ArticleV$RECOVERY_FILE_DEST
The V$RECOVERY_FILE_DEST view shows details about the flash recovery area. In the example below, it is queried to see the maximum size. This is then increased from 4 gigabytes to 5 gigabytes and the...
View Article