20 Index Restriction on Remote Tables (i.e. using Database Links)

The Oracle Database Administrator's Guides for 10g and 11g document a performance restriction that "No more than 20 indexes are considered for a remote table." If I go back to the 8i documentation it says "In cost-based optimization, no more than 20 indexes per remote table are considered when generating query plans. The order of the indexes varies; if the 20-index limitation is exceeded, random variation in query plans may result."
Does anyone have more details on this performance restriction? In particular I am trying to answer these questions:
1) Are the 20 indexes which are considered by the CBO still random in 10g?
2) Can I influence which indexes are considered with index hints or will my hints only be considered if they are for one of the "random" 20 indexes which are being considered by the CBO?
3) Are there any other approaches or work-arounds to this restriction assuming you need to select from a large remote table with more than 20 indexes (and need to perform the selection using 1 of those indexes to get adequate performance) or do we need to abandon database links for this table?
Thanks in advance for your input.

So, here's my simple test.
SQL>
SQL> create table gurnish.indexes20plus ( n1 number, n2 number, n3 number, n4 number, n5 number, n6 number, n7 number,
2 n8 number, n9 number, n10 number, n11 number, n12 number, n13 number, n14 number, n15 number, n16 number,
3 n17 number, n18 number, n19 number, n20 number, n21 number, n22 number, n23 number, n24 number,
4 n25 number, n26 number, n28 number);
create index xin1 on indexes20plus (n1);
Table created.
SQL> SQL> create index xin2 on indexes20plus (n2);
create index xin3 on indexes20plus (n3);
Index created.
SQL> SQL>
Index created.
SQL> SQL> create index xin4 on indexes20plus (n4);
Index created.
SQL> SQL>
Index created.
SQL> SQL> create index xin5 on indexes20plus (n5);
create index xin6 on indexes20plus (n6);
Index created.
SQL> SQL>
Index created.
SQL> SQL> create index xin7 on indexes20plus (n7);
Index created.
SQL> SQL> create index xin8 on indexes20plus (n8);
Index created.
SQL> SQL> create index xin9 on indexes20plus (n9);
Index created.
SQL>
SQL> create index xin10 on indexes20plus (n10);
Index created.
SQL> SQL> create index xin11 on indexes20plus (n11);
create index xin12 on indexes20plus (n12);
create index xin13 on indexes20plus (n13);
Index created.
SQL> SQL>
Index created.
SQL> SQL>
Index created.
SQL> SQL> create index xin14 on indexes20plus (n14);
Index created.
SQL> SQL> create index xin15 on indexes20plus (n15);
Index created.
SQL>
SQL> create index xin16 on indexes20plus (n16);
Index created.
SQL>
SQL> create index xin17 on indexes20plus (n17);
Index created.
SQL> SQL> create index xin18 on indexes20plus (n18);
Index created.
SQL> SQL> create index xin19 on indexes20plus (n19);
Index created.
SQL> SQL> create index xin20 on indexes20plus (n20);
Index created.
SQL> SQL> create index xin21 on indexes20plus (n21);
Index created.
declare
i number;
begin
for i in 1..100
loop
dbms_random.seed(i+100);
insert into indexes20plus values (dbms_random.value(1,5),dbms_random.value(1,21),dbms_random.RANDOM, dbms_random.RANDOM,dbms_random.value(1,20),
dbms_random.value(1,4),dbms_random.value(1,6), dbms_random.value(1,7),dbms_random.value(1,9),dbms_random.value(1,10),
dbms_random.value(1,11),dbms_random.value(1,12),dbms_random.value(1,13),dbms_random.value(1,14),dbms_random.value(1,1),
dbms_random.value(1,1),dbms_random.value(1,19),dbms_random.value(1,122),dbms_random.value(1,20),dbms_random.value(1,20)
,dbms_random.value(4,20),dbms_random.value(1,20),dbms_random.value(1,20),dbms_random.value(1,20),dbms_random.value(1,20)
,dbms_random.value(4,20),dbms_random.value(4,20));
end loop;
commit;
end;
SQL> set autotrace traceonly
SQL> l
1* select * from gurnish.indexes20plus@lvoprds where n1 = 4
SQL> /
no rows selected
Execution Plan
Plan hash value: 441368878
| Id | Operation | Name | Rows | Bytes | Cost (%CPU
)| Time | Inst |
| 0 | SELECT STATEMENT REMOTE | | 1 | 351 | 1 (0
)| 00:00:01 | |
| 1 | TABLE ACCESS BY INDEX ROWID| INDEXES20PLUS | 1 | 351 | 1 (0
)| 00:00:01 | LVPRD |
|* 2 | INDEX RANGE SCAN | XIN1 | 1 | | 1 (0
)| 00:00:01 | LVPRD |
Predicate Information (identified by operation id):
2 - access("A1"."N1"=4)
Note
- fully remote statement
- dynamic sampling used for this statement
Statistics
0 recursive calls
0 db block gets
0 consistent gets
0 physical reads
0 redo size
1897 bytes sent via SQL*Net to client
481 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
0 rows processed
SQL> select * from gurnish.indexes20plus@lvoprds where n21 = 4;
no rows selected
Execution Plan
Plan hash value: 2929530649
| Id | Operation | Name | Rows | Bytes | Cost (%CPU
)| Time | Inst |
| 0 | SELECT STATEMENT REMOTE | | 1 | 351 | 1 (0
)| 00:00:01 | |
| 1 | TABLE ACCESS BY INDEX ROWID| INDEXES20PLUS | 1 | 351 | 1 (0
)| 00:00:01 | LVPRD |
|* 2 | INDEX RANGE SCAN | XIN21 | 1 | | 1 (0
)| 00:00:01 | LVPRD |
Predicate Information (identified by operation id):
2 - access("A1"."N21"=4)
Note
- fully remote statement
- dynamic sampling used for this statement
Statistics
1 recursive calls
0 db block gets
0 consistent gets
0 physical reads
0 redo size
1897 bytes sent via SQL*Net to client
481 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
0 rows processed
SQL>

