PL/SQL :: Dropping Connected Users In Oracle DB?

Mar 27, 2013

I want to drop some users in Oracle DB using sqlplus but I am getting error:

SQL> DROP USER test CASCADE;
DROP USER test CASCADE
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected.But when I ran below command to know sessions connected I am not getting any results:

SQL> select sid,serial# from v$session where username = 'test';

no rows selected

View 3 Replies


ADVERTISEMENT

PL/SQL :: Killing And Dropping Users Connected From Application

Jul 11, 2012

I have a data base for the bank application development. So there might be more than one sessions of the application running on the data base as well as there might be more than one data base sessions being connected from the dbas.

There is refresh procedure to refresh the data base from the baseload scripts ,So for that first we need to disconnect the users (Kill the sessions) and then drop the users then recreate the users and populate the users with the base load data.

I have prepared the killing and dropping user script in the following manner, Most of the times it is working fine and killing the users but some times it is not able to kill the drop the users it is erroring out with the error that can not dorp the users as there are active sessions running ,

set termout on
set echo on
spool Kill_sessions_drop_users.log
DECLARE
v_alt_stmt VARCHAR2(1000) := 'ALTER SYSTEM DISCONNECT SESSION ''';
v_kill_stmt VARCHAR2(1000);
[code].......

--This will kill all the sessions except the current session

CURSOR cur_usr_dtls IS SELECT username FROM all_users WHERE username IN ('ACTIVITI','TP','TPCORR','TPTUX','TPVIEW');
v_dr_stmt VARCHAR2(1000);
BEGIN
EXECUTE IMMEDIATE 'ALTER SYSTEM ENABLE RESTRICTED SESSION';
DBMS_OUTPUT.PUT_LINE('The database has been put in the restricted mode');
FOR v_cur_ssn IN cur_session
[code]........

--Here we are making the processor to wait for 60 mins so that that the killing will happen at the OS label

DBMS_LOCK.SLEEP(60);
FOR v_cur_usr_dtls IN cur_usr_dtls LOOP
v_dr_stmt :='DROP USER '||v_cur_usr_dtls.username ||' CASCADE';
BEGIN
EXECUTE IMMEDIATE v_dr_stmt;
[code]........

View 4 Replies View Related

Dropping Users And Recreating?

Jun 18, 2012

we are refreshing data base for our application from the base load,Every time when ever there is refresh required we need to drop the users and recreate every thing from the base load. For this we need to kill the sessions and drop the users ,Putting the instance in the restricted mode and refreshing the db.Some time when ever During the killing and dropping process there are some errors like you can not drop the users which is currently connected .

set termout on
set echo on
spool Kill_sessions_drop_users.log
DECLARE

[code]...

how to get rid of this

View 6 Replies View Related

SQL & PL/SQL :: Find Out IP Address For All Currently Connected Users In V$session

Apr 6, 2010

I need a query to find out IP Adress for all currently connected users in V$session.

View 7 Replies View Related

SQL & PL/SQL :: Dropping Users - Queue Tables

Dec 9, 2010

I am trying to drop a user but i get the following error

*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-24005: must use DBMS_AQADM.DROP_QUEUE_TABLE to drop queue tables

A couple of questions on this error:

- I did a search on the forum and the thread [URL] appears to have a solution to it by using

DBMS_AQADM.DROP_QUEUE_TABLE(queue_table => 'DEF$_AQCALL', force =>TRUE);

What i am not sure of is which queue will the above statement drop if run as sys and there are multiple schemas with different schema names but with the same queue name?

- We recently rebuilt the database server and prior to the rebuild i have always managed to drop a user without the above error. Is it likely that some setting somewhere is changed?

View 2 Replies View Related

How To Store Space After Dropping Objects And Users To Maintain Storage Requirement

Jan 11, 2013

There is a scenario: I dropped all objects of 3 users and dropped other 2 users and then I checked the space from dba_segments it reflects decreased space which is perfectly fine. Problem is that when I checked the space of physical datafile on disk it remains same. How can I restore or shrink or regained the space after dropping objects and users to maintain my storage requirements.

View 1 Replies View Related

Networking And Gateways :: Oracle 10g Client Not Getting Connected To Database

Jun 28, 2006

I am facing difficulty in connecting Oracle 10g client to Oracle 10g database. Both the machines are in windows xp with service pack-2. The following observations are made in server machine

