Posts

Showing posts from June, 2018

Creating and Altering User Profiles

User profiles: ------------------ Specifying a Profile. You also specify a profile when you create a user. A profile is a set of limits on database resources and password access to the database. If no profile is specified, then the user is assigned a default profile. Views: DBA_PROFILES This view contains info about the profiles SQL> desc dba_profiles  Name                                                 Null?    Type  ---------------------------------------------------- -------- ------------------------------------  PROFILE                                              NOT NULL VARCHAR2(128)  RESOURCE_NAME                                        NOT NULL VARCHAR2(32)  RESOURCE_TYPE                                                 VARCHAR2(8)  LIMIT                                                         VARCHAR2(128)  COMMON                                                        VARCHAR2(3) Eg: Creating profile: --------------------- CREATE PROFILE "Pavan

Killing Blocking Sessions

Finding Blocking sessions: ---------------------------------- Views: --------- v$session v$lock dba_blockers dba_waiters 1.From v$session: SQL> select  blocking_session,  sid,  serial#,  wait_class, seconds_in_wait from v$session where blocking_session is not NULL order by  blocking_session; 2. From v$lock SQL> select * from v$lock; ###If attribute block=1 in v$lock then the Sid relating to that row is blocking session. we can also find which session is waiting by comparing the ID1 and ID2 attributes of the v$lock. If ID1 and ID2 have same values with blocking and other session. Then session other than blocking session is waiting session.### 3. From dba_blockers SQL> select * from dba_blockers; ###From the above query we will get session id of the particular blocking session.### 4. From dba_waiters SQL> select holding_session, blocking_session from dba_waiters; ###From the above statement, holding session is the blocking session and waiting ses