Wednesday, September 29, 2010

Renaming global database name hang with row cache enqueue lock

Problem Description
Renaming global database name hangs and never completes. That is following statements hangs,

SQL> alter database rename global_name to orcl.world;

From the alert log we see the a tracefile is generated containing following entry.

>>> WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK! <<< row cache enqueue: session: 0x11d4fd018, mode: N, request: X

 Cause of the Problem
The database was using Database links, which in fact using database GLOBAL_NAME. The ALTER DATABASE RENAME requires an exclusive lock which was waiting for the database link session to end and release their lock on the underlying data dictionary table.

Solution of the Problem
Ensure that currently no active database link session exist and then you can issue rename global_name command.

Alternatively, you can do the following:

SQL> shutdown immediate
SQL> startup restrict
SQL> alter database rename global_name to new name;
SQL> alter system disable restricted session;

No comments:

Post a Comment