Solved

SCN /resetlogs question

Posted on 2003-11-07
5
4,183 Views
Last Modified: 2010-08-05
I need some reference to get a simple minded understaning of SCN and the relationship to resetlogs.
This is the sequence of events as far as I can tell.
Database files were tar'ed and hardware was reconfigured.
The files were then un - tar'ed back into an area smaller than the original.  After the files were untarred, I attempted to start the database.  Some error messages came out that indicated I could recover until cancel which I did for one of the three databases and everything was fine.  Apparently noticing the space situation and the other two data bases giving error messages someone started trying to make space and deleted some files.  When I tried starting the database i had recovered, i got error messages.  I had my own backup of the data files  and replaced them.   At this point I resetlogs,
immediately made a backup.  Again files were deleted, this time all the datafiles plus the backup I had made immediately after the resetlogs.  Now SCN questions.  How does SCN relate to datafiles and /or controlfiles?
0
Comment
Question by:xoxomos
5 Comments
 
LVL 8

Assisted Solution

by:Danielzt
Danielzt earned 100 total points
ID: 9705965
0
 
LVL 13

Accepted Solution

by:
anand_2000v earned 250 total points
ID: 9706187
SCN is one of the different parts used in Oracle for syncronization. You might have noticed that the logfile sequence was reset to 1 after resetlogs. However SCN continued in the same manner. Resetting the SCN is not possible.  After you have given resetlogs you cannot use the previous backup datafiles for recovery unless you use the earlier controlfile also.
0
 
LVL 47

Assisted Solution

by:schwertner
schwertner earned 150 total points
ID: 9706735
System Change Number
Whenever a transaction commits, the Oracle server assigns a commit system change
number (SCN) to the transaction. The SCN is monotonically incremented and is
unique within the database. It is used by the Oracle server as an internal time stamp to
synchronize data and to provide read consistency when data is retrieved from the data
files. Using the SCN enables the Oracle server to perform consistency checks without
depending on the date and time of the operating system.

Steps in Processing COMMITs
When a COMMIT is issued, the following steps are performed:
1 The server process places a commit record, along with the SCN, in the redo log
buffer.
2 LGWR performs a contiguous write of all the redo log buffer entries up to and
including the commit record to the redo log files. After this point, the Oracle server
can guarantee that the changes will not be lost even if there is an instance failure.
3 The user is informed that the COMMIT is complete.
4 The server process records information to indicate that the transaction is complete
and that resource locks can be released.
Flushing of the dirty buffers to the data file is performed independently by DBW0 and
can occur either before or after the commit.
0
 

Author Comment

by:xoxomos
ID: 9712068
I thing that was part of the problem
..."unless you use the earlier controlfile also. "
But I included the controlfile in the backup
When I did the restore, it restored the controlfile.
From console
Starting restore at 04-NOV-03

using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=10 devtype=DISK
channel ORA_DISK_1: restoring controlfile
channel ORA_DISK_1: restore complete
replicating controlfile
input filename=/u01/app/oracle/oradata/haypsdmd/control01.ctl
output filename=/u01/app/oracle/oradata/haypsdmd/control02.ctl
output filename=/u01/app/oracle/oradata/haypsdmd/control03.ctl
Finished restore at 04-NOV-03
 



0
 

Author Comment

by:xoxomos
ID: 9712082
Sonds like Kong is saying i could have used any datafile 1 older than scn 162043.


What happened was you were able to recover the controlfile, what you had to do next was recover the datafiles then roll the database forward. If you only recovered the controlfile then it would have had an SCN < the datafiles that's why you got: RMAN-06556: datafile 1 must be restored from backup older than scn 162043

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Format Number Field 10 39
Add 0 to end of Number 21 71
Salary Amount Format 13 56
Create index on View 27 52
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Via a live example, show how to take different types of Oracle backups using RMAN.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now