Thursday, January 10, 2013

ORA-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 target databases, which I will call DB1. The @ccf instruction runs a file called ccf.sql to recreate the control file. The ccf.sql file was created by running alter database backup controlfile to trace on the source database: 

Solaris > sqlplus / as sysdba
 
SQL*Plus: Release 10.2.0.3.0 - Production on Thu Jan 10 14:31:55 2013
 
Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
 
Connected to an idle instance.
 
SQL> startup nomount
ORACLE instance started.
 
Total System Global Area  264241152 bytes
Fixed Size                  2029424 bytes
Variable Size              88082576 bytes
Database Buffers          167772160 bytes
Redo Buffers                6356992 bytes
SQL> @ccf
 
Control file created.
 
SQL> alter database open resetlogs
  2  /
 
While this was running, I tried to do the same thing (in a different server session) on another database, which I will call DB2. I forgot to run . oraenv first and Oracle was pointing to DB1 instead of DB2. Then I saw the following error:
 
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01154: database busy. Open, close, mount, and dismount not allowed now
 
SQL>
 
I returned to the UNIX prompt and ran . oraenv to point Oracle to DB2. Then when I tried to open the database again, the command was successful.

No comments:

Post a Comment