Monday, May 26, 2008

Oracle export and read only Oracle 8i database

When doing a whole database export from a read-only Oracle 8i database, got the following error near the end of exporting:

......
. about to export USERA's tables via Conventional Path ...

. exporting referential integrity constraints

. exporting synonyms

EXP-00008: ORACLE error 1682 encountered

ORA-01682: read-only DB cannot allocate temporary space in tablespace TEMP

EXP-00000: Export terminated unsuccessfully

Oracle exp uses TEMP tablespace while doing the export. So the solution is to open the database in normal mode, change tablespaces to read only except SYSTEM, RBS, RBSBIG and TEMP. Then perform the export.

Oracle parameter audit_trail and "alter database open read only"

Thank you for visiting Spatial DBA - Oracle and ArcSDE.

Please visit Oracle DBA Tips (http://www.oracledbatips.com) for more Oracle DBA Tips.

=================================================================

! Oracle database auditing has to be turned off before altering the database in READ ONLY mode.
1. Got ORA-16006 when running "alter database open read only":
Error: ORA-16006
Text: audit_trail destination incompatible with database open mode
---------------------------------------------------------------------------
Cause: The audit_trail initialization parameter was set to "DB" (or TRUE),
which is incompatible with a database opened for read-only access.
Action: When the database is opened for read-only access, the audit_trail
initialization parameter can only be set to "OS" or "NONE" (FALSE).
.
2. change the value of audit_trail=none in initnanprod1.ora
audit_trail = none
3. open the database in read only mode
sqlplus /nolog
SQL*Plus: Release 10.2.0.3.0 - Production on Mon May 26 13:26:43 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
SQL> conn / as sysdba;
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 178227688 bytes
Fixed Size 104936 bytes
Variable Size 110841856 bytes
Database Buffers 67108864 bytes
Redo Buffers 172032 bytes
SQL> alter database mount;
Database altered.
SQL> alter database open read only;
Database altered.
4. log in as system
create user test identified by aaa;
ORA-00604: error occurred at recursive SQL level 1
ORA-00372: file 1 cannot be modified at this time
ORA-01110: data file 1: '/fs/u01/oracle_data/testdb/system01.dbf'