How a select statement generates redo logs
Can some one explain how a select statement generates redo logs
Naveen
Redo with a select statement happens when dirty blocks get written to the database, and are then "cleaned up" when next read of that data block. This could happen when a large DML statement does not commit before the DB Writer needs to write modified blocks to disk. The next time the blocks are read by a select statement they get modified, hence REDO is generated by the select statement.
Read the following for more and better understandings.
http://www.dbspecialists.com/specialists/specialist2003-10.htm
Jaffar
Similar Messages
-
Check generated redo logs?
hi guys,
was wondering how do one check that redo logs is generated?flaskvacuum wrote:
>
1) What do YOU mean by 'check that redo logs are generated"?
{quote}
i realise that the filesystem (archived log) is growing quite fast lately
{quote}
2) Why do you want to do this? What is your long term objective?
{quote}
not too sure which batch jobs (transaction) are causing this.. ..would like to narrow it down.
Edited by: flaskvacuum on Mar 6, 2012 3:20 PMBack to basics here
- which operating system (including edition and version, especially if Windows), which version of the database (as reported by header from 'sqlplus' command)
- is this a production or a test system, and roughly what does it do (warehouse, user entry transaction, payroll, ...)
- how do you take backups (hot/cold; manually, using alter database begin backup; or rman)
- has something changed since before what you define as 'lately'
And - is the rapid redo switch and the load into the archive area a problem? Or becoming a problem? Or just for interest?
The tools we can offer to help you understand, and the short and long term approach depend entirely on your answers. Otherwise each of us who responds will assume a different environment and you will likely get confused. -
How to find or generate crash log in Indesign CC
Hi,
In InDesign document, I am updating the links using javascript. After updating the links, If i have opened the same document for two or more time, Indesign gets crashed. So i need to find the crash logs.
Please tell me how to find or generate crash log in InDesign CC.
Thanks,
Vimala Luse the variables ErrorCode and ErrorDescription
to create the body of the email message
these variables will give you the error details.
refer : http://social.msdn.microsoft.com/Forums/sqlserver/en-US/e7a5e86b-bcfb-4bfe-9b70-822169cb747b/show-error-message-in-ssis-email?forum=sqlintegrationservices
variable reference : http://technet.microsoft.com/en-us/library/ms141788.aspx
Surender Singh Bhadauria
My Blog -
I do not want to generate redo log, how ?
Hi All,
This is on Oracle 8.1.7.
I have a daily process, which truncates and populates some tables daily. These are reporting tables and daily get around 4 million records.
I do not want to generate any redo log for these tables.
I populate these tables with normal insert commands/updates. So, evenif I make that table NOLOGGING, still redo log is generated.
Any ideas??
RegardsThere is generally no need to supress redo logging. The truncate command eliminates the logging of the row deletes so you only have to worry about the repopulation of the report tables.
You might be able to use direct path loads (insert append) or bulk loading to help speed this process.
Usually when developers have compained that the database logging was the problem we have been able to find either better approaches to generating the data or to tune the queries used in generating the data.
HTH -- Mark D Powell -- -
Hi
I am trying to run a select query in a database which has performance problems and I get the following stats
recursive calls 47
db block gets 0
consistent gets 36909
physical reads 203
redo size 205164
bytes sent via SQL*Net to client 1873
bytes received via SQL*Net from client 1716
SQL*Net roundtrips to/from client 4
sorts (memory) 2
sorts (disk) 0
I get a lot of consistent gets and redo size compare to the same query run on a good performing db(results below). Why should a select query generate a lot of redo? Can some one suggest me where should I be looking at to resolve this issue?
Thanks
recursive calls 47
db block gets 0
consistent gets 3470
physical reads 0
redo size 0
bytes sent via SQL*Net to client 1885
bytes received via SQL*Net from client 1725
SQL*Net roundtrips to/from client 5
sorts (memory) 2
sorts (disk) 0
Edited by: APV on Nov 18, 2008 1:08 PMQueries can also generate redo if auditing is enabled. If you don't have auditing enabled and you find that a SELECT statement with no FOR UPDATE clause sometimes generates redo entries, you might be witnessing a case of delayed block cleanout
-
How to disable write to redo log file in oracle7.3.4
in oracle 8, alter table no logged in redo log file like: alter table tablename nologging;
how to do this in oracle 7.3.4?
thanks.user652965 wrote:
Thanks very much for your help guys. I appreciate it. unfortunately none of these commands worked for me. I kept getting error on clearing logs that redo log is needed to perform recovery so it can't be cleared. So I ended up restoring from earlier snapshot of my db volume. Database is now open.
Thanks again for your input.And now, as a follow-up, at a minimum you should make sure that all redo log groups have at least 3 members. Then, if you lose a single redo log file, all you have to do is shutdown the db and copy one of the good members (of the same group as the lost member) over the lost member.
And as an additional follow-up, if you value your data you will run in archivelog mode and take regular backups of the database and archivelogs. If you fail to do this you are saying that your data is not worth saving. -
How to recover from corrupt redo log file in non-archived 10g db
Hello Friends,
I don't know much about recovering databases. I have a 10.2.0.2 database with corrupt redo file and I am getting following error on startup. (db is non archived and no backup) Thanks very much for any help.
Database mounted.
ORA-00368: checksum error in redo log block
ORA-00353: log corruption near block 6464 change 9979452011066 time 06/27/2009
15:46:47
ORA-00312: online log 1 thread 1: '/dbfiles/data_files/log3.dbf'
====
SQL> select Group#,members,status from v$log;
GROUP# MEMBERS STATUS
1 1 CURRENT
3 1 UNUSED
2 1 INACTIVE
==
I have tried this so far but no luck
I have tried following commands but no help.
SQL> ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP 3;
Database altered.
SQL> alter database open resetlogs;
alter database open resetlogs
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery
SQL> alter database open;
alter database open
ERROR at line 1:
ORA-00368: checksum error in redo log block
ORA-00353: log corruption near block 6464 change 9979452011066 time 06/27/2009
15:46:47
ORA-00312: online log 1 thread 1: '/dbfiles/data_files/log3.dbf'user652965 wrote:
Thanks very much for your help guys. I appreciate it. unfortunately none of these commands worked for me. I kept getting error on clearing logs that redo log is needed to perform recovery so it can't be cleared. So I ended up restoring from earlier snapshot of my db volume. Database is now open.
Thanks again for your input.And now, as a follow-up, at a minimum you should make sure that all redo log groups have at least 3 members. Then, if you lose a single redo log file, all you have to do is shutdown the db and copy one of the good members (of the same group as the lost member) over the lost member.
And as an additional follow-up, if you value your data you will run in archivelog mode and take regular backups of the database and archivelogs. If you fail to do this you are saying that your data is not worth saving. -
How to move temp file, redo log to different drive oracle 9i
Hi ,
I am using oracle 9i
by mistakenly, i have instaled oracle installable on system drive i mean c: drive.I have installed teh database on D: drive.
For tunning perfomance i would like to move the redlog files and temp files to different drive.
Could you please explain me the step by step procedure how to do this
Thanks
AITSVery easy -
Create a new temp tablespace with the files on the drive you want, make it the default temp tablespace for any users/schemas you have created, then drop the old temp tablespace including datafiles.
For the redo logs, create new groups, again with the logfiles on the dirves you want them on, cycle out of the old ones with "alter system switch logfile;" then drop them. -
How Do I Restore Deleted Redo Logs
I currently have alter database archivelog set and am backing up my archive log redo file. However, I am trying to test a scenario where all of my redo log files have been deleted, and thus need to be restored. I have backups of my archivelog files. I'm trying to recover my redo log files by executing the following:
RMAN> restore archivelog all;
Starting restore at 14-AUG-02
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=9 devtype=DISK
archive log thread 1 sequence 102 is already on disk as file C:\ORACLE\ORA90\RDBMS\ARC00102.001
archive log thread 1 sequence 103 is already on disk as file C:\ORACLE\ORA90\RDBMS\ARC00103.001
archive log thread 1 sequence 104 is already on disk as file C:\ORACLE\ORA90\RDBMS\ARC00104.001
restore not done; all files readonly, offline, or already restored
Finished restore at 14-AUG-02
Since this doesn't work I'm assuming I'm doing something wrong. Therefore, what are the necessary steps for recovering my redo log files after they have been deleted? Thanks to all for your help.Since my test assumes that the Control files, redo logs and all tablespaces and data files have been deleted. These are the steps I'm using to attempt a full backup & recovery.
3. Login to SQLPLUS sys/jalisco@bas as sysdba
4. SQL> startup mount bas <enter>
5. SQL> alter database archivelog; <enter>
6. Stop the Listener and Instance through Services or Net Stop as before.
7. From a command enter C:\Oracle\startoracle jalisco bas.
8. Login to RMAN: rman target sys/jalisco@bas <enter>
9. RMAN> configure controlfile autobackup on; <enter>
10. RMAN> backup database format
a. 2> /oraclebackup/rman_%d_%t.bas plus archivelog; <enter>
At this point Oracle is configured so that both the archivelog and control files get backed up to oracle\ora90\database. The archivelogs get stored in oracle\ora90\rdbms.
1. Restore the control files.
2. Restore the archivelogs.
3. Restore the tablespaces and data files.
4. Create new reset logs.
1. Confirm that the Listener and BAS service have been started through the Contol Panel, or by using Net Start.
2. Login to RMAN: rman target sys/jalisco@bas as sysdba
3. RMAN> startup nomount
4. RMAN> restore controlfile from /oracle/ora90/database/C-493922189-2002MMYYYY-00;
5. RMAN> startup mount
6. RMAN> run {
a. 2> restore archivelog all; }
7. RMAN> restore database;
8. Exit RMAN and Login to SQLPLUS sys/jalisco@bas as sysdba
9. SQL> alter database open resetlogs;
At this point I get the error which is listed in the above thread.
At this point a complete recovery should have taken place. It is extremely important to create a new backup now before proceeding. -
How to select State based on the country
Hi All,
I have a requirement,i have to dynamically populate the value in State based on the Country chosen in the drop down.
Can you please tell me how to achieve this functionality.
Thanks & Regards,
Malkit SinghHi, Malkit
There is already a cotext mapping for Sate.
Take a look at this.
http://scn.sap.com/message/13816883#13816883
In your case, use these data types.
element Country :CountryCode;
element State :RegionCode;
Regards,
Fred. -
How to: SELECT statement returns the result in XML format.
That's it... I want to execute a query that returns all rowset in XML format. How can I do it?
Using Oracle 8.0 and up.
Tnx.FOR XML is a proprietary Microsoft Hack... It is not supported by Oracle in any release. Oracle 9.2.x includes the SQLXML operators, which are part of the SQL:2003 standard and are the agreed upon (Mircosoft, IBM, Oracle etc) way of generating XML from relational data....
See http://download-west.oracle.com/docs/cd/B12037_01/appdev.101/b10790/xdb03usg.htm#sthref251 -
How a SELECT statement can return the results in XML format
That's it... I want to execute a query that returns all rowset in XML format. How can I do it?
I have Oracle 9i
Thanks
Jaime9i, or 9iR2 ?. If 9i I would recommend upgrading to 9iR2 and then using the SQL/XML operators.
-
Excessive flashback log generates with select statement
Hi everyone;
We have some extractions taken from a "flashback on" database.
Extractions are just select statements but when they are run, database produces excessive flashback logs.
What may be the reason database produce flashback logs with just select statements?
(It's certain that there are no insert-update-delete operations)
Version: 10.2.0.4.3
Thanks...Do you do heavy update/delete before you select the statements ?
I am not very sure if delayed block cleanout also have the same effect on flashback logs but the output below is leading me to think that way
HR@ORACOS> select * from v$flashback_database_stat;
BEGIN_TIME END_TIME FLASHBACK_DATA DB_DATA REDO_DATA ESTIMATED_FLASHBACK_SIZE
20100527 15:32:53 20100527 15:50:16 875266048 1207132160 2038729728 0
20100527 14:32:50 20100527 15:32:53 248160256 127295488 450139648 1.3215E+10
20100527 13:32:48 20100527 14:32:50 10452992 15646720 4400640 1.5549E+10
20100527 12:32:43 20100527 13:32:48 745693184 948461568 1311620608 2.2789E+10
20100527 11:25:56 20100527 12:32:43 1262026752 1984741376 2358546432 2.7212E+10
HR@ORACOS> set autotrace traceonly statistics
HR@ORACOS> update base_table_np set y='INVALID';
commit;
4021808 rows updated.
Statistics
2512 recursive calls
8341430 db block gets
4069140 consistent gets
120569 physical reads
1908471980 redo size
848 bytes sent via SQL*Net to client
793 bytes received via SQL*Net from client
3 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
4021808 rows processed
HR@ORACOS> set autotrace off;
HR@ORACOS> select * from v$flashback_database_stat;
HR@ORACOS>
BEGIN_TIME END_TIME FLASHBACK_DATA DB_DATA REDO_DATA ESTIMATED_FLASHBACK_SIZE
20100527 15:32:53 20100527 16:00:36 1236664320 2021974016 4019910656 0
20100527 14:32:50 20100527 15:32:53 248160256 127295488 450139648 1.3215E+10
20100527 13:32:48 20100527 14:32:50 10452992 15646720 4400640 1.5549E+10
20100527 12:32:43 20100527 13:32:48 745693184 948461568 1311620608 2.2789E+10
20100527 11:25:56 20100527 12:32:43 1262026752 1984741376 2358546432 2.7212E+10
HR@ORACOS> set autotrace traceonly statistics
HR@ORACOS> select * from base_table_np;
4021808 rows selected.
Statistics
139 recursive calls
0 db block gets
53908 consistent gets
4404 physical reads
1652384 redo size ------->delayed block cleanout effect
175008833 bytes sent via SQL*Net to client
88996 bytes received via SQL*Net from client
8045 SQL*Net roundtrips to/from client
4 sorts (memory)
0 sorts (disk)
4021808 rows processed
HR@ORACOS> set autotrace off
HR@ORACOS> select * from v$flashback_database_stat; ----flashback data size increases
HR@ORACOS>
BEGIN_TIME END_TIME FLASHBACK_DATA DB_DATA REDO_DATA ESTIMATED_FLASHBACK_SIZE
20100527 15:32:53 20100527 16:01:11 1305264128 2054594560 4021728256 0
20100527 14:32:50 20100527 15:32:53 248160256 127295488 450139648 1.3215E+10
20100527 13:32:48 20100527 14:32:50 10452992 15646720 4400640 1.5549E+10
20100527 12:32:43 20100527 13:32:48 745693184 948461568 1311620608 2.2789E+10
20100527 11:25:56 20100527 12:32:43 1262026752 1984741376 2358546432 2.7212E+10Basically what I do is I update a 4 million table big redo generated with flashback logs
When I do select after the update I still see the redo generated because of delayed block cleanout but what I also see is the slight increase in flashback data size (check the first row of flashback_database_stat) which suits what you asking for. Select statement generates flashback log
Tested on 11.2.0.1 with single active session on the db
Coskan Gundogar
Blog: http://coskan.wordpress.com
Twitter: http://www.twitter.com/coskan
Linkedin: http://uk.linkedin.com/in/coskan
--------- -
Hi Experts,
I want to remove a wrong redo log file from 10G R2 database in window.
how to do that without loss data?
my steps as
1. alter system switch logfile;
2. select * from v$log;
which ARC and sataus do I can drop redo log file based on above SQL
no archive and active status?
ALso Which account should I do above action?
fExamp, system account added redo log file, i only
can drop by system? how about sys?
Thanks help in detail steps
Jim
Edited by: user589812 on Dec 23, 2008 4:35 PMJim,
Check this link out for how to drop a redo log file
Make sure a redo log group is archived (if archiving is enabled) before dropping it. To see whether this has happened, use the V$LOG view.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/onlineredo.htm#i1006489
SELECT GROUP#, ARCHIVED, STATUS FROM V$LOG;
GROUP# ARC STATUS
1 YES ACTIVE
2 NO CURRENT
3 YES INACTIVE
4 YES INACTIVE
Drop a redo log group with the SQL statement ALTER DATABASE with the DROP LOGFILE clause.
The following statement drops redo log group number 3:
ALTER DATABASE DROP LOGFILE GROUP 3; -
Question about how Oracle manages Redo Log Files
Good morning,
Assuming a configuration that consists of 2 redo log groups (Group A and B), each group consisting of 2 disks (Disks A1 & A2 for Group A and Disks B1 and B2 for group B). Further, let's assume that each redo log file resides by itself in a disk storage device and that the device is dedicated to it. Therefore in the above scenario, there are 4 disks, one for each redo log file and, each disk contains nothing else other than a redo log file. Furthermore, let's assume that the database is in ARCHIVELOG mode and that the archive files are stored on yet another different set of devices.
sort of graphically:
GROUP A GROUP B
A1 B1
A2 B2The question is: When the disks that comprise Group A are filled and Oracle switches to the disks in Group B, can the disks in Group A be taken offline, maybe even physically removed from the system if necessary, without affecting the proper operation of the database ? Can the Archiver process be temporarily delayed until the disks (that were removed) are brought back online or is the DBA forced to wait until the Archiver process has finished creating a copy of the redo log file into the archive ?
Thank you for your help,
John.Hello,
Dropping Log Groups
To drop an online redo log group, you must have the ALTER DATABASE system privilege. Before dropping an online redo log group, consider the following restrictions and precautions:
* An instance requires at least two groups of online redo log files, regardless of the number of members in the groups. (A group is one or more members.)
* You can drop an online redo log group only if it is inactive. If you need to drop the current group, first force a log switch to occur.
* Make sure an online redo log group is archived (if archiving is enabled) before dropping it. To see whether this has happened, use the V$LOG view.
SELECT GROUP#, ARCHIVED, STATUS FROM V$LOG;
GROUP# ARC STATUS
1 YES ACTIVE
2 NO CURRENT
3 YES INACTIVE
4 YES INACTIVE
Drop an online redo log group with the SQL statement ALTER DATABASE with the DROP LOGFILE clause.
The following statement drops redo log group number 3:
ALTER DATABASE DROP LOGFILE GROUP 3;
When an online redo log group is dropped from the database, and you are not using the Oracle Managed Files feature, the operating system files are not deleted from disk. Rather, the control files of the associated database are updated to drop the members of the group from the database structure. After dropping an online redo log group, make sure that the drop completed successfully, and then use the appropriate operating system command to delete the dropped online redo log files.
When using Oracle-managed files, the cleanup of operating systems files is done automatically for you.
Your Database wont be affected as you can operate with 2 redo log files in each group as The minimum number of redo log files required in a database is two because the LGWR (log writer) process writes to the redo log files in a circular manner. so the process will hang becuase you are having 2 only groups if you want to remove 1 add a third one and make it the current group then remove the one you want to be offline.
Please refer to:
http://download.oracle.com/docs/cd/B10500_01/server.920/a96521/onlineredo.htm#7438
Kind regards
Mohamed
Oracle DBA
Maybe you are looking for
-
Speakers no longer work after Mountain Lion update.
After my update of Mountain Lion my speakers in my macbook pro no longer work. The speaker symbol is grey and the volume can't be moved. Anyone else have this issue?
-
SMARTFORM: how to create 3 copy (each copy can print more than one page)
SMARTFORM: how to create 3 copy (each copy can print more than one page) Hello everyone. my user want to have form that print 3 copy. such as 1 copy description = master, 2 copy description = copy 1 ,3 copy description = copy 2. so i create 3 page .
-
Can you upgrade to photoshop from photoshop elements 11?
Just wondering if I purchased a copy of photoshop elements 11, is there an upgrade available to the regular photoshop? Thanks!
-
Delimitation and Period Handling Concept - HR ABAP
Hi All Please guide me through the following concepts: 1) Delimitation and 2) Period Handling Concept. I am new to HR-ABAP. Kindly help. <REMOVED BY MODERATOR> Thanks & Regards Gaurav Verma Edited by: Alvaro Tejada Galindo on Feb 22, 2008 10:35 AM
-
Hi everyone, is it possible to do drag & drop between 2 ALV (Grid/Tree)? Could some one provide me with a example coding please? Thanks for your help in advance.