Similar Messages

  • How to Execute a Remote Procedure in Portal using Database Link

    Hi,
    I followed the instructions to create a Portal form for a remote procedure. But I am encountering the following error. Can someone advise what may be the cause?
    Failed to execute - Missing string(create_package_body) language(us) domain (wwv) sub_domain (wwv_builder) (WWV-04300)
    ORA-04020: deadlock detected while trying to lock object PUBLIC.PORTLET_SCHEMA (WWV-11230)
    Failed to parse as PORTAL - (WWV-08300)
    PURPOSE
    How to execute a remote procedure in Portal using Database Link.
    DESCRIPTION
    This procedure assumes that you have two databases, one of which is remote, and Portal is configured in the other.
    Remote Database A:
    ==================
    1) Create a procedure as follows: Create or Replace PROCEDURE SCOTT.ADD_TWO_VALUES ( v_one IN NUMBER, v_two IN NUMBER, v_result OUT NUMBER) as begin v_result :=v_one+v_two; end; 2) Grant execute privileges to PUBLIC on the procedure.
    Database B (where Portal is configured): ========================================
    1) Create a public database link and choose to connect as a specific user (say SYSTEM). By default, in an Oracle 8i database, the "global_names" parameter in initSID.ora (or init.ora) file is set to "true". This Global Naming parameter enforces that a dblink has the same name as the database it connects to. Therefore, if the remote global database (A) name is "ora8.acme.com" then the database link should also be named as "ora8.acme.com".
    2) Create a synonym for the procedure in Database A. Make sure you fully qualify the procedure name in the remote database (like SCOTT.ADD_TWO_VALUES).
    3) Create a dynamic page to execute the procedure. The ORACLE tags in the dynamic page will look similar to the following: <ORACLE> DECLARE v_total NUMBER; BEGIN ADD_TWO_VALUES(:v_one,:v_two, v_total); htp.p('The total is => '); htp.p('<input type="TEXT" VALUE='||v_total||'>'); htp.para; htp.anchor('http://<machine.domain:port#>/pls/portal30/SCOTT.DYN_ADD_TWO_VALUES.show_parms', 'Re-Execute Procedure'); END; </ORACLE>
    4) Portal does not have an option to create a form based on a synonym. Therefore, if you want to create a form instead of a dynamic page, create a wrapper procedure and then create a form based on this procedure. For example: Create or Replace PROCEDURE PORTAL30.ADD_TWO_VALUES_PR ( v_one IN NUMBER, v_two IN NUMBER, v_total OUT NUMBER) as begin add_two_values(v_one, v_two, v_total); end;
    5) Grant execute privileges to PUBLIC on the procedure.

    hello...
    any input will welcomed... Thanks..

  • Form on a table with report using DB Link

    Hey Guys
    How do i create a "Form on a table with report"?? using a database link. Under the "Table/View name" category when i provide the table name with the database link (like EMP@test), it compalins and says table or view does not exist and it only allows me to select from local tables. When i run "select 1 from emp@test" in sql commands window, it does return records so database link is working..
    Any suggestions??

    yes, I know i can do that, but when i tried it, its not displaying the records that are in the table, so how can i delete an existing record. Its doesnt allow me to browse through the records. Atleast, in the other way, it creates an edit button on the left and clicking it will take you to a form when you can edit it, add/delete.....this is all really simply, only issue is how to incorporate database links in this.

  • Adding user to the oracle database using database link - is it possible?

    Hi, i wolud like to manage my databases using one client. I easilly operate on my distriubuted tables but i have problem with creating users in distribiuted database. Is it possible to create users in distributed database using database links? or it have to be done locally using some stored procedures or sth similar?

    The SQL syntax of the CREATE USER statement doesn't support DB links, the only way to do it would be with stored procedures. There might be an Oracle SP for that or for generic remote execution of SQL, but I'm not familiar with such.

  • Creating user using database link

    Hi
    I have 11g installed on one of the server
    I have created the database link BUGAU to bugau.us.oracle.com
    link works fine
    select * from table@"Bugau" gives the expected result
    I need run the below statement from my server using the dblink.but not sure how to use the dblink for this purpose.Please assit
    CREATE USER ABC IDENTIFIED BY welcome DEFAULT TABLESPACE USERS_001 TEMPORARY TABLESPACE temp123;
    GRANT DEFAULT TO abc;
    ALTER USER abc PROFILE LEVEL_1;
    Thanks
    Archana

    as mentioned in oracle documentation for db link purpose: you can use it for accessing schema objects in remote database..
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_5005.htm
    >
    Use the CREATE DATABASE LINK statement to create a database link. A database link is a schema object in one database that enables you to access objects on another database. The other database need not be an Oracle Database system. However, to access non-Oracle systems you must use Oracle Heterogeneous Services.
    After you have created a database link, you can use it in SQL statements to refer to tables and views on the other database by appending @dblink to the table or view name. You can query a table or view on the other database with the SELECT statement. You can also access remote tables and views using any INSERT, UPDATE, DELETE, or LOCK TABLE statement.
    >
    For creating users, you have to login to the remote database itself, You also need to login using the user who has the necessary credentials to create the user.
    Regards,
    Dipali.

  • How to create a form from a table available from a database link?

    Hi,
    I have a table accessible via a database link.
    It is working perfectly, but I cannot create a from using the wizzard.
    It says: "Primary Key must be specified."
    But there is a primary key in the source database!
    Best regards,
    Sebastien (Geneva)

    a little more about dblink:
    i have a view in the dblink
    when i execute
    insert into ias_time_of_acc(ias29, end_acc_period, start_acc_period, acc_last_date_id, comp_date_id, active)
    values(:p4110_ias29, to_date(:p4110_end_acc,'DD.MM.YYYY'),
    to_date(:p4110_start_acc,'DD.MM.YYYY'),:p4110_last_date, :p4110_comp_date,'N');
    i've got this err:
    ORA-01461: can bind a LONG value only for insert into a LONG column ORA-02063: preceding line from OFSA_OWNER@OFSA_TO_ORCL
    and when i execute
    a:= to_date(:p4110_start_acc,'DD.MM.YYYY') ;
    b:= :p4110_last_date;
    c:= :p4110_comp_date;
    d:= :p4110_ias29;
    insert into ias_time_of_acc(ias29, start_acc_period, end_acc_period, acc_last_date_id, comp_date_id, active )
    values(d, a,to_date(:p4110_end_acc,'DD.MM.YYYY'),
    b, c,'N' );
    everything is working properly
    so problem is in the lenght of insert statment i think.

  • TNS-12666 error occures when using database link

    When I am trying to use database link
    defined in my database the following error occures:
    TNS-12666 Dedicated server: outbound transport protocol different from inbound.
    In documentation is stated to resolve such an error to
    specify the same protocol in the SQL*Net connect string or alias for the outbound connection as that used for the inbound connection.
    I have in tnsnames.ora defined network service name
    by which I can connect to such a database by SQL*Plus
    without any problems, why can I not do such a thing
    via database link?
    Thanks a lot for advise, ...

    Could you change the following entry in your 'sqlnet.ora' file and try?
    SQLNET.AUTHENTICATION_SERVICES = (NONE)

  • How to use database link in from6i?

    I can use database link in sql plus,but i can't use it in forms6i,why? thanks

    Don't know why.
    What I always do is create a synonym on the local database which points (through the db link) to the object on the other database.
    Regards,
    Meine

  • Unable to access remote database object using database link

    Hi all,
    I have created a database link to a remote server
    SQL> create database link remote_link connect to lax_dba identified by lax_dba using 'abc.corp.com';
    database link created
    when i am trying to access any table of lax_dba
    sql> select * from laxtab@remote_link;
    i am getting this Ora error
    ORA-12514: TNS:listener does not currently know of service requested in connect
    I need your help please to solve this issue
    Thanks n Regards
    Laxman

    The database server where you defined the link (not your PC) has resolved 'abc.corp.com' to a server/port/service combination using its tnsnames.ora, sqlnet.ora and possibly ldap.ora settings. You can try
    tnsping abc.corp.comon the server (as ReubenC suggested) to see what it's attempting to connect to. (It's important to do this on the database server and not on your PC as they will have different tns settings etc.)
    It has then found the server and found a listener running on it (so you're getting close), but that remote listener doesn't recognise the service you're asking for. It might be something like the '.com' suffix.

  • How to use database link to create table in other database?

    e.g., java jdbc is connected to the database A.
    i want to create one table (Table1)in database B, and then insert data into Table1 select ....from Table2 which is in database A.
    i used the create database link (database name) connect to (database) indentified by .....
    but ...i got the sqlException as i wrote before.
    Thanks again.

    http://forum.java.sun.com/thread.jspa?threadID=656868&messageID=3860293#3860293

  • Add rows to a Table object without using database .

    Hi everyone ,
    I'm using visual web javaServer faces framework in Netbeans IDE 6.5.I want to use a Table and bind data to it row by row ,without using database.I dont know how i must do it. i searched and find nothing exept dataprovider that as i undrestood, it use just database to bind data to a table.
    i have a string in a loop that i want to devide it to several substrings and these substrings will be each field of each row and at the end of the loop,the number of rows are equal to reapiting the loop.
    I'll appreciate any help in this matter
    Best Regard,
    Fatemeh

    My Dataout variable contains a long string of personal information. Information such as Name, Family name, Father’s name, Date of birth, National code, Nationality.
    I want to make a personal information table with above mentioned information, whereas Name, Family name, Father’s name, Date of birth, National code, Nationality will be my column values. The number of its row depends on the times that the loop is repeated.
    I can make a JTable by defining an array[6] as above, but this table doesn’t appear in Visual Web javaServer faces framework. I want to be able to do what JTable does in the Table component in visual designer. Can anybody help me?
    Thanks in advance

  • Timeout when using database link connecting to a remote database

    Hi,
    I have another strange problem. I have two computers A and B. Both have an Oracle database server instance. I manage the one in B (which is my local computer) but not the one in A (which is a computer where I have a user account and an Oracle account but I don't own or manage).
    I tried to establish a database link on the database in B pointing to the one in A. This works.
    When I try the opposite, that is, establish a database link on the database in A pointing to the one in B I cannot get it work. I can create the database link but then when I try to use it (e.g., by submitting a "SELECT") it blocks for a long time and finally returns "ORA-12535: TNS:operation timed out". I tried to execute telnet from A to B using the port of the Oracle database server in B and it seems that the connection is established. I tried something similar with tnsping but this does not work, as I get again the timeout. I tried deactivating the firewall on my computer B, but it does not work either (besides, the telnet passes through even if I have the firewall activated).
    Any idea?
    My TNSPING looks like this:
    tnsping '(DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = <the-target-ip>)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = XE)
    I also tried with:
    tnsping '(ADDRESS = (PROTOCOL = TCP)(HOST = <the-target-ip>)(PORT = 1521))';
    I'm lost... Any ideas are very much appreciated.
    Thanks!

    From A to B and from B to A can you ping ... post the output surrounded by tags for formatting.
    Do the same thing for TNSPING.
    What do these computers have in the way of firewalls and antivirus products installed and how are they configured?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Insert using database link

    Now connected to database B :
    INSERT INTO abc_hesids
              (     abc_key,
                   hesid,
                   date_added,
                   date_updated,
                   dob,
                   sex,
                   newnhsno,
                   homeadd,
                   procode3,
                   lopatid
              SELECT     'X',
                        0,
                        sysdate,
                        sysdate,
                        HES_Common.f_string_field('X', 1),
                        HES_Common.f_string_field('X', 2),
                        HES_Common.f_string_field('X', 3),
                        HES_Common.f_string_field('X', 4),
                        HES_Common.f_string_field('X', 5),
                        HES_Common.f_string_field('X', 6)
              FROM dual
    The above INSERT has been reduced down to bare minimum with the following error occurring :
    HES_Common.f_string_field('X', 1),
    ERROR at line 18:
    ORA-02069: global_names parameter must be set to TRUE for this operation
    SQL>
    The abc_hesids table exists in database A and this insert is running in database B. A database link exists such that abc_hesids is a synonym for the table of the same name in database A.
    I want Oracle to insert into the table in database A but use the package HES_Common in database B. I think this is possible but have not done this sort of thing for a while. Note : the package HES_Common exists in both databases A and B
    Any ideas on how to get Oracle to use the local version of the package - do I have to get the DBA to change global_names to TRUE ??

    ORA-02069 global_names parameter must be set to TRUE for this operation
    Cause: A remote mapping of the statement is required but cannot be achieved because GLOBAL_NAMES should be set to TRUE for it to be achieved.
    Action: Issue ALTER SESSION SET GLOBAL_NAMES = TRUE if possible.

  • Using database link  with a dynamic SQL in Forms 5

    I have a Form 5 application where a database link is specified in a client version of dynamic SQL. The function that the application is designed to perform is to access data in a table in a remote database and use it to populate another table in a local database with the same structure as the source table. Dynamic SQL is used because the name of the table can only be resolved during run time.
    The problem is that it gives error with code 'ORA-03113' and text 'End-of-file on communication channel' when you try to run it.
    Is it not possible to use a database link with a dynamic SQL? What can I do to overcome the problem ?

    Try to create a local view based ao the remote table and use the view.

  • Using database link in my triggers,urgent

    There's DB A on ServerA,DB B on ServerB.Table TA in ServerA's DB and TB on ServerB's DB.My purpose is to synchronize usera.TA with userb.TB real time.
    In order to realize it,I created dblink AtoB from A to B using command "create database link AtoB.domain connect to userb identified by userb using 'BTNSname';",it's no problem for I have test on it :select count(*) from [email protected];It's ok to get the result.
    But when I create trigger on table TA by using the dblink AtoB.domain to update,delete and insert datas to TB,the error "PLS-00201: identifier '[email protected]' must be declared" occurs while compiling.
    The oracle version on the two servers is 8.1.7.
    It happens on the production envrionment,but in our lab,there's no problem.The difference between them is that it is cluster structure in production one.
    I tried several times,but failed,just wondered if some privilege was not right?But I can do selection from this dblink,only in trigger there's compilation errors.
    Really hope that someone could give light on it.
    Thank you in advance!
    In addition,I did some modification in my triggers to have a try.
    I created a synonym for the remote table,and the trigger then updates the synonym instead of the remote table [email protected] .But also failed.
    The same error,saying the synonym is not declared.
    Any good way to realize the same thing?

    Thank you for your answering first.
    I don't use replication because the destination table's structure is not exactly the same as the source one.
    --The selection was done in the production,connection to the source schema,then select through the dblink from the source to the dest schema,the trigger is created in source schema on source table to handle datas in destination schema's table.In lab,all is ok,no such a problem.
    --I created two dblinks,one is connect to source as system user,created a public dblink "create public database link AtoB.domain using 'BTNSname';";the other is connect as UserA,"create database link AtoB.domain connect to UserB identified by UserB using 'BTNSname';".                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • How to change the column header/channel name in an LVM file?

    Hi all, I made a VI (see attached JPG) that reads 2 voltages, but after calculations and other processes, ends up writing 6 columns of data to an LVM file (7 if you count the time). I have read in other posts that you can change the name of each sign

  • Why is the image brighter after converting H264 to Apple Prores 422 in Compressor ?

    Hello - Very strange situation, keep reading please! I am using Compressor to convert H264 1080p footage from a D600, to Apple Prores 422HQ for editing. Normal. I am using the default Quicktime Settings named "Apple Prores 422 (HQ)". The converted fi

  • I want the actual file name of my song to be edited through itunes

    Hello to all, I have spent a significant time of my life to keep my music folder very well organized. Then after a few years, I discovered itunes and I started to organizing and tagging my music files through itunes. Everything works well with no pro

  • Block ad making an exception

    when I play games or browse videos, there is a tiny white box in the top right corner, when I click it a window opens asking if I want to make a exception and allow the player, most of the time it allows me to see the videos or play the games. When I

  • Filtering Only Images by using query text

    Hi Dear,  I am going through in a trouble.. that is i want to filter only images from a site by using "query text" in "Search Result webpart" I am writting the following query but not  getting any result... {searchboxquery}ContentType:Image   and i h