1. The loopback test of the server is successful.
2. One net service name created in the server end.
3. Database connection is successful with above service name.
4. tnsping <server ip address> is successful

The tnsnames.ora file of the server is

# tnsnames.ora Network Configuration File: C:oracleproduct10.2.0db_1
etworkadmin nsnames.ora
# Generated by Oracle configuration tools.

CONTRACT =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 80.0.28.42)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = cam)
[code]........

the sqlnet.ora file of the server is

sqlnet.ora Network Configuration File: C:oracleproduct10.2.0db_1NETWORKADMINsqlnet.ora
# Generated by Oracle configuration tools.

# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

SQLNET.INBOUND_CONNECT_TIMEOUT = 30

The listner.ora file of the server is

listener.ora Network Configuration File: C:oracleproduct10.2.0db_1NETWORKADMINlistener.ora
# Generated by Oracle configuration tools.

LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 80.0.28.42)(PORT = 1521))
)

When I am connecting the 10g database with 10g client I am getting ORA-12170 error.

Attempting to connect using userid: nss
The test did not succeed.
ORA-12170: TNS:Connect timeout occurred

There may be an error in the fields entered,or the server may not be ready for a connection. How to configure this connectivity.

The client side tnsnames.ora file is as given below

# tnsnames.ora Network Configuration File: C:oracleproduct10.2.0client_1NETWORKADMIN nsnames.ora
# Generated by Oracle configuration tools.

CONTRACT =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 80.0.28.42)(PORT = 1521))
)
[code]......

The sqlnet.ora file of the client side is

sqlnet.ora Network Configuration File: C:oracleproduct10.2.0client_1
etworkadminsqlnet.ora
# Generated by Oracle configuration tools.

# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

View 13 Replies View Related

Precompilers, OCI & OCCI :: Keep Connected To Oracle Or It's Better Reconnect After Work?

Feb 27, 2012

I'm a beginner in the PRO*C and I have this issue/I have to maintain a multithreaded C++ PRO*C application and has the following structure

1) Application runs waiting for requirements
2) When detects a requirement it creates a Thread to work
3) The thread connects to Oracle with a EXEC SQL CONNECT :uid IDENTIFIED BY :pwd; instruction
4) Calls some anonymous calls to execute a stored procedure

EXEC SQL EXECUTE
BEGIN
commit;
:Status:=stored_procedure(:param1, :param2);
commit;
END;
END-EXEC;

5) If anything went wrong then issues a EXEC SQL ROLLBACK WORK RELEASE; then reconnects and the thread die
6) If everything was OK then the thread dies, but never called a EXEC SQL COMMIT WORK RELEASE; to disconnect from Oracle

I don't know why never the application disconnects from Oracle, maybe is for performance. Sometimes the application crashes and I believe that maybe the error is for never freeing the connections, the PROC compile line is this

proc parse=full sqlcheck=full user=system/manager cpp_suffix=cpp iname=source.pc include="..Hdr" include="C:ORACLEORA81ociinclude" include="C:ORACLEORA81precomppublic"

Which is the way to implement the connections?, connect and disconnect when done? or just keep the connection alive? Which way has better performance, connect and disconnect or just keep the opened connection?

View 1 Replies View Related

RAC/ASM Clusterware Installation :: ORA-03114 / Not Connected To ORACLE Error With Oracle DB Installation

Dec 3, 2012

I am getting "ORA-03114: not connected to ORACLE" while installing "Oracle Database 11GR2" on "Oracle RAC 11R2" cluster setup. I am getting this error at the time of "Oracle Database Configuration Assistant" configuration reaches till 39% on HP-UX 11.31 IA64 platform.

View 25 Replies View Related

SQL & PL/SQL :: Handling Circular Data In Oracle / Get Disjoint Sets Of Data Connected By 2 Values

Sep 29, 2011

I have this table :

column1 column2
--------- ---------
value1 value2
value1 value3
value2 value4
value3 value7
value7 value1
value8 value9

What I was trying to retrieve is something like that:

Quote:
output_column
---------------
value1, value2, value3, value4, value7
value8, value9

I donĀ“t care about the order of the values in the row. In other words, I want to get disjoint sets of data connected by any of both values.Every pair in the input table is unique.

I have seen in the web that it is possible to do using connect by and hierarchical retrieving but I've been trying to make a lot of combinationts and I can reproduce the output.

