ORA-01998
This was tested on Oracle 11.2.0.2.7. I wondered what would happen if you tried to revoke SYSDBA or SYSOPER from SYS so I decided to try it out: SQL> revoke sysdba from sys;revoke sysdba from...
View Article%NOTFOUND
This simple example was tested on Oracle 11.2. It uses SQL*Plus to list the tables owned by a user and counts the rows in each one:SQL> select table_name 2 from dba_tables 3 where owner =...
View ArticleHow to See the Version Number of an Oracle Client
If you want to find out the version number of an Oracle client from Windows, open a Command Prompt, type tnsping and press Enter / Return. No parameters are required. You will see the Oracle version...
View ArticleSwapping
You can see if any swapping has taken place since a UNIX server was started by running vmstat –s. If you see values other than zero on the swap ins or swap outs lines, then swapping has...
View ArticleORA-01090
The first screen print below shows 3 sessions on the same UNIX machine. In the first session, I connected to ORCL as an externally identified user at 14:10:46. In the second session, I connected to...
View ArticleHow to Move System Tablespace Datafiles
In an earlier post I explained how to move datafiles. The method I used then is NOT suitable for datafiles belonging to the system, undo or temporary tablespaces as they cannot be taken offline. I said...
View ArticleThe Curious Case of the Missing PL/SQL Procedure
I have to run files of SQL on databases for developers almost every day. These files often create or recreate PL/SQL packages. Any errors usually go back to the developers for correction as I am not a...
View ArticlePlease Answer my Poll
Another year is nearly over. For many of us, this means an annual appraisal and, if we are very lucky, details of the training we will receive next year.I decided to look and see what is available. I...
View ArticleV$SGASTAT
You can use the query below to show the amount of free memory in your shared pool. It was run on an Oracle 11.1.0.6.0 database: SQL> l 1 select bytes from v$sgastat 2 where pool = 'shared pool'...
View ArticleNOSORT and ORA-01409
When you create an index, Oracle usually does a sort. I read about the NOSORT option recently. This allows Oracle to create an index without doing a sort. I decided to give it a try on an Oracle...
View ArticleData Dictionary Cache Hit Ratio
Every Oracle database has a data dictionary, which is owned by the SYS user and stored in the SYSTEM tablespace. This consists of read-only tables, which record information about the database e.g....
View ArticleORA-01502
This example was tested on Oracle 11.2.0.2.7. It looks at why an index might become unusable. First I created a table in the SYSTEM tablespace by mistake:SQL> create table andrews_table 2...
View ArticleORA-01154
I was cloning one Oracle 10 test database into seven new test databases. I was doing this by copying the datafiles and recreating the control files. You can see this in progress below on one of the...
View ArticleORA-00904
I noticed this in Oracle 11. However, I do not think it is a bug as the same thing happens in Oracle 9. I joined two SELECT * statements with a UNION and added an ORDER BY at the end. This gave me an...
View ArticleHow to Add Conditions After a Where Clause
I went on an Oracle 9i DBA Performance and Tuning course in 2005 and was looking through the course notes recently to find something to blog about. They suggested that if you had conditions after a...
View ArticleEXP-00008 and ORA-00904
A colleague tried to use an Oracle 10 Windows Vista client to export a schema from an Oracle 11.1.0.6.0 database. The export failed and he came to me for help. I have reproduced the error below in a...
View ArticleWhy is my Package or Procedure Invalid?
I had a problem earlier this week with a package which kept going INVALID. Once I had worked out the reason, I decided to do a worked example of it on Oracle 11.2.0.2.7. I created users called...
View ArticleCan You Set a Datafile's Maxbytes / Maxsize to Less Than its Actual Size?
I was dealing with a message like this for one of our developers:ORA-01653: unable to extend table ...He was using a tablespace which had one datafile with AUTOEXTEND ON and this datafile had reached...
View ArticleSQL*Loader and ORA-01480
This was tested on Oracle 11.2.0.2.7 on Solaris. I created a SQL*Loader control file with a table name which was more than 30 characters long: ORCL > cat andrew.ctlload datainfile 'andrew.dat'into...
View ArticleCreate View ... With Check Option
This post was tested on Oracle 11.2. It shows how to use the WITH CHECK OPTION clause of the CREATE VIEW command. The following two steps create a table and a view on a subset of that table i.e. rows...
View Article