Drop user
Hello
If someone drop a user with 'drop statement user' does oracle connects something somewhere?
Thank you! * T
If you have enabled and configured the audit, then Yes, you would be able to see things in the audit trail.
Tags: Database
Similar Questions
-
Drop users connected to loop diagram
Hi all
I am currently trying to get a simple script that will get all the users currently connect to a schema and then kill the session so I can let it go. At the moment I can do this with separate controls.
select username, osuser, sid, serial# from v$session where username like 'myschema%' order by username, osuser;
alter system kill session '<sid>,<serial#>';
drop user <user> cascade;
All works, but requires that orders running manually. Ideally I would like to be able to run a command to do that. Right now I'm trying to just drag the users but I get the error:
10:18:07 [BEGIN - 0 row (s), 0,251 seconds] [error Code: 6550, SQL State: 65000] ORA-06550: line 5, column 4:
PLS-00103: encountered the symbol "END" when expected in the following way:
* & = - + ; <>/ is mod remains not return rem
return < an exponent (*) > <>or! = or ~ = > = < = <>and or
as like2 like4 likec between using | Member in bulk
submultiset
The code I use is
BEGIN FOR connectedUser IN (SELECT sid, serial# FROM v$session WHERE username like 'myschema%') LOOP EXECUTE IMMEDIATE 'ALTER SYSTEM KILL SESSION ''' || connectedUser.sid || ',' || connectedUser.serial# || '' END LOOP END
Any help is very appreciated.
Thank you
Nick
BEGIN
FOR connectedUser IN (SELECT sid, serial # FROM v$ session WHERE username like '% USER1% ')
LOOP
dbms_output.put_line (connectedUser.sid |) ',' || connectedUser.serial #);
RUN IMMEDIATELY "ALTER SYSTEM KILL SESSION"'| " connectedUser.sid | ',' | connectedUser.serial # | " ' ' ;
END LOOP;
END;
/ 2 3 4 5 6 7 8
You can try over a
-
Hello
I'm in Oracle Database 10 g Enterprise Edition Release 10.2.0.2.0 - Prod.
I'm trying to drop user cascade and the statement hangs with wait event 'db file scattered read' on a query from sys.
I put a trace on the session where I'm doing it and rerun the drop command.
ALTER session set events "name of the 1940 ERRORSTACK level 3 trace";
ALTER session set events 10046 trace context name forever, level 12';
The relevant section of the tkprof is below:
Select o.name, o.type #, o.obj #, o.remoteowner, o.linkname, o.namespace, o.subname
Of
obj$ o, tab$ t where o.owner #=: 1 and o.type #! 11 and o.type = #! = 13 and
o.type #! 14 and o.type = #! 10 and o.type = #! = 33 and o.type #! = 32 and o.type #.
! 8 and o.type = #! = 9 and o.type #! 7 and o.type = #! = 38 and o.type #! = 22
and o.type #! = 28 and o.type #! 29 and o.type = #! 30 and o.type = #! = 55 and
o.obj # t.obj = #(+) and (t.property is null or (bitand (t.property, 8192)! = 8192))
and bitand (t.property, 512). (= 512 and bitand(t.flags,536870912)! = 536870912))
o.type # desc order
call the query of disc elapsed to cpu count current lines
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Run of 115 0.01 0.02 0 0 0 0
Fetch 7501 75.39 825,13 1385179 2455703 0 7500
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Total 7617 75,40 825,15 1385179 2455703 0 7500
Chess in the library during parsing cache: 0
Optimizer mode: CHOOSE
The analysis of the user id: SYS (recursive depth: 1).
Rows Row Source operation
------- ---------------------------------------------------
7500 SORT ORDER BY (cr = 2449755 pr = 1381735 pw = time 0 = 822704263 en)
FILTER 162677 (cr = 2449755 pr = 1381735 pw = time 0 = 818684218 en)
162677 HASH JOIN EXTERNAL (cr = 2449755 pr = 1381735 pw = time 0 = 818328045 en)
164036 TABLE ACCESS BY INDEX ROWID OBJ$ (cr = 34382 pr = 6 pw = time 0 = 737122 en)
310201 I_OBJ2 INDEX RANGE SCAN (cr = 4830 pr = 4 pw = time 0 = 126082 US)(object id 37)
14444378 TABLE ACCESS FULL TAB $ (cr = 2421321 pr = 1385173 pw = time 0 = 770578194 en)
I tried to collect statistics of dictionary and troubleshoot with Metalink ID 1291804.1.
However, none of these permits.
Please help.
Kind regards
Horia BercaHello
There is a bug in Oracle10.2.0.4. Please try my suggestions mentioned bellows. And let me know if any question.
1 remove the objects belonged to the first schema.
2. then slide the user later.Also, please see my doc mentioned below.
Drop User Cascade very slow in 10.2.0.4 [ID 798586.1].
Hopefully this might solve your problem.
Thank you
Vishal Joshi
Oracle Apps DBA. -
DROP USER CASCADE takes forever! Cannot see all blocks... any ideas?
Hi all
I am running a script that has a cascade of user to fall, and it's been sitting there for about 3.5 hours at this point.
I ran a query to see if I could find any blocking sessions:
SQL > alter
A written file afiedt.buf
1 SELECT DECODE (ask, 0,' the owner: ',' server: '). Sess sid,
2 id1, id2, lmode, request, type
3. IN V$ LOCK
4. WHERE (id1, id2, type) IN
5 (SELECT id1, id2, type OF LOCKING WHEN demand for V$ > 0)
6 * ORDER BY id1, ask
SQL > /.
no selected line
So, I'm a bit stuck... is possible to see what maybe continues this? This is performed on a 3 x system RAC node... I think this would go pretty fast...
any ideas on what to do or what to watch?
TIA,
CayenneYes, you drop the first user objects, then delete it the user. Slow user drops have been written about many times over the years. It generally works better if you don't try to do everything via a single command.
I had the same experience with drop tablespace waterfall. It is generally faster remove objects via the script, then drop the tablespace.
For now, you want to probably just wait the drop user cascade.
HTH - Mark D Powell.
-
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
-
Possibility for impdp clean without "drop user cascade?
First time poster here.
Unlike a lot of readers here, our Organization the Group DBA super duper which are very sensitive to what we do to the servers. While it is understandable that what they do is also a headache for us, also.
The installer: We have 2 servers on 11g, a PROD and a QA. The DBA of takes a database PROD discharge via expdp and we give it to restore on QA. The plan is to drop and re-create the user before running impdp.
The problem is that we do not have the privileges 'connect sysdba virtue' so that we can delete and re-create the user, and we won't get to have.
It comes as good if:
(1) we drop all the tables, procedures, sequences, and etc, then run impdp
(2) there is an option to run impdp which will force overwrite the database?
(3) there are other alternatives to complete updating of the schema?
Thanks in advance for your advice.
David(1) it is just as good. Maybe better, because the privileges of the user, quotas, etc. remain in place.
(2) not sure offhand. see the documentation.
(3) truncate everything and start the import operation. This is useful as if your structure is the same and simply refresh the data.
Here is a block that I use to exterminate all the user objects, if I don't want to drop or create the user. He manages the types of objects in my application. If you have other types of objects, you may need to add sections for them.
-- this will drop all objects for a user. -- it assumes you are logged in AS the user owning the objects BEGIN FOR x_rec in (select view_name from user_views) LOOP execute immediate 'drop view '||x_rec.view_name; END LOOP; FOR x_rec in (select mview_name from user_mviews) LOOP execute immediate 'drop materialized view '||x_rec.mview_name; END LOOP; FOR x_rec in (select table_name from user_tables) LOOP execute immediate 'drop table '||x_rec.table_name||' cascade constraints'; END LOOP; FOR x_rec in (select synonym_name from user_synonyms) LOOP execute immediate 'drop synonym '||x_rec.synonym_name; END LOOP; FOR x_rec in (select sequence_name from user_sequences) LOOP execute immediate 'drop sequence '||x_rec.sequence_name; END LOOP; FOR x_rec in (select index_name from user_indexes) LOOP execute immediate 'drop index '||x_rec.index_name; END LOOP; END; / purge recyclebin;
-
Hanging drop user cascade and results: PX Deq: Txn recovery Star
I have question drop cascade command user. He was suspended for an hour.
the user segments size is 150 GB.
In v $session_wait folowing events are coming.
Event SID P1 P2 session_waited
------------------------------ ---------- ---------- ---------- ---------
PX Deq: Beginning of recovery Txn 515 200 782 0
PX Deq: Beginning of recovery Txn 530 200 781 0
DB file sequential read 543 232 113709 0
PX Deq: Start Recovery Txn 511 200 781 1
PX Deq: Start Recovery Txn 518 200 781 1
PX Deq: Start Recovery Txn 514 200 781 2
PX Deq: Start Recovery Txn 516 200 781 2
PX Deq: Start Recovery Txn 517 200 782 2
PX Deq: Start Recovery Txn 519 200 781 2
PX Deq: Start Recovery Txn 520 200 781 2
PX Deq: Start Recovery Txn 521 200 781 2
PX Deq: Start Recovery Txn 522 200 781 2
PX Deq: Start Recovery Txn 523 200 781 2
PX Deq: Start Recovery Txn 524 200 781 2
PX Deq: Start Recovery Txn 525 200 781 2
PX Deq: Start Recovery Txn 526 200 781 2
PX Deq: Start Recovery Txn 527 200 781 2
PX Deq: Start Recovery Txn 528 200 781 2
PX Deq: Start Recovery Txn 529 200 781 2
PX Deq: Start Recovery Txn 531 200 699 2
PX Deq: Start Recovery Txn 533 200 781 2
PX Deq: Start Recovery Txn 534 200 781 2
PX Deq: Start Recovery Txn 535 200 782 2
PX Deq: Start Recovery Txn 536 200 781 2
PX Deq: Start Recovery Txn 537 200 781 2
PX Deq: Start Recovery Txn 539 200 782 2
PX Deq: Start Recovery Txn 540 200 781 2
PX Deq: Start Recovery Txn 513 200 782 2
PX Deq: Start Recovery Txn 512 200 781 2
PX Deq: Start Recovery Txn 510 200 781 2
PX Deq: Start Recovery Txn 509 200 781 2
PX Deq: Start Recovery Txn 507 200 782 2
PX Deq: Start Recovery Txn 508 200 781 2
wait event CAP be increaed 548 0 0 124
How to delete this user... Please advice...There is then some data in your segment, I suggest you truncate / drop the table one by one, finally, you delete the user.
Now your issued user 'drop', the sql is ddl, it can not cancled, you restart your db, even the operation will continue.
-
drop user suspended in oracle 10g
Hi all
I'm giving 5 patterns on my database.
When issuing the command 'move user username', it runs for hours without completing.
There are no objects in the schema
There are no sessions related to patterns in the view v$ session/v$ process
I blocked patterns (down) in order to avoid users log in again.
Database version: 10.2.0.4.0
Operating system: Solaris 10
Thank you
Leruo
Mark this thread as a response please
-
Hello Experts-
Help me please drop the user.
SQL > select sid from session $ v where username = "POLICY";
no selected line
SQL > drop user cascade of POLICY;
drop the cascade of user POLICY
*
ERROR on line 1:
ORA-00604: an error has occurred at the SQL level 1 recursive
ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
Read the error message; the error is not about removing a user, it's dropping of the user OBJECTS, which were used at the time of the fall of attempt. Import (so an insertion) was interrupted while Oracle has roll back the transaction, which takes time and locks the object. Once the restore is complete, the locks have been released and the user, as well as all the objects for this user, could be deleted.
David Fitzjarrell
-
drop more than one user in the database
Hi How can I deposit more user user at the same time for example, I have users who got the prefix UCM how can I make use I drop all the user with this prefix
Drop user cascade ucm_tets
where username like UCM %
There is no such thing, but you can use:
Select "user menu". u.username |' waterfall;' u dba_users
where u.username like '% UCM % '.
----
Ramin Hashimzade
-
The user existed but trying to drop/Alter error giving as "user does not exist".
Hi team,
I'm a junior DBA. As part of my work connected SYSDBA and try to drop/Alter the user, then it the following errors.
Using the select command, I found the user is existed.
Please suggest and help me.
SQL > show user
The USER is "SYS".
SQL > select username, account_status from dba_users where username = "s354621";
USERNAME ACCOUNT_STATUS
------------------------------ --------------------------------
EXPIRED s354621
SQL > DROP USER s354621
2.
DROP USER s354621
*
ERROR on line 1:
ORA-01918: user 'S354621' does not exist
=========================================
SQL > Alter user s354621 identified by 'happy33 ';
ALTER user s354621 identified by 'happy33 '.
*
ERROR on line 1:
ORA-01918: user 'S354621' does not exist
============================================
Thank you
Venerable.
What is the version of your RDBMS?, I've seen a few bugs related to this issue
also post the result of this,
Select the username, dump (username) from dba_users where username like '% s35% '.
In addition,
You can also post the original create statement of the user? If you created the user with quotes, you need to remove the user with double quotes. For example:
SQL > create user 's354621' identified by one;
Created by the user.
SQL > drop user s354621;
Drop user s354621
*
ERROR on line 1:
ORA-01918: user 'S354621' does not exist
SQL > drop user 's354621 ';
Deleted user.
-
Impossible to drop the user in TimesTen
Hi all
I created a data store: "tt_demo."
Created a user: 'test' and he granted "Admin, connect, create table, select on SYS. $OBJ ".
Created a simple table: emp and inserted two records.
Now, I need to drop this user, so I plugged to the data as a store below:
[*oracle*@exalytics bin] $. / ttisql
Command > Connect "dsn = tt_demo";
Successful login: DSN = tt_demo; UID = oracle;...
But when I try to drop the user I get following errors:
Order > drop user test.
15168: cannot remove a user who has database objects (TABLE TEST. EMP)
The command failed.
Order > drop user test cascade;
805: DROP USER... CASCADE has not been implemented
The command failed.
CASCADE is not supported by the TTT?
Can someone let me know the solution for this?
FYI, Version TT: 11.2.2.4.1
Thank you
SrikanthAccording to the error message we have yet not DROP USER... CASCADE.
So to remove a user, you must first delete all the objects belonged to this user.
Chris
-
I get the following error while dropping the user...
SQL > drop user cascade ONAIR.
drop the ONAIR user cascade
*
ERROR on line 1:
ORA-00604: an error has occurred at the SQL level 1 recursive
ORA-24005: must use DBMS_AQADM. DROP_QUEUE_TABLE to drop queue tables
I asked dba_queue_tables but her shows that r thr tables without current queue...
Select queue_table from the dba_queue_tables where owner = "FLIGHT."
no selected line
DB version is 10.2.0.4.0 aix ServerRUN THE SYS. DBMS_AQADM. DROP_QUEUE_TABLE (queue_table-online 'JOB_QUEUE_DATA', force-online TRUE);
-
Cannot drop the USERS tablespace.
Hi all
I am trying to drop tablespace USERS and in the face of error below.
PLATFORM:
OS: Linux Ubuntu 9.04, LTS
SQL > select * from v version $;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
AMT for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
PROBLEM:
SQL > drop tablespace users, including content and files of data cascade constraints;
Drop tablespace users including data files and content cascade constraints
*
ERROR on line 1:
ORA-00604: an error has occurred at the SQL level 1 recursive
ORA-24005: must use DBMS_AQADM. DROP_QUEUE_TABLE to drop queue tables
When I see, dba_queue_tables...
SQL > select the owner, queue_table from dba_queue_tables object_type.
OWNER OBJECT_TYPE QUEUE_TABLE
------------------------------ ------------------------------ -------------------------------------------------------------
SYS ALERT_QT SYS. ALERT_TYPE
SYS AQ$ _MEM_MC
SYS AQ_EVENT_TABLE SYS. AQ$ _EVENT_MESSAGE
SYS AQ_SRVNTFN_TABLE SYS. AQ$ _SRVNTFN_MESSAGE
SYS KUPC$ DATAPUMP_QUETAB SYS. KUPC$ _MESSAGE
SCHEDULER SYS $_EVENT_QTAB SYS. PLANNER$ _EVENT_INFO
SCHEDULER SYS $_JOBQTAB SYS. ANYDATA
SYS SYS$ SERVICE_METRICS_TAB SYS. SYS$ RLBTYP
SYSMAN MGMT_NOTIFY_QTABLE SYSMAN. MGMT_NOTIFY_NOTIFICATION
SYSTEM DEF$ _AQCALL
DEF SYSTEM $ _AQERROR
11 selected lines.
Also, there no tables in the tablespace USERS now, as I moved to another tablespace.
SQL > select count (*) from dba_tables where nom_tablespace = 'USERS ';
COUNT (*)
----------
0
Tablespace USERS is not permanent tablespace, as I changed to another, always the problem.
SQL > select property_name, name from database_properties where PROPERTY_NAME = 'DEFAULT_PERMANENT_TABLESPACE. '
PROPERTY-NAME NAME
------------------------------ ------------------------------
DEV DEFAULT_PERMANENT_TABLESPACE
Can you please help me drop the USERS tablespace.Hi boss,
Please find the solution for the same problem, but by dropping the user. Try the same for the Tablespace too.
SQL > drop user cascade COLOMBO_LIVE;
drop the waterfall COLOMBO_LIVE user
*
ERROR on line 1:
ORA-00604: an error has occurred at the SQL level 1 recursive
ORA-24005: must use DBMS_AQADM. DROP_QUEUE_TABLE to drop queue tablesSQL > select object_name from user_OBJECTS;
OBJECT_NAME
-------------------------------------------------------------------------MYQ
SYS_LOB0001130873C00025$ $
SYS_C001810004SQL > drop table myq;
drop table myq
*
ERROR on line 1:
ORA-24005: must use DBMS_AQADM. DROP_QUEUE_TABLE to drop queue tablesSQL > exec sys. DBMS_AQADM. DROP_QUEUE_TABLE (queue_table-online 'MYQ', force-online TRUE);
PL/SQL procedure successfully completed.
-
Remove the drop schema vs. user
So far, I understood that user and schema are identical and interchangeable. If this is the case why do we schema user controls and drop drop?Hello
There is no command "drop schema. It is "drop user '.
I don't know where did you find the 'drop schema' command in Oracle.
Concerning
Published by: skvaish1 on March 23, 2010 15:36
Maybe you are looking for
-
EXS24 instrument "Chinese Kit.exs" not found.
Hello I am trying to import my masterpieces from my iPhone to my Mac. However, the Mac app cannot found the same instruments: EXS24 instrument "Chinese Kit.exs" not found. Anyone know if it is possible to get this instrument? Thank you. Xavi.
-
Should I uninstall windows internet explore instead of firefox?
I'm still using XP. I use Firefox since almost a year and have no need for Windows Internet Explorer. Can or should I uninstall it? I know that some programs depend on it... but it is deleted Firefox will be able to provide this support?
-
Well long story short, I can't do either in app purchases, or download updates for my apps because the App Store will not accept my billing information. Does anyone know why this may be? My card works and I know there is money in my account to be abl
-
End of 2009 Mac Mini won't start in recovery mode
I have a Mac mini end of 2009, the latest version of El Capitan. I recently stopped a partition bootcamp by mistake and now I have 80 GB of my Mac partition filled by anything. Repartition the hard drive does not fix it. I want to reinstall the OS vi
-
TouchSmart 300 Windows 7, re - install on hard drive replacement problem. Help!
I have official restore for my Touchsmart 300 disks and try to get it back on a hard drive, which I took from another machine. Drive hard said have left include Win 7 and Win XP. When I try to boot from the recovery CD, I am taken to the old hard dri