freelists is LIFO?

Jin

I read the following white paper:

http://BBS.wisky.org/doc/internal.docs/freelist%20Management%20with%20Oracle%208i%20.PDF

Here, he says:

"All types of freelists are implemented as a simple linked list using a mechanism of last-in first-out.

Now assume that we just a free list of Master and no process lists for free (and I guess if we have no free lists of process, can we have free Transaction lists?). That master free points list data block 5 and 5 points to the data block 7 data block, then the main free list will point to the data block 7 (because it points also to the tail). Now let assume us a new data block, the 100 block of data, becomes available. This block of data 7 now pointing to it, like the master list of free in the segment header. Now let say us that we had to do a lot of inserts. This means that a transaction will go to the MFL, look at the tail, go to the data block 100 and start making inserts so that it is the first to leave the free list? If so, what is the logic behind this? is it because this block of data is "hotter" than the others and is more likely to be in the database buffer cache? or is there a different reason (s)?

Thank you

Tags: Database

Similar Questions

  • at last in, first out (LIFO)

    Hello

    All those put implement LIFO using Labview. Help to share/Advisor? I understand that labview has FIFO LIFO but not.

    Just use the Element Enqueue to opposite end.  Adds items to the front of the queue, which makes a LIFO.

  • FREELISTS and FREELIST GROUPS of CREATE TABLE

    My oracle 10g, create table statement is below:

    CREATE TABLE S005. Test

    (

    AAA char (1)

    )

    PCTFREE 0

    STORAGE)

    FREELISTS 10

    FREELIST GROUPS 20

    )

    LOGGING

    NOCACHE

    NOPARALLEL

    NOMONITORING;

    After performing this sql, I have a query table USER_TABLES but FREELISTS and FREELIST_GROUPS fields show nothing.

    In my view, FREELISTS value must be 10, and FREELIST_GROUPS should be 20. How to retrieve these values?

    Thank you very much

    SAMS - Oracle FAQ

  • Freelist

    After corrupt him and the block using the fixing dbms_repair package must be created freelists? As in sybex, Freelist OCP preperation book blocks can become inaccessible due to physical corruption. You must use the REBUILD_FREELISTS procedure to create the list of reconstruction.

    But I have'nt has encountered no problem to insert the record in the table after the setting of the block without rebuliding freelist, when the above question may encounter if I rebuild not freelist?
    SQL> conn test/test123
    Connected.
    
    SQL> select count(*) from emp;
    
      COUNT(*)
    ----------
         10000
    
    --Connect to sys
    begin
    dbms_repair.admin_tables
    (table_name => 'REPAIR_TABLE',
    table_type => dbms_repair.REPAIR_TABLE,
    action => dbms_repair.create_action,
    tablespace => 'TEST_CORRUPT');
    end;
    /
    set serveroutput on size 100000;
    declare
    rpr_count int;
    begin
    rpr_count := 0;
    dbms_repair.check_object(schema_name => 'TEST',object_name => 'EMP',REPAIR_TABLE_name => 'REPAIR_TABLE',corrupt_count => rpr_count);
    dbms_output.put_line('repair block count: '||to_char(rpr_count));
    end;
    /
    select object_name, block_id, corrupt_type, marked_corrupt
     from REPAIR_TABLE
    /
    declare
    fix_block_count int;
    begin
    fix_block_count := 0;
    dbms_repair.fix_corrupt_blocks (schema_name => 'TEST',object_name => 'EMP',object_type => dbms_repair.table_object,REPAIR_TABLE_name => 'REPAIR_TABLE',fix_count => fix_block_count);
    dbms_output.put_line('fix blocks count: ' ||to_char(fix_block_count));
    end;
    /
    select object_name, block_id, marked_corrupt
     from REPAIR_TABLE
    /
    select count(*) from emp
    /
    -- Skips the corrupt blocks in the tables.
    declare
    begin
    dbms_repair.skip_corrupt_blocks (schema_name => 'TEST',object_name => 'EMP',object_type => dbms_repair.table_object,flags => dbms_repair.skip_flag);
    end;
    /
    select table_name, skip_corrupt from dba_tables
     where table_name = 'EMP' and owner='TEST'
    /
    SQL> conn test/test123
    Connected.
    
    SQL> select count(*) from emp;
    
      COUNT(*)
    ----------
          9340
    
    SQL> insert into emp select rownum from all_objects
      2  /
    
    40762 rows created.
    
    SQL> commit
      2  /
    
    Commit complete.
    
    SQL> select count(*) from emp;
    
      COUNT(*)
    ----------
         50102

    Aman... wrote:
    I'm not sure that I have read anywhere or have seen me this free list is corrupted after you use the package. And you can see on your own demo he didn't need advertising. So I would say that you have not really do as a confirmed declaration. Also use RMAN to perform block recovery.

    I haven't tested this - but if a block is on a freelist and corrupted then what will happen when you tried to find a block for insertion and your session chosen block corrupted free list? Although we can mark tables as 'skip corrupted' maybe that applies only when you tablescans. Just as we have a "fix index" procedure to run having satisfied damaged table blocks, perhaps we must 'fix freelists' to make sure that none of the freelists points to a block that is now marker for ORA-01578.

    Another possibility is that this procedure recreates freelists and freelist blocks if corruption is in the freelists - by analogy, there is a procedure (in the dbms_space package I think) to recreate the bitmaps of space segment if they beomce incompatible.

    Concerning
    Jonathan Lewis

  • waiting on a free freelist

    Hello

    If t1 and t2 are waiting for a freelist become free and t1 began waiting 1, t1 will have access to it first?

    Thank you

    OK, well, because I think that any answer to this question leads to a lot more questions, I'll recommend you read book excellent in Stephan Haisley, available on MetaLink, sorry available on MOS, as Doc ID 157250.1. (Assuming that you can get into MOS and make it work!)

    Then keep in mind, the free list management is endangered of the door. With SAMS, free lists are no longer used to manage the blocks with free space. In the long term, it may be more practical to spend the time to understand how the SAMS.

    Hope that helps,

    -Mark

  • How does Oracle 'choose' a block of free data of freelist?

    Hello

    We could have 10 blocks on the freelist, all empty. How Oracle will begin to be inserted in these? Will it be by choosing one, he fills, before moving on to the next, or is this a case of many blocks being inserted at the same time?

    Thank you

    This document gives a reasonable explanation.

    http://www.Ixora.com.au/q+a/DataBlock.htm

  • Sort by clicking the column of heade with LIFO

    Hello!

    I want to sort by the last entry is first (LIFO) in my report.
    To do this, I have to check United Nations ensure:
    Home > Application Builder > Application * > Page 1 > report attributes
    * (otherwise APEX indicates: "your query cannot include an"ORDER BY"clause when having the position active sort column".) *.


    When I followed the suggestion of APEX, my lost feature of report to sort by clicking the column header.
    I still want to keep sorting capacity on just any column by clicking the column header.


    Thanks in advance,

    Sam

    Sam:

    You want to create a process of type "Session State", then select 'Preferences to reset (delete all preferences the current user)' as the Type of State of Session process.
    This process subordinate to your button "Reset".

    CITY

  • Access to the floppy drive crashes Windows with code: 0X000000F7

    After you have installed the Windows XP updates a week ago (10/22/09 - while others seem to have gotten 0x000000E7 BSOD), my computer hangs when you try to use the floppy drive.  Neighbor has same problem.  However, another neighbour, who did not install the updates since 1 September doesn't have this problem.  We use Windows XP.  I even created a file on the diskette using the player of the 'good' of the neighbor and tried in my computer and the neighbour - always crushed the two machines.  Saw post to that topic or similar problem the other day, but he lost it when I hit the wrong button and cannot find him. Help!

    He is now 10/29 (5:20 pm EDT), and after three days of trying to solve this problem, I'm really frustrated.  Carefully removed eight updates installed since 14/10/2009. I removed them one at a time in reverse order, they were installed (LIFO) and I tried using the floppy after each removal drive, but still get BSOD. My BIOS/CMOS watch floppy drive and my device manager says its working. I even deleted the physically and in the BIOS, floppy drive deleted the contoller of floppy and drivers floppy drive in Device Manager. restarted and other devices working properly.  Reinstalled drive, reset the BIOS, restarted and Windows loaded automatically (as checked in the Device Manager) drivers - always get BSOD when trying to read the disk.

    I would have completely uninstalled CA, except that this user really liked the CA email spam filtering. So, I disabled the antivirus and antispyware of all parties and uninstalled the CA Personal Firewall, and here, the floppy drive has started working. I then installed the new Microsoft Security Essentials to prvide a / v sp and psyware protection.

    kW

  • Error on blue screen Windows 7 x 86

    Hello, I had a lot of problems with my laptop. The technical support guy said that my HD was done, so he sold me a new one, with Windows 7 x 86 (before I had the x 64), and my cell phone was OK for a while.

    During this time, I had some blue screen errors. But after the new HD, it never happened again.

    Unfortunately, this week it happened once more. I have the file Minidump here: https://onedrive.live.com/embed?cid=71AB5696D74B2AD5&resid=71AB5696D74B2AD5%21828&authkey=AEmmwpsHL2INHV

    and here: https://mega.co.nz/#! sV4QBQDJ! H9gnSuJZBXtv9EvcSFD8eSS0eHybE1_BfqD7l5BjBOo

    What is the problem? How can I solve it?

    Please, help me.

    Thanks in advance.

    Hello and good morning (morning here in New York!) :)

    BAD_POOL_HEADER (19)

    This indicates that a pool header is corrupt.

    Error checking 19, {3, 957f5490, 0, 957f5490}

    0: kd > k
    ChildEBP RetAddr
    80f68798 988cb868 nt! ExAllocatePoolWithTag + 0 x 664
    80f687ac 988d9e73 win32k! Win32AllocPool + 0 x 13
    80f687c0 988d9e27 win32k! AllocThreadBufferWithTag + 0x1e
    80f687d0 988da101 win32k! AllocFreeTmpBuffer + 0x2d
    80f687f0 988dacfa win32k! ESTROBJ::vInit + 0xcb
    80f68b38 9884af67 win32k! GreExtTextOutWLocked + 0x62f
    80f68bb4 988afb07 win32k! GreBatchTextOut + 0x1e6
    80f68d24 8304a73c win32k! NtGdiFlushUserBatch + 0 x 123
    80f68d34 77a164f4 nt! KiFastCallEntry + 0xcc
    WARNING: Frame IP not in any known module. Sequence of images may be wrong.
    80f68d38 badb0d00 0x77a164f4
    80f68d3c 0024ead8 0xbadb0d00
    80f68d40 0x24ead8 00000000

    It seems that the pool freelist is corrupted (caused by a driver left 3rd, probably).

    ---------------------------------

    1. remove and replace avast! with Microsoft Security Essentials for purposes of troubleshooting temporary as it is likely to cause conflicts:

    avast! removal - http://www.avast.com/uninstall-utility

    MSE - http://Windows.Microsoft.com/en-us/Windows/Security-Essentials-download 

    2 in your list of drivers loaded, dtsoftbus01.sys figure who is the driver for Daemon Tools. Daemon Tools is a very popular cause of BSOD in 7/8 base systems. Please uninstall Daemon Tools. Alternative imaging programs are: MagicISO, Power ISO, etc.

    Kind regards

    Patrick

  • ORA-39117 with 'MDSYS. "' SDO_GEORASTER ' when you perform an import in 12cR1 non - CBD

    Hello

    I'm trying to import a table from a database server Oracle 11 GR 2 (11.2.0.3) to a 12cR1 (12.1.0.2) Oracle database (non - CBD).

    Here's how I did the export of the source:

    SQL > show the db_name parameter

    VALUE OF TYPE NAME

    ------------------------------------ ----------- ------------------------------

    db_name string ZEUS

    SQL > select banner version of v$.

    BANNER

    --------------------------------------------------------------------------------

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    CORE Production 11.2.0.3.0

    AMT for Linux: Version 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    parfile: exp_missing_SPATIAL_SCHEMAS_ZEUS11g.par

    tables is MANGO. ORTHO_PHOTOS, MVDEMO_NATURALEARTH. WORLD_RASTER

    Directory = DATA_PUMP_DIR

    REUSE_DUMPFILES = y

    exclude = statistics

    dumpfile = expdp_missing_SPATIAL_SCHEMAS_ZEUS11g.dmp

    logfile = logexpdp_missing_SPATIAL_SCHEMAS_ZEUS11g.log

    expdp system parfile = exp_missing_SPATIAL_SCHEMAS_ZEUS11g.par

    Here's how I did the import to the target:

    SQL > show the db_name parameter

    VALUE OF TYPE NAME

    ------------------------------------ ----------- ------------------------------

    db_name string ZEUS

    SQL > select banner version of v$.

    BANNER

    --------------------------------------------------------------------------------

    Database Oracle 12 c Enterprise Edition Release 12.1.0.2.0 - 64 bit Production

    PL/SQL Release 12.1.0.2.0 - Production

    CORE Production 12.1.0.2.0

    AMT for Linux: Version 12.1.0.2.0 - Production

    NLSRTL Version 12.1.0.2.0 - Production

    parfile: imp_missing_SPATIAL_SCHEMAS_ZEUS12c.par

    tables is MANGO. ORTHO_PHOTOS, MVDEMO_NATURALEARTH. WORLD_RASTER

    Directory = TEMP_DUMPS

    dumpfile = expdp_missing_SPATIAL_SCHEMAS_ZEUS11g.dmp

    logfile = logimpdp_missing_SPATIAL_SCHEMAS_ZEUS12c.log

    Impdp system parfile = imp_missing_SPATIAL_SCHEMAS_ZEUS12c.par

    I find myself with this kind of error:

    ORA-39117: Type necessary to create the table is not included in this operation. Because sql is:

    CREATE TABLE "MANGO". "" ORTHO_PHOTOS "(NUMBER OF 'FID', 'NAME"VARCHAR2 (256 BYTE), VARCHAR2 (256 BYTE) 'TYPE', 'IMAGE' "MDSYS"." SDO_GEORASTER')

    SEGMENT OF PCTFREE, PCTUSED 10 40 INITRANS, MAXTRANS 1 255 NOCOMPRESS LOGGING CREATION

    STORAGE (INITIAL 65536 THEN 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS USER_TABLES DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT 1)

    TABLESPACE...

    Yet, the 'MDSYS. "' Data SDO_GEORASTER type" exist in the source and target database.

    Someone has such experience, may be related to a bug?

    Thanks in advance for any information.

    Kind regards

    Hi Laury.

    You say that the object exists, but you check its executable?

    https://docs.Oracle.com/database/121/GEORS/release_changes.htm#GEORS1382

    I guess that with the release of 12 c, Oracle wish you to specifically take action showing that you have a license Oracle Spatial.  Otherwise you can not use the georaster with just the license locator object.

    See you soon,.

    Paul

  • What is the syntax to create segments?

    Hello

    segment can be created manually as table space? If Yes, what is the syntax to create the segment?

    Concerning

    The create table statement has a storage clause that is part of the clause of physical attributes.

    These clauses to define options for the creation of segment/measure. If you do not specify the storage clause, then the tablespace-level settings are used.

    Documentation of the CREATE TABLE statement

    Physical properties: https://docs.oracle.com/database/121/SQLRF/statements_7002.htm#i2126711

    {[deferred_segment_creation] [table_compression] segment_attributes_clause}

    [inmemory_table_clause] [ilm_clause]

    | [deferred_segment_creation] ORGANIZATION

    {Heap_org_table_clause BUNCH [segment_attributes_clause]

    | INDEX index_org_table_clause [segment_attributes_clause]

    | External_table_clause EXTERNAL

    }

    | CLUSTER cluster (column [, column]...)

    Segment attributes clause: https://docs.oracle.com/database/121/SQLRF/statements_7002.htm#i2214991

    {physical_attributes_clause

    | TABLESPACE tablespace

    | logging_clause

    }...

    {Clause of their physical characteristics: https://docs.oracle.com/database/121/SQLRF/clauses007.htm#SQLRF30011}

    [{ PCTFREE whole

    | Whole PCTUSED

    | INITRANS whole

    | storage_clause

    }...

    ]

    Term of storage: https://docs.oracle.com/database/121/SQLRF/clauses009.htm#CJACEJGB


    STORAGE

    ({ INITIAL size_clause

    | Size_clause NEXT

    | MINEXTENTS whole

    | MAXEXTENTS {integer |} UNLIMITED }

    | maxsize_clause

    | PCTINCREASE whole

    | Whole FREELISTS

    | FREELIST GROUPS around

    | OPTIMAL [size_clause |] NULL ]

    | USER_TABLES { KEEP |} RECYCLE | DEFAULT }

    | FLASH_CACHE { KEEP |} NO | DEFAULT }

    | ENCRYPT

    } ...

    )

    However, the create table statement lets you not create segments or extensions directly. New extensions are to be created initially (when the table is created) or later, when more space is needed for the table, usually after several insertions that filled the original measure.

    Also remember that SQL is a language of generation 4. But there is no need to go into details such as the management of use or storage. All that and managed by the RDBMS.

  • IMP-00017: statement failed with error ORACLE 1658:

    # imp system/pass fromuser = touser = file=/disk1/Downloads/dmp/MI61015.dmp databaseName databaseName

    Import: Release 11.2.0.2.0 - Production on Sat Oct 10 09:29:32 2015

    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

    Connected to: Oracle Database 11 g Express Edition Release 11.2.0.2.0 - 64 bit Production

    Export file created by EXPORT: V11.02.00 by conventional means

    import performed AL32UTF8 and AL16UTF16 NCHAR character set

    Customer export uses the (possible character set conversion) US7ASCII character set

    . imported objects from databaseName databaseName

    . . import of table 'ACCOUNTS' 12 rows imported

    . . table import 'AGREEMENTS' 6 imported lines

    . . importing table "ASSIGNEDDEPT" 0 rows imported

    . . import of 2713 lines imported from the table 'BULKSAVEDCVS '.

    . . import of table "CERTIFICATION" 7 lines imported

    . . importing table "COMMONDOCS" 0 rows imported

    . . table import 'COUNTRY' 256 imported lines

    . . importing table "CVCATEGORIES" 6 imported lines

    . . table 'CVCERTIFICATION' import 92 lines imported

    . . importing table "CVCHECKAGAIN" 56 imported lines

    . . importing table "CVDETAILS".

    IMP-00058: ORACLE error 1653

    ORA-01653: unable to extend table databaseName.CVDETAILS 8192 in the SYSTEM tablespace

    IMP-00028: partial import of the restored previous table: 20960 restored lines

    . . table 'CVLICENSE' import 756 lines imported

    . . importing table "CVPROPERTIES" 69752 imported lines

    . . rows in table 'CVSPECIALTY' import imported 6159

    . . import of 1701 lines imported from the table 'CVVIEWS '.

    . . "DEPT" table import 2 lines imported

    IMP-00017: statement failed with error ORACLE 1658:

    ' CREATE TABLE 'DETAILRESUME' ("D_ID" (14: 0), THE NUMBER OF 'CV_ID' (14: 0), "").

    "NUMBER OF 'CAT_ID' (14: 0), 'DETAILRESUME' CLOB) INITRANS PCTUSED 40 PCTFREE 10.

    1 MAXTRANS 255' STORAGE ' (INITIALS 67108864 THEN 1048576 MINEXTENTS 1 FREELIST).

    "S 1 FREELIST GROUPS 1 DEFAULT USER_TABLES) TABLESPACE 'SYSTEM' LOGGING NOCO.

    "COMPRESS LOB ("DETAILRESUME") AS STORE BASICFILE (TABLESPACE 'SYSTEM' ENABLE '.

    "CHUNK 8192 PCTVERSION 10 NOCACHE LOGGING STORAGE (INITIAL 6" ONLINE STORAGE ".

    "THE NEXT 5536 1048576 MINEXTENTS 1 FREELISTS 1 FREELIST GROUPS 1 USER_TABLES OF."

    "FAULT)).

    IMP-00003: ORACLE error 1658

    ORA-01658: unable to create the INITIAL extent for segment in tablespace SYSTEM

    . . importing table "DOCCATEGORIES" 0 rows imported

    . . table 'EMPLOYERORAGENT' import 62 lines imported

    . . table 'FAQ' import 4 lines imported

    . . importing table "FOLDERCVS" 6 imported lines

    . . table import 'FOLDERS' 3 imported lines

    . . "JOBDETAILS" table import 84 lines imported

    . . table 'JOBKEYWORDS' import 190 lines imported

    . . table 'JOBPOSTINGS' import 84 lines imported

    . . import of table 'JOBPROPERTIES' 89 imported lines

    . . table 'JOBRESPONSES' import 64019 lines imported

    . . table import "LICENSE" 20 imported lines

    . . import of table 'MESSAGES' 0 rows imported

    . . table import 'NEWS' 0 rows imported

    . . table import "SPECIALTY" 301 lines imported

    . . table import "STAFF" 12 rows imported

    . . table import 'TICKET' 0 rows imported

    . . importing table "TICKETCATEGORY" 0 rows imported

    . . importing table "TICKETTEMPLATES" 0 rows imported

    . . import of rows in table 'USERS' 4410 imported

    About to activate the constraints...

    Import completed successfully with warnings.

    #

    Please advise.

    Thank you in anticipation

    Christy H. wrote:

    How can I increase its space?

    That drive you some people to knowledge, but you can't make them think.

    http://www.lmgtfy.com/?q=Oracle+increase+tablespace+size

  • SNA/ora_rowscn issues

    Hi all

    I was reading AskTom and he talked about the clothing of the SNA at some point.  If this is the case, then how great the RCS measure up until it wraps?  Where is stored the film count?

    On imports, ora_rowscn on the data in the table will get SNA SNA DB and not what has been exported?

    The only use of the CPN in a datapump file would be used for flashback_scn? Right?

    Thanks for all replies.

    All, Woody would have already seen this, but Tim Gorman posted an answer to this same question on Oracle-L, which explains the operation of the base of SNA and rap as well as some interesting facts

    https://www.freelists.org/post/Oracle-l/SCNora-rowscn-questions, 2

    - -

    HTH - Mark D Powell.

  • Analyze seems to work better stats of DBMS

    I know this question has been asked thousands of times in different contexts, but this is a very confusing topic:

    I have done a lot of googling and analyzed through the docs, but still not found the answer. Recommendation Docs oracle since version 9:


    Oracle Corporation strongly recommends that you use the DBMS_STATS package rather than ANALYZE to collect optimizer statistics. This package allows you to collect statistics in parallel, collect global statistics for partitioned objects, and refine your collection of statistics by other means. In addition, possibly cost-based optimizer uses only statistics that have been collected by DBMS_STATS . For more information about this package, see Oracle9i supplied PL/SQL Packages and Types reference .

    However, you must use the ANALYZE instruction rather than DBMS_STATS for the collection of statistics that are unrelated to the optimizer based on costs, such as:

    • Use the VALIDATE or LIST CHAINED ROWS clauses
    • To collect information on the blocks not freelist

    I'll try to post a test in most case this post earlier, because I can't post the plans exec real reason policies internal, but here's what I've noticed so far:

    Oracle 11.2.0.1.0 - Windows Server 2012 R2 64 bit

    -Memory settings increased Oracle, enabled WMA and restart of the database;

    -'Place' system statistics collected (dbms_stats.gather_system_stats), to let the Oracle knows that he has to work now;

    -Statistical collected schema (dbms_stats.gather_schema_stats);

    At this point, always kept users have reported performance issues. By examining some queries concerned, I found that there was a lot of full table scan (but yes, all the indexes were available and stats must be updated after stats diagram, please correct me if I'm wrong). So I ran dbms_stats.delete_schema_stats to remember his stats manually in analyse (cannot remember the paper at the moment, but I read, it is not a good idea to mix his stats with DBMS and analyze simultaneously), after after analysis completed, the cost overall reported 125 (before it was 400), but still a few tables running full table scan , so I remove the statistics for a specific table involved in full table scan, we'll call it 'A' and execution plan now opted for table access by index rowid and the cost for this stage went from 30 to 5, but know the overall cost has increased from-800 to 2000...

    So my main questions are:

    Anyone who works in a specific environment / db analyze where only worked / benefit show?

    Can it be dictated by modeling data / design? Whether or not DBMS / analyze will be a better option?

    What other steps can I take to isolate the problem?

    Is it necessary to clear the shared pool before collecting statistics, as it is sometimes possible to see immediate change to explain the release of the plan?

    Suggestions / corrections will be appreciated.

    Thank you.

    Guilherme, simply upgrade you your database?  I ask because the performance doesn't just normally in all areas except a major problem happens.  You get answers better when the full story is presented.  The main reason I ask is when you move a version of Oracle to an another treating CBO many changes come into play as with 10g on default DBMS_STATS to collect histograms while 9.2 no histograms were collected by default.  The sudden addition of histograms in the equation has burned more than a shop, while others barely noticed.

    - -

    Back on Oracle 9.2 we had better results using ANALYZE instead of DBMS_STATS. However, we started to use DBMS_STATS with our upgrade to 10.2.  We had only to give some queries immediately after the upgrade.

    - -

    If you recently upgraded you should be re-assembled all the statistics of objects as part of the upgrade.  Check your current settings of DBMS_STATS.  I recommend that you start with the default values of Oracle in all areas and keep the default values.  If you have any items where your plans get bad, you can change the settings on a basis of object level which is a nice feature because if you want to disable the histograms on a specific object or change the number of buckets used with the object.

    - -

    If this database has been used some time and performance went all of a sudden jar and then using ANALYZE instead of DBMS_STATS is not the right solution.  In this case, identify any changes to the system that were made as the parameters of database changes, the new application features enabled, etc...

    - -

    HTH - Mark D Powell.

  • DBMS_DATAPUMP.metadata_remap - a matter of REMAP_TABLE.

    I want to export SCOTT. DEPT table and imports than HR. DEPT_HR with constraint. I'm using DBMS_METADATA. METADATA_REMAP with REMAP_SCHEMA (to change the schema anme) and REMAP_TABLE (to change the name of the table). I don't know where I am getting the error. It seems that REMAP_SCHEMA is changing all the names of schema successfully, but REMAP_TABLE does not change the name of the table on the constraint. So constraint is not be created. Is there another workaround solution? Here is a small proof of concept:

    SQL> --My database version.
    SQL> ----------------------
    SQL> SELECT * FROM v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    
    SQL> SET SERVEROUT ON
    SQL> ed
    Wrote file afiedt.buf
    
      1  DECLARE
      2  l_data_pump_handle    NUMBER;
      3  l_logfilename    VARCHAR2(30) := 'DWABI_'||to_char(sysdate, 'DDMMRRRRhh24miss') || '.log';
      4  l_expfilename    VARCHAR2(30) := 'DWABI_'||to_char(sysdate, 'DDMMRRRRhh24miss') || '.dmp';
      5  BEGIN
      6  l_data_pump_handle:= DBMS_DATAPUMP.OPEN(operation   => 'EXPORT',
      7                        job_mode    => 'TABLE',
      8                        remote_link => NULL,
      9                        job_name    => 'TEST_REMAP_DP',
    10                        version     => 'LATEST');
    11   DBMS_DATAPUMP.ADD_FILE(handle    => l_data_pump_handle,
    12                     filename    => l_expfilename,
    13                     directory => 'SAUBHIK',
    14                     filetype    => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE);
    15  DBMS_DATAPUMP.ADD_FILE(handle    => l_data_pump_handle,
    16                     filename    => l_logfilename,
    17                     directory => 'SAUBHIK',
    18                     filetype    => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
    19   DBMS_DATAPUMP.metadata_filter(handle => l_data_pump_handle,
    20                        name   => 'SCHEMA_EXPR',
    21                        value  =>'= '||''''||'SCOTT'||'''');
    22   DBMS_DATAPUMP.metadata_filter(handle => l_data_pump_handle,
    23                        name   => 'NAME_EXPR',
    24                        value  =>'= '||''''||'DEPT'||'''');
    25  --We don't need index
    26    DBMS_DATAPUMP.metadata_filter(handle => l_data_pump_handle,
    27                        name   => 'EXCLUDE_PATH_EXPR',
    28                        value  =>'=''INDEX''');
    29  -- We don't copy table statistics!!
    30    DBMS_DATAPUMP.metadata_filter(handle => l_data_pump_handle,
    31                        name   => 'EXCLUDE_PATH_EXPR',
    32                        value  =>'=''STATISTICS''');
    33   -- We don't copy index statistics either!!
    34    DBMS_DATAPUMP.metadata_filter(handle => l_data_pump_handle,
    35                        name   => 'EXCLUDE_PATH_EXPR',
    36                        value  =>'=''INDEX_STATISTICS''');
    37    -- We do not need the data!!
    38    DBMS_DATAPUMP.DATA_FILTER(
    39     handle => l_data_pump_handle,
    40     name => 'INCLUDE_ROWS',
    41     value =>0
    42     );
    43  -- Start the export now.
    44       DBMS_DATAPUMP.start_job(l_data_pump_handle);
    45       dbms_output.put_line('Export started....');
    46   -- Detach, it's finish!
    47      DBMS_DATAPUMP.detach(l_data_pump_handle);
    48      dbms_output.put_line('Export ended....');
    49  EXCEPTION
    50       WHEN OTHERS THEN
    51        dbms_datapump.stop_job(l_data_pump_handle);
    52        RAISE;
    53*  END;
    54  /
    Export started....
    Export ended....
    
    PL/SQL procedure successfully completed.
    
    SQL> SELECT * FROM user_datapump_jobs;
    
    no rows selected
    
    
    
    

    Now, I'm importing that:

    SQL> ed
    Wrote file afiedt.buf
    
      1  --DWABI_28052015143133.dmp
      2  DECLARE
      3  l_data_pump_imp_handle NUMBER;
      4  l_logfilename  VARCHAR2(30) := 'DWABI_'||to_char(sysdate, 'DDMMRRRRhh24miss') || '.log';
      5  ind       NUMBER;        -- loop index
      6   pct_done  NUMBER;        -- percentage complete
      7   job_state VARCHAR2(30);  -- track job state
      8   le        ku$_LogEntry;  -- WIP and error messages
      9   js        ku$_JobStatus; -- job status from get_status
    10   jd        ku$_JobDesc;   -- job description from get_status
    11   sts       ku$_Status;    -- status object returned by get_status
    12  BEGIN
    13  l_data_pump_imp_handle:= DBMS_DATAPUMP.OPEN(operation   => 'IMPORT',
    14                        job_mode    => 'FULL',
    15                        remote_link => NULL,
    16                        job_name    => 'TEST',
    17                        version     => 'LATEST');
    18   DBMS_DATAPUMP.ADD_FILE(handle    => l_data_pump_imp_handle,
    19                     filename    => 'DWABI_28052015143133.dmp',
    20                     directory => 'SAUBHIK',
    21                     filetype    => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE);
    22  DBMS_DATAPUMP.ADD_FILE(handle    => l_data_pump_imp_handle,
    23                     filename    => l_logfilename,
    24                     directory => 'SAUBHIK',
    25                     filetype    => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
    26   --If table is already there then do not import.
    27   dbms_datapump.set_parameter(handle => l_data_pump_imp_handle,
    28                              name => 'TABLE_EXISTS_ACTION',
    29                              value =>'SKIP');
    30    -- We need to remap the schema!!.
    31    dbms_output.put_line('Changing Schema...');
    32    DBMS_DATAPUMP.METADATA_REMAP (
    33     handle => l_data_pump_imp_handle,
    34     name => 'REMAP_SCHEMA',
    35     old_value => 'SCOTT',
    36     value=>'HR'
    37     );
    38    -- We need to remap the table!!. This is not working properly.
    39    dbms_output.put_line('Changing Table...');
    40    DBMS_DATAPUMP.METADATA_REMAP (
    41     handle => l_data_pump_imp_handle,
    42     name => 'REMAP_TABLE',
    43     old_value => 'DEPT',
    44     value=>'DEPT_HR',
    45     object_type => NULL
    46     );
    47   -- Start the import now.
    48       DBMS_DATAPUMP.start_job(l_data_pump_imp_handle);
    49    -- monitor job
    50    pct_done := 0;
    51    job_state := 'UNDEFINED';
    52    WHILE (job_state != 'COMPLETED') AND (job_state != 'STOPPED') LOOP
    53      dbms_datapump.get_status(l_data_pump_imp_handle, dbms_datapump.ku$_status_job_error +
    54      dbms_datapump.ku$_status_job_status +
    55      dbms_datapump.ku$_status_wip, -1, job_state, sts);
    56      js := sts.job_status;
    57      -- If the percentage done changed, display the new value
    58      IF js.percent_done != pct_done THEN
    59        dbms_output.put_line('*** Job percent done = ' ||
    60        to_char(js.percent_done));
    61        pct_done := js.percent_done;
    62      END IF;
    63      -- If any work-in-progress (WIP) or error messages
    64      -- were received for the job, display them.
    65      IF (BITAND(sts.mask,dbms_datapump.ku$_status_wip) != 0) THEN
    66        le := sts.wip;
    67      ELSE
    68        IF (BITAND(sts.mask,dbms_datapump.ku$_status_job_error) != 0) THEN
    69          le := sts.error;
    70        ELSE
    71          le := NULL;
    72        END IF;
    73      END IF;
    74      IF le IS NOT NULL THEN
    75        ind := le.FIRST;
    76        WHILE ind IS NOT NULL LOOP
    77          dbms_output.put_line(le(ind).LogText);
    78          ind := le.NEXT(ind);
    79        END LOOP;
    80      END IF;
    81      --DBMS_LOCK.sleep (10);
    82    END LOOP;
    83    -- Indicate that the job finished and detach from it.
    84    dbms_output.put_line('Job has completed');
    85   -- Detach, it's finish!
    86       DBMS_DATAPUMP.detach(l_data_pump_imp_handle);
    87  EXCEPTION
    88       WHEN OTHERS THEN
    89        dbms_datapump.stop_job(l_data_pump_imp_handle);
    90        RAISE;
    91* END;
    SQL> /
    Changing Schema...
    Changing Table...
    Master table "SYS"."TEST" successfully loaded/unloaded
    Starting "SYS"."TEST":
    Processing object type TABLE_EXPORT/TABLE/TABLE
    Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
    ORA-39083: Object type CONSTRAINT failed to create with error:
    ORA-00942: table
    or view does not exist
    Failing sql is:
    ALTER TABLE "HR"."DEPT" ADD CONSTRAINT
    "PK_DEPT" PRIMARY KEY ("DEPTNO") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE
    DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS"  ENABLE
    
    Job "SYS"."TEST" completed with 1 error(s) at 15:04:02
    Job has completed
    
    PL/SQL procedure successfully completed.
    
    SQL>
    
    
    
    

    If you look at the failing sql code, it is clear that the name of the table in the constraint definition has not changed, but the DEPT_HR table is created in the HR schema without constraint. What's not here?

    Post edited by: Massimiliano edited the subject line, because he said as DBMS_METADATA. Changed to DBMS_DATAPUMP.

    Hello

    This is a bug in 11.2.0.1 I think - please this Ref

    Oracle Support Document 1609238.1 (REMAP_TABLE on IMPDP FAILS WITH ORA-942) can be found at: https://support.oracle.com/epmos/faces/DocumentDisplay?id=1609238.1

    See you soon,.

    Rich

Maybe you are looking for

  • I don't have some options inside the group discussions on iMessage.

    So, here's my problem: when I go to iMessages, click on a newsgroup, and then click on details, it won't give me the opportunity to leave the conversation or add a contact. And when I scroll to the top, in detail, it does not give me the option of ch

  • Compressor doesn't recognize no updates of project FCPX

    When I recently sent a FCPX project to the compressor, I noticed that he needed to sharpen after that he had done his work. I went back to FCPX and redesigned some of the clips and sent to compressor again. He spat that is exactly the same result as

  • string in table 2D

    Hello I have big chain like this: TITLE N1string1-1string1-2string1-3N2string2-1string2-2string2-3N31 string3string3-2string3-3... n99 string99-1 string99-2 string99-3 And I want to create a table: N1 1 string1-string1 of string1-2-3N2 string2-1 2 st

  • Get NI Daq device using C++ name

    Hi, I'm having some problems by using nisysconfig to programaticaly API to retrieve the name of the device of data acquisition. What I mean is the following: When you open MAX and get the list of devices, they will have names such as 'Dev1', "Dev2",

  • Looking for a new lens

    I have a T1i and am looking for a new lens for an upcoming trip to Italy.  I am currently using a 28-135 as my lens every day and wonder if it is better to use as my daily lens out there to be able to capture the sights.  I'll be bringing in a 50 mm