SQL & PL/SQL :: Without Error - Keep RowID?
Oct 9, 2013CREATE TABLE CD_TRANS_GLIDE
( "TRANS_GLIDE_ID" CHAR(32) NOT NULL ENABLE,
"CARD_SEQ_NO" CHAR(10),
"SUBACCOUNT_NO" VARCHAR2(10),
"CASH_FLAG" CHAR(1),
[code]....
CREATE TABLE CD_TRANS_GLIDE
( "TRANS_GLIDE_ID" CHAR(32) NOT NULL ENABLE,
"CARD_SEQ_NO" CHAR(10),
"SUBACCOUNT_NO" VARCHAR2(10),
"CASH_FLAG" CHAR(1),
[code]....
I observed logical corruption in one of the database, while running select on some tables observed ORA-01410: invalid ROWID error. These errors or errors related to this logical corruption are not reported in alert log file.
Since our database is in NOARCHIVELOG mode and regular backups are not happening through RMAN (weekly cold mount point backup to tape),
i was not able to use RMAN to investigate block corruption.
So used DBVERIFY on all datafiles of database to check the consistency of datafiles, and found DBV gives error for one of the datafile - 'Completely zero block found during dbv:' As i mentioned earlier, we are not taking regular backups using RMAN and database is in NOARCHIVE mode.
I have complied while doing my oracle stuff.
1. When do you use a rowID?
2. if you have this:
alter table shopowner.jobs
add constraint uk_salary
unique (min_salary, max_salary);
insert into shopowner.jobs
values (3, 'dba', 20002,55000, 'jobs');
Why does the above constraint not fail when one of these columns are not unique? It needs to fail both to fail the constraint.
3. what is a transaction? and how do you do it? how does deferred transaction look like?
4. How do you view constraints through isqlplus?
5. How do you drop multiple constraints at once?
6. When would you not use cascading delete?
7. How do you use create like cmd in enterprise Manger? I keep getting this error Failed to
commit: ORA-02264: name already used by an existing constraint even if you delete every constraint or rename ever constraint to anything.
8. how to make comments in isqlplus?
9. how do you add multiple insert values in at once in isqlplus?
I'm looking for a way to select 25% of a view.. I need to do this four time to get all the data. The size of the view changes constantly (I need to split my select because of heavy load on an application)
something like this:
Select * from MyView where [some condition that makes only 0-25% show ]
Select * from MyView where [some condition that makes only 25-50% show ]
Select * from MyView where [some condition that makes only 50-75% show ]
Select * from MyView where [some condition that makes only 75-100% show ]
I tried to search in the forum but found nothing.. maybe ROWID could be used to accomplish this somehow?
session from user U1
C:Documents and Settingsuser>sqlplus u1/u123456@orcl
SQL*Plus: Release 10.2.0.1.0 - Production on Pn Wrz 12 12:56:14 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Po│╣czono z:
Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.7.0 - Production
SQL> update u1.tab1 set u1.tab1.col1=3 where u1.tab1.col1=1;
1 wiersz zosta│ zmodyfikowany.
SQL>
and now i can check which table is locked
SQL> SELECT lo.session_id, lo.OBJECT_ID, obj.object_name FROM v$locked_object lo
2 INNER JOIN Dba_Objects obj ON obj.object_id = lo.OBJECT_ID;
SESSION_ID OBJECT_ID OBJECT_NAME
---------- ---------- --------------------------------------------------
34 13197 TAB1
but the question is why can i check row id of locked row?
We have two jobs. one job insert the data in X table and Second job use X table in select statement.
Second job aborting due to ORA-01410: invalid ROWID error. When we restart it again, it is completed successfully.
what I have to check or do to prevent this error.
i have an ORA-01410, in my procedure. I use Oracle 10G
ERROR at line 1:ORA-01410: invalid ROWIDORA-06512: at "OFFICE.Calc", line 1011ORA-06512: at line 7
Here the link of my procedure: [SQL] ORA-08103: object no longer exists
i have a procedure written below,it is compiled:
====================================================
CREATE OR REPLACE PROCEDURE myproc (vdept NUMBER)
IS
vsal number(10,2);
CURSOR mycur
IS
[code]...
but whenever i am trying to call this proc like below:
==============================
begin
myproc(10);
end;
it is showing me error,i.e. :ORA-01410: invalid ROWID
I just want to know that "is it safe to select a columns using ROWID in a table?"
View 3 Replies View RelatedI am trying to delete duplicates from table without using rowid.
here is data:-
create table test(col1 number(3),col2 varchar2(20));
insert into test values(100,'rocky');
insert into test values(100,'rocky');
[Code]....
I know i am perfoming dml on view. IT wont allow me to perform DML on view which contain columns with expression. IS there any way to delete duplicates without using rowid?
I dump a index tree and get the flowing infomation,and i want to transform the rowid to the ROWID of a row,how can i do?
alter session set events 'immediate trace name treedump level 70339';--index object
alter system dump datafile 4 block 251; -- index tree block
row#0[8010] flag: ------, lock: 2, len=13
col 0; len 2; (2): c1 03
col 1; NULL
col 2; len 6; (6): 01 00 00 f7 00 01 --rowid
row#1[8023] flag: ------, lock: 2, len=13
col 0; NULL
col 1; len 2; (2): c1 02
col 2; len 6; (6): 01 00 00 f7 00 00 -- rowid
----- end of leaf block dump -----
is it possible to compare two tables with rowid? I want to put rowid in where condition...how can we do this?
View 4 Replies View RelatedI want to delete the duplicate rows in a table without using ROWID.
I have the following data.
SNO SNAME SECTION
1 RAM A
2 SHYAM B
2 SHYAM B
3 KISHOR C
3 KISHOR D
4 RAMESH E
5 RAJESH F
5 RAJESH F
The Output Should be like this.
SNO SNAME SECTION
1 RAM A
2 SHYAM B
3 KISHOR C
3 KISHOR D
4 RAMESH E
5 RAJESH F
I'm placing this here since the only tool I have is TOAD to hack database. I have discovered a bad record with the system but as the date field is '0000' and the values are all hieroglyphics which I can't place in UPDATE statement. Only fields able to determine are that it's a journal entry. I tried the blow code only to be forced out of TOAD via ORA-03113: end-of-file on communication channel error is a generic error. How can I update the bad date fields with such limited access? Is the ROWID acceptable?
Update ft_os
set ost_upd_dt = '06-dec-2010'
where ost_tran_code = 'JEN'
and ost_doc_ref = 'IS'
I want to delete the duplicate records from a table without using Below 2 methods:
1> delete from table_1 a where row_id not in (select min(row_id) from Table_1 b where a.PK=b.PK);
2> Insert into Table_2 select distinct * from Table_1;
Drop table Table_1;
Rename Table_2 to Table_1;
I am a developer and not a DBA and I need to find th correct query to find the exact rowid of the record locked on a table. This is for a RAC database and locked record can be from the web form in oracle application server. When I try to get the correct row id, I get the following error:
ORA-01410 - Invalid row id For the criteria, the output is Dbms_Rowid.rowid_create(1, -1, 36, 7845, 0), why I get a -1 for the ROW_WAIT_OBJ#?
Additional Information: The lock type is DML and the lock mode is: Row Exclusive, the table is locked and the program is web oracle forms executing.
I am executing the query in Oracle Database 11g Enterprise Edition Release 11.1.0.7.0
How to accomplish getting the correct rowid? Below is the selection criteria I have:
select vs.inst_id,
vs.audsid audsid,
locks.sid sid,
[Code]....
Rowid type is one of data types in oracle,is it equal to the varchar2,the flowing test show varchar2 type can contain rowid type.
SQL> Declare
2 L_Rowid1 Varchar2(18);
3 L_Rowid2 Rowid;
4 Begin
5
[Code]....
the table is a view. But the column ROWID doesn't display in Toad. He just ignores that.
View 3 Replies View RelatedI have a report linked to a form. The link column is currently ROWID and I want to change it to the Primary Key of the DB table, which is called ID.
I have done this before on a previous report/form where that ID was a display column and it works fine. Now I'm trying to copy what I did, which is this:
On the report page, go to Interactive Report attributes, scroll down to Link Column, and for Item 1, change the Name and Value.
The problem is that Name does not list P52_ID. If I type it in, it throws an error when I run the page.
I think I added ID, which is also a Display column, later on, so I wonder whether Apex has a refresh issue and can't "see" P52_ID.
I've a query like
update tab1
set col1 = ( select col2 from
tab2
where tab1.id = tab2.id) table 1 has arnd 10,000 rows
table 2 has arnd 1,700,000 rows and has a primary key on column id.This query is taking around 20 secs to execute. I checked the x-plan and most of time taken for table access by index rowid.I checked the stats for the tab2, its just three days old.
I have an interactive report from a view and have a rowid column that is a link to a page to edit a table.
The rowid value in db is: ABH/WVAG1AAAAF9AAA
But the generated link is:
f?p=XXX:24:9420765805297::NO::P24_ROWID:ABH%26#x2F;WVAG1AAAAF7AAA
And when it loads the page it happens a no data found error (because the escaped characters)
What would be the solution for this problem?
I have a Multi layer Mviews and Views which i use to load a table. There are three base level Mview which is accessed by 4 views ... which are in turn accessed by a view which is used to load a table.
Before the insert called for the table .. the base mviews are refreshed.
I get the "ORA-01410 Invalid Rowid" error while inserting in to the table and while refreshing the mviews. They don't occur every time and not together as well.
The Mviews contains table joins and the top level views which accessing these mviews does aggregation. Below is the mview query for one of the mview.
SELECT DISTINCT c.fiscal_time_id,
a.product_group_id,
a.allocation_driver_id,
a.hyp_entity_id,
d.business_division_alt_id
[code].....
The Refresh method for the mview is Force.
I am exporting using query parameter. I am trying to export subset of table using rowid.
SQL> select rowid , name from tab1;
ROWID NAME
------------------ ---------------
AAAM0rAAEAAAAGMAAA sam
AAAM0rAAEAAAAGMAAB sona
AAAM0rAAEAAAAGMAAC rose
AAAM0rAAEAAAAGMAAD chris
AAAM0rAAEAAAAGMAAE san
.................. ....
.................. ....
command given as
exp sam/sam tables=tab1 file=exprwid.dmp query="where ROWID='AAAM0rAAEAAAAGMAAA'" log=log1.log
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P1 character set (possible charset conversion)
About to export specified tables via Conventional Path ...
. . exporting table TAB1
EXP-00056: ORACLE error 911 encountered
ORA-00911: invalid character
Export terminated successfully with warnings.
how can i export this record ?
how to select 1st record from duplicate vales in a table.
If we created one table with out primary key column In form in search block have uwi value and top_depth value when i enter uwi and top_depth value then when i click search button then it will display all values in master block.
but here duplicate values r there.
SQL> select rownum,uwi,top_depth,base_depth,test_start_date from well_pre_header;
ROWNUM UWI TOP_DEPTH BASE_DEPTH TEST_STAR
---------- ---------------- ---------- ---------- ---------
1 100 453.05 458.08 09-SEP-10
2 100 200 288 23-AUG-00
3 1001 200 289 25-AUG-01
4 1001 200 201 24-MAY-87
if uwi = 1001 and top_depth=200 and i will click search button it should be display 3 record & when i click next button then it will show 4th record.
Let's consider such table that all rows fit into single block:
SQL> create table test as select rownum id, '$'||rownum name from dual connect by level <= 530;
Table created.
SQL> create index i_test on test(id);
Index created.
SQL>
SQL> begin
[code].....
why does approach with full scan take longer even if table occupies only one data block? PS. 11gR2
Oracle version - 10.1.0.4 OS - HP-UX
In my alert log I am getting the following error quite repeatedly; My application hangs, and have to restart the instance.
CODEORA-00604: error occurred at recursive SQL level 1
ORA-06521: PL/SQL: Error mapping function
ORA-06512: at "SYS.OLAPIHISTORYRETENTION", line 1
ORA-06512: at line 6
error while exporting a job
ORA-39171- job is experiencing a resumable wait
ORA-01652-UNABLE TO EXTEND TEMP SEGMENT BY 128 IN TABLESPACE TEMP.
im new to Database i have to count no of messages based on the minuties like 1-5, 6-15,16-30,>30 min how to write query
select count(*) from table1
where (
select
( (extract(day from column2)-extract(day from column1))*24*60 +
(extract(hour from column2)-extract(hour from column1))*60 +
extract(minute from column2)-extract(minute from column1)) as Processed_time from table1
) IN (1,5)
getting an error TOO MANY VALUES
In oracle 11.2.0.3 I am getting, PL/SQL:ORA-00904 TR_STATE_NAME invalid identifier
but the same code compiled without any compilation error (though column name specified was wrong).I corrected the column name and its working fine in 11.2.0.3 now. Is there any enhancement in Oracle Version 11.2.0.3 in terms of compilation error?
My task has more lines of code,so i tried to present here only few lines of code where i am getting the error.The following cursor needs to select data from two tables with some conditions that are included in cursor and place those in other table.I used BULK collect.
CURSOR c_arch_trk (p_run_date DATE,
p_nbr_days_arch1 NUMBER,
p_nbr_days_arch2 NUMBER )
IS
SELECT a.SIS_PGM_START_DATE,a.SIS_PGM_END_DATE,a.PGM_MSTR_NBR,a.PGM_TRK_NBR,a.CNTL_LOCN,a.CMPNY_VNDR_NBR,a.AGRMNT_MSTR_NBR,
a.SLS_CONT_NBR,b.PGM_NAME,b.PGM_BASIS,b.AGRMNT_CNTL_LOCN
[code]....