Table with RowID
Hi,
JDeveloper 11g.
I have two tables one with a proper primary key and other one with rowid. I have observed that table with database primary key is loading very fast where as table with RowID is taking time to load.
Is there any issue with RowID? If so, what would be the solution. Please help.
Thanks.
Hi,
should not be a reason. However, having tables without a primary key sound strange to me.
You don't provide much information about how you access and display data queried from the table. This is unfortunate as it prevents any better answer than what I gave.
Frank
Similar Messages
-
Deletion of duplicates in the table with out using rowid
How can I delete duplicates in the table with out using ROWID .
hi
sleect count(coulmnname),columnname from table
group by columnname
having count(columnname) > 1;
find the primary key of the table
apply the below query
delete from table
where (primary key,repeated column name )
not in
( select min(primary key), repeated column
from employee group by repeated column );
use this in the primary key column use empid ,,,the repated column is ename
empid ename
1 sankar
2 sankar
try this one -
Which one faster- With Rowid or PK
Hi,
Recently came across the concepts of IOT(Index organised table). It was mentioned that
You must specify a primary key for an index-organized table, because the primary key uniquely identifies a row. Use the primary key instead of the Rowid for directly
accessing index-organized rows. "
This surprised me as till date I was assuming that the fastest way to access the data from a table is by Rowid. Isn't this contadicting then?
Can the experts clarify more on these conceps related to IOT.
Rgds,
Aashishwhat is the diff betn a Normal table with PK on some column and IOT with almost
the same structure?The difference is whatever is implied by that "almost".
Look, the purpose of index organized tables is to do away with a nugatory object when a table and and its primary key index - have basically the same structure. The classic example is the code lookup table, where the difference between the table's columns (code, code_descr) and its primary key (code) is a single column (code_descr). Nearly access of that table is going to be an indexed read on code to get the description. That usage makes it a good candidate for being an IOT.
Mere creation of PK on a column would give the same result.No. An index organized table is similar to creating an index on (code, code_descr) but without the need to maintain two sets of data. Furthermore the IOT allows us to include non-primary key columns without compromising our relational integrity.
Cheers, APC
Blog : http://radiofreetooting.blogspot.com/ -
Problem inserting a gif into a blob field in a table with sqldev / forms6i
Problem solved - For those that might be interested, the errors don't make much sense - the problem was with the gif. Seems that these 28 gifs plus the new scans were saved from the scanner with
GIF - LZW, Transparent color: 255
Converting them to Black and white allowed them to be loaded.
If anyone understands why, I'd like to know
glenn
I was previously having a problem deleting a row with a blob and it was suggested that I create the table using rowdependencies - which I did as follows.
CREATE TABLE "MDD"."MDD_FIGURE2"
( "FG_FIGURENAME" VARCHAR2(18 BYTE),
"FG_FIGURE" BLOB,
CONSTRAINT "FG_FIGURENAME_NN" CHECK ("FG_FIGURENAME" IS NOT NULL) ENABLE
) ROWDEPENDENCIES;
Then I copied my data from my previous table with the following - and everything came across
INSERT INTO MDD_FIGURE2 (fg_figurename, fg_figure)
SELECT FIG_FIGNAME, FIG_FIGURE FROM MDD_FIGURE;
mdd_figure2 was then renamed to mdd_figure
The table, Mdd_Figure, already contains some 2000+ .gifs that were successfully loaded with Forms 6i (yes, I know it is old, but I am stuck with having to use it). All the .gifs I am loading are from scans and all are less than 64k. However, 28 .gifs would not load. When I insert the .gif into the field and committed the form, the status message tells me a record was written but when I check it, the blob is empty.
So, when I try to insert one of these problem .gifs in SqlDeveloper, I open the new mdd_figure table, select the blob field, open the edit dialog, set it to figure, select the .gif that I want to load and then save it. The blob field changes from NULL to BLOB, but it is empty. When I try to commit, I get the following error from SqlDev.
UPDATE "MDD"."MDD_FIGURE" SET WHERE ROWID = 'AAAOeWAAEAAABAlAAz' AND ORA_ROWSCN = '358136842'
One error saving changes to table "MDD"."MDD_FIGURE":
Row 14: ORA-01410: invalid ROWID
I use rollback to restore the record to it's previous state.
If I load one of the successfully loaded .gifs into the same field, it loads perfectly as follows.
UPDATE "MDD"."MDD_FIGURE" SET WHERE ROWID = 'AAAOeWAAEAAABAoAAp' AND ORA_ROWSCN = '358136522'
Commit Successful
It appears the 28 gifs have a problem. I've re-scanned them, with the same results. They are just small scanned line map images from our earlier publications. They view properly in several different graphics programs and I can't find anything wrong with them.
I notice that the ROWID's are different while the ORA_ROWSCN's are the same - but what is the significance of that?
Any suggestions as to what is happening and what I can do about it?
Thanks for any help you can give me.
glenn
(Database is 10R2 and sqldev is the most recent one)
Edited by: gconley on Sep 25, 2008 9:51 PMsolved it myself - problem was with the gif
-
No data found error on Form on a Table with report
Hi Everyone, I'm using Application Express 4.1.0.00.32 on Windows 7. I built a Form on a table with report. Earlier I was using rowid as a passing parameter but then I had to change it to primary key column from report to form.
So in the "Fetch row process" I changed the "Items containing primary key value" and "Primary Key column" to P1004_PERSON_ID and PERSON_ID respectively. Which is my primary key.
My Form is working exactly fine but at on point it throws "no data found error".
I have a required date field in the form. So if the user doesn't fill in the date field and try to save the form, it throws the "Feild required error" and then when user enters date and try to save then it throws the error "No data found.". here is the snapshot... snapshot
How can I fix this error.I'm really stuck.
I checked debubber..it is as follows... in debughger it's still showing rowid. I don't know why. How can I fix that.
Execution
Message
Level
Graph
0.00233
0.00932
S H O W: application="101" page="1004" workspace="" request="" session="123235901404364"
4
0.01161
0.00102
Language derived from: FLOW_PRIMARY_LANGUAGE, current browser language: en-us
4
0.01261
0.00046
alter session set nls_language="AMERICAN"
4
0.01307
0.00042
alter session set nls_territory="AMERICA"
4
0.01348
0.00053
NLS: CSV charset=WE8MSWIN1252
4
0.01401
0.00042
...NLS: Set Decimal separator="."
4
0.01443
0.00053
...NLS: Set NLS Group separator=","
4
0.01495
0.00050
...NLS: Set g_nls_date_format="DD-MON-RR"
4
0.01545
0.00051
...NLS: Set g_nls_timestamp_format="DD-MON-RR HH.MI.SSXFF AM"
4
0.01597
0.00050
...NLS: Set g_nls_timestamp_tz_format="DD-MON-RR HH.MI.SSXFF AM TZR"
4
0.01647
0.00079
...Setting session time_zone to -05:00
4
0.01726
0.00046
Setting NLS_DATE_FORMAT to application date format: DD-MON-YYYY
4
0.01772
0.00060
Setting NLS_TIMESTAMP_FORMAT to application timestamp format: DD-MON-YYYY HH24.MI.SSXFF
4
0.01832
0.00092
...NLS: Set g_nls_date_format="DD-MON-YYYY"
4
0.01924
0.00049
...NLS: Set g_nls_timestamp_format="DD-MON-YYYY HH24.MI.SSXFF"
4
0.01973
0.00083
...NLS: Set g_nls_timestamp_tz_format="DD-MON-RR HH.MI.SSXFF AM TZR"
4
0.02056
0.00099
NLS: Language=en-us
4
0.02154
0.00157
Application 101, Authentication: PLUGIN, Page Template: 5091946581246503
4
0.02312
0.00065
...fetch session state from database
4
0.02377
0.00106
fetch items
4
0.02483
0.00065
...fetched 103 session state items
4
0.02548
0.00194
Authentication check: NTLM (NATIVE_CUSTOM)
4
0.02742
0.00188
...Execute Statement: begin declare begin wwv_flow.g_boolean := f_ntlm_page_sentry_parm; end; end;
4
0.02930
0.00050
... sentry+verification success
4
0.02980
0.00042
...Session ID 123235901404364 can be used
4
0.03021
0.00114
...Application session: 123235901404364, user=VARMAN01
4
0.03135
0.00162
...Check for session expiration:
4
0.03297
0.00075
Session: Fetch session header information
4
0.03372
0.00113
...Setting session time_zone to -5:00
4
0.03485
0.00080
Branch point: Before Header
4
0.03565
0.00598
Fetch application meta data
4
0.04165
0.00081
...metadata, fetch computations
4
0.04245
0.00076
...metadata, fetch buttons
4
0.04321
0.00086
Setting NLS_DATE_FORMAT to application date format: DD-MON-YYYY
4
0.04406
0.00058
Setting NLS_TIMESTAMP_FORMAT to application timestamp format: DD-MON-YYYY HH24.MI.SSXFF
4
0.04464
0.00049Just an observance... SQL is still showing the rowid instead of the P1004_PERSON_ID ??
where "PERSON_ID" = :p_rowid;
should it not be :
where "PERSON_ID" = :P1004_PERSON_ID:
thx, Bill -
ORA-00942 error on truncating a table with a XML Index
Oracle Version: 11.2.0.1.0
When truncate command fails with error "ORA-00942: table or view does not exist" when run against a table with an XML Index defined
SQL> CREATE TABLE XML_TEST
2 (
3 ID INTEGER,
4 TESTXML SYS.XMLTYPE
5 );
Table created.
SQL> truncate table XML_TEST;
Table truncated.
SQL> CREATE INDEX xmlindex ON XML_TEST(TESTXML)
2 indextype IS xdb.xmlindex
3 parameters ('PATH TABLE MY_PATH_TABLE');
Index created.
SQL> truncate table XML_TEST;
truncate table XML_TEST
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> Drop Index xmlindex;
Index dropped.
SQL> truncate table XML_TEST;
Table truncated.No, I don't think that explanation is correct. I don't think it has to do with user privs. besides, we don't
adjust rowids on an import -- we recreate the index, just like a b-tree index import would.
This should be working. It's most likely a bug in our (i.e. Text) import code -- SYS.XMLTYPE is a little
strange because under the covers it's actually a function-based index.
I will test it out and file a bug if I can reproduce the behavior on solaris. -
MATERIALIZED view on two tables with Fast Refresh
i Wanted to create MV on two tables with Fast refresh on commit.
I followed below steps
create materialized view log on t1 WITH PRIMARY KEY, rowid;
create materialized view log on t2 WITH PRIMARY KEY, rowid;
CREATE MATERIALIZED VIEW ETL_ENTITY_DIVISION_ASSO_MV
REFRESH fast ON commit
ENABLE QUERY REWRITE
AS
select A.ROWID B.ROWID,a.c1, DECODE(a.c1,'aaa','xxx','aaa') c2
from t1 A
join t2 b
on AB.c1= CD.c2;
i am getting below error.
Error report:
SQL Error: ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
12054. 00000 - "cannot set the ON COMMIT refresh attribute for the materialized view"
*Cause: The materialized view did not satisfy conditions for refresh at
commit time.
*Action: Specify only valid options.
Basically i want to take record in MV by joinig two tables and if both of the base tables will updated then record should reflect in materialised view.
Please do the needfull.does the table support PCT? the other restrictions on joins look to be ok in your statement.
maybe try creating first with on demand instead of commit to see does it create.
http://docs.oracle.com/cd/B19306_01/server.102/b14223/basicmv.htm
>
Materialized Views Containing Only Joins
Some materialized views contain only joins and no aggregates, such as in Example 8-4, where a materialized view is created that joins the sales table to the times and customers tables. The advantage of creating this type of materialized view is that expensive joins will be precalculated.
Fast refresh for a materialized view containing only joins is possible after any type of DML to the base tables (direct-path or conventional INSERT, UPDATE, or DELETE).
A materialized view containing only joins can be defined to be refreshed ON COMMIT or ON DEMAND. If it is ON COMMIT, the refresh is performed at commit time of the transaction that does DML on the materialized view's detail table.
If you specify REFRESH FAST, Oracle performs further verification of the query definition to ensure that fast refresh can be performed if any of the detail tables change. These additional checks are:
A materialized view log must be present for each detail table unless the table supports PCT. Also, when a materialized view log is required, the ROWID column must be present in each materialized view log.
The rowids of all the detail tables must appear in the SELECT list of the materialized view query definition.
If some of these restrictions are not met, you can create the materialized view as REFRESH FORCE to take advantage of fast refresh when it is possible. If one of the tables did not meet all of the criteria, but the other tables did, the materialized view would still be fast refreshable with respect to the other tables for which all the criteria are met. -
How to interface with ROWID column in DB2?
I'm using DB2 version 7.1.
I have a column in a table called ROWID, and the Data Type is ROWID. However, I don't know how to interface with it in Java. For example, for CHAR and VARCHAR, I use the String class. For SMALLINT, I use int, etc. But what do I use for ROWID? It's not in the java.sql.Types list. The DB2 manual says it is stored as a VARCHAR(17), but I didn't just want to assume I could use String.
Any thoughts?try getObject() and see what kind of object you get:
ResultSet rs = statement.executeQuery("...");
while(rs.next()) {
Object o = rs.getObject(1); // the rowid column
System.out.println(o + " class: " + o.getClass().getName());
} -
Row Level PPR in Advanced Table with Add More Rows Button
<br>
I have programmatically fired PPR event on MessageChoice. But it is in Advanced Table with
Add More Rows Button. When the value is changed in MessageChoice I Show/Hide Custom LOV
through SPEL like this ${oa.BioEmployeePVO.EmpManagerRender} .
But it is <b>hiding the all the ROWS</b> not just the row where the value has been changed.
I even tried with this code and get NULL for rowReference.
String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
In Processrequest()
String pageName = pageContext.getRootRegionCode();
Hashtable params = new Hashtable (1);
params.put ("param1", pageName);
Hashtable paramsWithBinds = new Hashtable(1);
paramsWithBinds.put ("param2",new OADataBoundValueFireActionURL (mcb, "{$AttendeeType}"));
mcb.setFireActionForSubmit ("empPositionChange", params, paramsWithBinds,false, false);
In ProcessFormRequest() {
if ("empPositionChange".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
String rowReference = pageContext.getParameter("param2");
// String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
Serializable[] parameters = { rowReference };
am.invokeMethod("handlePositionChangeEvent", parameters);
<br>HI Kumar,
Answer to your last post is "yes".
Now to your doubt regarding the code:
Hi Anna
I am trying to understand your code.
FireAction firePartialAction = new FirePartialAction("fireHideEvent"+(i/noOfTlaColSpan));
HideImgBean.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR,firePartialAction);
1. What is this i/noOfTlaColSpan ?
:)Forget abt this in your case it should be the event name which u r firing and capturing the it in the PFR.
Like FireAction firePartialAction = new FirePartialAction("YOurEventName");
and in PFR u can capture tht as:
if("YOurEventName".equals(pageContext.getParameter(EVENT_PARAM)))
//your logic to invoke AM method
2. I believe this HideImgBean would be MessageChoice for me?
:)Yep ur right
3. This brcdOhInventoryViewUpdateVOImpl would be the Custom PVO(Extending Seeded Base VO)
I create by adding the transient attributes?
:)Yep ur right
4. I cannot understand this code. Could you explain.
:)Please look at my comments in some of the lines .I have explained wht i am doing
if(updateIter==null)
updateIter[0]= invViewVO.createRowSetIterator("updateIter");//This initViewVo should be ur custom VO object
if(cnt>0)
updateIter[0].setRangeStart(0);
updateIter[0].setRangeSize(cnt);
for(int i=0;i<cnt;i++)
row = (brcdOhInventoryViewUpdateVORowImpl)updateIter[0].getRowAtRangeIndex(i);
String selectFlag=(String)row.invokeMethod("getPartNumber");//This getPartNuber should be replaced by the Prim Key inoke methd of ur VO
if(RowID.equals(selectFlag))
//This is my logic to set the transient attributes based on the msgChoiceBean value ..u have to pass the value when u invoke this method
if(reserveMethod.equals("BINARY"))
System.out.println("In Binary");
Boolean bVal= new Boolean("false");
Serializable sr[]={bVal};
Class []methodParamTypes = { bVal.getClass() };
row.invokeMethod("setshowreservetxt",sr,methodParamTypes);
Boolean bVal1= new Boolean("true");
System.out.println("bVal1"+bVal1);
Serializable sr1[]={bVal1};
Class []methodParamTypes1 = { bVal1.getClass() };
row.invokeMethod("setShowreservemsgchoice",sr1,methodParamTypes1);
break;
In my AM I am doing this. Am i doing right?:)Yep u r right
BioPrescribersPVO is the custom VO(extending seeded base VO).
public void handlePositionChangeEvent(String param)
OAViewObject vo = (OAViewObject)findViewObject("BioPrescribersPVO");
OARow row = (OARow)findRowByRef(rowReference);
if (row != null)
String position = (String)row.getAttribute("AttendeeType");
if (("PRESCRIBER".equals(position)) )
// BioEmpManagerRender is the transient attribute in BioPrescribersPVO.
row.setAttribute("BioEmpManagerRender", Boolean.TRUE);
row.setAttribute("BioPresManagerRender", Boolean.FALSE);
else
row.setAttribute("BioEmpManagerRender", Boolean.FALSE);
row.setAttribute("BioPresManagerRender", Boolean.TRUE);
} // end handlePositionChangeEvent()
// Initializing the custom VO
/*No need to initialize the VO because this is not a PVO(Propeties View object)
U r just using the existing VO and tht vo shloud have a primary key.Tht way u can match the rowref u r getting with the actual row from the View object*/
public void init()
OAViewObject appPropsVO = (OAViewObject)getBioPrescribersPVO();
if (appPropsVO != null)
if (appPropsVO.getFetchedRowCount() == 0)
appPropsVO.setMaxFetchSize(0); appPropsVO.executeQuery();
appPropsVO.insertRow(appPropsVO.createRow());
OARow row = (OARow)appPropsVO.first();
row.setAttribute("RowKey", new Number(1));
handlePositionChangeEvent("");
} // end init()
Thanks
Anna -
How can I update the table with a single query for...
I have a table with columns C1 and C2.
C1 C2
A1 null
A1 null
A1 null
A1 null
A2 null
A2 null
A2 null
A3 null
A4 null
A4 null
I want to update my table with a single query so that I would have data like
C1 C2
A1 1
A1 2
A1 3
A1 4
A2 1
A2 2
A2 3
A3 1
A4 1
A4 2
The updated column C2 has the values like serial no grouped on the column C1.SQL> create table mytable
2 ( c1 varchar2(2)
3 , c2 number(2)
4 )
5 /
Tabel is aangemaakt.
SQL> insert into mytable (c1)
2 select 'A1' from dual union all
3 select 'A1' from dual union all
4 select 'A1' from dual union all
5 select 'A1' from dual union all
6 select 'A2' from dual union all
7 select 'A2' from dual union all
8 select 'A2' from dual union all
9 select 'A3' from dual union all
10 select 'A4' from dual union all
11 select 'A4' from dual
12 /
10 rijen zijn aangemaakt.
SQL> select * from mytable
2 /
C1 C2
A1
A1
A1
A1
A2
A2
A2
A3
A4
A4
10 rijen zijn geselecteerd.
SQL> merge into mytable t1
2 using (select c1
3 , row_number() over (partition by c1 order by null) rn
4 , rowid rid
5 from mytable
6 ) t2
7 on (t1.rowid = t2.rid)
8 when matched then
9 update set c2 = rn
10 when not matched then
11 insert values (null,null)
12 /
10 rijen zijn samengevoegd.
SQL> select * from mytable
2 /
C1 C2
A1 1
A1 2
A1 3
A1 4
A2 1
A2 2
A2 3
A3 1
A4 1
A4 2
10 rijen zijn geselecteerd.Regards,
Rob. -
Row chaining in table with more than 255 columns
Hi,
I have a table with 1000 columns.
I saw the following citation: "Any table with more then 255 columns will have chained
rows (we break really wide tables up)."
If I insert a row populated with only the first 3 columns (the others are null), is a row chaining occurred?
I tried to insert a row described above and no row chaining occurred.
As I understand, a row chaining occurs in a table with 1000 columns only when the populated data increases
the block size OR when more than 255 columns are populated. Am I right?
Thanks
dyahavuser10952094 wrote:
Hi,
I have a table with 1000 columns.
I saw the following citation: "Any table with more then 255 columns will have chained
rows (we break really wide tables up)."
If I insert a row populated with only the first 3 columns (the others are null), is a row chaining occurred?
I tried to insert a row described above and no row chaining occurred.
As I understand, a row chaining occurs in a table with 1000 columns only when the populated data increases
the block size OR when more than 255 columns are populated. Am I right?
Thanks
dyahavYesterday, I stated this on the forum "Tables with more than 255 columns will always have chained rows." My statement needs clarification. It was based on the following:
http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/schema.htm#i4383
"Oracle Database can only store 255 columns in a row piece. Thus, if you insert a row into a table that has 1000 columns, then the database creates 4 row pieces, typically chained over multiple blocks."
And this paraphrase from "Practical Oracle 8i":
V$SYSSTAT will show increasing values for CONTINUED ROW FETCH as table rows are read for tables containing more than 255 columns.
Related information may also be found here:
http://download.oracle.com/docs/cd/B10501_01/server.920/a96524/c11schem.htm
"When a table has more than 255 columns, rows that have data after the 255th column are likely to be chained within the same block. This is called intra-block chaining. A chained row's pieces are chained together using the rowids of the pieces. With intra-block chaining, users receive all the data in the same block. If the row fits in the block, users do not see an effect in I/O performance, because no extra I/O operation is required to retrieve the rest of the row."
http://download.oracle.com/docs/html/B14340_01/data.htm
"For a table with several columns, the key question to consider is the (average) row length, not the number of columns. Having more than 255 columns in a table built with a smaller block size typically results in intrablock chaining.
Oracle stores multiple row pieces in the same block, but the overhead to maintain the column information is minimal as long as all row pieces fit in a single data block. If the rows don't fit in a single data block, you may consider using a larger database block size (or use multiple block sizes in the same database). "
Why not a test case?
Create a test table named T4 with 1000 columns.
With the table created, insert 1,000 rows into the table, populating the first 257 columns each with a random 3 byte string which should result in an average row length of about 771 bytes.
SPOOL C:\TESTME.TXT
SELECT
SN.NAME,
MS.VALUE
FROM
V$MYSTAT MS,
V$STATNAME SN
WHERE
SN.NAME = 'table fetch continued row'
AND SN.STATISTIC#=MS.STATISTIC#;
INSERT INTO T4 (
COL1,
COL2,
COL3,
COL255,
COL256,
COL257)
SELECT
DBMS_RANDOM.STRING('A',3),
DBMS_RANDOM.STRING('A',3),
DBMS_RANDOM.STRING('A',3),
DBMS_RANDOM.STRING('A',3)
FROM
DUAL
CONNECT BY
LEVEL<=1000;
SELECT
SN.NAME,
MS.VALUE
FROM
V$MYSTAT MS,
V$STATNAME SN
WHERE
SN.NAME = 'table fetch continued row'
AND SN.STATISTIC#=MS.STATISTIC#;
SET AUTOTRACE TRACEONLY STATISTICS
SELECT
FROM
T4;
SET AUTOTRACE OFF
SELECT
SN.NAME,
SN.STATISTIC#,
MS.VALUE
FROM
V$MYSTAT MS,
V$STATNAME SN
WHERE
SN.NAME = 'table fetch continued row'
AND SN.STATISTIC#=MS.STATISTIC#;
SPOOL OFFWhat are the results of the above?
Before the insert:
NAME VALUE
table fetch continue 166
After the insert:
NAME VALUE
table fetch continue 166
After the select:
NAME STATISTIC# VALUE
table fetch continue 252 332 Another test, this time with an average row length of about 12 bytes:
DELETE FROM T4;
COMMIT;
SPOOL C:\TESTME2.TXT
SELECT
SN.NAME,
MS.VALUE
FROM
V$MYSTAT MS,
V$STATNAME SN
WHERE
SN.NAME = 'table fetch continued row'
AND SN.STATISTIC#=MS.STATISTIC#;
INSERT INTO T4 (
COL1,
COL256,
COL257,
COL999)
SELECT
DBMS_RANDOM.STRING('A',3),
DBMS_RANDOM.STRING('A',3),
DBMS_RANDOM.STRING('A',3),
DBMS_RANDOM.STRING('A',3)
FROM
DUAL
CONNECT BY
LEVEL<=100000;
SELECT
SN.NAME,
MS.VALUE
FROM
V$MYSTAT MS,
V$STATNAME SN
WHERE
SN.NAME = 'table fetch continued row'
AND SN.STATISTIC#=MS.STATISTIC#;
SET AUTOTRACE TRACEONLY STATISTICS
SELECT
FROM
T4;
SET AUTOTRACE OFF
SELECT
SN.NAME,
SN.STATISTIC#,
MS.VALUE
FROM
V$MYSTAT MS,
V$STATNAME SN
WHERE
SN.NAME = 'table fetch continued row'
AND SN.STATISTIC#=MS.STATISTIC#;
SPOOL OFFWith 100,000 rows each containing about 12 bytes, what should the 'table fetch continued row' statistic show?
Before the insert:
NAME VALUE
table fetch continue 332
After the insert:
NAME VALUE
table fetch continue 332
After the select:
NAME STATISTIC# VALUE
table fetch continue 252 33695The final test only inserts data into the first 4 columns:
DELETE FROM T4;
COMMIT;
SPOOL C:\TESTME3.TXT
SELECT
SN.NAME,
MS.VALUE
FROM
V$MYSTAT MS,
V$STATNAME SN
WHERE
SN.NAME = 'table fetch continued row'
AND SN.STATISTIC#=MS.STATISTIC#;
INSERT INTO T4 (
COL1,
COL2,
COL3,
COL4)
SELECT
DBMS_RANDOM.STRING('A',3),
DBMS_RANDOM.STRING('A',3),
DBMS_RANDOM.STRING('A',3),
DBMS_RANDOM.STRING('A',3)
FROM
DUAL
CONNECT BY
LEVEL<=100000;
SELECT
SN.NAME,
MS.VALUE
FROM
V$MYSTAT MS,
V$STATNAME SN
WHERE
SN.NAME = 'table fetch continued row'
AND SN.STATISTIC#=MS.STATISTIC#;
SET AUTOTRACE TRACEONLY STATISTICS
SELECT
FROM
T4;
SET AUTOTRACE OFF
SELECT
SN.NAME,
SN.STATISTIC#,
MS.VALUE
FROM
V$MYSTAT MS,
V$STATNAME SN
WHERE
SN.NAME = 'table fetch continued row'
AND SN.STATISTIC#=MS.STATISTIC#;
SPOOL OFFWhat should the 'table fetch continued row' show?
Before the insert:
NAME VALUE
table fetch continue 33695
After the insert:
NAME VALUE
table fetch continue 33695
After the select:
NAME STATISTIC# VALUE
table fetch continue 252 33695 My statement "Tables with more than 255 columns will always have chained rows." needs to be clarified:
"Tables with more than 255 columns will always have chained rows +(row pieces)+ if a column beyond column 255 is used, but the 'table fetch continued row' statistic +may+ only increase in value if the remaining row pieces are found in a different block."
Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc.
Edited by: Charles Hooper on Aug 5, 2009 9:52 AM
Paraphrase misspelled the view name "V$SYSSTAT", corrected a couple minor typos, and changed "will" to "may" in the closing paragraph as this appears to be the behavior based on the test case. -
MATERIALIZED VIEW WITH ROWID OPTION
Hi All I need to create a materialized view on a table that does not have a PK defined. Reading around, I have to create a MV using the WITH ROWID option and no other fancy options. I cant seem to find a simple snytax example?! Also do I have to create a log.
Below is the error I got from the table that does not have a PK defined on project_id
Error
SQL> CREATE MATERIALIZED VIEW xxca_project_status_mv
2 WITH ROWID
3 AS
4 SELECT ppa.rowid
5 , ppa.project_id
6 , ppa.project_status_code
7 FROM apps.pa_projects_all ppa
8 /
WITH ROWID
ERROR at line 2:
ORA-00905: missing keyword
Any help on this greatly appreciated!
SatnamWITH ROWID is used with REFRESH clause. Try
SQL> CREATE MATERIALIZED VIEW xxca_project_status_mv
2 REFRESH WITH ROWID
3 AS
do I have to create a log.Only if you want a fast refresh. -
Import materialized view with rowid
We are upgrading the Data Warehouse and Source Database from Oracle 9i to 10G.
For replication we use materialized views. Since in our source database we don't have any primary keys, we maintain materialized view logs based on rowids in Source/Master Database.
Similarly in the Staging schema of or data warehouse we have defined materialized views with rowid and fast refresh option.
We are using imp/exp utility for migrating both the source database and the data warehouse.
Since our replication is based on rowid, when we migrate to new environment, all the rowids of the source tables would be redifined making the materialized view tables rowid obsolete.
One way is to do compete refresh to bring both source database and Staging database baack in sync, but that would be expensive and time consuming.
Is there any way we can preserve rowid or keep the materialized views in staging in sync with source database ?
Thanks.WITH ROWID is used with REFRESH clause. Try
SQL> CREATE MATERIALIZED VIEW xxca_project_status_mv
2 REFRESH WITH ROWID
3 AS
do I have to create a log.Only if you want a fast refresh. -
Hi,
My doubt is can I join the table with view in the below where clause condition in the query. If yes, the below query will take 4 hrs to execute it. Can I do the below query to write as simplest?
SELECT *
FROM uabpymt p, uavlsum l
WHERE uabpymt_appl_ind = 'N'
AND uabpymt_amount > 5
AND l.uavlsum_balance < 0
AND l.uavlsum_cust_code = p.uabpymt_cust_code
AND l.uavlsum_prem_code = p.uabpymt_prem_codeuavlsum ---view
uabpymt ---table
The view script below:
CREATE OR REPLACE VIEW UAVLSUM
(UAVLSUM_CUST_CODE, UAVLSUM_PREM_CODE, UAVLSUM_AMOUNT, UAVLSUM_BALANCE)
AS
SELECT cust_code,
prem_code,
SUM(amount),
SUM(balance)
FROM (
SELECT uabopen_cust_code cust_code,
uabopen_prem_code prem_code,
uabopen_billed_chg amount,
uabopen_balance balance
FROM uimsmgr.uabopen
UNION ALL
SELECT uabpymt_cust_code,
uabpymt_prem_code,
uabpymt_amount * -1,
uabpymt_balance * -1
FROM uimsmgr.uabpymt
UNION ALL
SELECT uabadje_cust_code,
uabadje_prem_code,
uabadje_balance,
to_number(0)
FROM uimsmgr.uabadje
WHERE uabadje_balance <> 0)
GROUP BY cust_code,
prem_codeFind the below explain plan output which we get from the execute the query
STATEMENT_ID TIMESTAMP REMARKS OPERATION OPTIONS OBJECT_NODE OBJECT_OWNER OBJECT_NAME OBJECT_INSTANCE OBJECT_TYPE OPTIMIZER
16/01/2009 05:57:24 SELECT STATEMENT RULE
16/01/2009 05:57:24 FILTER
16/01/2009 05:57:24 SORT GROUP BY
16/01/2009 05:57:24 TABLE ACCESS BY INDEX ROWID UIMSMGR UABPYMT 1
16/01/2009 05:57:24 NESTED LOOPS
16/01/2009 05:57:24 VIEW UIMSMGR 3
16/01/2009 05:57:24 UNION-ALL
16/01/2009 05:57:24 TABLE ACCESS FULL UIMSMGR UABOPEN 4
16/01/2009 05:57:24 TABLE ACCESS FULL UIMSMGR UABPYMT 5
16/01/2009 05:57:24 TABLE ACCESS FULL UIMSMGR UABADJE 6
16/01/2009 05:57:24 INDEX RANGE SCAN UIMSMGR UABPYMT_CUST_PREM_INDEX NON-UNIQUE
Index column:
Table name :UABPYMT
Column Name
UABPYMT_APPL_IND
UABPYMT_APPROVED_IND
UABPYMT_PYMT_DATE
UABPYMT_SOURCE
UABPYMT_ORIGIN
UABPYMT_CUST_CODE
UABPYMT_PREM_CODE
UABPYMT_PYMT_DATE
UABPYMT_AR_TRANS
UABPYMT_GL_IND
UABPYMT_GL_POST_DATE
UABPYMT_AR_TRANS -
Form on a Table with Report,SOS!!!!!!!!!
I HAVE TWO TABLE'S AS
TAB_SALES AS
BRAND SKIND PRICE SALES
APPLE PHONE 5000
SAMSUNG PHONE 3000
SONY PHONE 5600
PIONEER PHONE 2300
SANYO BATTERY 109
AND TAB_COUNTRY AS
BRAND CONUTRY
APPLE USA
SONY JAPAN
SAMSUNG KOREA
SANYO JAPAN
AND I WANT TO CREATE A Form on a Table with Report to display the :
BRAND SKIND PRICE SALES CONUTRY
APPLE PHONE 5000 USA
SAMSUNG PHONE 3000 KOREA
SONY PHONE 5600 JAPAN
PIONEER PHONE 2300 JAPAN
SANYO BATTERY 109 JAPAN
I want to let end_user modify the sales
but when I create the Form on a Table with Report,the apex give me the rowid error:
Error creating form and report.
ORA-20001: Unable to create query and update page. ORA-20001: Unable to create query and update page. ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table
who can help me ?Hi lily,
I'm sure you are aware of these, but please have a look again at the "Welcome" page of the forum: https://forums.oracle.com/forums/ann.jspa?annID=1324 and think about changing the subject of your post.
Please provide your APEX and DB version, along with the SELECT statement you are using in the form.
Any chance to create an example on apex.oracle.com?
This would probably be the quickest way to get help.
Thanks
Sandro
Maybe you are looking for
-
Create the user master records using the Enterprise Portal
Hello gurus!! I'm configuring SRM 7.0 with EP. I'm configuring the organizational structure, and steps guide (pdf and Solution Manager ) are: 1. Go to transaction SU01 and create an ABAP User. (SRMADMIN) 2. Assign this user the administrator role /SA
-
Hi, After migrating to Spring webflow 2.4.0 , I am getting the below mentioned error in the weblogic console. <Jun 26, 2014 12:14:45 PM IST> <Error> <javax.enterprise.resource.webcontainer.jsf.application> <BEA-000000> <Unable to determine expected r
-
How can I import all my favorites (including folders within) from internet explorer?
In internet explorer my favorites are organised into folders but when I try to import these into firefox only the files that aren't in folders comes across, in this case 1.
-
Restricting entry values for "document date"
We need to restrict BKPF's "document date" whereever it is entered. This may not be a programming question per se, but programmers usually know at least as much as users do on the front end of SAP. Users must not be allowed to enter invalid document
-
I am trying to create a form in LiveCycle 8 where a user who has the form open can enter in information, and that information then populates into different locations on the page. Say that there is a drawing of a door. I'd like there to be a form wher