Professional Documents
Culture Documents
Tuning Goals
In case of a restore from hot backup, please ensure you have taken care of all temporary
files. It has been observed in the past that all data files were restored but temporary files
were ignored.
SQL> startup
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
Database mounted.
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: 'C:\ORACLASS\ORADATA\U03\LOG01A.RDO'
ORA-00312: online log 1 thread 1: 'C:\ORACLASS\ORADATA\U04\LOG01B.RDO'
NOTE: Assumption is that there is least 3 redo log group in order to do the following.
1
Oracle 9i Backup and Recovery
Tuning Goals
2
Oracle 9i Backup and Recovery
Tuning Goals
If you created only one log file per group then you have two choices. You can open a TAR
with oracle support for help in forcing the database open when you have lost your active
log file. Or, judging by the low sequence numbers of your log files, you may be able to
recreate the database from scratch and reapply any transactions. This is shown below:
SQL> startup
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
Database mounted.
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: 'C:\ORACLASS\ORADATA\U03\LOG01A.RDO'
SQL> startup
3
Oracle 9i Backup and Recovery
Tuning Goals
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
Database mounted.
4
Oracle 9i Backup and Recovery
Tuning Goals
5
Oracle 9i Backup and Recovery
Tuning Goals
SQL> startup
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
ORA-00205: error in identifying controlfile, check alert log for more info
SQL> shutdown
ORA-01507: database not mounted
ORACLE instance shut down.
At this point I refer to the backup done in the past of the controlfile done
via the following command:
SQL> alter database backup controlfile to trace;
Database altered.
Find the file created in the directory listed below and edit the file removing
all the lines above the STARTUP NOMOUNT, and also change the
# to -- (comments). NOTE: there are two STARTUP MOUNT’s in the file.
SQL> show parameter user
NAME TYPE VALUE
------------------------- ----------- ---------------------------
user_dump_dest string c:\oraclass\ADMIN\UDUMP
SQL> @controlfile
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
Control file created.
ORA-00283: recovery session canceled due to errors
ORA-00264: no recovery required
6
Oracle 9i Backup and Recovery
Tuning Goals
SQL> startup
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: 'C:\ORACLASS\ORADATA\U02\SAMPLE01.DBF'
6 rows selected.
Looking at the OS you find that the mount point has been lost and all of files on it.
This one also has the UNDO tablespace, So a closed recovery is required.
7
Oracle 9i Backup and Recovery
Tuning Goals
SQL> startup
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 2 - see DBWR trace file
ORA-01110: data file 2: 'C:\ORACLASS\ORADATA\U02\UNDOTBS.DBF'
8
Oracle 9i Backup and Recovery
Tuning Goals
SQL> startup
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: 'C:\ORACLASS\ORADATA\U01\SYSTEM01.DBF'
9
Oracle 9i Backup and Recovery
Tuning Goals
SQL> startup
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 3 - see DBWR trace file
ORA-01110: data file 3: 'C:\ORACLASS\ORADATA\U03\USERS01.DBF'
10
Oracle 9i Backup and Recovery
Tuning Goals
This assumes that you have discovered the problem and have restored all the datafiles.
COUNT(*)
----------
1016271
11
Oracle 9i Backup and Recovery
Tuning Goals
SQL> startup
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
Database mounted.
ORA-01113: file 5 needs media recovery
ORA-01110: data file 5: 'C:\ORACLASS\ORADATA\U02\SAMPLE01.DBF'
6 rows selected.
12
Oracle 9i Backup and Recovery
Tuning Goals
SQL> startup
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 8 - see DBWR trace file
ORA-01110: data file 8: 'C:\ORACLASS\ORADATA\U05\JUNK01.DBF'
NAME TBLSPACE
---------------------------------------- --------------------
C:\ORACLASS\ORADATA\U01\SYSTEM01.DBF SYSTEM
C:\ORACLASS\ORADATA\U02\UNDOTBS01.DBF UNDOTBS
C:\ORACLASS\ORADATA\U03\USERS01.DBF USERS
C:\ORACLASS\ORADATA\U03\INDX01.DBF INDX
C:\ORACLASS\ORADATA\U02\SAMPLE01.DBF SAMPLE
C:\ORACLASS\ORADATA\U01\QUERYDATA01.DBF QUERY_DATA
C:\ORACLASS\ORADATA\U02\EXAMPLE01.DBF EXAMPLE
C:\ORACLASS\ORADATA\U05\JUNK01.DBF JUNK
8 rows selected.
13
Oracle 9i Backup and Recovery
Tuning Goals
SQL> startup
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 3 - see DBWR trace file
ORA-01110: data file 3: 'C:\ORACLASS\ORADATA\U03\USERS01.DBF'
SQL> startup
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
Database mounted.
SQL> shutdown
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
14
Oracle 9i Backup and Recovery
Tuning Goals
SQL> startup
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
Database mounted.
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: 'C:\ORACLASS\ORADATA\U01\SYSTEM01.DBF'
15
Oracle 9i Backup and Recovery
Tuning Goals
SQL> startup
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: 'C:\ORACLASS\ORADATA\U04\NEW01.DBF'
A tablespace and table were created in the past with the following commands:
SQL> create tablespace new_sample datafile
2 'c:\oraclass\oradata\u04\new01.dbf' size 1m;
Tablespace created.
SQL> create table new_tables (col1 number ,col2 number)
2 tablespace new_sample;
Table created.
16
Oracle 9i Backup and Recovery
Tuning Goals
SQL> startup
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
17
Oracle 9i Backup and Recovery
Tuning Goals
18
Oracle 9i Backup and Recovery
Tuning Goals
SQL> startup
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
ORA-00205: error in identifying controlfile, check alert log for more info
SQL> @c:\oraclass\backup\ctl
Control file created.
ORA-00283: recovery session canceled due to errors
ORA-00264: no recovery required
System altered.
Database altered.
19
Oracle 9i Backup and Recovery
Tuning Goals
SQL> @c:\oraclass\backup\ctl
ORACLE instance started.
System altered.
Database altered.
Database altered.
Tablespace altered.
Tablespace altered.
20
Oracle 9i Backup and Recovery
Tuning Goals
SQL> startup
ORACLE instance started.
Total System Global Area 26286444 bytes
Fixed Size 452972 bytes
Variable Size 20971520 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> select * from dba_tab_columns order by 1,2,3,4;
ERROR:
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: 'C:\ORACLASS\ORADATA\U02\TEMP01.DBF'
no rows selected
21
Oracle 9i Backup and Recovery
Tuning Goals
The only way I could the fix the problem was to delete the spfile and create an
init.ora file from the non-default parameters from the alert log file.
22