View 2 Replies View Related

Default Oracle Users

Oct 2, 2013

I am trying to find out if there is a definite way to find out (by querying database) which database users have been created by Oracle (either during installation or as part of patching or adding new feature) and which database users have been created by DBAs.

I have looked into the documentation but could not find anything relevant. Ideally, I would like to know if this can be done for any versions starting from 9iR2.

View 7 Replies View Related

SQL & PL/SQL :: Where Does Oracle Get Value Of Users Windows Login Name

Jun 10, 2013

I'm working on a client-server application that uses ODBC to connect Windows XP or Windows 7 PCs to an Oracle 11 database. I use a dedicated account to connect to Oracle, and I get the users Windows login name using the call shown in the title. I use the Windows login name to verify that they can access my application. I've been asked by security conscious folks in our IT department how this information is obtained

My question is: where does Oracle get the value of the users Windows login name? Is it coming from a windows registry key? Environment variable? I heard that it's possible that the ODBC driver is calling a Microsoft Win32 function like GetUserName or GetUserNameEx to retrieve the user ID.

View 1 Replies View Related

SQL & PL/SQL :: Select All Users Created By Oracle?

May 4, 2012

During installation of a database Oracle creates several users. Also when using DBCA in a later stage to add more options Oracle can create more users.

Here's my problem: Public synonyms never get exported using exp(dp)/imp(dp) utility. Ofcourse using public synonyms isn't good practise, but sometimes handy. Unfortunately in our environment they have been used a lot in the passed.

So I want to create an SQL statement that does the trick and returns only all users that were NOT created by Oracle software.

I've tried several things, but can't seem to distinguish Oracle users from Manually created users.

View 7 Replies View Related

Server Administration :: Default Users In Oracle 9i?

May 31, 2010

how many default users available in oracle 9i version.

View 4 Replies View Related

Assign Different Profile For Oracle Database Users According To Their Job Functions

Apr 10, 2011

it is a good practise to assign different profile for oracle database users according to their job functions.what could be the resons for that?

View 3 Replies View Related

Distinguish Between Oracle Predefined Users / Roles - Customized Ones?

Apr 18, 2012

I am looking for a query which can select all existing Oracle predefined users and roles from db.I need it because one of my other scripts needs to know a given user name or role is a customised one or a system one.It looks like sys.user$ does not have any column that can be used to distinguish predefined users/roles.

I could find all the list of Oracle predefined users and roles by googling and hardcoded them in a query. I can also collect all the customised users and roles as well. However, I prefer a query which can automatically reports that and minimise the maintenance cost as new names and roles, either Oracle predefined or customised, may come out at anytime.

View 6 Replies View Related

Sending Automated Emails From Oracle DB To Users After A Certain Event

Jul 17, 2012

OS: RHEL 5.7 64 bit
DB: 11.2.0.2 Standard Edition 64 bit

Everyday EOD is run and after the eod, users are requesting to receive a mail confirming the same from the database. For this we need to configure automated email which will be sent to a list of users email ID immediately after the EOD is done.

View 3 Replies View Related

Server Administration :: How Many Users Can Be Created In Oracle 11g Release 2 Database

Dec 27, 2012

how many users we can create in oracle 11g release 2 database. Is there any specific limit or parameter for that.

View 1 Replies View Related

Export/Import/SQL Loader :: Copying Oracle Database Users From 9i To 11g?

Aug 19, 2012

I need to copy more than 1000 database users(without objects) from orcle 9i to oracle 11g. They don't allow to use any graphical tools.which is the best way to complete this task? does conventional export /import works for only users only ?

View 2 Replies View Related

Application Express :: Raise Warning When Password Due To Expire - Oracle Database Users

Aug 23, 2012

Using Apex 4.1 and custom authentication based on Oracle Database users.

I want to be able to show a warning immediately after a user logs in if their password is due to expire in xx days. Oracle raises a warning (ORA-28002) but I don't know how to handle that from the standard Apex login page.

View 1 Replies View Related

SP2-0640 Not Connected

Oct 4, 2007

I am using Oracle 10g on Fedora Linux and trying to learn a bit of pl/sql. Here is the piece of code that I today tried to run in the SQL Plus window but it back with an error message saying SP2-0640 Not connected.

set serveroutput on
declare x number;
begin x :=7777;
dbms_output.put_line('x= ');
dbms_output.put_line(x);
end;

