answersLogoWhite

0

How to unlock a schema in oracle database?

Updated: 12/22/2022
User Avatar

Mihira567

Lvl 1
12y ago

Best Answer

The question is a bit short but I cured a locking problem with the following if it helps?

-- MESSAGE "Data" OR "Information" "is out of date" on some APP screens.

--

-- Identify which table is affected. In this case we know that

-- ops are stored in table WTL. We now need a session_id and serial number

-- so we can invoke the kill command against this rogue process.

--

-- sqlplus system/password@schemaname

select object_id from dba_objects where object_name ='WTL';

--3738

--3820

--3930

--3335

--

-- The following was run against 3738, 3820 and 3930 but nothing was returned

-- However when run against 3335 returned a session_id of 71

select * from v$locked_object where object_id=3335;

-- All we need now is the serial number so we can kill the rogue process.

--

select sid, serial#, command, taddr from v$session where sid=71;

--

-- This returned us a serial number 16711

--

-- All the above can be combined as below:

--

select sid, serial#, command, taddr

from v$session

where sid=(select SESSION_ID

from v$locked_object

where object_id in (select object_id

from dba_objects

where object_name='WTL'))

-- If we are sure this is the rogue lock then kill it.

alter system kill session '71,16711';

-- If it refuses to die use

alter system kill session '71,16711' IMMEDIATE ;

--

-- NOTE: Your sid and serial number will be different from this example!

-- NOTE: Closing the APP window and waiting 10 minutes can (sometimes) also cure the fault.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to unlock a schema in oracle database?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What do you mean by logical schema in database?

tablespace,segment,extent,oracle blocks.. are the logical schema of a database


What is a database schema?

A database schema is described in a formal language supported by the database management system (DBMS). In a relational database, the schema defines the tables, the fields in each table, and the relationships between fields and tables. Schemas are generally stored in a data dictionary. Although a schema is defined in text database language, the term is often used to refer to a graphical depiction of the database structure Levels of database schema 1. Conceptual schema, a map of concepts and their relationships 2. Logical schema, a map of entities and their attributes and relations 3. Physical schema, a particular implementation of a logical schema 4. Schema object, Oracle database object 5. Schema is the over all structure of the database


Is schema a logical structure or physical structure in oracle database?

the schema can be termed either conceptual or logical or physical. But mostly speaking, the term schema is used to refer to a logical structure.


What is the difference between schema and database?

Database schema are the logical structure of entities (tables or object classes) and their relationships (keys, or object associations) in a database. Schema can exist at different levels of abstraction (see: en.wikipedia.org/wiki/Database_schema). Schema themselves may or may not exist as such in a database. In general schema at the higher levels of abstraction are design models that are captured in printed documents, and authored by business analysts and database designers, rather than created by database programmers and stored in the database itself. But in some types of databases, schema at any level of abstaction can be realized physically. In Oracle databases, schema can be realized as schema objects, which are a part of an Oracle database. These schema objects may represent a human user's conceptual model of the knowledge captured in an enterprise database. Thus defined, there can be many schema that can be associated with one physical database. In other kinds of relational database, an abstract user's schema can be represented by logically linked metadata, views, and stored procedures assocated with a user class. In object-oriented databases, especially those based on the highly self-referential language Smalltalk (e.g. Gemstone/S), schema are realized as "physical" objects in the database as a matter of course, as well as in the logical models captured in design documents. The schema objects in such databases are, in essence, the classes comprising the infrastructure of the database or application. Oracle-style user schema are readily created; these would be realized as user interface orchestrator classes.


Why must create user in oracle todo your work in oracle?

A user in Oracle corresponds to a schema. Objects, such as table and indexes, must exist within a schema. Without creating a user/schema, use of the database will be limited to the built-in schemas and objects, such as the one-row DUAL table and standard PL/SQL packages.


Difference between user and schema oracle?

The both words user and schema are interchangeble,thats why most people get confusion on this words.Below i explained the difference between them--UserUser is a account to connect database(Server). we can create user by using CREATE USER user_name IDENTIFIED BY password.--SchemaActually Oracle Database contain logical and physical strucutre to process the data.The Schema Also Logical Structure to process the data in Database(Memory Component). Its Created automatically by oracle when user created.It Contains All Objects created by the user associated to that schema.For Example if i created a user with name santhosh then oracle createts a schema called santhosh,oracle stores all objects created by user santhosh in santhosh schema.We can create schema by CREATE SCHEMA statement ,but Oracle Automatically create a user for that schema.We can Drop the schema by using DROP SCHEMA schema_name RESTRICT statement but it can not delete scehema contains objects,so to drop schema it must be empty.here the restrict word forcely specify that schema with out objects.If we try to drop a user contain objects in his schema we must specify CASCADE word because oracle does not allow you to delete user contain objects. DROP USER user_name CASCADE so oracle deletes the objects in schema and then it drops the user automatically,Objects refered to this schema objects from other schema like views and private synonyms goes to invalid state.


What is schema object of database?

We know that schema in the database is refer to the basic design of that database and is stored in an object . That object is known as schema object of database.


The meaning of Oracle is?

Oracle is relational DataBase


What are the Types of database schema architecture?

The Star & Snowflake are two common type of database Schema.


How does one read a database schema?

One can easily read a database schema through any software available currently. Simpy because a database schema is a blueprint which can be read by a software.


What are database schema and sub-schemas?

A database schema is an actual plan for a database system. Sub-schemas are separate divisions that are used to achieve the plan for the database system.


What is the difference between oracle and oracle?

Oracle is one of the popular database and DBA (DataBase Administrator) is the person who maintain the database (install oracle software, create,setup,maintain database)