Monday, May 23, 2016

How to check Database is in restricted mode or not

Hi All,

Users are not allowed to login in restricted mode. You get ORA-01035: ORACLE only available to users with RESTRICTED SESSION privilege

Login to database and

SQL> select logins from v$instance;
.

Example:


SQL> select * from global_name;

GLOBAL_NAME
--------------------------------------------------------------------------------
TEST

SQL> Select logins from v$instance;

LOGINS
----------
RESTRICTED

SQL>


It should be ALLOWED.

Tuesday, May 3, 2016

How to compare AWR report for two time period

You can do it using awrddrpt.sql

During performance troubleshooting we need to compare the AWR report for good time and bad time. Below the step to compare the awr for two time period


Consider the time you are comparing are::::::::::


First pair of snap id's:
25 April 2016 5:00 AM SNAP ID  19102
25 April 2016 6:00 AM SNAP ID  19103


Second pair of snap id's:
29 April 2016 5:00 AM SNAP ID  19198
29 April 2016 6:00 AM SNAP ID  19199


Example:

connect to sqlplus using sysdba


sql> @?/rdbms/admin/awrddrpt.sql


Specify the First Pair of Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 19102
First Begin Snapshot Id specified: 19102

Enter value for end_snap: 19103
First End   Snapshot Id specified: 19103




Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   DB Id     Inst Num DB Name      Instance     Host
------------ -------- ------------ ------------ ------------
* 98999865678  1 TSTPRD      TSTPRD      ashish.mydomain.com
                                             
|
|
|
|
Database Id and Instance Number for the Second Pair of Snapshots
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Using 98999865678 for Database Id for the second pair of snapshots
Using          1 for Instance Number for the second pair of snapshots


Specify the number of days of snapshots to choose from
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Entering the number of days (n) will result in the most recent
(n) days of snapshots being listed.  Pressing <return> without
specifying a number lists all completed snapshots.


Enter value for num_days2: 19198

Listing the last 19198 days of Completed Snapshots



                              19275 02 May 2016 10:00      1



Specify the Second Pair of Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap2: 19199
Second Begin Snapshot Id specified: 19199

Enter value for end_snap2: 19199
Second End   Snapshot Id specified: 19199



And then you got the report to compare.