I_Snap$ indexes
In the past I have created all my read only snapshots (both in 7.3.4 and 8.1.6 databases) without qualifying the owner of the table on the remote database. We are upgrading our source database from 7.3.4 to 8.1.7. Now we MUST qualify the owner of the table in the remote db. This is ok, but now for every snapshot created, I get an I_snap$_<snapname> created automatically. It is a unique index created automatically in the "data" tablespace where the snap is being created. I have no control over it. If I don't qualify the source table name with the owner name, these extraneous indexes are not created. It does not make any difference if the db I am creating the snaps in is 8.1.6 or 7.3.4. As long as I specifiy the schema owner, the extra index is created.
Sample of old create script for snap in 8.1.6(no I_snap$ index created)
CREATE SNAPSHOT abc
STORAGE
INITIAL 100000
NEXT 30000
PCTINCREASE 0
MINEXTENTS 1
MAXEXTENTS 100
TABLESPACE DATA
REFRESH COMPLETE
WITH ROWID
AS
SELECT * from abc@latt
Sample of new create script for snap in 8.1.6 (I_snap$ index created)
CREATE SNAPSHOT abc
STORAGE
INITIAL 100000
NEXT 30000
PCTINCREASE 0
MINEXTENTS 1
MAXEXTENTS 100
TABLESPACE DATA
REFRESH COMPLETE
WITH ROWID
AS
SELECT * from ownername.abc@latt
I don't want these other indexes!
Hello Rafi,
I don't have any MLOG$_<table> in the database, After connecting as SYS -
SQL> select tname from tab where tname like '%MLOG%';
TNAME
MLOG_REFCOL$
MLOG$
C_MLOG#
SQL> select count(*) from mlog$;
COUNT(*)
0
I am not using Replication here -
SQL> select tname from tab where tname like '%RUPD%';
no rows selected
Why you think that granting SELECT access to MLOG$_* tables will solve this issue?
Thanks,
Roopesh
Similar Messages
-
Materialized View Refresh and I_SNAP$ Indexes issue
At the time of doing REFRESH of the Materialized View, we are getting error like -
SQL> EXECUTE DBMS_MVIEW.REFRESH('MV_TEST.MY_VIEW,'CF');
BEGIN DBMS_MVIEW.REFRESH('MV_TEST.MY_VIEW,'CF'); END;
ERROR at line 1:
ORA-12008: error in materialized view refresh path
ORA-00001: unique constraint (MV_TEST.I_SNAP$_FIN_RESULT_EXPENSE1) violated
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2545
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2751
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2720
ORA-06512: at line 1
I tried to drop and recreate the index I_SNAP$_FIN_RESULT_EXPENSE1 but it didn’t helped.
Later I dropped the index I_SNAP$_FIN_RESULT_EXPENSE1 and refreshed the materialized view and it was successful (obvious). But when I tried to recreate the index, I got the following error –
SYS_OP_MAP_NONNULL("FIN_MULT"), SYS_OP_MAP_NONNULL("FIN_CD"))
ERROR at line 8:
ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found
When I look at the value of SYS_OP_MAP_NONNULL('FIN_CD'), it seems to be unique.
SQL> select SYS_OP_MAP_NONNULL('FIN_CD') from dual;
SYS_OP_MAP_NONNULL('FIN_CD’)
46494E5F5650545F4C564C5F335F434400
My questions are:
1. Why are the indexes (I_SNAP$_*) automatically created for?
2. What is the purpose of these (I_SNAP$_*) indexes?
3. What harm can be there if we drop these (I_SNAP$_*) indexes?
4. Why it is complaining about the Duplicate records / Uniqueness?
5. How to know where exactly the problem is in this case?
6. What is the solution for this problem? How to recreate these indexes successfully?
Thanks!This forum is for the OLAP Option (which supports a cool featured called cube-organized materialized views). If this question if about table-based materialized views you should post it the General Oracle Database forum. Good luck.
-
Materialized View and I_SNAP$ Indexes
Hello Everybody,
At the time of doing REFRESH of the Materialized View, we are getting error like -
SQL> EXECUTE DBMS_MVIEW.REFRESH('MV_TEST.MY_VIEW,'CF');
BEGIN DBMS_MVIEW.REFRESH('MV_TEST.MY_VIEW,'CF'); END;
ERROR at line 1:
ORA-12008: error in materialized view refresh path
ORA-00001: unique constraint (MV_TEST.I_SNAP$_FIN_RESULT_EXPENSE1) violated
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2545
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2751
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2720
ORA-06512: at line 1
I tried to drop and recreate the index I_SNAP$_FIN_RESULT_EXPENSE1 but it didn’t helped.
Later I dropped the index I_SNAP$_FIN_RESULT_EXPENSE1 and refreshed the materialized view and it was successful (obvious). But when I tried to recreate the index, I got the following error –
SYS_OP_MAP_NONNULL("FIN_MULT"), SYS_OP_MAP_NONNULL("FIN_CD"))
ERROR at line 8:
ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found
When I look at the value of SYS_OP_MAP_NONNULL('FIN_CD'), it seems to be unique.
SQL> select SYS_OP_MAP_NONNULL('FIN_CD') from dual;
SYS_OP_MAP_NONNULL('FIN_CD’)
46494E5F5650545F4C564C5F335F434400
My questions are:
1. Why are the indexes (I_SNAP$_*) automatically created for?
2. What is the purpose of these (I_SNAP$_*) indexes?
3. What harm can be there if we drop these (I_SNAP$_*) indexes?
4. Why it is complaining about the Duplicate records / Uniqueness?
5. How to know where exactly the problem is in this case?
6. What is the solution for this problem? How to recreate these indexes successfully?
Thanks!Hello Rafi,
I don't have any MLOG$_<table> in the database, After connecting as SYS -
SQL> select tname from tab where tname like '%MLOG%';
TNAME
MLOG_REFCOL$
MLOG$
C_MLOG#
SQL> select count(*) from mlog$;
COUNT(*)
0
I am not using Replication here -
SQL> select tname from tab where tname like '%RUPD%';
no rows selected
Why you think that granting SELECT access to MLOG$_* tables will solve this issue?
Thanks,
Roopesh -
MVIEW does not keep With ROWID in DDL
Below is a create materialized view statement that I specify with rowid. However, after the mview gets created the ddl shows with primary key. Why doesn't it keep the with rowid definition and why doesn't it create the I_SNAP$ index.
CREATE MATERIALIZED VIEW SIEBEL.MV_GST
NOCACHE
LOGGING
NOCOMPRESS
NOPARALLEL
BUILD IMMEDIATE
USING INDEX
REFRESH FAST ON DEMAND
WITH ROWID
AS
SELECT OI_F.ACCNT_BILL_GEO_WID,
SEG.ROW_WID AS SEGMENT_WID,
PROD.PART_NUM AS PROD_PART_NUM,
PROD.PROD_NAME,
PROD.PRODUCT_TYPE_CODE AS PROD_TYPE,
PROD.SUB_TYPE AS PROD_SUB_TYPE,
SRC.CAMP_NAME,
SRC.CAMP_SRC_NUM,
SEG.SGMT_NAME AS SEGMENT_NAME,
SEG.SGMT_SRC_ID AS SEGMENT_SRC_ID,
LPAD (PER.EMP_NUM, 11, '0') AS X_EMPLID,
LPAD (PER.EMP_NUM, 9, '0') AS X_PEOPLE_ID,
PROD.X_13_MONTH_FLG,
OI_F.ACCNT_ID,
SRC.ROWID AS SRC_ROWID,
OI_F.ROWID AS ORITEM_ROWID,
SEG.ROWID AS SEGMENT_ROWID,
ORD.ROWID AS ORDER_ROWID,
PROD.ROWID AS PROD_ROWID,
ORG.ROWID AS ORG_ROWID,
PER.ROWID AS PER_ROWID,
BILL_TO_ACCNT.ROWID AS BILL_ROWID,
SHIP_TO_ACCNT.ROWID AS SHIP_ROWID
FROM SIEBEL.W_ORDERITEM_F OI_F,
SIEBEL.W_SOURCE_D SRC,
SIEBEL.W_SEGMENT_D SEG,
SIEBEL.W_ORDER_D ORD,
SIEBEL.W_PRODUCT_D PROD,
SIEBEL.W_ORG_D BILL_TO_ACCNT,
SIEBEL.W_ORG_D SHIP_TO_ACCNT,
SIEBEL.W_ORG_D ORG,
SIEBEL.W_PERSON_D PER
WHERE OI_F.SOURCE_WID = SRC.ROW_WID(+) AND OI_F.SEGMENT_WID = SEG.ROW_WID(+) AND OI_F.ORDER_WID = ORD.ROW_WID(+) AND OI_F.PROD_WID = PROD.ROW_WID(+) AND OI_F.CONTACT_WID = PER.ROW_WID(+) AND OI_F.BILL_ACCNT_WID = BILL_TO_ACCNT.ROW_WID(+) AND OI_F.SHIP_ACCNT_WID = SHIP_TO_ACCNT.ROW_WID(+) AND OI_F.ACCNT_WID = ORG.ROW_WID(+);Hi,
You can e.g. use APEX_DEBUG.MESSAGE to write debug information inside loop
http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_debug.htm#BCGIFJIH
Regards,
Jari
My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
Twitter: http://www.twitter.com/jariolai -
Which to use - Sy-index or sy-tabix ??
This is what i found out about SY-INDEX and SY-TABIX but which one to use when i want to delete a line of data from an internal table ? I tried both sy-index and sy-tabix and both works fine and returning the expected output for me but which one is better of to use ?
SY-TABIX :- For Internal Table, Current Line Index
SY-INDEX :- For Loops, Current Loop Pass
The below code is where i uses the Delete ..
LOOP AT dmg.
CONCATENATE
dmg-dmg00
dmg-dmg01
dmg-dmg02
dmg-dmg03
dmg-dmg04
dmg-dmg07
dmg-dmg08
dmg-dmg09 INTO tli_down1 SEPARATED BY '*'.
APPEND tli_down1. CLEAR tli_down1.
DELETE dmg INDEX sy-index.
EXIT.
ENDLOOP.Right. Just like what they said upstairs, sy-babix is the best choice.
One more thing is, if you want to concatenate fields of table dmg and append to tli_down1 on by one. You should not use EXIT after delete dmg.
In that case ,only one line can be appended into tli_down1 table.
> The below code is where i uses the Delete ..
>
> LOOP AT dmg.
> CONCATENATE
> dmg-dmg00
> dmg-dmg01
> dmg-dmg02
> dmg-dmg03
> dmg-dmg04
> dmg-dmg07
> dmg-dmg08
> dmg-dmg09 INTO tli_down1 SEPARATED BY '*'.
> APPEND tli_down1. CLEAR tli_down1.
> DELETE dmg INDEX sy-index.
> EXIT.
> ENDLOOP. -
Index's on cubes or Aggregates on infoobjects
Hello,
Please tell me if it is possible to put index's on cubes; are they automatically added or is this something I put on them?
I do not understand index's are they like aggregates?
Need to find info that explains this.
Thanks for the hlep.
NewbieIndexes are quite different from aggregates.
An Aggregate is a slice of a cube which helps the data retrival on a faster note when a query is executed on a cube. Basically it is kind of a snapshot of KPI's and Business Indicators (Chars) which will be displayed as the initial query run result.
Index is a process which is inturn will reduce the query response time. While an object gets activated, the system automatically create primary indexes. Optionaly, you can create additional index called secondary indexes.Before loading data, it is advisable to delete the indexes and insert them back after the loading.
Indexes act like pointers for quickly geting the Data.When u delete it will delete indexes and when u create it will create the indexes.
When loading we delete Bcs during loading it has to look for existing Indexes and try to update so it will effect the Data load performence so we delete and create it will take less time when compared to updating the existing ones.
There is one more issue we have to take care if u r having more than 50 million records this is not a good practice insteah we can delete and create during week end when they r no users. -
LIKE, LIKEC and Index usage
I've table that contains about 20 million rows, and I've created index for varchar2(100) column. It works well if I do
SELECT * FROM MY_TABLE WHERE MY_COL LIKE 'FOO%';
But if I change query to use LIKEC (to make unicode escaped strings work):
SELECT * FROM MY_TABLE WHERE MY_COL LIKEC 'FOO%';
I always get full table scan in explain plan.
I tried to use NVARCHAR, or index created by TO_NCHAR but I always end up hitting full table scan.
Should I create index some special way or do something else before I get index working?Just a gut feeling : is the database using character semantics or byte semantics?
My gut feeling, after looking up the documentation, is it should be character semantics.
BTW: Not posting version info decreases the chance you get an adequate reply.
Sybrand Bakker
Senior Oracle DBA -
Index with "or" clause (BUG still exists?)
The change log for 2.3.10 mentions "Fixed a bug that caused incorrect query plans to be generated for predicates that used the "or" operator in conjunction with indexes [#15328]."
But looks like the Bug still exists.
I am listing the steps to-repro. Let me know if i have missed something (or if the bug needs to be fixed)
DATA
dbxml> openContainer test.dbxml
dbxml> getDocuments
2 documents found
dbxml> print
<node><value>a</value></node>
<node><value>b</value></node>
INDEX (just one string equality index on node "value")
dbxml> listIndexes
Index: unique-node-metadata-equality-string for node {http://www.sleepycat.com/2002/dbxml}:name
Index: node-element-equality-string for node {}:value
2 indexes found.
QUERY
setVerbose 2 2
preload test.dbxml
query 'let $temp := fn:compare("test", "test") = 0
let $results := for $i in collection("test.dbxml")
where ($temp or $i/node[value = ("a")])
return $i
return <out>{$temp}{$results}</out>'
When $temp is true i expected the result set to contain both the records, but that was not the case with the index. It works well when there is no index!
Result WITH INDEX
dbxml> print
<out>true<node><value>a</value></node></out>
Result WITHOUT INDEX
dbxml> print
<out>true<node><value>a</value></node><node><value>b</value></node></out>Hi Vijay,
This is a completely different bug, relating to predicate expressions that do not examine nodes. Please try the following patch, to see if it fixes this bug for you:
--- dbxml-2.3.10-original/dbxml/src/dbxml/optimizer/QueryPlanGenerator.cpp 2007-04-18 10:05:24.000000000 +0100
+++ dbxml-2.3.10/dbxml/src/dbxml/optimizer/QueryPlanGenerator.cpp 2007-08-08 11:32:10.000000000 +0100
@@ -1566,11 +1572,12 @@
else if(name == Or::name) {
UnionQP *unionOp = new (&memMgr_) UnionQP(&memMgr_);
+ result.operation = unionOp;
for(VectorOfASTNodes::iterator i = args.begin(); i != args.end(); ++i) {
PathResult ret = generate(*i, ids);
unionOp->addArg(ret.operation);
+ if(ret.operation == 0) result.operation = 0;
- result.operation = unionOp;
// These operators use the presence of the node arguments, not their valueJohn -
Hi,
Can some body explain the CLEAR difference between Sy-index and Sy-tabix. And one or two small examples. I am little bit confused.
Thanx.Hi,
SY-INDEX
In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.
SY-TABIX
Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.
APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
SEARCH <itab> FOR sets SY-TABIX to the index of the table line in which the search string is found.
regards,
madhu -
What is" LINE-COL2 = SY-INDEX ** 2."
can u explain what is '' ** "
FIELD-SYMBOLS <FS> LIKE LINE OF ITAB.
DO 4 TIMES.
LINE-COL1 = SY-INDEX.
LINE-COL2 = SY-INDEX ** 2. "what this will do
APPEND LINE TO ITAB.
ENDDO.Hi sunil,
1 ** means "To the power of"
2. eg. 5 ** 2 = 25
(5 To the power of 2 = 25)
regards,
amit m. -
Hi all,
I am trying to get loop count by using sy-index.
But I am not able get exact expected out put.
I am gettig all zeros instead of loop number.
I am sending my code here.
DATA: lv_diff(10) TYPE c,
lv_erdat1 LIKE sy-datum,
lv_erdat2 LIKE sy-datum,
i(15) TYPE c VALUE '1'.
SORT t_ordno BY aufnr.
LOOP AT t_ordno INTO st_ordno.
READ TABLE t_ordno INTO st_ordno INDEX i.
lv_erdat1 = st_ordno-erdat.
i = i + 1.
READ TABLE t_ordno INTO st_ordno INDEX i.
lv_erdat2 = st_ordno-erdat.
i = i + 1.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = lv_erdat2
i_datum_von = lv_erdat1
IMPORTING
e_tage = lv_diff.
WRITE:/ lv_diff,
50 <u><b>sy-index.</b></u>
CLEAR: lv_erdat1,lv_erdat2,lv_diff.use this code
DATA: lv_diff(10) TYPE c ,
lv_erdat1 LIKE sy-datum ,
lv_erdat2 LIKE sy-datum ,
i(15) TYPE c VALUE '1' ,
l_tabix type syst-tabix .
SORT t_ordno BY aufnr.
LOOP AT t_ordno INTO st_ordno.
l_tabix = sy-tabix .
READ TABLE t_ordno INTO st_ordno INDEX i.
lv_erdat1 = st_ordno-erdat.
i = i + 1.
READ TABLE t_ordno INTO st_ordno INDEX i.
lv_erdat2 = st_ordno-erdat.
i = i + 1.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = lv_erdat2
i_datum_von = lv_erdat1
IMPORTING
e_tage = lv_diff.
WRITE:/ lv_diff,
50 l_tabix.
CLEAR: lv_erdat1,lv_erdat2,lv_diff. -
ANY SY-INDEX REFLECT CHANGES WHEN CONTROL BREAK STATEMENT PROCESS
Dear Guru's,
I have a requirement where i have to move the values to variable when control break (AT END OF) process. So i want to move the values according to the end of Vendor so for that i want to know is there any sy-index available which reflects changes when Control break (AT end of) process.
LIKE Sy-subrc = 0 when select statement fetches record or sy-tabix is like counter for loop.
Hope to get reply soon.
Regards,
Himanshu RangappaHi,
There is no system Fields for it.
But your requirement can be done with 'AT NEW' and 'AT END' statement.
Refer this sample example,
loop at otab.
at new module.
move otab-module to otab2-module.
ENDAT.
at END OF effort.
sum. "Do your calculations here
move otab-count to otab2-count.
append otab2.
endat.
endloop. -
What is the diffrence betweensy-tabix and sy-index
hi
can any one suggest me
what is the diffrence betweensy-tabix and sy-index
Thanks & Regards
kalyan.Hi Kalyan,
This question has been answered many times on SCN. Please make a search before posting a thread.
Read the Rules of Engagement.
Happy Posting.
Regards,
Chandra Sekhar -
ABAP-- diff between sy-sy-tabix and sy-index
Hi Guru's,
Pleae can anybody expalins me what is the difference between sy-tabix and sy-index(Loop Index) ?
Because in one case i am Modifyimg the internal table inside the do loop by giving sy-index ((Index of Internal Tables)(MODIFY scarr_tab INDEX sy-index FROM scarr_wa TRANSPORTING currcode. ) in the syntax and in other case inside loop statement i am modifyng same record by giving sy-tabix MODIFY scarr_tab INDEX sy-tabix FROM scarr_wa TRANSPORTING currcode.) in the syntax.
in both cases its working fine but i am not getting which one i have to use where to modify the internal table?
regards
SATYAHi Henry,
SY-INDEX is the value of the current iteration. It is applicable for the following programming constructs in ABAP -
DO...ENDDO.
WHILE...ENDWHILE.
SY-TABIX (TABle IndeX) is applicable to internal tables. If you scroll down in the link which Eddie has given, you will find a more detailed explanation for sy-tabix and which statements affect its value.
Regards,
Anand Mandalika. -
What is difference between sy-tabix and sy-index.
SAP Seniors,
Can you please let me know what is difference between sy-index and sy-tabix.
I read the SAP help, it is confusing for me. it looks like both are same from help. please help me.
Thank you
Anitha.HI,
Here is a brief description of difference between SY_TABIX and SY_INDEX and using them with several conditions.
SY-TABIX
Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.
APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
SEARCH <itab> FOR sets SY-TABIX to the index of the table line in which the search string is found.
SY-INDEX
In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.
Hope this helps.
Thank you,
Pavan.
Maybe you are looking for
-
Problems with plugins after upgrading to win8
Hi I made the upgrade to Windows 8 and now several PS plugins causes Photoshop CS6 to "Stop Working And need to close". I have uninstalled and reinstalled plugins and still the same problem. As this happens with different plugins from different vendo
-
Howto split the payment medium file for bank's tranference?
Hello all We use the Tx:PC00_M32_FFOT to get the payment file (MT100 format). The file is submitted in bank's portal but the portal accepts 3000 transactions per file. How could we do for get files with 3000 transactions ? thanks in advance
-
Import back the transport request to Development Server
Hi All, I need to import back the Transport request which is in Quality Server to Development Server. For ex: DEV900764 from Quality to Development Server. But the same(DEV900764 ) transport request is available in Development also. How to overwrite
-
Airport utilities does not recognise windows 7 and will not load, how do I fix this?
Airport utiltiy will not load, it does not recognise windows 7 and I get an effor message telling me that it requires XP or vista etc. I have deleted and reloaded Airport Utilities, Bonjour and Itunes to no effect. Help!
-
Need to take Print out - PL SQL Program / Unix
Hi, I need to take print out from a file already created in Database Server in a specific path to a printer. Any PL SQL program or any shell script is there to do this?? Thanks, Neil