Header block in datafile
How to get header block in oracle datafile?
Which oracle view will be helpful?
To corrupt a block in datafile use the " dd " command,
dd if=/dev/zero of=/oracle/oradata/ORCL/datafile/test.dbf bs=8k conv=notrunc seek=10 count=1
How to corrupt an Oracle 10g Database to test repair
Thanks
Similar Messages
-
ORA-27047: unable to read the header block of file
My Windows 2003 crashed which was running Oracle XE.
I installed Oracle XE on Windows XP on another machine.
I coped my D:\oracle\XE10g\oradata folder of Win2003 to the same location in WinXP machine.
When I start the database in WinXP using SQLPLUS i get the following message
SQL> startup
ORACLE instance started.
Total System Global Area 146800640 bytes
Fixed Size 1286220 bytes
Variable Size 62918580 bytes
Database Buffers 79691776 bytes
Redo Buffers 2904064 bytes
ORA-00205: error in identifying control file, check alert log for more info
I my D:\oracle\XE10g\app\oracle\admin\XE\bdump\alert_xe I found following errors
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
starting up 4 shared server(s) ...
Oracle Data Guard is not available in this edition of Oracle.
Wed Apr 25 18:38:36 2007
ALTER DATABASE MOUNT
Wed Apr 25 18:38:36 2007
ORA-00202: control file: 'D:\ORACLE\XE10G\ORADATA\XE\CONTROL.DBF'
ORA-27047: unable to read the header block of file
OSD-04001: invalid logical block size (OS 2800189884)
Wed Apr 25 18:38:36 2007
ORA-205 signalled during: ALTER DATABASE MOUNT...
ORA-00202: control file: 'D:\ORACLE\XE10G\ORADATA\XE\CONTROL.DBF'
ORA-27047: unable to read the header block of file
OSD-04001: invalid logical block size (OS 2800189884)
Please help.
Regards,
ZulqarnainTry to install win 2003 server software, do the fresh installation of oracle software, now copy the datafiles and controlfiles to same locations as you did on winxp.
get back to us, if still not out of the woods. I still doubt that a simple restore would do the trick, since you doing it across different platforms, might be I can be wrong, but this is what I personally feel, you not able to start the database on winxp.
hare krishna
Alok -
Hello expert,
I have a problem in MT100 generation.
File is generated with the correct payment information but I don't have headr block i mean tags 01, 02, 03, 04, 05, 06 and 07.
There is an option that i should set to print also header block?
Thank you in advance.Thank you Gaurav.
I checked all MF of all events. There is no tags 1,2..7. In the event 30, the MF creates tags 20 until 72.
The bank sent me the file format MT100 expected. There are two blocks: header Block (Tag from 1 to 7) and payment information block (Tag from 20 to 72). I have no problem with the payment block is what generate SAP and i found those tags in event 30.
by cons I do not know how to enable the generation of header block?
1- This block could be generated by standard SAP ? What i must to set?
2- Or i must use MF to add myself this header block? (Specific dev)
Just for information, header block is like that:
:01: Refrence --> YYMMDDNN when NN is the file number --> Mandatory for the bank
:02: Total amount --> Mandatory for the bank
:03: No orders --> Mandatory for the bank
:04: Paying Bank --> SWIFT --> Mandatory for the bank
:05: Ordering party --> Ordering party name and adress --> Mandatory for the bank
:06: User No --> User No at the paying bank -->optional
:07: File name -->optional
Thank you very much for your help. -
Req Help to Update LIKP-LIFSK,Delivery Header block through custom program.
Hi everyone,
Can you please suggest a FM or BAPI to update the delivery header block field, LIFSK, in LIKP table through FM or a BAPI.
I tried using 'BAPI_OUTB_DELIVERY_CHANGE' as below to update the LIKP-LIFSK, but it is not working.
DATA : ls_likp TYPE likpvb,
ls_dlv_header TYPE bapiobdlvhdrchg,
lt_dlv_items_control TYPE STANDARD TABLE OF bapiobdlvitemctrlchg,
ls_dlv_item_control TYPE bapiobdlvitemctrlchg.
DATA : ls_dlv_hdr_control TYPE bapiobdlvhdrctrlchg,
ls_dlv_techn_control TYPE bapidlvcontrol,
lt_bapireturn TYPE STANDARD TABLE OF bapiret2,
ls_bapireturn TYPE bapiret2,
lt_bapiext2 TYPE STANDARD TABLE OF bapiext,
ls_bapiext2 TYPE bapiext.
DATA : BEGIN OF ls_mns_of_del,
vbeln TYPE likp-vbeln, "delivery number
lifsk TYPE likp-lifsk, "means of transport
END OF ls_mns_of_del.
CONSTANTS : lc_del_blck TYPE bapiext-param VALUE 'LIKP-LIFSK'.
PARAMETERS : p_dlv TYPE likp-vbeln OBLIGATORY." OBLIGATORY.
SELECT SINGLE *
FROM likp
INTO ls_likp
WHERE vbeln = p_dlv.
CHECK sy-subrc = 0.
CLEAR : ls_bapiext2.
ls_mns_of_del-vbeln = ls_likp-vbeln.
ls_mns_of_del-lifsk = 'BX'.
ls_bapiext2-param = lc_del_blck .
ls_bapiext2-value = ls_mns_of_del.
APPEND ls_bapiext2 TO lt_bapiext2.
CALL FUNCTION 'MAP2E_LIKPVB_TO_BAPIOBDLVHDRCH'
EXPORTING
likpvb = ls_likp
CHANGING
bapiobdlvhdrchg = ls_dlv_header.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
EXPORTING
header_data = ls_dlv_header
header_control = ls_dlv_hdr_control
delivery = ls_likp-vbeln
techn_control = ls_dlv_techn_control
TABLES
extension2 = lt_bapiext2[]
return = lt_bapireturn[]
EXCEPTIONS
communication_failure = 1
system_failure = 2
OTHERS = 3.
IF lt_bapireturn[] IS INITIAL.
COMMIT WORK AND WAIT.
MESSAGE 'Success' TYPE 'I' DISPLAY LIKE 'S'.
LEAVE LIST-PROCESSING.
ELSE.
MESSAGE 'Error' TYPE 'I' DISPLAY LIKE 'E'.
LEAVE LIST-PROCESSING.
ENDIF.Hi ,
After seeing your code, you are not passing any parameters to header control data. once check the below code, it might useful.
DATA: h_data like bapiobdlvhdrchg,
h_control like bapiobdlvhdrctrlchg,
delivery like bapiobdlvhdrchg-deliv_numb,
item_data like bapiobdlvitemchg occurs 0 with header line,
item_control like bapiobdlvitemctrlchg occurs 0 with header line,
return like bapiret2 occurs 0 with header line.
CLEAR: h_data, h_control, delivery, item_data, item_control,
return.
REFRESH: item_data, item_control, return.
h_data-deliv_numb = gst_alv_table-c6_vbeln.
h_data-dlv_block = p_new_del_blck. "the new delivery block
h_control-deliv_numb = gst_alv_table-c6_vbeln.
h_control-dlv_block_flg = 'X'.
delivery = gst_alv_table-c6_vbeln.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
EXPORTING
header_data = h_data
header_control = h_control
delivery = delivery
TABLES
return = return .
"Check if return table got an error.
READ TABLE return WITH KEY type = 'E'.
IF NOT sy-subrc IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ELSE.
ROLLBACK WORK.
ENDIF.
Regards,
Parupelly -
Commit in Header Block, but cannot Commit in Control Block
I am new to Oracle Forms, and would really appreciate your kind response.
I am using Oracle Forms 6i, Client/Server environment, and no base tables.
The DATA BLOCKS is divided into two areas: 1) HEADER, and 2) CONTROL. I successfully commit from the HEADER area, but cannot COMMIT nor CLEAR_FORM in the CONTROL area after Inserting records. What is causing this, and how can I get the application to Commit and Clear_Form?
I also notice in Data Block - Control that I am still in QUERY mode after INSERTING records. Shouldn't I be in CHANGED mode, and if so how do I make sure I am in the correct mode after inserting records?
Thanks in advance.
Below is a sample of my codes:
Data Block: HEADER
- Items: CLONE_ITEMS
- Triggers: WHEN-BUTTON-PRESSED
create_security_id(:security_id,:first_name,:last_name,:middle_name,:prefix,:suffix,:ti_title_class);
:header.CT_SECURITY_ID := :header.SECURITY_ID;
go_item('cf_security_id');
Program Units: CREATE_SECURITY_ID
This section inserts the User_ID into the All_Users System table, and adds a record into the user defined SECURITY_USERS table. COMMIT is successfully done in this section.
------------------------------- Problems here - COMMIT not successful ---------------------------
So we tried using: FORMS_DDL('COMMIT'); which works. However we cannot get the Clear_Block to Work. All other codes commented out does not work.
Data Block: CONTROL
- Items: COPY_USER
- Triggers: WHEN-BUTTON-PRESSED
Copy_User_Role_locations (:CT_SEUS_ID, :CF_SEUS_ID);
IF :System.Form_Status <> 'QUERY' THEN
Message('Error prevented Commit');
RAISE Form_Trigger_Failure;
End if;
IF :System.Form_Status = 'QUERY' THEN
Display_Message('QUERY MODE');
END IF;
IF :System.Form_Status = 'CHANGED' THEN
Display_Message('CHANGED MODE');
END IF;
IF :System.Form_Status = 'NEW' THEN
Display_Message('NEW/INSERT');
END IF;
IF Form_Success THEN
display_message('Security user created Sucessfully '||:ct_seus_id);
FORMS_DDL('COMMIT'); ---------This works
FORMS_DDL('CLEAR_BLOCK'); --Does not work
-- do_key('commit_form'); --Does not work
-- clear_block; --Does not work
-- set_block_property( 'header', INSERT_ALLOWED, PROPERTY_true);
-- clear_form(DO_COMMIT); --Does not work
END IF;
Program Units: COPY_USER_ROLE_LOCATIONS
This section fetches records with matching Security-ID, and INSERTS a copy of the record with the new ID. No commits is done in this section.Gerd,
No the Header Block was not created through the Block_Wizard. The Form was copied from another, and modified accordingly. I inherited it with these issues which I am trying to fix.
Omar,
I tried using the Go_Block procedure with Clear_Block, but unfortunately it still did not work. I also tried doing Clear_Form, same results. Below are the codes I used in SAVE button, where I tried to commit and clear_block (Note that Display_Message is an inhouse function):
Data Block: CONTROL
Items: SAVE
Triggers: When_Button_Pressed
Display_Message('save..');
FORMS_DDL('COMMIT');
IF Form_Success THEN
Display_Message('Transaction Completed Sucessfully');
else
Display_Message('Failure to Commit Security_User');
end if;
Go_Block('CONTROL');
CLEAR_BLOCK ;
---CLEAR_FORM;
IF Form_Success THEN
Display_Message('Transaction Cleared Sucessfully');
else
Display_Message('Transaction Not Cleared');
end if;
Whereas the message "Transaction Completed Successfully" was received when I used FORMS_DDL('COMMIT'), I still got a "Transaction Not Cleared" message, and the data was not cleared from the screen. I would really like to to resolve this issue.
I also would be grateful if someone could clarify what mode I should be in after Inserting records. Should I be in the Query Mode, or Changed Mode.
Thanks a mil.
Sonia. -
ORA-27044: unable to write the header block of file / IBM AIX RISC System/6
We are getting an error like this...
Oracle 11.2.0.2
AIX 5.3
Error:
CREATE CONTROLFILE REUSE DATABASE "CLMST" RESETLOGS NOARCHIVELOG
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-00200: control file could not be created
ORA-00202: control file: '/clmst02/UAT/oradata/control/control01.ctl'
ORA-27044: unable to write the header block of file
IBM AIX RISC System/6000 Error: 89: Invalid file system control data detected
Additional information: 3
Additional information: -1
Additional information: 1ORA-09817 IBM AIX RISC System/6000 Error: 89
Oracle 11.2.0.2
AIX 5.3
Related Errors:-
Mon Nov 05 18:33:51 2012
ARC3 started with pid=30, OS id=954622
ARC1: Becoming the 'no FAL' ARCH
ARC1: Becoming the 'no SRL' ARCH
ARC2: Becoming the heartbeat ARCH
Errors in file /clmst01/UAT/oracode/app/oracle/diag/rdbms/clmst/clmst/trace/clmst_ora_2514960.trc (incident=17053):
ORA-00600: internal error code, arguments: [kccugg_end], [], [], [], [], [], [], [], [], [], [], []
Errors in file /clmst01/UAT/oracode/app/oracle/diag/rdbms/clmst/clmst/trace/clmst_m000_2105586.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/clmst02/UAT/oradata/redo/redo03A.log'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
CREATE CONTROLFILE REUSE DATABASE "CLMST" RESETLOGS NOARCHIVELOG
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-00200: control file could not be created
ORA-00202: control file: '/clmst02/UAT/oradata/control/control01.ctl'
ORA-27044: unable to write the header block of file
IBM AIX RISC System/6000 Error: 89: Invalid file system control data detected
Additional information: 3
Additional information: -1
Additional information: 1
Cause:-
Your /clmst02/ mount point might be corrupted.
Check:-
fsck /clmst02
The current volume is: /dev/fslv00
File system is currently mounted.
Primary superblock is valid.
fsck: Performing read-only processing does not produce dependable results.
*** Phase 1 - Initial inode scan
*** Phase 2 - Process remaining directories
*** Phase 3 - Process remaining files
*** Phase 4 - Check inode allocation map
File system inode map is corrupt (NOT FIXED)
fsck: 0507-278 Cannot continue.
File system is currently mounted.
fsck: Performing read-only processing does not produce dependable results.
Fix:-
Either you can change the file location to another mount points or shutdown the database and run the fsck on /clmst02 mount point to fix the corrupted one & start the database.
Fix:-
Recreate the affected Redolog files
alter database add logfile group 3 (
'/clmst02/UAT/oradata/redo/redo03A.log',
'/clmst03/UAT/oradata2/redo/redo03B.log',
'/clmst04/UAT/oradata3/redo/redo03C.log') size 50m reuse; -
As we know datafiles may contains both committed and uncommitted block. My question is when then uncommitted block in datafile is updated with the committed block.
user13549752 wrote:
As we know datafiles may contains both committed and uncommitted block. My question is when then uncommitted block in datafile is updated with the committed block.after COMMIT is issued
Handle: user13549752
Status Level: Newbie (5)
Registered: Jan 26, 2011
Total Posts: 139
Total Questions: 76 (39 unresolved)
why so many unanswered questions? -
Conf Qty 'Zero' in Schedule line for order with header block
Hi,
Am facing with a suituation where the confirmed quantities are set to '0' when there is a delivery block at header. was this issue been experienced by any and if so what was the solution sought? pls share
there are active user exits but none are handling the change in the quantities.Hi,
I think this is config at the item category / schedule line category level. Check with your functional consultant.
Regards, Andy -
SCN in blocks and datafile headers
When CKPT updates datafiles headers with the new SCN is it also updates the datafiles blocks with the new SCN ?
Thank you,
Micheal.imran khan wrote:
The SCN are not stored the datafile blocks in fact it stores the SCNs in terms of bitmaps..Cheers!An absolutely wrong statement! How you think that the transaction within a block would come to know that its committed or not if there is no SCN stored in the block?
See below the dump of a block and also the SCN info recorded in it,
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select header_file, header_block from dba_segments where segment_name='EMP'
2 ;
HEADER_FILE HEADER_BLOCK
4 234
SQL> select blocks from dba_segments where segment_name='EMP' and owner='SCOTT';
BLOCKS
8
SQL> alter session set tracefile_identifier=myblockd;
Session altered.
SQL> alter system dump datafile 4 block 235;
System altered.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Windows XP Version V5.1 Service Pack 2
CPU : 2 - type 586
Process Affinity : 0x0x00000000
Memory (Avail/Total): Ph:437M/2045M, Ph+PgF:1335M/3428M, VA:1663M/2047M
Instance name: orcl
Redo thread mounted by this instance: 1
Oracle process number: 30
Windows thread id: 4596, image: ORACLE.EXE (SHAD)
*** 2011-08-21 17:40:49.781
*** SESSION ID:(16.6) 2011-08-21 17:40:49.781
*** CLIENT ID:() 2011-08-21 17:40:49.781
*** SERVICE NAME:(SYS$USERS) 2011-08-21 17:40:49.781
*** MODULE NAME:(sqlplus.exe) 2011-08-21 17:40:49.781
*** ACTION NAME:() 2011-08-21 17:40:49.781
Start dump data blocks tsn: 4 file#:4 minblk 235 maxblk 235
Block dump from cache:
Dump of buffer cache at level 4 for tsn=4, rdba=16777451
Block dump from disk:
buffer tsn: 4 rdba: 0x010000eb (4/235)
scn: 0x0000.002c106e seq: 0x05 flg: 0x04 tail: 0x106e0605
frmt: 0x02 chkval: 0xed5f type: 0x06=trans data
Hex dump of block: st=0, typ_found=1There is for sure, a block level SCN that oracle maintains .
Aman.... -
How to validate date between Header and Detail Block..
Hi All,
I was trying to find a way where, suppose I enter 'from date' and 'to date' in the header block.then in detail block all 'from dates' and 'to dates' should be restricted between the dates entered in the header block.
Thank youOr U Can Simply set in the child item lowest / highest Allowed Value
Invoke Property pallete for child date item and set the following
lowest Allowed Value :header.from_date (must be prefix with :)
Highest Allowed Value :header.to_date
siju.koiply -
Invoice blocking at header level
Dear team,
Could you kindly provide your inputs for the following issue;
While posting invoice with MIRO with a different ( higher) price than PO price, price blocking is happening only at the item level. But user wants to know why it is not blocking at header level why it was happened only for Item level.
At what circumstances, header level will be blocked.
Thanks in advance.
Regards
MadhavHi Madhav,
In your case, the system can determine that blocking is required only when the price in entered on MIRO. The system compares the price with PO price. So blocking will always be at line level, since price is entered at line level.
Header blocking means blocking the PO completely( by checking Final Invoice check) or by blocking the Vendor in master data from posting. Both these options are not suitable for your case. The blocking can only be handled at line level.
Hope this helps,
Thanks.
Uma -
Ora-01113 and ora-01110 -- Data Block Corruption
Running 10g no backup and noarchivelog.
I put the datafile offline so I can bring up the database. Can anyone help me figure out how to fix the Bad datafile?
Thank You,TRACE FILE INFORMATION
SQL> select pa.value || '/' || i.instance_name || '_ora_'
2 || pr.spid || '.trc' as trace_file
3 from v$session s, v$process pr, v$parameter pa, v$instance i
4 where s.username = user and s.paddr = pr.addr
5* and pa.name='user_dump_dest';
TRACE_FILE
/oracle/admin/ora9i/udump/ora9i_ora_25199.trcDUMPING A TABLE BLOCK
SQL> select file_id,block_id,bytes,blocks
2 from dba_extents
3 where owner='P' and segment_name='EMP';
FILE_ID BLOCK_ID BYTES BLOCKS
3 9 65,536 8next is to find out the tablespace name and the datafile...
SQL> select tablespace_name,file_name from dba_data_files
2 where relative_fno = 3;
TABLESPACE_NAME FILE_NAME
USER_DATA /oradata3/ora9i/user_data01.dbfNow that we know which file and blocks hold our table, let’s dump a sample block of the table. This is done as follows:
SQL> alter system dump datafile 3 block 10;System altered.
Let’s now look at the contents of dumping one block.
Start dump data blocks tsn: 3 file#: 3 minblk 10 maxblk 10
buffer tsn: 3 rdba: 0x00c0000a (3/10)
scn: 0x0000.00046911 seq: 0x02 flg: 0x04 tail: 0x69110602
frmt: 0x02 chkval: 0x579d type: 0x06=trans data
Block header dump: 0x00c0000a
Object id on Block? Y
seg/obj: 0x6d9c csc: 0x00.46911 itc: 2 flg: O typ: 1 - DATA
fsl: 0 fnx: 0x0 ver: 0x01
Itl Xid Uba Flag Lck Scn/Fsc
0x01 xid: 0x0005.02f.0000010c uba: 0x00806f10.00ca.28 C--- 0 scn 0x0000.00046900
0x02 xid: 0x0003.01c.00000101 uba: 0x00800033.0099.04 C--- 0 scn 0x0000.00046906
This is the beginning of the data block dump. The first line tells us that we are dumping file#3, starting at block# 10 (minblk), and finishing with block# 10 (maxblk). Had we dumped more than one data block, these values would represent a range. The relative data block address (rdba) is 0x00c0000a. For more information on the rdba, refer to a later section in this paper. At the end of this line, we can see in parentheses that the rdba corresponds to file# 3, block# 10 (3/10).
The third line describes the SCN of the data block. In our case, the SCN is 0x0000.00046911. The tail of the data block is composed of the last two bytes of the SCN (6911) appended with the type (06) and the sequence (02). If the decomposition of the tail does not match these three values, then the system knows that the block is inconsistent and needs to be recovered. While this tail value shows up at the beginning of the block dump, it is physically stored at the end of the data block.
The block type shows up on the fourth line. Some of the valid types correspond to the following table:
Type Meaning
0x02 undo block
0x06 table or index data block
0x0e undo segment header
0x10 data segment header block
0x17 bitmapped data segment headeri hope it will help... -
Strange block prefetch patterns in 11g
Hi.
I've detected that Oracle 11g is able to prefect blocks when using table access by index rowid. This is great for datawarehouses (DWH), but when/how Oracle uses block level prefetching is not clear.
This problem really affects performance on 11g datawareshouses as the results can be very different.
So far, where's what I've found (these results where collected for empty buffer caches):
Oracle is able to prefetch index and table blocks when doing table access by index rowid even if there's no nested loop join batching
After a tablespace being created, nested loops on table/index in the tablespace are done using single block reads (db file sequential read). This only goes away after the DB is bounced. Neither gathering statistics nor flushing buffer_cache/shared_pool solves the problem.
After the DB is bounced, when doing nested loops access by rowid, the first block of each extent is read using single block reads and the remaining of the extent is prefetched using 'db file scattered read' up to the end of the extend or DBFMRB (assuming the data is packed together sequentially in the extents)
Next time the data is requested from that extent, all data from table/index is read using db file scattered reads, there are no longer single block reads for the extent header block.
Forcing full scans on index and tables is enough for Oracle to cache (somewhere) the extent header information. Flushing the cache/shared_pool will not invalidate that information and prefetches will read all extent wihout single block reads for the header block.
Where's how I've reproduced the problem, on Oracle 11.2.0.1.0, Windows 7 64 bits with local disks (no ASM), 8K block size, .
Creating a table+index in a 128K tablespace (each segment will have 16 blocks). The data in the table is sorted by ID, so filtering by ID will return the least number of block possible and all blocks are consecutive:
CREATE TABLESPACE TS_128K DATAFILE 'd:\ORADATA\TESTE\TS_128K_002.DBF' SIZE 500M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED LOGGING ONLINE PERMANENT
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128k
SEGMENT SPACE MANAGEMENT MANUAL ;
create table T tablespace TS_128K nologging as
select mod(rownum, 1e2) id, lpad('x', 1, 'x') x
from dual connect by level <= 1e6
order by id;
create index IDX_T on T(id) tablespace TS_128K nologging compress;
exec dbms_stats.gather_table_stats(user, 'T', estimate_percent=>null,method_opt=>'for all columns size 1')
Read the data from table using the index:
alter session set db_file_multiblock_read_count = 128 ;
alter system flush buffer_cache;
alter system flush shared_pool;
select count(length(x)) from T where id between 10 and 16 ;
Execution Plan
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 5 | 251 (1)| 00:00:04 |
| 1 | SORT AGGREGATE | | 1 | 5 | | |
| 2 | TABLE ACCESS BY INDEX ROWID| T | 80606 | 393K| 251 (1)| 00:00:04 |
|* 3 | INDEX RANGE SCAN | IDX_T | 80606 | | 127 (1)| 00:00:02 |
Predicate Information (identified by operation id):
3 - access("ID">=10 AND "ID"<=16)
This is what I get when until I bounce the DB (all reads are db file sequential reads)
WAIT #11: nam='SQL*Net message to client' ela= 4 driver id=1413697536 #bytes=1 p3=0 obj#=74261 tim=96925045642
WAIT #11: nam='db file sequential read' ela= 6208 file#=7 block#=1665 blocks=1 obj#=74470 tim=96925051918
WAIT #11: nam='db file sequential read' ela= 4851 file#=7 block#=2171 blocks=1 obj#=74470 tim=96925056835
WAIT #11: nam='db file sequential read' ela= 5796 file#=7 block#=1819 blocks=1 obj#=74470 tim=96925062678
WAIT #11: nam='db file sequential read' ela= 7091 file#=7 block#=280 blocks=1 obj#=74469 tim=96925069857
WAIT #11: nam='db file sequential read' ela= 282 file#=7 block#=281 blocks=1 obj#=74469 tim=96925070204
WAIT #11: nam='db file sequential read' ela= 270 file#=7 block#=1820 blocks=1 obj#=74470 tim=96925070601
WAIT #11: nam='db file sequential read' ela= 218 file#=7 block#=282 blocks=1 obj#=74469 tim=96925070971
After I bounce the database, then it starts to read the first block using single reads and the remaining blocks on the extent using multiblock reads:
EXEC #5:c=0,e=15,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=1883549804,tim=98054723327
WAIT #5: nam='SQL*Net message to client' ela= 2 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=98054723367
WAIT #5: nam='Disk file operations I/O' ela= 72 FileOperation=2 fileno=7 filetype=2 obj#=74474 tim=98054723486
WAIT #5: nam='db file sequential read' ela= 12960 file#=7 block#=1665 blocks=1 obj#=74474 tim=98054736474
WAIT #5: nam='db file sequential read' ela= 21410 file#=7 block#=2171 blocks=1 obj#=74474 tim=98054757983
WAIT #5: nam='db file sequential read' ela= 22377 file#=7 block#=1819 blocks=1 obj#=74474 tim=98054780424
WAIT #5: nam='db file sequential read' ela= 15349 file#=7 block#=280 blocks=1 obj#=74473 tim=98054795897
WAIT #5: nam='db file scattered read' ela= 13822 file#=7 block#=281 blocks=7 obj#=74473 tim=98054809899
WAIT #5: nam='db file scattered read' ela= 488 file#=7 block#=1820 blocks=4 obj#=74474 tim=98054857456
WAIT #5: nam='db file sequential read' ela= 34925 file#=7 block#=1824 blocks=1 obj#=74474 tim=98054894002
WAIT #5: nam='db file scattered read' ela= 171842 file#=7 block#=1825 blocks=15 obj#=74474 tim=98055066371
WAIT #5: nam='db file sequential read' ela= 261 file#=7 block#=288 blocks=1 obj#=74473 tim=98055067476
WAIT #5: nam='db file scattered read' ela= 1328 file#=7 block#=289 blocks=15 obj#=74473 tim=98055069298
WAIT #5: nam='db file sequential read' ela= 24779 file#=7 block#=1840 blocks=1 obj#=74474 tim=98055098838
WAIT #5: nam='db file scattered read' ela= 1257 file#=7 block#=1841 blocks=15 obj#=74474 tim=98055100636
WAIT #5: nam='db file sequential read' ela= 24738 file#=7 block#=304 blocks=1 obj#=74473 tim=98055126180
WAIT #5: nam='db file scattered read' ela= 15299 file#=7 block#=305 blocks=15 obj#=74473 tim=98055142016
WAIT #5: nam='db file sequential read' ela= 34570 file#=7 block#=1856 blocks=1 obj#=74474 tim=98055181298
WAIT #5: nam='db file scattered read' ela= 1309 file#=7 block#=1857 blocks=15 obj#=74474 tim=98055183144
WAIT #5: nam='db file sequential read' ela= 13036 file#=7 block#=320 blocks=1 obj#=74473 tim=98055197077
If I flush the caches and ask for the same data , now the full extent is read using multiblock reads (if I change the filter on ID to read from extents that where never visited before, I'll get that single block read on header + remaining extent multiblock reads)
WAIT #6: nam='SQL*Net message to client' ela= 4 driver id=1413697536 #bytes=1 p3=0 obj#=0 tim=98237022295
WAIT #6: nam='db file sequential read' ela= 12608 file#=7 block#=1665 blocks=1 obj#=74474 tim=98237034964
WAIT #6: nam='db file sequential read' ela= 4829 file#=7 block#=2171 blocks=1 obj#=74474 tim=98237039883
WAIT #6: nam='db file scattered read' ela= 7116 file#=7 block#=1808 blocks=16 obj#=74474 tim=98237047101
WAIT #6: nam='db file scattered read' ela= 7359 file#=7 block#=272 blocks=16 obj#=74473 tim=98237054586
WAIT #6: nam='db file scattered read' ela= 1359 file#=7 block#=1824 blocks=16 obj#=74474 tim=98237057773
WAIT #6: nam='db file scattered read' ela= 1358 file#=7 block#=288 blocks=16 obj#=74473 tim=98237060271
WAIT #6: nam='db file scattered read' ela= 11341 file#=7 block#=1840 blocks=16 obj#=74474 tim=98237076799
Can anyone explain the rules for block prefetching/batching ? This is happening even without the query plan using nested loop batch joins as you can see in the plan above.
Thanks in advance.Hi,
I don't think you should expect db file scattered read waits with TABLE ACCESS BY ROWID -- this is not the normal behavior. I think the only reason you're getting them after you bounce the database is because Oracle "sees" that the buffer cache is empty and wants to fill it using multiblock reads -- so multiblock reads don't help the performance of this particular query, rather, they're supposed to help the global database performance.
Did you measure elapsed time in both cases?
Best regards,
Nikolay -
Reclaim free space in datafiles
Hello:
I have taken over management of one of our test servers with Oracle 9i on Windows2000 and have noticed that there are two files that are much larger than the space that is actually being used:
D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF - 17964M - (Used 1,542M)
D:\ORACLE\ORADATA\ORCL\DATA01.DBF - 12511M - (Used 243M)
How can I reclaim all of this unused space?Remember it is always best to reclaim space by moving all the objects to another tablespace and reclaiming all space. This will free up space within the tables and indexes as well.
I use the following script to generate the commands for me:
resizea.sql:
drop table alan99;
set pages 50
create table alan99 as
select max(block_id+blocks) block_id,file_id from dba_extents
group by file_id;
column tablespace_name format a15
column pct format 999.99
set wrap off
set lines 120
set trunc off
column file_id format 999
spool resizea.lst
select b.bytes/1024/1024-a.bytes/1024/1024 CURRENT_meg,
a.file_id,a.tablespace_Name,'alter database datafile '''||b.file_name||''' resize '
||trunc(c.block_id*8192/1024/1024+1)||'m;'
from dba_free_space a,dba_data_files b, alan99 c
where a.file_id=b.file_id
and a.block_id=c.block_id and a.file_id=c.file_id
order by current_meg;
set termout off
drop table alan99;
set termout on
spool off
select 'Your output has been saved as resizea.lst' from dual;
A script that will tell you what is inside is:
column owner format a30
column object format a30
set lines 120
set wrap off
set trunc off
set pages 50
set feedback on
column file_id format 999
select /*+ Rule */ 'free space' owner /*"owner" of free space*/
, ' ' object /*blank object name*/
, file_id /*file id for the extent header*/
, block_id /*block id for the extent header*/
, blocks /*length of the extent, in blocks*/
from dba_free_space
where file_id=&1
union
select /*+ Rule */ substr(owner,1,20)||' '||substr(segment_type,1,9) /*owner name (first 20 chars)*/
, substr(segment_name,1,32)||'.'||partition_name /*segment name*/
, file_id /*file id for the extent header*/
, block_id /*block id for the extent header*/
, blocks /*length of the extent, in blocks*/
from dba_extents
where file_id=&1
order by 3,4
/ -
Use expdp/impdp to reorganize a tablespace to remove additional datafile ?
Oracle 10g (10.2.0.1)
We had a tablespace with a single datafile WORK1, WORK1 filled up, colleague added two datafiles WORK2 and WORK3 (instead of resizing original larger).
I resized WORK1, increasing by 500Mb.
I was able to drop WORK3, but not WORK2 (ORA-03262: the file is non-empty)
My proposed solution is to expdp the tablespace, drop the tablespace and datafiles, recreate the tablespace with a correctly sized datafile and finally impdp the tablespace.
Is this solution valid ?
Any hints at syntax would be useful1. Map your datafile.
2. If no segments in datafile, drop it and go to 5.
2. Shrink the datafile up to where the data ends.
3. Rebuild/move the last object in the data file,
4. Go to 1
5. Fin
To map data file...
accept file_num char prompt 'File ID: ';
SET PAGESIZE 70
SET LINESIZE 132
SET NEWPAGE 0
SET VERIFY OFF
SET ECHO OFF
SET HEADING ON
SET FEEDBACK OFF
SET TERMOUT ON
COLUMN file_name FORMAT a50 HEADING 'File Name'
COLUMN owner FORMAT a10 TRUNC HEADING 'Owner'
COLUMN object FORMAT a30 TRUNC HEADING 'Object'
COLUMN obj_type FORMAT a2 HEADING ' '
COLUMN block_id FORMAT 9999999 HEADING 'Block|ID'
COLUMN blocks FORMAT 999,999 HEADING 'Blocks'
COLUMN mbytes FORMAT 9,999.99 HEADING 'M-Bytes'
SELECT 'free space' owner,
' ' object,
' ' obj_type,
f.file_name,
s.block_id,
s.blocks,
s.bytes/1048576 mbytes
FROM dba_free_space s,
dba_data_files f
WHERE s.file_id = TO_NUMBER(&file_num)
AND s.file_id = f.file_id
UNION
SELECT owner,
segment_name,
DECODE(segment_type, 'TABLE', 'T',
'INDEX', 'I',
'ROLLBACK', 'RB',
'CACHE', 'CH',
'CLUSTER', 'CL',
'LOBINDEX', 'LI',
'LOBSEGMENT', 'LS',
'TEMPORARY', 'TY',
'NESTED TABLE', 'NT',
'TYPE2 UNDO', 'U2',
'TABLE PARTITION','TP',
'INDEX PARTITION','IP', '?'),
f.file_name,
s.file_id,
s.block_id,
s.blocks,
s.bytes/1048576
FROM dba_extents s,
dba_data_files f
WHERE s.file_id = TO_NUMBER(&file_num)
AND s.file_id = f.file_id
ORDER
BY file_id,
block_id
Maybe you are looking for
-
Skip first screen of the VIEW (V_T052) with FM VIEW_MAINTENANCE_CALL-
Hi at all, i use the Functionmodul "VIEW_MAINTENANCE_CALL" and call the View "V_T052". But i need the second screen of this View, to add new Payment Terms. How can I skip the first screen of the View "V_T052" ? DATA: view_name TYPE dd02v-tabname VA
-
Custom Loading screen for blu-ray
I'm fairly new to this so my experience level is low. However, I have no problem creating my own static menus and burning great quality Blu-Ray disks. I'm just now learning how to create active menu content and would like to implement the custom "loa
-
How to automate the preflight option.
I need to automate the "Advanced->preflight" option through any software. Kindly advice me.
-
Keep track of the shopping cart for anonymous user
Hi, I have the following problem on b2c site. Anonymous user can browse through the site and adds items to the shopping cart. At the checkout the login page is prompted, however login page is located on the different application server where the actu
-
Suspicious contact appeared in contact list
HHi guys I just recently noticed in my contact list there was a suspicious contact in my contact list "sofndjd Dubrovnik" and my credit card has also been used for fraud overseas for hotels taxis airfares etc in and around Europe and dubrovnik, which