I have to update Order_id with some 8 digit number generated by some algorithm. And i have to update that value in child tables as well. In how many ways i can do this task. for example..
1) Disabling the constraint and updating Master value and child value.
I have a issue in updation of data from CLOB to BLOB.
create or replace function CLOB_TO_BLOB (p_clob CLOB) return BLOB as l_blob blob; l_dest_offset integer := 1; l_source_offset integer := 1; l_lang_context integer := DBMS_LOB.DEFAULT_LANG_CTX; [code]........
ERROR at line 1: ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified: ORA-22275 ORA-06512: at "SYS.DBMS_LOB", line 696 ORA-06512: at "SYSADM.CLOB_TO_BLOB", line 11 ORA-06512: at line 6
I want to execute a db trigger once for updation of more than one record on a single primary key. The updation would be made by a 10g form by using the common tabular data block.
if we update partition key, internally row movement is done as if you had in fact deleted the row and reinserted it. It will update every single index on this table, and delete the old entry and insert a new one. It will do the physical work of a DELETE plus an INSERT. However, it is considered an update by Oracle even though it physically deletes and inserts the row¿therefore, it won't cause INSERT and DELETE triggers to fire, just the UPDATE triggers. Additionally, child tables that might prevent a DELETE due to a foreign key constraint won¿t. You do have to be prepared, however, for the extra work that will be performed; it is much more expensive than a normal UPDATE.
In above I inserted few rows into table and those belong to partition P1 and Tablespace DJB and then I updated partition key from A to B which resulted row movement from partition P1 to P2 which belong to tablespace users. Before updation data has consumed some space in tablespace DJB and after update those records consumed some space in tablespace USERS. But in this scenario I checked that space consumed in DJB is not released. Is there any way to get this space released ?
I am trying to access and modify data of a table of another schema which contains 80,000-90,000 records. My procedure is taking near about 30 mins to complete the operation. faster access and updation of table data.
Details: I have two schema: TEST and PROD I am running the below code from TEST Schema. /* CODE START HERE*/ DECLARE exc_bulk_errors EXCEPTION; PRAGMA EXCEPTION_INIT (exc_bulk_errors, -24381); v_block_count NUMBER := 1000;
[Code]....
The above code is taking near about 30mins to process.
I have also tried another approch: Creating a procedure in PROD schema to update COMPONENT_MASTER table and by calling the procedure from above code by passing component code.
/* PROCEDURE CALL FROM ABOCE CODE INTEST SCHEMA*/ PROD.PROCEDURE_TO_UPDATE(v_comp_code);
I am using RAC to RAC data guard environment. Os hp-unix. during primary(old standby) to standby(old primary) switchover I am ussing:
SQL>ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;
I have 11.2.0.1 environment with standby and when performing switch over - it was hanging for more than 2 hours and i had to cancel it. This is what all i see in the database alert.log:
Errors in file /u02/app/oracle/diag/rdbms/drpdb/drpdb1/trace/drpdb1_m000_15160.trc: ORA-01155: the database is being opened, closed, mounted or dismounted Thu Apr 04 17:44:03 2013 Errors in file /u02/app/oracle/diag/rdbms/drpdb/drpdb1/trace/drpdb1_m000_15780.trc: ORA-01155: the database is being opened, closed, mounted or dismounted Thu Apr 04 17:59:03 2013 Errors in file /u02/app/oracle/diag/rdbms/drpdb/drpdb1/trace/drpdb1_m001_16373.trc:
[code]....
ORA-01155: the database is being opened, closed, mounted or dismounted.
what is the difference between these two and in where we use Primary key and where we choose Surrogate Key.How to understand the difference between these two keys.
I have set up a schema using a DDL script in Oracle 10g. I am linking this through to a Visual Basic 2008 fron end. The connection is fine. My database of is for a car hire company project.
I need to know how to create an auto increment for a primary key field, like Access does.
For example here is my table structure for my Rental_Payment table.
-- TABLE RENTAL_PAYMENT CREATE TABLE RENTAL_PAYMENT ( PAYMENTNO NUMBER NOT NULL, CARDNO NUMBER NOT NULL,
I am trying to establish PK-FK relationship between 2 tables. Table 1 has VACC_ID as a primary key. Table 2 has VACC_ID and SCH_ID as the primary keys. I am trying to add VACC_ID from Table 2 as a FK to Table 1. This is the code I used
I also tried to add it without writing the query and editing the Table 1. By default, I am getting 2 columns(both VACC_ID) in the local column being referenced to the 2 primary keys(VACC_ID and SCH_ID) of table 2. I also uploaded the screeshot of the error, when I run the query.
In my application I am facing peculiar error. For easy understanding I am considering emp table. In my package P1 I have two procedures Proc1,Proc2.
Proc1 : It is receiving employee details and for checking if employee already exists it is calling Proc2. Proc2 : Here it checks if employee exists. If exists it deletes old record, commit and inserts new record in sequence.
But however in few instances Proc2 is returning unique constraint (CONSTRAINT_NAME) violated. I am very much confused why this error is coming.
I have the following 3 columns in my VERSIONS table.
MAJOR MINOR MICRO
The MAJOR,MINOR and MICRO columns create a unique composite primary key. I need to query out the last version by doing the following 3 queries and combine them.
select max(major) as max_major from versions select max(minor) as max_minor from versions where major = :max_major select max(micro) as max_micro from versions where minor = max_minor and major = max_major
Is there any way I can query out max(major),max(minor),max(micro) in a single query.
On my system 2 oracles are installed for different applications one having version 8.0 & other 10.0.
The oracle 10.0 is required for Windchill application. When I am trying to access the sqlplus by windchill shell it access the Oracle 8.0 sqlplus. how to set one oracle as primary on system so i am able to access the oracle 10 sqlplus in windchill shell.
I have a dilemma......the constraint was disable somehow in my table of about 900,000 records which allowed the insertion on duplicate primary keys as well as duplicate records. I've managed to get rid of the duplicate records, but I haven't quite figured out how to update the primary key and version number. I've tried the following but
UPDATE TABLE SET PM_PM_KEY=(MAX(PM_KEY)+1), PM_VERNO=(MAX(PM_VERNO)+1) WHERE TBLDATE= MAX(TBLDATE) ORDER BY TBLDATE ASC GROUP BY PCN;
The query is failing with Error at Command Line:2 Column:19
Error report: SQL Error: ORA-00934: group function is not allowed here 00934. 00000 - "group function is not allowed here" *Cause: *Action:
How can i retrieve which tables have composite primary keys, and only one of the primary key columns is a foreign key to another table?
Like: CREATE TABLE club ( clubId NUMBER, name VARCHAR(20) NOT NULL, PRIMARY KEY (ClubId) );
CREATE TABLE team ( teamid NUMBER(10), clubid NUMBER(10), teamname VARCHAR(10) NOT NULL, PRIMARY KEY (teamid, clubid), FOREIGN KEY (clubid) REFERENCES club (clubid));So in this case, the team table
I have a table say EMP with 2 fields ID and Name, with ID being the primary key. The name of the primary key constraint is ID_PK.Now my scenario is :
1. Rename the table EMP to EMP_TEMP; 2. Create an empty table EMP 3. If (data successfully loaded into EMP) { Drop EMP_TEMP; } else { Drop EMP; Rename EMP_TEMP to EMP; }
The problem here for me is the primary key constraint. When I am in 2, I cannot create the primary key constraint again since the old one is still in tact. If I go ahead to drop the original pk constraint and re-create a new one in 2, then in case of else part , I need to get the constraint again while renaming the original table.
I am working on a new project in OBIEE. I am asked to do the data modeling in the database using oracle sql developer. I have to create the joins based on the requirements. I have the tables created already. But the primary keys for few tables are not defined for few tables. PK-FK joins are also not done properly.
My questions are (1) If I have to define the primary key for the existing tables can I do that using the alter table command or should I create the table all over again and then define it? (2) If I have to make the changes in the existing PK-FK joins how do i go about doing that?
If you were asked to design a schema, would you create a table (however irrelevant) without a primary Key ? Say for example, a 'non-business' table like an Error logging table which logs exceptions thrown from stored procedures, would you create this table without a primary key ?
I have a dataguard setup, a primary and a standby.my instance is testdb.i have set all necessary dataguard parameters and everything seemed to work well initially with logs being moved from primary to secondary and being applied there.but all of a sudden i see that the primary pushes logs to the standby and at the standby end these logs are available but not applied.
when i try to execute the: alter database recover managed standby database cancel; it hangs for a long time and never returns to sql prompt.
i bascially want to stop and restart the MRP process to apply the logs but cannot cancel the managed recover mode.Is it advisable to kill the mrp process at os level using "kill -9 "?