Oracle block corresponding to a given rowid.

Hi all,
When we know the rowid R of a row in a table named TABLE_TEST, how can we know the ID of the Oracle block containing this row?
Thanks.

SQL> select dbms_rowid.ROWID_BLOCK_NUMBER( rowid ), ROWID FROM A_NEW ;
DBMS_ROWID.ROWID_BLOCK_NUMBER( ROWID
                         94826 AAASO/AABAAAXJqAAA
                         94826 AAASO/AABAAAXJqAAB
                         94826 AAASO/AABAAAXJqAAC
SQL>

Similar Messages

  • Disk Blocks, Oracle Blocks, Physical vs. Logical I/O

    Hi,
    I would like to request for some clarification. Sam Alapati states the following in his book “Expert Oracle9i Database Administration:”
    “The storage disks on which the Oracle blocks reside are themselves divided into disk blocks, which are areas of contiguous storage containing a certain number of bytes—for example, 4096 or 32768 bytes (4KB or 32KB, because each kilobyte has 1024 bytes). Note that if the Oracle block size is smaller than the operating system file system buffer size, you may be wasting the capacity of the operating system to read and write larger chunks of data for each I/O.”
    There are several questions stemming from the above discussion:
    1.     Is the “file system buffer size” the same as the size of a disk block?
    2.     Is the disk block the unit of physical I/O?
    3.     Does there exist such a term as “logical I/O” in Oracle’s nomenclature? With the help of my limited knowledge of database administration, what I understand from the term “logical I/O” is “reading or writing of one Oracle block,” which, in turn, requires several physical I/O’s depending on how large a multiple of the OS block size the Oracle block size is. In that case, does setting the Oracle block size to, say, 8 KB, when the OS block size is, say, 2 KB then mean that one logical I/O would involve four physical I/O’s? Please correct me if I am mistaken.
    Thanks,
    Karim

    I second that.
    For all questions about the very basic concepts in the world of oracle db, you should read the, erhm, yes Concepts guide (read it back and forth a couple of times, then keep revisit).
    Also via the tahiti page you can search or get books from libraries of the various server products from 8i, 9i, and 10g families.

  • Oracle blocked process on vmstat

    Hello,
    I am getting oracle blocked process on the results of vmstat b column. The run queue is fine and but the blocked process are increasing . When I checked with the forums i found out that it waiting for an I/O.
    Hardware: IBBM blade
    SAN - Netapp
    The server is OEL 5 with Oracle 11g running on it. There is no local disk on the server everything configured as SAN with multipathing. Also along with the /boot and / partition are connected to the SAN.
    Also experiencing the issues with the cpu utilization as well and the cpu utilization become 100%. And it causes for the server load to reach 15 , 25, 30. The kernel parameters are set it up as recommend by the Oracle.
    This is causing issues for Oracle query. Is there any recommendation I can use to improve the performance?

    The numbers in vmstat alone won't help you, as they depend on workload. As far as I know, the values won't tell you if your system or processes are working efficiently. You may have a busy process or technical issue causing a performance bottleneck, or perhaps you are overloading the machine, have run out of physical memory, etc., etc.
    The bi and bo column in vmstat shows the data transfer between virtual memory and block devices. I don't see how these numbers could possibly tell you that something is wrong. Perhaps your database is performing a lot of full table scans or the DB cache is too small, etc. But then again, it depends on your tasks and workload.
    I suggest to find out which processes are causing the most I/O and then analyze the processes. Process that are waiting for I/O are typically in "D" state. What is your output of the following:
    <pre>
    # ps -eo state,pid,cmd | grep "^D"
    </pre>
    If you suspect that disk access is the issue, use the pid(s) of the previous command as following to see which files are affected.
    <pre>
    # lsof -p pid
    </pre>

  • (oracle) block corruption

    Hi Everybody,
    Recently, my site has a development database that encountered block corruption in the system tablespace. I have verified this by using Oracle utility DBVERIFY on the system datafile.
    We have no backup at all for this development database. So database recovery from backup is impossible for us.
    I understand that there's a package called DBMS_REPAIR that can be used to repair corrupted blocks. I tried using this, but the process failed because it could not access the system tablespace (which is corrupted) to create a table used by the package.
    Does anyone know if I could overcome this problem and repair the corrupted blocks on the system tablespace?
    Also, I would like to understand what are the possible causes of block corruption. My site's Oracle Server and databases are installed on Windows 2000 platform.
    Please help answer my queries if you can. Thank you!
    null

    Iam sorry that I have not seen this posting until today .
    When there is a block corruption export will fail with error.
    The best method is to replace this file with a backup file and roll forward.
    null

  • Oracle Block Size - question for experts

    Hi ,
    For years i thought that my system block size was 8K.
    Lately due to an HPUX Bug i found that the file system block size is gust .... 1K
    (HP DocId: DCLKBRC00006913 fstyp(1m) returns unexpected block size (f_bsize) for VXFS )
    My instance is currently 10204 but previously was 7.3 --> 8 --> 8174 --> 10204.
    Since its old instance its block size is gust 4kb.
    We are planing to create new file system block size of 8k.
    The instance size is about 2 TB.
    Creating the whole database with 8 kb is impossible since its 24*7 instance.
    Do you think that i sould move gust few important tables to a new tablespace with 8k block size , or should i leave it with 4 kb ?
    Thanks

    Given that your Oracle Database Block_Size (4K) is a multiple of the FileSystem Block_Size (1K), there should be no inherent significant issue, as such.
    Yes, it would have been nice to have an 8KB Oracle Database Block_Size but whether you should recreate your FileSystems to 8KB is a difficult question. There would be implications on PreFetch that the OS does and on how the underlying Storage (must be a SAN, I presume) handles those requests.
    A thorough test (if you can setup a test environment for 2TB such that it does NOT share the same HW, doesn't complicate PreFetches in the existing SAN) would be well adviced.
    Else, check with HP and Veritas support if there are known issues and/or any Desupport plans for this combination ?!
    Oracle, obviously, would have issues with Index Key Length sizes if the Block Size is 4KB. Presumably you do not need to add any new indexes with very large keys.
    Having said that, you would have read all those posts about how Oracle doesn't (or really does ?) test every different block-size ! However, Oracle had, before 8i, been using 2K and 4K block sizes. Except that the new features (LMT, ASSM etc) may not have been well tested.
    Since you upgraded from 7.3 in place without changing the Block_Size, I would venture to say that your database is still using Dictionary Managed and Manual Allocation and Segment Space Management Manual ?
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • Oracle Blocking Session History

    Hi Folks,
    This morning the database server machine CPU hits 100% - i found a blocking session but didnt killed it as it was of the flashback session.
    The only option i thought was to restart the database.
    Now, i want to investigate the problem - any idea, how to find the cause of tht problem???
    regards,
    OraGuy

    1) Session A holding a lock that Session B is waiting on, causing session B to be temporarily blocked, assuming that's what you saw when you're talking about a "blocking session", is not particularly unusual in Oracle (or any relational database for that matter). That shouldn't cause a spike in CPU and it shouldn't require a database restart to clear the problem (at worst, you might kill the session that holds the lock, but it would normally resolve itself automatically), though. And that definitely doesn't explain a hung database if that's truly what you had.
    2) Since you mentioned AWR, can we assume that you are using the enterprise edition with the performance & tuning packs? If so, assuming you rebooted before the AWR snapshot captured information about the state of the system, you could potentially go through the ASH data (active session history) for the various sessions that were blocking and waiting to see what they were waiting on.
    Justin

  • Co-relation between oracle blocks and OS blocks ??

    how is the database data-block co-related withe the OS data-block ??

    Akshay,<br>
    <br>
    Ca va, merci. ;-)<br>
    In the doc above, we can read "Each operating system has a block size. Oracle requests data in multiples of Oracle data blocks, not operating system blocks.".<br>
    <br>
    Anyway, you can search into Oracle doc, and find DB_BLOCK_SIZE Initialization Parameter : If a database's block size is different from the operating system block size, make the database block size a multiple of the operating system's block size.<br>
    <br>
    Nicolas.

  • Oracle ASM rebalancing does change rowid??

    Hi, all.
    The db is 11.2.0.3 on a linux machine.
    I use ASM for storage management.
    When oracle ASM rebalancing occurs, does the rowid of rows change?
    In my production environment, some application modules depend on rowid of rows.
    Have a wonderful day.
    Best Regards.

    Hi
    When oracle ASM rebalancing occurs, does the rowid of rows change?No, the load balancing is doie by moving ASM allocation units i.e datafiles extents (synonymous to OS blocks) to other physical volumns within same diskgroup to make data spread across all volumes in a balanced way. It has nothing to do with rowids and you should not worry about it.
    Salman

  • [req] how to check whether given oracle table exist or not + C#

    Hi,
    All.
    Actually i m creating a program using C# which connects to the database (oracle) and checks for the given table "OPC_GROUP". if the table doesnt exists then it creates the table else it updates all field with provided values
    code
    cmd.CommandText = "SELECT tname from tab where tname = 'OPC_GROUP'";
    cmd.CommandType = CommandType.Text;
    int length = cmd.ExecuteNonQuery();
    if (cmd.ExecuteNonQuery() >0)
    MessageBox.Show("Table does exist");
    else
    MessageBox.Show("Table doesnt exist");
    But this code return "TABLE DOESNT EXIST" though table is already created
    What i m doing wrong???
    Please help..........
    Thnx in advance

    Try this..
    cmd.CommandText = "SELECT count(*) from tab where tname = 'OPC_GROUP'";
    cmd.CommandType = CommandType.Text;
    string strnum = cmd.ExecuteScalar().ToString();
    if (strnum!="0")
    MessageBox.Show("Table does exist");
    else
    MessageBox.Show("Table doesnt exist");
    Hope it helps,
    Greg

  • Oracle 11g: Block Corruption in SYSAUX File

    Hello All,
    I am facing Data corruption issue in the SYSAUX file.
    We are using Oracle 11G (Microsoft 32 bit) and our system is running in noarchivelog mode.
    Following are the errors in the alert log.
    e:\sc\sc15.2\databases\oracleconfig\diag\rdbms\enmscsdb\nm45\trace\nm45_p000_5944.trc
    Corrupt block relative dba: 0x0088a9f8 (file 2, block 567800)
    Fractured block found during buffer read
    Data in bad block:
    type: 6 format: 2 rdba: 0x0088a9f8
    last change scn: 0x0000.0b3bb7c7 seq: 0x1 flg: 0x04
    spare1: 0x0 spare2: 0x0 spare3: 0x0
    consistency value in tail: 0xc7000601
    check value in block header: 0xee6b
    computed block checksum: 0x72c6
    Reread of rdba: 0x0088a9f8 (file 2, block 567800) found same corrupted data
    Thu Jan 22 16:46:44 2009
    SMON: Restarting fast_start parallel rollback
    SMON: ignoring slave err,downgrading to serial rollback
    ORACLE Instance nm45 (pid = 12) - Error 1578 encountered while recovering transaction (9, 11) on object 458.
    Errors in file e:\sc\sc15.2\databases\oracleconfig\diag\rdbms\enmscsdb\nm45\trace\nm45_smon_6492.trc:
    ORA-01578: ORACLE data block corrupted (file # 2, block # 567800)
    ORA-01110: data file 2: 'E:\SC\SC15.2\DATABASES\ORACLECONFIG\SYSAUXNM45.ORA'
    Thu Jan 22 16:46:45 2009
    Trace dumping is performing id=[cdmp_20090122164645]
    Corrupt Block Found
    TSN = 1, TSNAME = SYSAUX
    RFN = 2, BLK = 567800, RDBA = 8956408
    OBJN = 458, OBJD = 458, OBJECT = I_WRI$_OPTSTAT_HH_OBJ_ICOL_ST, SUBOBJECT =
    SEGMENT OWNER = SYS, SEGMENT TYPE = Index Segment
    Following query indicates the corruption is in index.
    SQL> SELECT tablespace_name, segment_type, owner, segment_name FROM dba_extents
    WHERE file_id = 2 and 567800 between block_id AND block_id + blocks - 1;
    TABLESPACE_NAME SEGMENT_TYPE OWNER
    SEGMENT_NAME
    SYSAUX INDEX SYS
    I_WRI$_OPTSTAT_HH_OBJ_ICOL_ST
    ==============
    DBverify output:
    ==============
    E:\SC\SC15.2\Databases\OracleConfig>dbv file=SYSAUXNM45.ORA blocksize=8192
    DBVERIFY: Release 11.1.0.7.0 - Production on Thu Jan 22 16:59:11 2009
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    DBVERIFY - Verification starting : FILE = E:\SC\SC15.2\Databases\OracleConfig/SY
    SAUXNM45.ORA
    DBV-00200: Block, DBA 8956312, already marked corrupt
    Page 567800 is influx - most likely media corrupt
    Corrupt block relative dba: 0x0088a9f8 (file 2, block 567800)
    Fractured block found during dbv:
    Data in bad block:
    type: 6 format: 2 rdba: 0x0088a9f8
    last change scn: 0x0000.0b3bb7c7 seq: 0x1 flg: 0x04
    spare1: 0x0 spare2: 0x0 spare3: 0x0
    consistency value in tail: 0xc7000601
    check value in block header: 0xee6b
    computed block checksum: 0x72c6
    DBVERIFY - Verification complete
    Total Pages Examined : 1623864
    Total Pages Processed (Data) : 540984
    Total Pages Failing (Data) : 0
    Total Pages Processed (Index): 964944
    Total Pages Failing (Index): 0
    Total Pages Processed (Other): 17849
    Total Pages Processed (Seg) : 0
    Total Pages Failing (Seg) : 0
    Total Pages Empty : 100086
    Total Pages Marked Corrupt : 2
    Total Pages Influx : 1
    Total Pages Encrypted : 0
    Highest block SCN : 190789648 (0.190789648)
    SQL> select * from v$database_block_corruption;
    FILE# BLOCK# BLOCKS CORRUPTION_CHANGE# CORRUPTIO
    2 567800 1 0 FRACTURED
    2 567704 1 0 FRACTURED
    How to resolve this issue.
    Thanks
    With Regards
    Hemant Joshi.

    Drop and re-creating the index would be better than re-building the index.
    Check the metalink note: Identify the corruption extension using RMAN/DBV/ANALYZE etc - 836658.1
    Note 28814.1 - Handling Oracle Block Corruptions in Oracle7/8/8i/9i/10g
    Note 472231.1 - How to identify all the Corrupted Objects in the Database reported by RMAN
    ORA-1578 Main Reference Index for Solutions -830997.1

  • Optimal NTFS block size for Oracle 11G on Windows 2008 R2 (OLTP)

    Hi All,
    We are currently setting up an Oracle 11G instance on a Windows 2008 R2 server and were looking to see if there was an optimal NTFS block size. I've read the following: http://docs.oracle.com/cd/E11882_01/win.112/e10845/specs.htm
    But it only mentioned the block sizes that can be used (2k - 16k). And basically what i got out of it, was the different block szes affect the max # of database files possible for each database.
    Is there an optimal NTFS block size for Oracle 11G OLTP system on Windows?
    Thanks in advance

    Is there an optimal NTFS block size for Oracle 11G OLTP system on Windows?ideally FS block size should be equal to Oracle tablespace block size.
    or at least be N times less than Oracle block size.
    For example - if Oracle BS=8K then NTFS BS better to be 8K but also can be 4K or 2K.
    Also both must be 1 to N times of Disk sector size. Older disks had sectors 512 bytes.
    Contemporary HDDs have internal sector size 4K. Usually.

  • Oracle is adding "RowId" to select statement = ORA-00918 follows

    Hi,
    i've a problem with a strange case:
    Oracle adds a rowId column to the select - and this select has joins to 2 other tables and a ora-00918 is the result!
    But my application don't throw a java-excpetion - this appears only in the database log files - in the application, no problem is determined!
    Database is suffering under this statement because in an hour, 1800 statements are failing... so what could this be and how i can prevent it to add this column!?
    select rowid, t1.name, .......... from t1, t2, t3 etc....
    I use the following statement:
    Statement selStmt = stmt.getConnection().createStatement(
    ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
    Thx for help!
    lg
    Manny

    Tough to help if you don't provide you Java and OS infor and the Oracle JDBC driver version.
    Post all of the relevant Java code that is used to setup and execute the prepared statement and handle the result set.
    The Oracle JDBC driver uses ROWID to support scroll sensitive or updatable result sets so it is probably being added for this reason.
    Remove the 'TYPE_SCROLL_SENSITIVE' setting and see if the problem goes away.
    Seacrh for ROWID in the JDBC Dev guide (Chap 17) - http://www.stanford.edu/dept/itss/docs/oracle/10g/java.101/b10979/resltset.htm
    >
    17.1.2.2 Oracle JDBC Implementation for Result Set Updatability
    To support updatability, Oracle JDBC uses ROWIDs to uniquely identify database rows that appear in a result set. For every query into an updatable result set, the Oracle JDBC driver automatically retrieves the ROWID along with the columns you select.
    >
    And since you are trying to produce a scroll sensitive result set you should do a test as described in this doc hint:
    >
    There is a simple way to determine if your query will probably produce a scroll-sensitive or updatable result set: If you can legally add a ROWID column to the query list, then the query is probably suitable for either a scroll-sensitive or an updatable result set. (You can try this out using SQL*Plus, for example.)
    >
    and:
    >
    The Oracle JDBC drivers use the ROWID to uniquely identify a row in a database table. As long as the ROWID is still valid when a driver tries to send an UPDATE or DELETE operation to the database, the operation will be executed.
    >
    Hope that helps.

  • Oracle Datafile block corruption

    HI all
    i am facing datafile block corruption in following datafile .
    i don't have any backup.
    how i can recover these blocks
    Regards
    Vivek Rawat

    Hi Vivek,
    Please refer below SAP notes to analyze the affected objects which needs to be recovered
    365481 - Block corruptions
    1559652 - How to deal with block corruptions on Oracle
    923919 - Advanced Oracle block checking features
    http://www.dba-oracle.com/t_repair_corrupt_blocks.htm
    Hope this helps.
    Regards,
    Deepak Kori

  • Concerning oracle single block io call and os block size!!

    Hi, all
    The block size of my db(10gr2) is 8k, and
    the db is on the raw device file system on a aix machine.
    OS block size is 512k.
    How much block will be read from disk when a single oracle io call occurs?
    Which one is currect, 8K or 512K?
    If the block size for a single io call depends on the os block size (512k),
    I think os block size need to be tuned for oracle block size (8k).
    If we use raw device file system, os level block size has no meaning??
    Thanks in advance.
    Best Regards.

    Hi,
    Please refer to the following oracle doc:
    http://docs.oracle.com/cd/B28359_01/server.111/b32009/appa_aix.htm
    extract from it:
    Setting the Database Block Size
    You can configure Oracle Database block size for better Input-Output throughput. On AIX, you can set the value of the DB_BLOCK_SIZE initialization parameter to between 2 KB and 32 KB, with a default of 4 KB. If Oracle Database is installed on a journaled file system, then the block size should be a multiple of the file system block size (4 KB on JFS, 16 K to 1 MB on GPFS). For databases on raw partitions, Oracle Database block size is a multiple of the operating system physical block size (512 bytes on AIX).
    Thanks and Regards,
    Raj K.

  • Oracle Corrupted Blocks .

    Hi ,
        We using R/3 4.7 with Oracle 9.2 , Now i want to check any corrupted blocks are attected in our server , Can you tell me how can i check . Because i want to check the corrupted blocks in database is in online . Shall i use DBVERIFY .
    Regards
    Palani Selvan

    Palani,
    Yes You can use DBVERIFY.  You can run it from DB13-->Verify Database
    Check below note for details
    Note 23345 - Consistency check of ORACLE database
    SAP Note 354293 - DBVerify reports corrupt block in freespace area
    Note 365481 - Block corruptions
    Note 923919 - Advanced Oracle block checking features
    Just for your information, in BW system If you get warning like "DBV-00200: Block, dba 97446680, already marked corrupted", it occures because secondary indexes of InfoCube fact
    tables are set up in mode NOLOGGING as a standard.
    See below notes for more information                                                      
    Note 442763 - Avoid NOLOGGING during the index structure (Oracle
    Note 547464 - Nologging Option when creating indexes
    Note 849485 - Reconstruction of the NOLOGGING indexes after recovery
    Re: SAP_INFOCUBE_INDEXES_REPAIR
    Hope it help
    Thanks,
    Sushil

Maybe you are looking for

  • Is there any way to convert video files and keep my project in Final Cut Pro 7?

    I am currently editing a project, and have been having multiple issues with freezing while editing. Upon doing some quick research, I learned it is bcause my clips are in the h.264 format, which is not a good editing codec. Is there any way to change

  • External monitor preview

    I have heard that you need firewire to preview on a another monitor (after effects). where do i plug the wires? usb part in the computer and the firewire part in the monitor? <moved by mod from downloading,installing,setting up - kglad>

  • Update a table from a view

    I'm a newbie and I would like any suggestions and help with my problem. I have a view, m_jobs, that is based on the view, sys.dba_jobs. I want to add a two fields, user_id and update, to keep track of user who is adding and modifying scheduled jobs.

  • About the 'ALSM_EXCEL_TO_INTERNAL_TABLE'

    Hi all, I use the FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' to write a report for the upload the Excel to Datatable. And now, i am wondering to know wheater this FM is international or not, cause this report may be deliver to customers, and we hope this repo

  • How do I transfer a separate scan to a blank paper?

    If I'm working on one photo, but want to merge in second photo, how do I do that?