Quantcast
Browsing all 330 articles
Browse latest View live

redo log space wait time, redo buffer allocation retries, redo blocks written...

The redo log space wait time statistic records the total amount of time spent (since the instance was started) waiting for space in the redo log buffer. It is recorded in hundredths of a second:...

View Article


ORA-00301 and ORA-27038

If you try to add a member to a redo log group, and the file already exists at the UNIX level,you get an ORA-00301 and an ORA-27038: SQL> select group#, member from v$logfile;     GROUP#...

View Article


SQL MINUS Operator

If you join two SELECT statements together with a MINUS, the output from the second SELECT is removed from the output from the first SELECT before the results are displayed. As always, it is easier to...

View Article

ORA-00068

This example, tested on an Oracle 9 database, shows the largest permitted value for the max_enabled_roles parameter:SQL> alter system set max_enabled_roles = 150 scope = spfile  2  /alter system set...

View Article

Library Cache Pin and Library Cache Lock Wait Events

A developer was trying to compile a procedure without success recently so I decided to reproduce the problem for future reference. I did this in an Oracle 11.2 database. First I created a user then I...

View Article


ORA-00360

Oracle returns an ORA-00360 if you try to drop a redo logfile member which does not exist: SQL> select group#, member from v$logfile  2  order by 1, 2;     GROUP# MEMBER----------...

View Article

Recursive Procedure Compilation

This was tested on Oracle 11.2. You cannot compile a procedure if anybody is running it so, if you write a procedure which compiles itself, it hangs: SQL> conn andrew/reidConnected.SQL> select...

View Article

ORA-12154

You get this error when you try to connect to a database which is not in your tnsnames.ora file as you can see in the example below: I set my TNS_ADMIN variable to the current directory:...

View Article


ORA-01078

If you get an ORA-01078 when trying to open a database, this means there is an invalid value in the database’s parameter file: Oracle 9: sqlplus '/ as sysdba' SQL*Plus: Release 9.2.0.5.0 - Production...

View Article


LOCKED and LOCKED(TIMED)

This example, which was tested on Oracle 11.2, shows the difference between a user with an ACCOUNT_STATUS of LOCKED and one with an ACCOUNT_STATUS of LOCKED(TIMED). First I created a profile with a...

View Article

ORA-04042

If you try to grant execute access to a non-existent procedure, you get an ORA-04042. You can see what I mean in the example below, which I ran in an Oracle 9 database: SQL> create procedure proc1...

View Article

Operator Precedence in PL/SQL

This was tested on Oracle 11.2. Many platforms give unary plus and minus a higher priority than exponentiation but PL/SQL does not:SQL> SET SERVEROUTPUT ONSQL> DECLARE  2   A NUMBER := -2**2;  3...

View Article

ORA-02494

This was tested on Oracle 11.2. If you create a tablespace with a datafile with autoextend on, the file’s maxsize cannot be less than its size. If it is, you get an ORA-02494: SQL> l  1  create...

View Article


How to Run DDL in PL/SQL

This was tested on Oracle 11.2. You cannot run DDL directly in PL/SQL. If you try, you get an error:  SQL> conn / as sysdbaConnected.SQL> select account_status  2    from dba_users  3    where...

View Article

ORA-00909

You can count the number of different values in a column as follows:SQL> select count(distinct owner)  2  from dba_tables  3  /COUNT(DISTINCTOWNER)--------------------                  17SQL>But...

View Article


V$SESSION_WAIT SECONDS_IN_WAIT Column

This was tested on Oracle 11.2.0.1.0. I created a user in the red session below and used it to login to the database: SQL> grant create session to andrew  2  identified by reid  3  / Grant...

View Article

ORA-01792

I tested this example in Oracle 11.2. First I created a table with 1 column called COL1: SQL> create table tab1 (col1 number)  2  / Table created. SQL> Then I used a PL/SQL loop and EXECUTE...

View Article


How to Allow Updates and Inserts on Individual Columns

This was tested on Oracle 11.2. First I created a couple of users: SQL> create user andrew identified by reid  2  default tablespace users  3  quota unlimited on users  4  / User created. SQL>...

View Article

ORA-00069

A colleague asked what the table_lock column in dba_tables was for. I did not know so I decided to investigate.First I looked at the distribution of table_lock values in one of our test...

View Article

PL/SQL Example Using SUBTYPE and VALUE_ERROR

This example was tested on Oracle 11.2. First it creates a single-digit variable called SMALL_NUMBER. It then uses this to define a subtype called SINGLE_DIGIT, which has the same type as SMALL_NUMBER....

View Article
Browsing all 330 articles
Browse latest View live