I cannot "drop table"
Hi,
I've table BP:
CREATE TABLE BP (
BV_ID VARCHAR2 (32) DEFAULT NULL NOT NULL,
BP_ID VARCHAR2 (32) DEFAULT NULL NOT NULL,
CONSTRAINT BP_PK
PRIMARY KEY ( BV_ID, BP_ID )
BP has more 100 records:
Now I'd like to drop table BP:
drop table BP;
ORA-02449: unique/primary keys in table referenced by foreign keys
ALTER TABLE BP DISABLE CONSTRAINT BP_PK;
ORA-02297: cannot disable constraint (BP_PK) - dependencies exist
I tried disable all constraints with:
select 'alter table '||table_name||' disable constraints '||constraint_name||';'
from user_cons_columns
where column_name='BV_ID'
or column_name='BP_ID'
but when I try drop table BP;
ORA-02449: unique/primary keys in table referenced by foreign keys
also truncate table BP:
ORA-02266: unique/primary keys in table referenced by enabled foreign keys
How can I drop table BP and disable all referenced by enabled foreign keys on table BP?
Thanks!
Or you could disable the foreign key constraint refering to primary key on the table and then drop the PK and then drop the table
G
Similar Messages
-
Dear All,
I created one table like
create table cls_lrn_tab_unique (F_no number unique UK_F_NO );
after performing some operations I want to delete the same.
At that time i got following error. Please help me and tell what is the reason for the error.
ORA-00604 error occured at recursive level1
ORA-20123 Insufficient privileges: you cannot drop table cls_lrn_tab_unique TABLE,
ORA-06512 at line no 2
Thanks and Regards
Prasad26bffcad-f9a2-4dcf-afa0-e1e33d0281bf wrote:
Dear All,
I created one table like
create table cls_lrn_tab_unique (F_no number unique UK_F_NO );
after performing some operations I want to delete the same.
At that time i got following error. Please help me and tell what is the reason for the error.
ORA-00604 error occured at recursive level1
ORA-20123 Insufficient privileges: you cannot drop table cls_lrn_tab_unique TABLE,
ORA-06512 at line no 2
Thanks and Regards
Prasad
ORA-20123 is a localized/customized error code & message; therefore any solution depends upon what is unique inside your DB now.
I suspect that some sort of TRIGGER exists, which throws posted error, but this is just idle speculation on my part.
How do I ask a question on the forums?
https://forums.oracle.com/message/9362002#9362002 -
Versions are Oracle 11.2.0.1.0 and SQL Developer 4.0.0.12 on Windows 7 Ultimate SP1.
Hi
I'm following the CBT Nuggets SQL Fundementals training (video #11) and cannot drop a table I have just created. The command executed and error are:
drop table newprods;
Error starting at line : 1 in command -
drop table newprods
Error report -
SQL Error: ORA-00604: error occurred at recursive SQL level 1
ORA-20000: Cannot drop object
ORA-06512: at line 2
00604. 00000 - "error occurred at recursive SQL level %s"
*Cause: An error occurred while processing a recursive SQL statement
(a statement applying to internal dictionary tables).
*Action: If the situation described in the next error on the stack
can be corrected, do so; otherwise contact Oracle Support.
As the HR user I created two tables and created a FK constraint between them. After truncating the table with this FK, I am unable to drop it. Even if I remove the FK, the error is the same. Issing the command in SQL*Plus gives the same error.
This is the first time I have created any tables since installing Oracle on this machine and is my first attempt at dropping a table. I have not created any sequences, triggers or views based on these newly created tables.
Does anyone have any ideas?
CheersC:\Oracle>sqlplus hr@orcl
SQL*Plus: Release 11.2.0.1.0 Production on Wed Sep 4 18:58:55 2013
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> CREATE TABLE table1 (column1 VARCHAR2(20 BYTE));
Table created.
SQL> select * from table1;
no rows selected
SQL> drop table table1;
drop table table1
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-20000: Cannot drop object
ORA-06512: at line 2
SQL>
Can I run a query to see if there are any triggeres on the table?
EDIT: Ok it looks like no triggers:
SQL> show user
USER is "SYS"
SQL> select * from DBA_TRIGGERS where table_name like '%table1%';
no rows selected
SQL> select * from USER_TRIGGERS where table_name like '%table1%';
no rows selected -
Cannot Drop table with lower case name
Hi,
One of my developer created a table through application in oracle 10g R2,
when I list tables
select * from tab;
the table name is shown in lower case or Initcap.
I cannot drop or manipulate that table.
How can I drop that table(s)?
Thanks & Regards,
Fahimuse the same case what your table has used and put double quotes on both sides for example if your table is lower case use like:
DROP TABLE "your_table";HTH
Ghulam Mustafa Butt -
Cannot Drop Table that Shows in dba_tables
In my IDE I see two tables that I no longer need. I created them as a test to see the difference between LOGGING vs NOLOGGING. Now I want to drop the tables.
I issue the command drop table customers_no_logging.
The system responds with ORA-00942: table or view does not exist.
However, select table_name from dba_tables returns the table names in question.
Even in sqlplus I get the same result:
SQL> select table_name from dba_tables where owner = 'RUB';
TABLE_NAME
CUSTOMERS
INV_ITEM_MASTER
INV_SITE
CUSTOMERS_w_log
CUSTOMERS_no_log
5 rows selected.
SQL> drop table CUSTOMERS_no_log;
drop table CUSTOMERS_no_log
ERROR at line 1:
ORA-00942: table or view does not exist
How can I drop these tables?
Thanks,
GregoryI was connected as RUB in my IDE and SYS in SQLPlus.
I have connected as RUB in SQLPlus and tried
SQL> drop table "RUB.CUSTOMERS_no_log";
drop table "RUB.CUSTOMERS_no_log"
ERROR at line 1:
ORA-00942: table or view does not exist
Maybe I need to stop and restart the DB?
Gregory -
Cannot drop table (error ORA-00054)
I am trying to drop a table but get an "ORA-00054 Resource busy and acquire with NOWAIT specified". Previously I had created this table and run a join which I cancelled because it was taking too long and obviously not doing what I wanted. Now I can't get rid of the table, even with sysdba privileges and re-starting the machine running the database.
Can anyone help?It looks like your table got locked. Do you see any locks in your database on this table? I also, suggest you to close or kill the session which was cancled due to long running join condition, as you said in your question.
-
Hi Every one,
An error has occurred during report processing. (rsProcessingAborted)
Get Online Help
Query execution failed for data set 'NonFinTran'. (rsErrorExecutingCommand)
Get Online Help
Cannot drop the table '#NonFinTran', because it does not exist in the system catalog. Cannot drop the table '#MultipleNonFinTran',
because it does not exist in the system catalog. Transaction context in use by another session.
NOTE: NonFinTran &
MultipleNonFinTran are
the Temp table in my storedPoc.
Please any help me to solve this issue.
Thanks & Regards,
Anil Kumar
Anil KumarHi Harsh,
Below is my Stored Proc
SELECT @ServerName=datasource from master.dbo.sysservers WHERE catalog='Voyager'
SELECT @ServerName3=datasource from master.dbo.sysservers WHERE catalog='AuditLog'
SELECT @ServerName2=datasource from master.dbo.sysservers WHERE catalog='Portal'
IF @ServerName IS NOT NULL SET @ServerName='[' + @ServerName + '].' ELSE SET @ServerName=''
IF @ServerName3 IS NOT NULL SET @ServerName3='[' + @ServerName3 + '].' ELSE SET @ServerName3=''
IF @ServerName2 IS NOT NULL SET @ServerName2='[' + @ServerName2 + '].' ELSE SET @ServerName2=''
IF Exists(Select * From tempdb.dbo.SysObjects Where Name Like '#NonFinTran%')
DROP TABLE #NonFinTran
IF Exists(Select * From tempdb.dbo.SysObjects Where Name Like '#MultipleNonFinTran%')
DROP TABLE #MultipleNonFinTran
CREATE TABLE #NonFinTran (FirstName VARCHAR(40), TaxId VARCHAR(40), TrxID VARCHAR(40), Status VARCHAR(255), Field1 VARCHAR(255), Field2 VARCHAR(255),
Field3 VARCHAR(255), Field4 VARCHAR(255), Field5 VARCHAR(255), Field6 VARCHAR(255), DateTime DATETIME,
BranchID CHAR(3), BankID CHAR(1), FromAccountID VARCHAR(255), FromAccountType VARCHAR(255))
CREATE TABLE #MultipleNonFinTran (FirstName VARCHAR(40), TaxId VARCHAR(40), TrxID VARCHAR(40), Status VARCHAR(255), Field1 VARCHAR(255), Field2 VARCHAR(255),
Field3 VARCHAR(255), Field4 VARCHAR(255), Field5 VARCHAR(255), Field6 VARCHAR(255), DateTime DATETIME,
BranchID CHAR(3), BankID CHAR(1), FromAccountID VARCHAR(255), FromAccountType VARCHAR(255))
INSERT #NonFinTran
EXEC('SELECT FirstName, TaxID,
TrxID, Status, TrxField1, TrxField2, TrxField3, TrxField4, TrxField5, TrxField6, DateTime, '''', '''', '''', ''''
FROM ' + @ServerName3 + 'AuditLog.dbo.CCAuditLogEntryView AS Audit, ' + @ServerName + 'Voyager.dbo.CCUser AS CCUser
WHERE CCUser.UserID = Audit.UserID
AND Audit.Succeeded = 1
AND Audit.TrxID IN (''ChangeBillPayDefaultAccountEdit'',''ChangeExpiryUserPassword'',''ChangePasswordEdit'',
''ChangeUserPassword'',''ManageAddressMaint'',''ManageContactMaint'',''ManageSecretQuestionAnswerEdit'',
''ManageTransLimitMaint'',''OtherBankAccountMaintAdd'',''OtherBankAccountMaintDelete'',''OtherBankAccountMaintEdit'',
''WithinAmBankAccountMaintAdd'',''WithinAmBankAccountMaintDelete'',''WithinAmBankAccountMaintEdit'',
''SetAccountMaskPreferenceAudit'',''ChangeLoginIdAudit'')
AND DATEDIFF(DAY, CONVERT(DATETIME, CONVERT(VARCHAR(10), ''' + @StartDate + '''), 103), Audit.DateTime) >= 0
AND DATEDIFF(DAY, CONVERT(DATETIME, CONVERT(VARCHAR(10), ''' + @EndDate + '''), 103), Audit.DateTime) <= 0 ')
INSERT #MultipleNonFinTran
EXEC('SELECT DISTINCT FirstName, TaxID,
TrxID, Status, TrxField1, TrxField2, TrxField3, TrxField4, TrxField5, TrxField6, Audit.DateTime as AuditDateTime,
(SELECT DISTINCT SUBSTRING(A.BranchCode,3,3) FROM ' + @ServerName + 'AuditLog.dbo.CCAuditLogEntryView X INNER JOIN ' + @ServerName + 'Voyager.dbo.CCuser U
ON X.UserId = U.UserId INNER JOIN ' + @ServerName + 'Voyager.dbo.AMHZ_CustomerProfile P ON P.EnrolId = U.TAXID
INNER JOIN ' + @ServerName + 'Voyager.dbo.AMHZ_AccountListing A ON A.CIFNO = P.CIFNO
WHERE X.UserId = Audit.UserId AND A.AccountNo = SUBSTRING(Audit.TrxField1,11,16) AND P.CIFNO = A.CIFNO
AND (SUBSTRING(A.BranchCode,3,3) <> NULL OR SUBSTRING(A.BranchCode,3,3) <> '''')
AND CHARINDEX(''AccountID='', Audit.TrxField1, 1) > 0),
SUBSTRING(TrxField1,14,1), CASE WHEN CHARINDEX(''AccountID='', TrxField1, 1) > 0 THEN
SUBSTRING(TrxField1,11,16) ELSE '''' END, CASE WHEN CHARINDEX(''AccountType='', TrxField2, 1) > 0 THEN SUBSTRING(TrxField2,13,3) ELSE '''' END
FROM ' + @ServerName3 + 'AuditLog.dbo.CCAuditLogEntryView AS Audit, ' + @ServerName + 'Voyager.dbo.CCUser AS CCUser
WHERE CCUser.UserID = Audit.UserID
AND Audit.Succeeded = 1
AND Audit.TrxID IN (''SetAccountAttributesAudit'',''SetAccountFriendlyNameAudit'',
''AccountProfileMaintULDelete'',''AccountProfileMaintLHAAdd'',''AccountProfileMaintLSCAdd'')
AND DATEDIFF(DAY, CONVERT(DATETIME, CONVERT(VARCHAR(10), ''' + @StartDate + '''), 103), Audit.DateTime) >= 0
AND DATEDIFF(DAY, CONVERT(DATETIME, CONVERT(VARCHAR(10), ''' + @EndDate + '''), 103), Audit.DateTime) <= 0 ')
SET @stmt = '
SELECT * FROM
SELECT BranchName,
CASE WHEN SUBSTRING(FromAccountID,1,6) IN (''519901'',''559409'') THEN ''DC''
ELSE
CASE FromAccountType WHEN ''01'' THEN ''SA '' WHEN ''02'' THEN ''CA '' WHEN ''03'' THEN ''FD ''
WHEN ''SA'' THEN ''SA '' WHEN ''CA'' THEN ''CA '' WHEN ''FD'' THEN ''FD '' ELSE FromAccountType + '' ''
END
END +
case when Len(FromAccountID) =16 Then
CASE FromAccountType WHEN ''VC'' THEN
SUBSTRING(FromAccountID,1,6)+''******''+SUBSTRING(FromAccountID,13,4)
WHEN ''MC'' THEN SUBSTRING(FromAccountID,1,6)+''******''+SUBSTRING(FromAccountID,13,4) END
when Len(FromAccountID) =15 Then
CASE FromAccountType WHEN ''VC'' THEN
SUBSTRING(FromAccountID,1,6)+''******''+SUBSTRING(FromAccountID,13,3)
WHEN ''MC'' THEN SUBSTRING(FromAccountID,1,6)+''******''+SUBSTRING(FromAccountID,13,3) END
ELSE FromAccountID
ENd
AS FromAcctNo,
CASE TrxId
WHEN ''AccountProfileMaintLHAAdd'' THEN ''Link Account/Card''
WHEN ''AccountProfileMaintLSCAdd'' THEN ''Link Account/Card''
WHEN ''APMFamilyFirstAdd'' THEN ''Link Family First Account''
WHEN ''AccountProfileMaintULDelete'' THEN ''Unlink Account/Card''
WHEN ''BalInqFD'' THEN CASE WHEN Field3 IN (''APMLink=SUCCESS'') THEN ''APMLink Success'' ELSE ''Fixed Deposit Balance Inquiry'' END
WHEN ''BalInqCASA'' THEN CASE WHEN Field3 IN (''APMLink=SUCCESS'') THEN ''APMLink Success'' ELSE
CASE WHEN FromAccountType IN (''SA'',''01'') THEN ''Savings Account Balance Inquiry''
ELSE ''Current Account Balance Inquiry''
END
END
WHEN ''StopCheck'' THEN ''Stop Cheque Request''
WHEN ''CheckReorder'' THEN ''Order Your Cheque''
WHEN ''CheckInquiry'' THEN ''Cheque Inquiry''
WHEN ''TransHistFD'' THEN ''Fixed Deposit Transaction History''
WHEN ''TransHistCASA'' THEN
CASE WHEN FromAccountType IN (''SA'',''01'') THEN ''Savings Account Transaction History'' ELSE ''Current Account Transaction History'' END
WHEN ''StmtInqCC'' THEN
CASE WHEN FromAccountType IN (''DR'',''03'') THEN ''Debit Card Statement Inquiry'' ELSE ''Credit Card Statement Inquiry'' END
WHEN ''StmtInqDA'' THEN
CASE WHEN FromAccountType IN (''SA'',''01'') THEN ''Savings Account Statement Inquiry'' ELSE ''Current Account Statement Inquiry'' END
WHEN ''StmtReq'' THEN ''Printed Statement Request''
WHEN ''StmtInqIAMSTAR'' THEN ''E-AMSTAR Statement Inquiry''
WHEN ''Repayment/Transfer Inquiry'' THEN ''Repayment/Transfer Inquiry''
WHEN ''Account Inquiry'' THEN ''Account Inquiry''
WHEN ''Payment Inquiry'' THEN ''Payment Inquiry''
END AS TransType,
FirstName AS CustomerName,
TaxId, CONVERT(VARCHAR, DateTime, 103) AS Date, CONVERT(VARCHAR, DateTime, 108) AS Time
FROM #NonFinTran, ' + @ServerName3 + 'Portal.dbo.TB_Branch AS TB_Branch
WHERE
BranchId = TB_Branch.BranchCode
AND (TB_Branch.InstCode IN (''00001'', ''00003'',''001'',''002''))
AND (FromAccountType IN (''SA'', ''CA'', ''FD'', ''01'', ''02'', ''03'')))'
EXEC (@stmt)
IF Exists(Select * From tempdb.dbo.SysObjects Where Name Like '#NonFinTran%')
DROP TABLE #NonFinTran
IF Exists(Select * From tempdb.dbo.SysObjects Where Name Like '#MultipleNonFinTran%')
DROP TABLE #MultipleNonFinTran
Anil Kumar -
Hi Gurus,
when i am trying to drop a table, getting the below error:
ora - 00942; table or view does not exists
when am doing "desc <table_name>", i can see the structure.
tried to rename the table still its giving ora 00942
can you please suggest why the table cannot be dropped?
thanks in advance!
//sabyTry this as user TEST2:
SQL> select 'drop table "'||table_name||'" purge;' from user_tables where upper(TABLE_NAME) like 'SKF_%' ;
'DROPTABLE"'||TABLE_NAME||'"PURGE;'
drop table "SKF_CL_AL_ROW_AVAILABILITY " purge;
SQL> drop table "SKF_CL_AL_ROW_AVAILABILITY " purge;
There COULD be a blank (or something else) at the end of the table name. -
Cannot drop column from table owned by SYS
Hello everybody,
How can I drop a column of table which is owned by sys? thanks!
Result as follows:
SQL> ALTER TABLE HELLO_TB DROP COLUMN NUM;
ALTER TABLE HELLO_TB DROP COLUMN NUM
ERROR at line 1:
ORA-12988: cannot drop column from table owned by SYS
newbie vYou can not 'change' the ownership.
You can, however, 'move' or 'clone' most objects by exporting and importing. As follows:
I create a table under SYS (shudder).
I then export it
- using userid SYS in this case,
- under normal circumstances I'd either use a DBA account or the owner's userid
- since I want a table, I use the TABLES option - a list is comma separated and in quotes
I then import it using a 'userid' switch - fromuser & touser options
- in this case from SYS to HR
Finally, I verify it was transported.
Actual console session in Linux follows:
pop2@fuzzy:~> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 10 19:58:01 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> create table test1 ( x1 number );
Table created.
SQL> insert into test1 values (2);
1 row created.
SQL> select * from test1;
X1
2
SQL> Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
pop2@fuzzy:~> exp file=exp.dmp tables='TEST1'
Export: Release 10.2.0.1.0 - Production on Fri Mar 10 20:00:07 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Username: sys/????? as sysdba
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table TEST1 1 rows exported
Export terminated successfully without warnings.
pop2@fuzzy:~> imp file=exp.dmp fromuser=sys touser=hr
Import: Release 10.2.0.1.0 - Production on Fri Mar 10 20:00:44 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Username: sys/????? as sysdba
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Export file created by EXPORT:V10.02.01 via conventional path
import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
. importing SYS's objects into HR
. . importing table "TEST1" 1 rows imported
Import terminated successfully without warnings.
pop2@fuzzy:~> sqlplus hr/hr
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 10 20:00:57 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> select * from test1;
X1
2
SQL>The export/import pair are incredibly powerful - and few people understand them well. If you are interested in digging into their capability, check out their chapters in the Utilities manual (under the Books tab) at http://www.oracle.com/pls/db102/portal.portal_db?selected=1 -
ORA-02303: cannot drop or replace a type with type or table dependents
Oracle 10.2.0.3 on solaris :
I am trying to do a
CREATE OR REPLACE TYPE WickType_StringArray AS TABLE OF VARCHAR2(256);
I am getting the error :
ORA-02303: cannot drop or replace a type with type or table dependents
I then looked for the dependencies :
select * from dba_dependencies where name = 'WICKTYPE_STRINGARRAY' and owner='HARPER';
(Columns below with values are delimited by pipe | )
OWNER|NAME|TYPE|REFERENCED_OWNER|REFERENCED_NAME|REFERENCED_TYPE|REFERENCED_LINK_NAME|DEPENDENCY_TYPE
HARPER|WICKTYPE_STRINGARRAY|TYPE|SYS|STANDARD|PACKAGE||HARD
What is the best way for me to proceed to get my CREATE OR REPLACE statement working ?
ThanksWell you could move to 11g but I'd suggest a less drastic measure for now. Save the data, drop the table, reload the table.
But give serious consideration to Tom Kyte's advice about object tables: Don't use them. Instead use relational tables and object views. -
ORA-12983: cannot drop all columns in a table
Hi,
I am creating a table with two columns.
I have modified a column as unused using ALTER statement.
After that i have tried to drop the another column by using ALTER statement.
But it throws an error ORA-12983: cannot drop all columns in a table.
is it not possible to achieve this via ALTER statement?
thanksis there any other way to find the name of the columns which have been marked as unused?Don't think so, and you would not be able to do much about. You won't be able to reference it, you won't be able to un-unuse it, and you would even be able to add a new column having same name.
Why are you using SET UNUSED in the first place?
Regards
Peter
Quoting myself:
You won't be able to reference itMaybe not good enough:
SQL> select column_name, data_type, segment_column_id
from user_tab_cols
where table_name = 'T';
COLUMN_NAME DATA_TYPE SEGMENT_COLUMN_ID
SYS_C00001_11051618:28:14$ NUMBER 1
B NUMBER 2
SYS_C00003_11051618:28:14$ NUMBER 3
3 rows selected.
select "SYS_C00003_11051618:28:14$" from t
Error at line 1
ORA-00904: "SYS_C00003_11051618:28:14$": invalid identifier
SQL> alter table t drop column "SYS_C00001_11051618:28:14$";
Table altered.
SQL> select column_name, data_type, segment_column_id
from user_tab_cols
where table_name = 'T';
COLUMN_NAME DATA_TYPE SEGMENT_COLUMN_ID
B NUMBER
1 row selected.
Note: Both columns "disappeared" Thanks MichaelS
Edited by: Peter on May 16, 2011 9:29 AM -
Hi all, I have a problem. In next SQL query SELECT owner_name, job_name, operation, job_mode, state, attached_sessions FROM dba_datapump_jobs;
OWNER_NAME JOB_NAME OPERATION JOB_MODE STATE ATTACHED_SESSIONS
SYS exp_sys_stats1 EXPORT TABLE NOT RUNNING 0
SYS exp_sys_stats EXPORT TABLE NOT RUNNING 0
2 rows selected. Then I try
DROP TABLE SYS.exp_sys_stats1;
DROP TABLE SYS.exp_sys_stats1
Error at line 1
ORA-00942: table or view does not exist
SELECT o.status, o.object_id, o.object_type,
o.owner||'.'||object_name "OWNER.OBJECT"
FROM dba_objects o, dba_datapump_jobs j
WHERE o.owner=j.owner_name AND o.object_name=j.job_name
AND j.job_name NOT LIKE 'BIN$%' ORDER BY 4,2;
STATUS OBJECT_ID OBJECT_TYPE OWNER.OBJECT
VALID 113753 TABLE SYS.exp_sys_stats
VALID 113788 TABLE SYS.exp_sys_stats1
2 rows selected.
DECLARE
job1 NUMBER;
BEGIN
job1 := DBMS_DATAPUMP.ATTACH('exp_sys_stats1','sys');
DBMS_DATAPUMP.STOP_JOB (job1);
END;
also say ORA-31626: job does not exist I trying attach job, but got a error job does not exist. What can I do to delete this jobs?Yes I create this jobs with DBMS_SCHEDULER, and then delete, but records of them remained in view.
SELECT * FROM sys.obj$ where name like ('exp_sys_stats%');
OBJ# OWNER# NAME CTIME
113753 0 exp_sys_stats 11/17/2011
113788 0 exp_sys_stats1 11/17/2011
2 rows selected.*2oradba* I cannot atach job, I got error job does not exist :)
Edited by: 807831 on 17.11.2011 6:01 -
Drop table is not Working in SQL
Hi,
I am trying to drop table in below code in dynamic way, but facing error.
Looking for your support.
/**********************************RESET************************/
if @TypeOfUpdate='Reset'
Begin
Drop table [' + @DestinationTable + ']
exec('select * into [' + @DestinationTable + '] from openrowset(''Microsoft.ACE.OLEDB.12.0'', ''Excel 12.0;HDR=YES;Database=' + @TABLENAME + ''', ' + ''' select * from '+@SourceSheet + ''')')
PRINT 'Congratulations!!!! Database is Reset.';
END
above is part of SP code where I am getting an error if i run the below code.
EXEC [ImportExcelFile_Reset] 'C:\temp\TestFiles\OPENASNs.xlsx','Sheet1', 'test', 'Reset'
------------Error-------
(1 row(s) affected)
Msg 3701, Level 11, State 5, Procedure ImportExcelFile_Reset, Line 53
Cannot drop the table '' + @DestinationTable + '', because it does not exist or you do not have permission.
Msg 2714, Level 16, State 6, Line 1
There is already an object named 'test' in the database.
SharePoint_Consultant_EMEAYou you need a dynamic SQL statement for drop too. :)
if @TypeOfUpdate='Reset'
Begin
exec('Drop table '+ @DestinationTable+';
select * into [' + @DestinationTable + ']
from openrowset(''Microsoft.ACE.OLEDB.12.0'', ''Excel 12.0;HDR=YES;Database=' +
@TABLENAME + ''', ' + ''' select * from '+@SourceSheet + ''')')
PRINT 'Congratulations!!!! Database is Reset.';.......
Satheesh
My Blog | How to ask questions in technical forum -
Cannot drop cube or analytic workspace due to ORA-37409
The error is ORA-37409: cannot delete or truncate AW used by CUBE ORGANIZED table.
This seems very closely related to the bug discussed in this thread: Drop cube organized table
We need to drop and rebuild a cube due to a design change. It looks like there are some CR$ tables related to the cube preventing the drop.
We cannot drop the CR$ table, nor can we drop the cube, nor can we drop the analytic workspace. We have tried disabling materialized view refresh on the cubes (which works but leaves the CR$ tables out there). We have tried the drop using dbms_aw.aw_delete and with dbms_cube.import_xml (to remove everything). No such luck.
Is there a workaround you can give me that will allow us to drop the CR$ tables? Or a workaround that will allow us to drop the workspace?Update:
Our last attempt to drop the analytic workspace did remove almost all OLAP metadata. However, there were still rows in sys.olap_tab$ with object IDs relating the problem CR$ tables. In a test database, we confirmed that deleting these rows does allow us to drop the CR$ tables that cannot otherwise be dropped. However, running DML against a sys-owned table like this is unwise at best, and certainly an unsupported workaround (unless we can get Oracle's blessing to do it).
We may go through MOS and see if Oracle can provide a one-off patch for the bug listed above, to correct this situation. Or perhaps they may be able to provide some other direction.
This puts us in a situation where our only immediate option may be to uninstall the OLAP option and reinstall it. -
Cannot drop old undo tablespace. Cause: active rollback segment
dear all.
db: oracle 10.2.0.1
os: rhel as version 5 64 bits.
This is a testing database. And my database is online and open. But i can free the external usb disk that contains my ols undotbs.
I want to drop old undo tablespace but this is not possible.
1.- In order to open my database i had my datafile( '/mnt/hdext/back_plelds/undotbs02.dbf') offline drop, and then i can to open my database.
2.- When i try to delete my old undo tablespace im getting this error:
SQL> drop tablespace undotbs1 including contents and datafiles;
drop tablespace undotbs1 including contents and datafiles
ERROR at line 1:
ORA-01548: active rollback segment '_SYSSMU1$' found, terminate dropping
tablespace
3.- My default undo_tablespace is another that i was created before step 1.
SQL> sho parameter undo_ta
NAME TYPE VALUE
undo_tablespace string UNDOTMP
SQL>
Well i search in metalink ORA-01548 code error and in 18947.1 doc whows me that the solution is:
Action: Shut down instances that use the active rollback segments in the
tablespace and then drop the tablespace.
4.- I try to shutdown but im getting:
SQL> shutdown immediate;
ORA-00376: file 10 cannot be read at this time
ORA-01110: data file 10: '/mnt/hdext/back_plelds/undotbs02.dbf'
SQL>
This /mnt/hdext is an external USB disk and i have all permissions. I exported tables without any problem and i can read all files.
i search un metalink again ora codes (ORA-00376 ORA-01110) and the doc id: 427801.1 shows in the solution:
Drop the old undo tablespace instead of making it offline.
but when i try to drop the tablespace it shows the error describe in the step 2.
Facts:
- my tablespace UNDOTBS1 is ONLINE. I put in offline and this is not the solution.
- This is the status of my rollback segments:
SQL> select segment_name, status from dba_rollback_segs where
2 tablespace_name='UNDOTBS1';
SEGMENT_NAME STATUS
_SYSSMU1$ NEEDS RECOVERY
_SYSSMU2$ NEEDS RECOVERY
_SYSSMU3$ NEEDS RECOVERY
_SYSSMU4$ NEEDS RECOVERY
_SYSSMU5$ NEEDS RECOVERY
_SYSSMU6$ NEEDS RECOVERY
_SYSSMU7$ NEEDS RECOVERY
_SYSSMU8$ NEEDS RECOVERY
_SYSSMU9$ NEEDS RECOVERY
_SYSSMU10$ NEEDS RECOVERY
_SYSSMU11$ OFFLINE
SEGMENT_NAME STATUS
_SYSSMU12$ OFFLINE
12 rows selected.
SQL>
- I have the note (Unable to drop und tablespace In this article describe the problem but this is not the same. The difference is that i cannot drop the rollback segment that describe in step 2.
SQL> drop rollback segment "_SYSSMU1$";
drop rollback segment "_SYSSMU1$"
ERROR at line 1:
ORA-30025: DROP segment '_SYSSMU1$' (in undo tablespace) not allowed
in metalink the doc id: 173696.1 shows the solution:
Action: Check the undo segment name and reissue statement if necessary.
i cannot drop the rollback_segment
What can i do ???
thanks a lot.in step 4 did you try with shutdown abort?
If its still does not work then create another new table space with new file and then swtich to that tablespace http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/undo.htm#sthref1504Khurram
Maybe you are looking for
-
Window 8.1 preview for developer update issu.
After updating to window 8.1 preview for developer in lumia720 any surity that the major problem will not occurs in device? it is safe for device to update? if i m not comfortable with new update then can i come back to old version of software?
-
How to make website fit any screen size?
Hello all! I am trying to make my website fits any screen size (desktop, tablet, mobile) In Dreamweaver cs6, I go to file -multiscreen preview – Media Queries- make a CSS file for (site-wide) and click on the Default Presets and
-
Hi SD Guru's I would like to default the Billing Date in VF01 to Current Date. Any suggestions and advice on this. Regards Vineet
-
How to change the format in shipping point
Hiii.. When we define shipping point, how to change the format from hours to days for entering loading time & pick pack time. Regards, Jay
-
Viewing photos in an exported file
Once I have exported photos to be able to email them through hotmail, how can I open them to view the photos to see which ones I want to send. I can't get past the three view options of either thumbnails or lists. I want to open all the photos as thu