View 1 Replies View Related

Database Is Not Connected To Application

Jan 4, 2013

We have 11.2.0.3 RAC on Oracle Virtual Box,OEL 5.8. Storage is ASM on EMC SAN.Even when the database is not connected to application and thus open but idle and none is working on it, and all other virtual machines are powered off, we are still getting a continuous i/o in SAN.Since I am new to RAC setup I need to know the few things...

1.Is it normal behaviour?
2.If yes, what is the reason of this i/o? Is it due to continuous ping on voting disk?..write in OCR? automatic backup of OCR?

Attached File(s)
SAN_I0_Issue.png ( 65.33K )
Number of downloads: 2

View 2 Replies View Related

RMAN Connected To 2 Database?

May 15, 2010

Through RMAN i have to connect to two databases having same name but the databases are at two different nodes.Can RMAN recognise the 2 databases.If yes how? I want to know the command.

View 1 Replies View Related

Processes / Sessions Connected To DB After ORA 20 Error?

Dec 28, 2010

Is there any way to tell what processes/sessions were connected to a DB after I get an ORA 20error. As you can see from the query results below, I did hit the max value of processes but I would like to know when it happen and who was connected.

I realize I can up the value, but before I do that I want to see what caused this to happen.

SQL> select * from v$resource_limit where resource_name in ('sessions', 'processes');
RESOURCE_NAME CURRENT_UTILIZATION MAX_UTILIZATION INITIAL_AL
LIMIT_VALU
----------
processes 221 1000 1000
1000
sessions 223 1020 1105
1105

View 6 Replies View Related

Exadata :: Tell Version Of Machine Connected To?

Mar 8, 2013

How can I tell version of exadata machine I'm connected to? Mean whether X2, X3-2. X3-8 ....

example: machinemodel=X2-2 Full rack A file named config.dat is mentioned in this doc [URL]

but I could not find that file on server I'm connected to (DB Host)

Any command, file I could use to get machinemodel?

View 9 Replies View Related

Client Tools :: SP2-0640 - Not Connected?

Jun 30, 2006

My Oracle DB is working properly till yesterday. When i tried connecting to it today using scott/tiger@orcl its not accepting.So i entered as system/system..it connected

when i tried to select instance_name from v$instance; it is giving me error

SP2-0640: Not connected

View 6 Replies View Related

SQL & PL/SQL :: Dropping A Snapshot

Apr 13, 2008

I am unable to drop a snapshot , i tried even from sys, it is giving the following error,

drop snapshot adm.dup_resource_status
9:46:29 ORA-08103: object no longer exists

but, when i try to create a new snapshot with the same name

CREATE MATERIALIZED VIEW ADM.DUP_RESOURCE_STATUS
..............
I get
ORA-12006: a materialized view with the same user.name already exists.

View 31 Replies View Related

PL/SQL :: Dropping A Partition?

Jul 7, 2012

Do i have to create indexes again if i drop a partition on a table?

View 6 Replies View Related

PL/SQL :: Dropping Partitions At Once

Nov 2, 2012

ALTER TABLE table_name DROP PARTITION (partition_1000);
ALTER TABLE table_name DROP PARTITION (partition_1001);
...
.........
......
ALTER TABLE table_name DROP PARTITION(partition_1320);(b

it is a delta partition,so trying to remove 320 partitions at once in pl/sql developer for a single table.

Like this i have to remove for more then 15 tables one by one, will this effect the database like filling up the archinve log destination by writing more logs.

kind of problems that i am going to face , as i am doing it on the production box directly.

View 5 Replies View Related

RAC & Failsafe :: Check How Many Sessions Connected To Particular Node

May 30, 2013

I have few doubts in rac environment

1.In 2 node rac while adding datafile to tablespace if you forget to mention '+'then what will happen whether it is going to be create or it throws an error if it creates where exactly located and other node users how to work on that tablespace .what all steps to perform that datafile is useful for all node users.

2. In Rac environment how to check how many sessions connected to particular node.

3)In Rac any node is evicted due to network failure then after we rebuild the network .Is there any steps to do manually to access the failure node after rebuilding the network or it will automatically available in cluster group which service is perform this activity.

4.While configuring cluster ware you choose voting disk and ocr disk location and which redundancy you will choose suppose if you go for normal redundancy how many disks you can select for each file either one or two?

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved