Vous êtes sur la page 1sur 4

Oracle DBA Flavours: What happens when the database is in Begin backup mode?

More

Next Blog

Create Blog

Sign In

Home

Sponsored Partners

Thursday, 12 April 2012

Followers

What happens when the database is in Begin backup mode?


with Google Friend Connect

Members (2)

What happens when the database is in Begin backup mode?


When a hot backup runs in the oracle, rst we will make the database in begin backup mode and then we copy the database les to tape or disk. The ques on that most of us will have is: what happens to the datales when the database is in begin backup mode? Oine? Or frozen? Answer is No. Some of the Oracle books contains that the database les are not writable during the backup mode and the changes are stored in the SGA, redo logs and Rollback segments. And these changes will be the wri+en into the data les when the database is taken out of begin backup mode. But the above predic ons are opposed. It does not stop wri ng to the data les. The database almost works in normal way when the database in the backup mode. It can be summarized in as follows: DBWn process writes out all the dirty blocks of a par cular SCN, i.e. when a check point process runs, the DBWn process writes all the blocks related to that SCN generated. CKPT process stops upda ng the checkpoint SCN eld in the data les headers and begins upda ng the Hot backup checkpoint SCN eld in the data les headers. LGWR process begins logging of the changed blocks.
Contributors
Already a member? Sign in

Blog Archive

2012 (9) September (2) June (1) April (1) What happens when the database is in Begin backup ... March (4) January (1) 2011 (6)

By freezing the checkpoint SCN in the data le headers, any subsequent recovery on that par cular hot backup will know that it must commence at that SCN. Having an old SCN in the le header tells recovery that the le is an old one, and that it should look for the archivelog containing that SCN, and applies recovery star ng there. Here we need to know that in hot backup mode the checkpoints to data les are not suppressed . The main checkpoint ag is frozen, frozen but the hot backup Checkpoint SCN will be updated in the le header.

Venkat Lova BapiRaju Swamy VUDA

SQL> create table student(name varchar(20)); Table created.

SQL> select * from tab; TNAME TABTYPE CLUSTERID ------------------------------ ------- ---------DEPT TABLE EMP TABLE BONUS TABLE SALGRADE TABLE

1 of 4

2013-03-29 20:33

Oracle DBA Flavours: What happens when the database is in Begin backup mode?

T1 STUDENT RAMA 7 rows selected.

TABLE TABLE TABLE

Insert some values into the student table: SQL> insert into student values('venkat'); 1 row created. SQL> commit; Commit complete.

SQL> alter system checkpoint; System altered.

Check the block number and the datale in which the data is stored. SQL> select dbms_rowid.rowid_rela ve_fno(rowid) le_num,dbms_rowid.rowid_block_number(rowid) block_num, name from student; FILE_NUM BLOCK_NUM NAME -------------------------------------4 68 venkat Check the data in the block number 68 with the dd command: [oracle@dg2 ~]$ dd bs=8k skip=68 count=1 if=/u02/oradata/DBACLASS /users01.dbf |strings 1+0 records in 1+0 records out 8192 bytes (8.2 kB) copied, 6.9861e-05 seconds, 117 MB/s Insert another row, commit the transac on and check the block and le informa on: SQL> insert into student values('ram'); 1 row created. SQL> commit; Commit complete. SQL> select dbms_rowid.rowid_rela ve_fno(rowid) "le num", dbms_rowid.rowid_block_number(rowid) "block num",name from student; le num block num NAME ---------- ---------- -------------------4 68 venkat 4 68 ram Make the database in Backup mode: SQL> alter tablespace users begin backup; Tablespace altered. Update the record in the student table:

2 of 4

2013-03-29 20:33

Oracle DBA Flavours: What happens when the database is in Begin backup mode?

SQL> update student set name='rama krishna' where name='ram'; 1 row updated.

[oracle@dg2 ~]$ dd bs=8k skip=68 count=1 if=/u02/oradata/DBACLASS /users01.dbf |strings 1+0 records in 1+0 records out 8192 bytes (8.2 kB) copied, 6.5554e-05 seconds, 125 MB/s ram, venkat

Run the checkpoint process which creates an SCN and invoke the DBWn process to write the changed blocks to the datales: SQL> alter system checkpoint; System altered. Now extract the informa on in the 68 block of that par cular data le. We can observe that the changes made to the table (database) are wri+en into the data le during the backup mode. [oracle@dg2 ~]$ dd bs=8k skip=68 count=1 if=/u02/oradata/DBACLASS /users01.dbf |strings 1+0 records in 1+0 records out 8192 bytes (8.2 kB) copied, 7.0099e-05 seconds, 117 MB/s rama krishna, ram, venkat

So, it is clear that the data les can be writable during the hot backup mode. End the tablespace backup mode. SQL> alter tablespace users end backup; Tablespace altered.

Posted by Venkat Lova at 09:29


Recommend this on Google

No comments: Post a Comment

Comment as:

3 of 4

2013-03-29 20:33

Oracle DBA Flavours: What happens when the database is in Begin backup mode?

Newer Post

Home Subscribe to: Post Comments (Atom)

Older Post

Template images by Storman. Powered by Blogger.

4 of 4

2013-03-29 20:33

Vous aimerez peut-être aussi