Home » RDBMS Server » Backup & Recovery » RMAN Backup
RMAN Backup [message #236154] Wed, 09 May 2007 03:41 Go to next message
balaji1010
Messages: 35
Registered: March 2006
Location: London
Member

Hi everyone,

I have doubt regarding RMAN backups.

I am aware of the fact that RMAN skips empty blocks while taking backups.

But, I believe RMAN backup can be slow because it has to read
every block in the datafile to make sure that block is empty or filled up and not every block is written to the backup location only eligible blocks for backups(filled up blocks) are backed up. (This is what i know)

When backingup locally managed tablespaces RMAN DOESNOT attempt to read all the blocks because it will get the information from the bitmap block of the datafile.(This is what i am not sure about).

If not true, can anyone please try to help me out with this.

Thanx in advance


Re: RMAN Backup [message #236158 is a reply to message #236154] Wed, 09 May 2007 03:51 Go to previous messageGo to next message
sriram717
Messages: 48
Registered: February 2007
Location: UNITED KINGDOM
Member
Hi

Your statement about RMAN gets the details from the bitmap for the localy managed tablespaces is not true , the problems are still existing in 9i as it has to scan the empty blocks as well , but in 10g you have something called as Block Change Tracking feature

See http://www.oracle.com/technology/oramag/oracle/04-nov/o64rman.html

for mre details
Re: RMAN Backup [message #236161 is a reply to message #236158] Wed, 09 May 2007 03:55 Go to previous messageGo to next message
balaji1010
Messages: 35
Registered: March 2006
Location: London
Member


Thank you very much sriram

I am glad to have your reply
Re: RMAN Backup [message #236164 is a reply to message #236158] Wed, 09 May 2007 04:02 Go to previous messageGo to next message
balaji1010
Messages: 35
Registered: March 2006
Location: London
Member


I have been through your link. Its informative.

Actually i am working on user managed backups and was thinking of implementing RMAN backups (because of its features) in my testing instance.

Can i get this cleared please.

I am trying to take a user managed backup by placing datafile in begin backup mode.

What i am aware of is datafile header is freezed so that SCN number is not changed while datafile is backedup and later after we put the datafile in end-backup mode then SCN number will be updated in the header.

I know minimal data is written to the datafile but, can i know what kind of data is written to the datafiles and why so much redo is generated.

Thanx in advance.

Re: RMAN Backup [message #236165 is a reply to message #236164] Wed, 09 May 2007 04:05 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This has no relation with RMAN backup.
Please start a new topic if you have a new question that is not related with the previous one.

Regards
Michel
Re: RMAN Backup [message #236167 is a reply to message #236154] Wed, 09 May 2007 04:12 Go to previous messageGo to next message
saibal
Messages: 111
Registered: March 2007
Location: India
Senior Member
Quote:
I am aware of the fact that RMAN skips empty blocks while taking backups.

Actually RMAN skips unused rather than empty blocks while backing up.RMAN can only draw information about the contents of a block by reading either the file header or the block header. So, if we truncate a table (thereby resetting the HWM), all blocks that had information in them but are now empty will be backed up regardless. This is because RMAN only knows that a block has been initialized by a segment. It does not know that the block is empty.
Regards
Re: RMAN Backup [message #236171 is a reply to message #236167] Wed, 09 May 2007 04:16 Go to previous messageGo to next message
sriram717
Messages: 48
Registered: February 2007
Location: UNITED KINGDOM
Member
Thanks for the correction saibal , i had unused blocks in mind but wrote as empty blocks.

Thanks again
Re: RMAN Backup [message #236172 is a reply to message #236164] Wed, 09 May 2007 04:17 Go to previous messageGo to next message
saibal
Messages: 111
Registered: March 2007
Location: India
Senior Member
There is excessive redo generated only the first time a block is modified after a tablespace is put in hot backup mode. Not subsequently.

[Updated on: Wed, 09 May 2007 04:27]

Report message to a moderator

Re: RMAN Backup [message #236175 is a reply to message #236165] Wed, 09 May 2007 04:19 Go to previous messageGo to next message
balaji1010
Messages: 35
Registered: March 2006
Location: London
Member

sorry micheal i would do that
Re: RMAN Backup [message #236179 is a reply to message #236172] Wed, 09 May 2007 04:25 Go to previous messageGo to next message
sriram717
Messages: 48
Registered: February 2007
Location: UNITED KINGDOM
Member
Regarding excessive Redo Generation :

The Data files are being written or changed in "real time" just like normal.

Now while we are copying the files , we might get into the state where whilst we are copying a particular block, the database might also be overwriting it with a change. So we would end up with a corrupted block. To ensure that we can by pass this during a recovery, more information is written to the redo logs ie the before image of the blocks not the change vector . This is why you get more redo activity. So it is advisbile not to schedule a hot backup when there is a huge activity on the database.

Thanks
Re: RMAN Backup [message #236196 is a reply to message #236154] Wed, 09 May 2007 04:51 Go to previous messageGo to next message
balaji1010
Messages: 35
Registered: March 2006
Location: London
Member

Thankyou very much saibal and sriram,

I understand what exactly happens but not 100% ok with what ever i have in my mind.

I know that excessive redo generation is done and i also understand the scenario why it happens.

But, when "delete" statement is issued RMAN backsup the data block by reading UNDO tablespace because RMAN needs consistent and valid copy of the block. This is 100% fine and perfect.

On "commit" still deleted blocks belong to the segment so RMAN must backup.

On the contrary, when truncate occurs all the blocks are released and blocks nolonger belong to the segment though the segment has initiated the block.

What could be the story behind this.

Please correct if i am taking a wrong way.

Thankyou very much for your cooperation.

Re: RMAN Backup [message #236198 is a reply to message #236196] Wed, 09 May 2007 04:56 Go to previous messageGo to next message
balaji1010
Messages: 35
Registered: March 2006
Location: London
Member

I would start a new topic regarding

user managed backups as suggested

let us please continue with RMAN backups

Thanx
Re: RMAN Backup [message #236204 is a reply to message #236196] Wed, 09 May 2007 05:15 Go to previous messageGo to next message
saibal
Messages: 111
Registered: March 2007
Location: India
Senior Member
Quote:
I know that excessive redo generation is done and i also understand the scenario why it happens.


Let me repeat 'excessive redo generation' is done only the first time a block is modified after a tablespace is put in hot backup mode. This behavior is not seen subsequently, i.e. you only get minimal redo for subsequent modifications to the block.
RMAN has two access points to the database:
1) The File header
2) The Block header
So, RMAN can only draw information about the contents of a block from either its own header or the file header.RMAN cannot be sure of getting any other information, because all of those is predicated on the database being open. And here is the punch line: RMAN just cannot bank on the database being open!

[Updated on: Wed, 09 May 2007 05:16]

Report message to a moderator

Re: RMAN Backup [message #236207 is a reply to message #236204] Wed, 09 May 2007 05:17 Go to previous messageGo to next message
balaji1010
Messages: 35
Registered: March 2006
Location: London
Member

Thanx saibal,

Glad to have your prompt reply

thanx again

regards

balaji
Re: RMAN Backup [message #236208 is a reply to message #236207] Wed, 09 May 2007 05:22 Go to previous messageGo to next message
saibal
Messages: 111
Registered: March 2007
Location: India
Senior Member
There is one more thing to add: RMAN reads the blocks, not the tablespaces. So, your understanding that RMAN looks up info. from the undo tablespace is not quite correct.
Regards
Re: RMAN Backup [message #236229 is a reply to message #236204] Wed, 09 May 2007 06:34 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
saibal wrote on Wed, 09 May 2007 12:15
RMAN has two access points to the database:
1) The File header
2) The Block header
So, RMAN can only draw information about the contents of a block from either its own header or the file header.RMAN cannot be sure of getting any other information, because all of those is predicated on the database being open. And here is the punch line: RMAN just cannot bank on the database being open!


What does this mean?

RMAN perfectly works with opened database. It was designed for this to avoid putting tablespace in backup mode.

Regards
Michel
Re: RMAN Backup [message #236235 is a reply to message #236229] Wed, 09 May 2007 06:47 Go to previous messageGo to next message
saibal
Messages: 111
Registered: March 2007
Location: India
Senior Member
Michel,
Perhaps you missed what I was trying to say. Of course RMAN works with open databases. That's how it will work perhaps 90% of the time, but RMAN cannot be guaranteed that the database will remain open. FYI RMAN is available even when the database is not open--the database needs to be just in NOMOUNT state for RMAN to be available.And, as you know a lot remains unavailable wile you are in nomount state. So, the system that RMAN uses is 'read the blocks' and not depend upon the vagaries of the state of the database to do its job.
Regards
Re: RMAN Backup [message #236239 is a reply to message #236208] Wed, 09 May 2007 06:53 Go to previous messageGo to next message
balaji1010
Messages: 35
Registered: March 2006
Location: London
Member

Thanx saibal,

What i meant was RMAN would read the blocks from UNDO tablespace or UNDO datafile to get the read consistent image of the blocks at the time of open DML transaction.

This was my interview question and i got the answer from the interviewer.

thanx
Re: RMAN Backup [message #236244 is a reply to message #236239] Wed, 09 May 2007 07:06 Go to previous messageGo to next message
saibal
Messages: 111
Registered: March 2007
Location: India
Senior Member
Quote:
What i meant was RMAN would read the blocks from UNDO tablespace or UNDO datafile to get the read consistent image of the blocks at the time of open DML transaction.


You are absolutely correct. It is the block level access that sets apart RMAN from any other backup utility.And it is precisely this feature that derives all the benefits that RMAN actually does.
So, if your interviewer asked you about 'RMAN reading tablespaces', then I am afraid, that was very bad paraphrasing of the question.
Regards
Re: RMAN Backup [message #236330 is a reply to message #236244] Wed, 09 May 2007 11:19 Go to previous messageGo to next message
balaji1010
Messages: 35
Registered: March 2006
Location: London
Member

Thanx again for the prompt reply

I have got one more discovery regarding RMAN backups

which is, when RMAN backsup locally managed tablespace (with segment space management auto)i came to know through my interviewer that RMAN backups are very fast.

What i know about the RMAN backups is as follows :

1) RMAN backups are slow because every block header must be read to identify the status (unused or used) of the block
2) no of blocks written to the backup location are less
3) restoration and recovery is fast

Where i have been contradicted :

1) when RMAN attempts to read the first block (which is BITMAP block with the info of all the block headers) of the datafile RMAN will have complete info about filled blocks and unused blocks (because every BIT in the BITMAP block corresponds to every block in the datafile) so it doesn't attempt to read all the blocks of the datafile.

I do not know to what extent its true.

I believe it can be right but i am not 100% confident.

As of my knowledge RMAN attempts to read the header of the block (or BITMAP BLOCK) not the content of the block.

Can anyone clarify this please.

i am totally confused
Re: RMAN Backup [message #236403 is a reply to message #236330] Wed, 09 May 2007 22:06 Go to previous messageGo to next message
saibal
Messages: 111
Registered: March 2007
Location: India
Senior Member
Let me briefly try to explain how RMAN works:
RMAN compiles a list of files to be backed up based on the information gathered using the two packages DBMS_RCVMAN and DBMS_BACKUP_RESTORE, as well as the algorithm rules that it is following.
Based on the number of channels you have configured and the degree of multiplexing that you are using, RMAN takes the preparatory step of creating buffers in oracle's shared memory segment, which is usually in the PGA, but there are circumstances where you may find the buffers in the SGA as well.
Now, RMAN starts reading the blocks, and at this point it takes no cognizance of the fact that the blocks are used, unused, full, empty, corrupt, whatever. It just reads them into the input buffers.
When the input buffer fills up, the blocks are pushed into an output buffer. It is only when input buffers are pushed into the output buffers that the actual checking takes place. RMAN performs a checksum, detecting corrupt, unused, and other blocks that do not meet RMAN's criteria for backing up. It is this intra-memory write that is crucial, because all the filtering takes place here. Once the output buffer is full, it is pushed to the backup location--a disk or tape, whichever it may be.
On another note, a hot backup made BY RMAN is ALWAYS CONSISTENT, because RMAN coordinates with the DBWR process to only write consistent blocks into the memory. This synchronization, between DBWR and RMAN produces the consistent blocks in memory AND NOT BECAUSE RMAN READS THEM FROM UNDO TABLESPACE/BLOCKS.
So, now let's look at your statements and analyze them:
Quote:
RMAN backups are slow because every block header must be read to identify the status (unused or used) of the block

Not entirely true. backups may be slow/fast due to many reasons--such as multiplexing, backup optimization etc. While it is true that RMAN reads the header of each block, but it does so in memory and not while reading the blocks.
Quote:
no of blocks written to the backup location are less


Could be true. Could be false. But mostly it ought to be true because no. of blocks written to the disk/tape shall be less than the no. of blocks read into memory, because of null compression, corrupt blocks, and blocks not passing the checksum.
Quote:
restoration and recovery is fast

Depends. If you are using incremental backups, restoration will be decidedly slower than when you are not using incremental backups. And besides when you say 'restoration and recovery is fast', you must specify faster than what-- otherwise it is a very subjective assertion.
Hope this helps,
Regards

Re: RMAN Backup [message #236658 is a reply to message #236403] Thu, 10 May 2007 10:13 Go to previous message
balaji1010
Messages: 35
Registered: March 2006
Location: London
Member

Thats quite clear

thanx a lot

Previous Topic: Flash Recovery Area
Next Topic: Catalog database on Windows Server and target Database on Linux??
Goto Forum:
  


Current Time: Fri Apr 19 11:36:22 CDT 2024