"Create Sequence statement" simple giving ORA 00604,06502 and 00955 while giving only 00955 in another environment
Hello
We have two Oracle 11 g R2 databases hosted on the AIX platform and running the same 'create the sequence' gives me different error messages
Create sequences "IDS_B88E01_SEQ" START BY INCREMENT of 1 BY 1;
1 database
Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
PL/SQL Release 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
Second time in a row below "create the sequence" statement gives me AN error message
ORA-00955 - name already used by an object existing.
Database 2
Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
PL/SQL Release 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
Second time in a row below "create the sequence" statement gives me FOUR error messages
ORA 00604 - an error has occurred at the SQL level recursive 1
ORA-06502-pl/sql: digital error or value
ORA 06512 - line 11
ORA-00955 - name already used by an existing object
Will there be other parameters in the database that you might be aware that leads to the different exception handling?
I really need a mechanism which will be generic to the environment of exception handling
It will be a ddl after initiation... Triggering event will be 'DDL '.
Tags: Database
Similar Questions
-
ORA-00604 with ORA-20010: the user is not authorized to CREATE Table
Hello
I use 11.1.0.7 database
I'm only running this SQL logged on as a schema PLAN. PLAN scheme a DBA privilege but I receive error message-
What can be the problem here?create table SALARY.test (ID NUMBER); create table SALARY.test (ID NUMBER) * ERROR at line 1: ORA-00604: error occurred at recursive SQL level 1 ORA-20010: PLAN is not allowed to CREATE this - SALARY.TEST ORA-06512: at line 15
Thank you!user608897 wrote:
I know that we cannot use in a DDL trigger, but how can this be a DDL trigger.
As sybrand hinted it often allows to read a manual.
http://download.Oracle.com/docs/CD/E11882_01/server.112/e16508/srvrside.htm#CNCPT118
>
Overview of triggersA database trigger is a stored program unit compiled, written in PL/SQL or Java, that Oracle Database ("fire") automatically calls whenever one of the following occurs:
1. DML instructions on a particular table or view, issued by a user
The DML statements modify data in the schema objects. For example, inserting and removing lines are DML operations.* 2. DDL statements issued by a particular user or any user *.
DDL statements define schema objects. For example, create a table and add a column are DDL operations.3. database events
User login or closing of session, errors and database startup or a stop are events that can call triggers.
>A DDL trigger is one that runs when the DDL is made as in 2 above.
When you create the table, you run DDL, someone wrote a trigger that runs when you try to create the table, and in this trigger, they raise a user-defined exception ORA-20010: the user is not authorized to CREATE Table to tell you that you are not authorized to create the table.
-
ORA-01031 on create sequence with Execute Immediate
I have the following statement in a procedure:
When the statement is executed, I get an ORA-01031: insufficient privileges error.EXECUTE IMMEDIATE ' CREATE SEQUENCE my_seq INCREMENT BY 1 START WITH 130224 NOMINVALUE NOMAXVALUE NOCYCLE NOCACHE';
I can run the CREATE statement in sqlplus. The schema from which I executed the CREATE statement is the same as that under which the procedure is run. In addition, the procedure is also created in the same schema.
What a privilege I'm missing?Your privilege CREATE SEQUENCE given to you through a role.
Roles are not considered in the stored procedures, you must have the privilege granted directly to your user name.
-
ORA-14030: partitioning column does not exist in the CREATE TABLE statement
Hi all
We are trying to create a partition materialized view and get an error below.
ORA-14030: partitioning column does not exist in the CREATE TABLE statement
Our GL_BALANCES21 and GL_CODE_COMBINATIONS21 base tables is already divided by interval of the range on Code_combination_id.
In the same way that we try to partition the view materialized
We get the error.
ORA-14030: partitioning column does not exist in the CREATE TABLE statement
Where the clause there are 4 tables gl_balances21, gl_code_combinations21, gl_periods and gl_set_of_books.
CREATE MATERIALIZED VIEW apps. BAL_PART
PARTITION BY RANGE ("CODE_COMBINATION_ID")
(SCORE LOWER (80000) VALUES,
PARTITION OF LOWER VALUES (160000),
PARTITION OF LOWER VALUES (240000),
PARTITION OF LOWER VALUES (320000),
PARTITION OF LOWER VALUES (400000),
PARTITION OF LOWER VALUES (480000),
PARTITION OF LOWER VALUES (560000),
PARTITION OF LOWER VALUES (640000),
PARTITION OF LOWER VALUES (720000),
PARTITION OF VALUES LESS THAN (800000),
PARTITION OF LOWER VALUES (880000),
PARTITION OF LOWER VALUES (960000),
PARTITION OF VALUES LESS THAN (10400000),
PARTITION OF LOWER VALUES (11200000),
PARTITION OF LOWER VALUES (12000000),
PARTITION OF LOWER VALUES (12800000),
PARTITION OF VALUES LESS THAN (13600000),
PARTITION OF LOWER VALUES (14400000),
PARTITION OF VALUES LESS THAN (15200000),
PARTITION OF LOWER VALUES (16000000),
PARTITION OF VALUES LESS THAN (16800000),
PARTITION OF VALUES LESS THAN (17600000),
PARTITION OF VALUES LESS THAN (18400000),
PARTITION OF VALUES LESS THAN (19200000),
PARTITION OF LOWER VALUES (20000000),
PARTITION OF VALUES LESS THAN (20800000),
PARTITION OF VALUES LESS THAN (21600000),
PARTITION OF VALUES LESS THAN (22400000),
PARTITION OF VALUES LESS THAN (23200000),
PARTITION OF LOWER VALUES (24000000),
PARTITION OF VALUES LESS THAN (24800000),
PARTITION OF VALUES LESS THAN (25600000),
PARTITION OF VALUES LESS THAN (26400000),
PARTITION OF LOWER VALUES (27200000),
PARTITION OF LOWER VALUES (28000000),
PARTITION OF VALUES LESS THAN (28800000),
PARTITION OF VALUES LESS THAN (29600000),
PARTITION OF VALUES LESS THAN (30400000),
PARTITION VALUES LESS THAN (MAXVALUE))
QUICKLY REFRESH ON DEMAND
SELECT the QUERY REWRITE as
SELECT GL.GL_CODE_COMBINATIONS21. ROWID C1,
GL.GL_BALANCES21. ROWID C2,
"GL". "" GL_BALANCES21 ". "" ACTUAL_FLAG, "
"GL". "" GL_BALANCES21 ". "" CURRENCY_CODE "
"GL". "" GL_BALANCES21 ". "" PERIOD_NUM, "
"GL". "" GL_BALANCES21 ". "" PERIOD_YEAR ".
"GL". "" GL_BALANCES21 ". "" SET_OF_BOOKS_ID ""SOB_ID"
"GL". "" GL_CODE_COMBINATIONS21 ". "" CODE_COMBINATION_ID ""CCID.
"GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT1 ",.
"GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT10, "
"GL". "" GL_CODE_COMBINATIONS21 ". "" DIRECTION11, "
"GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT12, "
"GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT13, "
"GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT14, "
"GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT2 ",.
"GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT3. "
"GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT4, "
"GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT5, "
"GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT6, "
"GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT7. "
"GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT8, "
"GL". "" GL_CODE_COMBINATIONS21 ". "" SEGMENT9, "
"GL". "" "" GL_PERIODS '. "" PERIOD_NAME,"
NVL ("GL". "GL_BALANCES21" "." " (BEGIN_BALANCE_CR', 0) Open_Bal_Cr,
NVL ("GL". "GL_BALANCES21" "." " (BEGIN_BALANCE_CR', 0) +.
NVL ("GL". "GL_BALANCES21" "." " (PERIOD_NET_CR', 0) Close_Bal_Cr,
NVL ("GL". "GL_BALANCES21" "." " (BEGIN_BALANCE_DR', 0) Open_Bal_Dr,
NVL ("GL". "GL_BALANCES21" "." " (BEGIN_BALANCE_DR', 0) +.
NVL ("GL". "GL_BALANCES21" "." " (PERIOD_NET_DR', 0) Close_Bal_Dr,
NVL ("GL". "GL_BALANCES21" "." " (BEGIN_BALANCE_DR', 0).
NVL ("GL". "GL_BALANCES21" "." " (BEGIN_BALANCE_CR', 0) Open_Bal,
NVL ("GL". "GL_BALANCES21" "." " (BEGIN_BALANCE_DR', 0).
NVL ("GL". "GL_BALANCES21" "." " (BEGIN_BALANCE_CR', 0) +.
NVL ("GL". "GL_BALANCES21" "." " (PERIOD_NET_DR', 0).
NVL ("GL". "GL_BALANCES21" "." " (PERIOD_NET_CR', 0) Close_Bal,
NVL ("GL". "GL_BALANCES21" "." " (PERIOD_NET_CR', 0) Period_Cr,
NVL ("GL". "GL_BALANCES21" "." " (PERIOD_NET_DR', 0) Period_Dr
OF GL.GL_CODE_COMBINATIONS21.
GL.GL_BALANCES21,
GL.GL_SETS_OF_BOOKS,
GL.GL_PERIODS
WHERE GL.GL_BALANCES21. CODE_COMBINATION_ID = GL.GL_CODE_COMBINATIONS21. CODE_COMBINATION_ID
AND GL.GL_SETS_OF_BOOKS. SET_OF_BOOKS_ID = GL.GL_BALANCES21. SET_OF_BOOKS_ID
AND GL.GL_PERIODS. PERIOD_NUM = GL.GL_BALANCES21. PERIOD_NUM
AND GL.GL_PERIODS. PERIOD_YEAR = GL.GL_BALANCES21. PERIOD_YEAR
AND GL.GL_PERIODS. PERIOD_TYPE = GL.GL_BALANCES21. PERIOD_TYPE
AND GL.GL_PERIODS. PERIOD_NAME = GL.GL_BALANCES21. PERIOD_NAME
AND GL.GL_PERIODS. PERIOD_SET_NAME = GL.GL_SETS_OF_BOOKS. PERIOD_SET_NAME
and gl.GL_CODE_COMBINATIONS21.summary_flag! = « Y »
ERROR on line 54:
ORA-01013: user has requested the cancellation of the current operation
I checked the metalink note saying that ensure that all columns in a partitioning column list are columns of
the table being created.
Partition is already there, on the column of code_combination_id of gl_balances21 and gl_code_combinations21.
Please suggest.
Thank youIt's your mistake:
PARTITION BY RANGE ("CODE_COMBINATION_ID")
but in your projection of column list, you have an alias he:
"GL"."GL_CODE_COMBINATIONS21"."CODE_COMBINATION_ID" "CCID",
You must use the alias as a partition key, not the name fom the secondary table column.
--
John Watson
Oracle Certified Master s/n
http://skillbuilders.com -
ORA-02289 delete and create sequences to help to run immediately
Hi all
I copied a schema of one database to another.
In the former base my package works very well and the procedure inside the PKG_REFRESH package below works like a charm.
PROCEDURE FILL_TABLE(P_PROC_ID INTEGER) AS
BEGIN
EXECUTE IMMEDIATE (' drop sequence sq1' ");
EXECUTE IMMEDIATE (' create the sequence sq1 with cache of 1 500 ft);
v_kenmerk: = 'dim_1 ';
INSERT INTO dim_1)
Field1
Field2
... < snip >
END;
Now that I have imported the package in a different database, and while footage used by inside the packaging procedures exist, it gives the errors below:
Start
*
LAUGHING at regel 1:
. ORA-02289: sequence does not exist
ORA-06512: at "OWNER. PKG_REFRESH", line 117
ORA-06512: at "OWNER. PKG_REFRESH', line 80
ORA-01031: insufficient privileges
ORA-06512: at "OWNER. PKG_REFRESH', line 20
ORA-06512: at line 3 level
I checked and the sequence is abandoned, but has not been recreated. However, it only gives me an error message when you try to create the sequence.
I'm puzzled... search this forum, google and metalink did not help me either.
Does anyone have an idea why this is happening? Strange is that it does not work on the old database.
Robin
Published by: RobbieNerve on June 30, 2011 10:27 I forgot to say that the procedure is inside the packageTry to give an explicit subsidy to the user:
GRANT CREATE SEQUENCE TO OWNER;
Max
-
ORA-00604: error occurred at recursive SQL when the proc via db_link
Hello
I'm on 9.2.0.8 and got a strange problem with simple test cases
What wrong with my code?on source db: CREATE OR REPLACE PROCEDURE ADMIN.gg_ref(out_tokens OUT SYS_REFCURSOR) is BEGIN OPEN out_tokens for select dummy from dual; END ; / Now testing code localy: SQL> var r refcursor SQL> declare 2 output sys_refcursor; 3 begin 4 adminx.gg_ref(output); 5 :r:=output; 6 end; 7 / PL/SQL procedure successfully completed. SQL> print r D - X So its working. I've got db_link to that db , and now call that proc via dblink from other 9.2.0.8 DB: var r refcursor 1 declare 2 output sys_refcursor; 3 begin 4 admin.gg_ref@LINK_NAME(output); 5 :r:=output; 6* end; SQL> / declare * ERROR at line 1: ORA-00604: error occurred at recursive SQL level 1 ORA-00900: invalid SQL statement
Is there a any restriction that I'm not aware?
Concerning
GregGGregG says:
What should my code looks like now?
Should I rewrite this as function returns the index of collection or something?You can use DBMS_SQL - but use the remote package and not the local. It's a little more complex ito call interface you use a Ref Cursor, but is the same server-side. DBMS_SQL also provides a more comprehensive set of features to use the ref cursor interface.
Most, however, is add code - DBMS_SQL is a lower level interface (much closer to the real Oracle Call Interface/OIC):
--// on remote database the procedure returns a DBMS_SQL cursor instead of a ref cursor SQL> create or replace procedure FooProc( cur in out number, deptID number ) is 2 rc number; 3 begin 4 cur := DBMS_SQL.open_cursor; 5 6 DBMS_SQL.parse( 7 cur, 8 'select ename from emp where deptno = :deptID', 9 DBMS_SQL.native 10 ); 11 12 DBMS_SQL.Bind_Variable( cur, 'deptID', deptID ); 13 14 rc := DBMS_SQL.Execute( cur ); 15 end; 16 / Procedure created. --// from the local database side we call this remote proc SQL> declare 2 c number; --// instead of using sys_refcursor 3 empName varchar2(10); --// buffer to fetch column into 4 begin 5 FooProc@testdb( c, 10 ); --/ call the proc that creates the cursor 6 7 --// we need to define our fetch buffer for the 1st column in the 8 --// SQL projection of that cursor (10 byte fetch buffer for 1st column) 9 DBMS_SQL.define_column@testdb( c, 1, empName, 10 ); 10 11 --// we now fetch from this cursor, but via the DBMS_SQL 12 --// interface 13 loop 14 --// fetch the row (exit when 0 rows are fetched) 15 exit when DBMS_SQL.Fetch_Rows@testdb( c ) = 0; 16 17 --// copy value of 1st column in row into the local PL/SQL buffer 18 DBMS_SQL.column_value@testdb( c, 1, empName ); 19 20 --// record value it via dbms output 21 DBMS_OUTPUT.put_line( 'name='||empName||' deptID=10' ); 22 end loop; 23 24 --// close it explicitly as you would a ref cursor 25 DBMS_SQL.Close_Cursor@testdb( c ); 26 end; 27 / name=CLARK deptID=10 name=KING deptID=10 name=MILLER deptID=10 PL/SQL procedure successfully completed. SQL>
-
ORA-00604: an error has occurred at the SQL level 1 recursive
Hi all
I made the full database expdp and impdp Production to test the server its success but during the creation of any user or change password its me poster below error
SQL > create user identified by bam bam
2 default tablespace users
3 tablespace temporary temp
4 unlimited quota on users;
create user bam identified by bam
*
ERROR on line 1:
ORA-00604: an error has occurred at the SQL level 1 recursive
ORA-06502: PL/SQL: digital or value error: character string buffer too small
ORA-06512: at line 7
SQL > alter user identified by 12345; system
change the system of the user identified by 12345
*
ERROR on line 1:
ORA-00604: an error has occurred at the SQL level 1 recursive
ORA-06502: PL/SQL: digital or value error: character string buffer too small
ORA-06512: at line 7
kindly help me to solve this problem.
Thank you.One last thing. 100% make sure error is defined as partners on the issue of Test database:
change the system '_system_trig_enabled' = FALSE;
And then try to create/modify the user. For example:
SQL> create or replace 2 trigger ORA_06502 3 after alter 4 on database 5 declare 6 v_str1 varchar2(1); 7 v_str2 varchar2(3); 8 begin 9 v_str2 := 'ABC'; 10 v_str1 := v_str2; 11 end; 12 / Trigger created. SQL> alter user u1 identified by u1 2 / alter user u1 identified by u1 * ERROR at line 1: ORA-00604: error occurred at recursive SQL level 1 ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at line 6 SQL> alter system set "_system_trig_enabled"=FALSE; System altered. SQL> alter user u1 identified by u1 2 / User altered. SQL>
SY.
-
ORA-01194 and ORA-00604 when using backup controlfile set #2
Oracle 11.2.0.1 database version
Enterprise Linux 5.4
Database is in archivelog mode.
I'm trying to recover a database according to a backup controlfile to trace #2. Create the controlfile works very well, but recover the database fails.
From what I understand, the recovery fails because it cannot roll forward - 39 sequence is in the online missing redo log file. However, the database opens with the restlogs option and I understand that it should use the archivelogs in order to roll back. Since it is a new controlfile he does not know the archivelogs, but he does not accept to register or use archivelog files.
The recovery as shown in set #2 doesn't seem to work as expected. Any ideas?
Following errors:
Thank youSQL> CREATE CONTROLFILE REUSE DATABASE "RCAT" RESETLOGS ARCHIVELOG etc. Control file created. Tyring to register on of the archivelogs does not work: SQL> ALTER DATABASE REGISTER LOGFILE '/u02/fra/RCAT/archivelog/2010_09_19/o1_mf_1_33_69bfo5tx_.arc'; ALTER DATABASE REGISTER LOGFILE '/u02/fra/RCAT/archivelog/2010_09_19/o1_mf_1_33_69bfo5tx_.arc' * ERROR at line 1: ORA-00604: error occurred at recursive SQL level Applying an existing archivelog during recovery does not work: SQL> recover database using backup controlfile until cancel Specify log: {<RET>=suggested | filename | AUTO | CANCEL} /u02/fra/RCAT/archivelog/2010_09_19/o1_mf_1_33_69bfo5tx_.arc ORA-00310: archived log contains sequence 33; sequence 39 required ORA-00334: archived log: '/u02/fra/RCAT/archivelog/2010_09_19/o1_mf_1_33_69bfo5tx_.arc' ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below ORA-01194: file 1 needs more recovery to be consistent ORA-01110: data file 1: '/u02/RCAT/datafile/o1_mf_system_6959kz7l_.dbf' ls -l /u02/fra/RCAT/archivelog/2010_09_19: -rw-r----- 1 oracle dba 49313280 Sep 19 00:01 o1_mf_1_33_69bfo5tx_.arc -rw-r----- 1 oracle dba 312320 Sep 19 00:03 o1_mf_1_34_69bft63b_.arc -rw-r----- 1 oracle dba 20343808 Sep 19 02:10 o1_mf_1_35_69bo6y6j_.arc -rw-r----- 1 oracle dba 40960 Sep 19 02:12 o1_mf_1_36_69boc9t8_.arc -rw-r----- 1 oracle dba 20992 Sep 19 02:13 o1_mf_1_37_69bofng4_.arc -rw-r----- 1 oracle dba 794624 Sep 19 02:15 o1_mf_1_38_69bokwbf_.arc
MarkusMarkus Waldorf wrote:
I think that I am aware and do not suggest to use the hidden setting.What worries me is that the value #2 of the controlfile to trace the contours of the database backup can be recovered even with the lack of recovery online newspapers, but apparently this is not the case. What I also don't understand, is why he simply not restore using the information of the archivelogs. The database was not shut down properly, but isn't always the case when you lose again-online newspapers?
Here is the text of the controlfile.sql
-Set #2. RESETLOGS case
--
-The following commands will create a new control file and use
-to open the database.
-The data used by the Recovery Manager will be lost.
-The content of online newspapers will be lost and all backups
-be invalidated. Use this option only if online newspapers are damaged.Published by: Markus Waldorf Sep 20, 2010 09:34
You are right. But it is especially the case.perform, create the new database and will stop immediately (without demolition) and remove newspapers online OS level. And try to recover the database using backup controlfile until cancel or just recover database until cancel then enter Word Cancel and resetlogs option database open. It will work. Because it actually do not need any recovery operation. But your case you need to recover the database. You consider backup restore las and perform incomplete recovery. I think you can do the first test.
-
insufficient privileges when you create sequence using the procedure
CREATE OR REPLACE PROCEDURE schema1.proc1 AS BEGIN EXECUTE IMMEDIATE 'DROP SEQUENCE schema1.add_ins_seq'; EXECUTE IMMEDIATE 'CREATE SEQUENCE schema1.add_ins_seq MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 1000 NOORDER NOCYCLE'; END;
This procedure is created to schema1 by schema1.
Schema1 boasts a CREATE SEQUENCE privilege.
When I run this procedure through SQL Developer after the Cup to schema1, the error is thrown in insufficient privilege to CREATE SEQUENCE, however, DROP SEQUENCE is executed. I can create the sequence without the procedure call.
If I add AUTHID CURRENT_USER so I don't get the error of insufficient privileges.
Why it gives this error when the owner and the applicant of the procedure is schema1?
Hello
1st thing to know: when a procedure is defined (and updated), any privileges granted through ROLE is not taken into account. This is because these privileges can be active or not at the level of the session (as happens if for example a user has active 'role A' in session 1 but not in session 2 and if this role has been used to define a procedure?) The proecedure must at the same time be VALID in session 1 and INVALID session 2? Is not possible.
Thus, for instance in a situation of 'standard': user SYSTEM has 'DBA Rôle', so you can for example make a sqlplus session "SELECT * v $ instance;", but you would write a procedure owned by system making instance_name SELECT INTO l_variable OF v$ instance; "then"surprise": the procedure cannot be compiled because of the ORA-904 Table or view does not exist..." To be able to create the procedure, a DSS system needs to be done.
2nd thing for your special case, a little more complex: default for a procedure is 'AUTHID DEFINE', but once more: it means "privileges of the author creating the procedure", so without taking into account the acquired privileges through roles... Your user name is 'sequence create' through a role, it cannot use the privilege within the procedure. But... but when you define the procedure with AUTHID CURRENT_USER, privileges are evaluated at run time, and thanks to the active ROLE in the session by calling the procedure, at this time, the user can create the sequence. If try again you but with 'The VALUE NONE ROLE' in the session before the call, you will again have the question.
Conclusion: If you need to do the action, you must grant the user the necessary privilege directly.
Best regards
Bruno Vroman.
-
Error ORA - 00604 DB creation with DBCA
Hello
I want to create an instance of database with MS Windows 8.1 64bits.
So I installed the Standard Edition 12.1.0.1.16 database (12.1.0.1.0 and Patch16). Now, when I create an instance I get the error ORA-00604 in the script cloneDBCreation.sql to the command ' modify AL32UTF8 database character set INTERNAL_CONVERT '.»
Has anyone an idea what is the problem?
Thanks in advance.
Kind regards
Martin
12.1.0.2 is only available under EA right now - see MOS Doc 1905806.1
-
drop user failed ORA-00604 ORA-01008
Hello
Oracle Database Enterprise Edition on Solaris SPARC 10.2.0.4.0.
Recently I didn't drop a schema:
user password menu cascade
Error report-
SQL error: ORA-00604: error occurred at the SQL level 1 recursive
ORA-01008: not all variables
ORA-06512: at line 2
00604 00000 - "an error occurred at the SQL level recursive %s.
* Cause: An error occurred during the processing of a recursive SQL statement
(a statement applicable to dictionary tables inside).
* Action: If the situation described by the following error stack
can be corrected, to do so; otherwise contact Oracle Support.
So, I turned on 10046 trace to check what caused the failure:
In the trace file, I saw:
PARSING IN CURSOR #42 len = dep 88 = 1 uid = 25 oct = 47 = 25 tim = hv 46736406559755 lid = ad 909419424 = "9a554a68".
Start
run immediately 'call wmsys.lt_ctx_pkg.allowDDLOperation ("false");
end;
END OF STMT
ANALYSIS #42:c = 0, e = 42, p = 0, cr = 0, cu = 0, set = 0, r = 0, dep = 1, og = 1, tim = 46736406559753
LINKS FOR #42:
=====================
PARSING IN CURSOR #43 len = dep 51 = 2 uid = 25 oct cover 170 = 25 tim = hv 46736406560263 = = ad 2806787184 = "b3862ea8".
call wmsys.lt_ctx_pkg.allowDDLOperation(:"SYS_B_0")
END OF STMT
ANALYSIS #43:c = 0, e = 264, p = 0, cr = 0, cu = 0, put = 1, r = 0, dep = 2, og = 1, tim = 46736406560261
EXEC #42:c = 0, e = 832, p = 0, cr = 0, cu = 2, set = 0, r = 0, dep = 1, og = 1, tim = 46736406560766
#42 ERROR: err = 1008 tim = 490840735
Suggests that the wmsys.lt_ctx_pkg.allowDDLOperation(''false'') caused the problem.
So I manually ran it:
Start
run immediately 'call wmsys.lt_ctx_pkg.allowDDLOperation ("false");
end;
Error report-
ORA-01008: not all variables
ORA-06512: at line 2
01008 00000 - "not all variables.
* Cause:
* Action:
Can anyone help on this please? I looked everywhere but no luck.
Thank you
Hello
Please, I beg you. Check the Note MOS "Datapump Export or Drop Table Fails with ORA-01008 (Doc ID 791065.1)"
If the database parameter cursor_sharing value other than EXACT, set CURSOR_SHARING = TRUE.
Borys
-
ORA-1403, ORA-00604 and ORA-20000
Kindly help... is we face two errors
Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
AMT for IBM/AIX RISC System/6000: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
Alerts log error:
ORA-1403 encountered alert server SMG-4120
---------------------------------------------------------------------------------------------------------------------------
After importing the DB, the following error message is displayed by creating materialized views.
ORA-00604: an error has occurred at the SQL level 1 recursive
ORA-20000: Trigger xdb_installation_trigger does not support the creation of objects of
type of snapshotPL don't post duplicates - ORA-1403, ORA-00604 and ORA-20000
-
ORA-00604 and ORA-01450 during index creation
Hi all
While trying to create the index on a partitioned table online, I confronted the following errors:
ORA-00604: an error has occurred at the SQL level 1 recursive
ORA-01450: length maximum key (3215) exceeded
I'm on oracle 10G and Linux OS.
Here's the query I use to the index:
Any suggestions...CREATE INDEX DBNAME.TABLE_NAME_NAME1_SN_IDX ON DBNAME.TABLE_NAME (NAME1_SN) TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS INITRANS 2 MAXTRANS 255 NOLOGGING LOCAL ( PARTITION INDEXNAME_ABC_20080101 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20080201 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20080301 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20080401 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20080501 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20080601 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20080701 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20080801 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20080901 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20081001 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20081101 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20081201 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20090101 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20090201 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20090301 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20090401 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20090501 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20090601 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20090701 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20090801 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20090901 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20091001 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20091101 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20091201 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20100101 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20100102 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20100103 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_20100104 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201005 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201006 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201007 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201008 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201009 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201010 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201011 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201012 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201101 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201102 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201103 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201104 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201105 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201106 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201107 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201108 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201109 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_201110 NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ), PARTITION INDEXNAME_ABC_MAX NOLOGGING NOCOMPRESS TABLESPACE DBNAME_INDEXNAME_ABC_IDX_TS PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ) ) NOPARALLEL online;
Thanks and greetings
KKHello
as already indicated the error: exceeded key length. So how is the column as defined name1_sn? If she varchar2 (4000) os, then you get this kind of error. Then, one must look for Oracle Text index these fields.
Herald tiomela
http://htendam.WordPress.com -
Our development team is trying to create an external tabe in the database of another schema. ODI is to create the inside connection bridge. I don't know how. But whenever they get from this request, he'll hang on State. When in the same code works fine in a different database.
Users whereby they are connceting to the source in the fire database this query have the same privileges.
For a database, it works fine that the table is created in the target database and in the correct schema but for another, it doesn't work and hung... (not giving any results)
Databases are used to the BI work and having almost the same configurations.
I checked the view target database v$ session. It gives me < enq: PS - contention > event
and three rows are back with < PX Deq: table Q narrow > event for others following two lines...
is - can anyone shed some light on this? What should I do now. like killing the session blocking is not solve problems
Here is an example of the executed query:
CREATE TABLE SCHEMA_NAME. C$ _0ODS_JDE_F0004
(C1_DTSY, C2_DTUCD1, C3_DTRT, C4_DTJOBN, C5_DTUPMJ_DT, C6_DTMRTY, C7_DTDL01, C8_DTPID,
C9_DTMRCT, C10_DTLN2, C11_DTCNUM, C12_DTUSEQ, C13_DTUSER, C14_DTCDL, JRN_SUBSCRIBER, JRN_FLAG, JRN_DATE)
EXTERNAL ORGANIZATION
(TYPE oracle_datapump
THE DEFAULT DIRECTORY DIR_SCHEMA_NAME
LOCATION ("X58030417C$ _0ODS_JDE_F0004_1.EXP", ' X58030417C$ _0ODS_JDE_F0004_2.EXP ')
)
2 PARALLEL AS
SELECT
NVL (TRIM (F0004. (DTSY), ' ') C1_DTSY, NVL (TRIM (F0004. (DTUCD1), ' ') C2_DTUCD1, F0004. DTRT C3_DTRT,
TRIM (F0004. C4_DTJOBN DTJOBN), J2DT (DTUPMJ, DTUPMT) C5_DTUPMJ_DT, NVL (TRIM (F0004. (DTMRTY), ' ') C6_DTMRTY;
TRIM (F0004. DTDL01) C7_DTDL01, TRIM (F0004. DTPID) C8_DTPID, F0004. DTMRCT C9_DTMRCT, F0004. DTLN2 C10_DTLN2,
F0004. DTCNUM C11_DTCNUM, F0004. DTUSEQ/10 C12_DTUSEQ, TRIM (F0004. C13_DTUSER DTUSER),
F0004. DTCDL C14_DTCDL, ' ' AS JRN_SUBSCRIBER, 'I' AS JRN_FLAG, SYSDATE AS JRN_DATE
OF SCHEMA_NAME. F0004 F0004 WHERE (1 = 1)
-Best regards,.
Sahascratched...
-saha
-
How good my trigger &; Create Sequence are written review my excerpt from PL/SQL
I have a CustomerHistory table.
Here's a sequence I created for the table:
I created a trigger example the primary key of the history table:CREATE SEQUENCE customerhistory_id_seq START WITH 90 INCREMENT BY 10 MAXVALUE 90000 NOCYCLE NOCACHE;
After each update, or delete, insert the old record in the history table:CREATE OR REPLACE TRIGGER cushistory_bef_insert BEFORE INSERT ON CustomerHistory FOR EACH ROW BEGIN SELECT customerhistory_id_seq.NEXTVAL INTO :NEW.CustomerHistoryID FROM DUAL; END; /
1 are structured correctly 3 pl/sql code snippets?CREATE OR REPLACE TRIGGER cushistory_aft_upddel AFTER UPDATE OR DELETE ON CUSTOMER FOR EACH ROW BEGIN IF UPDATING THEN INSERT INTO CustomerHistory * ( SELECT :OLD.c.customerID, :OLD.c.firstname, :OLD.c.lastname, :OLD.c.email, . . . :OLD.mr.roomtype, . . . :OLD.b.checkout, 'UPDATE', SYSDATE FROM Customer c JOIN CustomerFamilyMember cf ON c.customerID = cf.customerID JOIN Phone p ON c.customerID = p.customerID JOIN ThirdParty t ON c.thirdpartyid = t.thirdpartyID JOIN BookedRoom b ON c.customerID = b.CustomerID JOIN MotelRoom mr ON b.roomID = mr.roomID JOIN Motel m ON mr.motelID = m.motelID ); ELSIF DELETING THEN INSERT INTO CustomerHistory * ( SELECT :OLD.c.customerID, :OLD.c.firstname, :OLD.c.lastname, :OLD.c.email, . . . :OLD.mr.roomtype, . . . :OLD.b.checkout, 'DELETE', SYSDATE FROM Customer c JOIN CustomerFamilyMember cf ON c.customerID = cf.customerID JOIN Phone p ON c.customerID = p.customerID JOIN ThirdParty t ON c.thirdpartyid = t.thirdpartyID JOIN BookedRoom b ON c.customerID = b.CustomerID JOIN MotelRoom mr ON b.roomID = mr.roomID JOIN Motel m ON mr.motelID = m.motelID ); END IF; END; /
2. in the last example, which is an alternative using the JOIN? If know join 5 tables is not a good
long term solution. Any idea?Hello
Here are the bugs I find in your code.
Please view the description of test table and features for more information.1 cushistory_aft_upddel is a level trigger line on client.
Querying the table inside the trigger would give the error table mutation.ERROR at line 1: ORA-04091: table XXXXX.CUSTOMER is mutating, trigger/function may not see it ORA-06512: at "XXXXX.TEST_TRG", line 2 ORA-04088: error during execution of trigger 'XXXXX.TEST_TRG'
The only way you can acccess them using: old.col_name and: new.col_name.
2 table the customer is the only updated and so the new and the old mke sense only for the customer table. the old.b.col_name and old. XXX.col_name for all other tables mean nothing and will result in error;
Here is an excerpt of small test with tahe customer table and another table called check_in. You can extend the same thing for your problem.
sql> create table customer( 2 cust_id number, 3 cust_name varchar2(20)); Table created. sql> create table check_in( 2 cust_id number, 3 check_in date, 4 check_out date 5 ); Table created. sql> create table cust_history( 2 cust_id number, 3 cust_name varchar2(20), 4 check_in date, 5 check_out date); sql> insert into customer values (100, 'Rajesh'); 1 row created. sql> insert into customer values (200, 'kumar'); 1 row created. sql> insert into check_in values (100, sysdate-2, null); 1 row created. sql> insert into check_in values (200, sysdate-3, null); 1 row created. sql> commit; Commit complete. create or replace trigger test_trg after update on customer for each row begin insert into cust_history select :old.cust_id, :old.cust_name, ci.check_in, ci.check_out from check_in ci where ci.cust_id = :old.cust_id; end; / sql> select * from customer; CUST_ID CUST_NAME ---------- -------------------- 100 Rajesh 200 kumar sql> select * from check_in; CUST_ID CHECK_IN CHECK_OUT ---------- --------- --------- 100 25-DEC-09 200 24-DEC-09 sql> select * from cust_history; no rows selected sql> update customer set cust_name = 'Rajesh2' where cust_id = 100; 1 row updated. sql> commit; Commit complete. sql> select * from customer; CUST_ID CUST_NAME ---------- -------------------- 100 Rajesh2 200 kumar sql> select * from cust_history; CUST_ID CUST_NAME CHECK_IN CHECK_OUT ---------- -------------------- --------- --------- 100 Rajesh 25-DEC-09
You can use the other tables to select as I used the check_in above. You don't need to access the customer table that you have values in the: old. and: new. variables for them.
Thank you
Rajesh.Published by: Rajesh Chamarthi on December 26, 2009 21:30 added example.
Maybe you are looking for
-
Cannot install Adobe 10... impossible to uninstall Adobe 8.14
I can't install Adobe 10 it still gives the same message at 5%, unable to connect.When I try to uninstall the Adobe 8.14 I get a not authorized tent program to access the system > Help!
-
How to remove the guest on Macbook Air user account
My 13 year daughter, uses the internet recklessly and I need to close the guest account, because my parental control does not seem to work. Even though I've taken away the guest user option in system preferences, it restarts the computer so that she
-
HP Officejet Pro 8500 has more freeze scans
After the digitization of several documents by using HP scan software on computer, the printer stops. To start again, you must turn off the computer - wait a few minutes to make the message "turn", then wait several more minutes for the printer to
-
How to turn off Wi - Fi and Bluetooth on IdeaPad U510?
Hello! I want to activate Bluetooth and Wi - Fi to save battery, but I just can't find the way to do it. There is no button or sth like that. No one knows how to do?
-
I noticed that when I open a file, the file Explorer window remains open. Is there a setting that can close this window after you have launched a file? I have always go back and close the window. I want that it closes when I open the file. He added