Monday, July 15, 2013

ORA-01103: database name 'BCBL' in control file is not 'TEST'

SQL> STARTUP

ORACLE instance started.

Total System Global Area  612368384 bytes
Fixed Size                  1292036 bytes
Variable Size             239077628 bytes
Database Buffers          364904448 bytes
Redo Buffers                7094272 bytes
ORA-01103: database name 'BCBL' in control file is not 'TEST'

SQL> SHUT IMMEDIATE;

ORA-01507: database not mounted

ORACLE instance shut down.

SQL> STARTUP NOMOUNT;

ORACLE instance started.

Total System Global Area  612368384 bytes
Fixed Size                  1292036 bytes
Variable Size             243271932 bytes
Database Buffers          360710144 bytes
Redo Buffers                7094272 bytes

SQL> ALTER SYSTEM SET DB_NAME=BCBL SCOPE=SPFILE;

System altered.

SQL> SHUT IMMEDIATE;

ORA-01507: database not mounted

ORACLE instance shut down.

SQL> STARTUP

ORACLE instance started.

Total System Global Area  612368384 bytes
Fixed Size                  1292036 bytes
Variable Size             247466236 bytes
Database Buffers          356515840 bytes
Redo Buffers                7094272 bytes
Database mounted.
Database opened.

SQL>

Sunday, July 14, 2013

Redo Logs Files And Control Files Activity.

Redo Logs:- Redo logs record all changes made to a database's data files. Each time data is changed in the database, that change is recorded in the online redo log first, before it is applied to the data files. An Oracle database requires at least two online redo log groups , and in each group there is at least one online redo log member , an individual redo log file where the changes are recorded. At intervals, the database rotates through the online redo log groups, storing changes in the current online redo log.

Control Files:-  The control file contains the record of the ph ysical structures of the database and their status. Several types of information stored in the control file are related to backup and recovery:

1. Database information (RESETLOGS SCN and time stamp)
2. Tablespace and datafile records (filenames, datafile checkpoints, read/write status, offline ranges)
3. Information about redo threads (current online redo log)
4. Log records (log sequence numbers, SCN range in each log)
5. A record of past RMAN backups
6. Information about corrupt datafile blocks


Undo Segments:- In general, when data in a datafile is upda ted, "before images" of that data are written into undo segments . If a transaction is rolled back, this undo information can be used to restore the original datafile contents. In the context of recovery, the undo information is used to undo the effects of uncommitted transactions, once all the datafile changes from the redo logs have been applied to the datafiles. The database is actually opened before the undo is applied.

Monday, July 1, 2013

ORA-08189: cannot flashback row movement is not enabled

Whenever I tried to Flashback Table in Oracle. The following error occurs.

FLASHBACK TABLE OUTWDCLR TO TIMESTAMP (SYSTIMESTAMP - INTERVAL '5' minute);

Cause :
========================
Whenever you performed flashback operation(flashback table, flashback version query,flashback transaction query) of a table except flashback drop feature(which don't need to enable row movement as whole objects come from recycle bin) then above error will come.

Solution :
========================
Row movement of the table need to be enabled in order to perform flashback table.

See Row Movement Status
 ========================
SELECT TABLE_NAME,ROW_MOVEMENT FROM USER_TABLES WHERE TABLE_NAME='OUTWDCLR';

Enable  Row Movement Status
========================
ALTER TABLE OUTWDCLR ENABLE ROW MOVEMENT;

Now You can FLASHBACK Your Table.

FLASHBACK TABLE OUTWDCLR
  TO TIMESTAMP (SYSTIMESTAMP - INTERVAL '5' minute);