Professional Documents
Culture Documents
44 rows selected.
Source Database:
PRODDB:
--------SQL> select count(*) from dba_objects
where owner= REFRESH_SCHEMA ;
COUNT(*)
---------132
SQL> select count(*) from dba_tables
where owner= REFRESH_SCHEMA ;
COUNT(*)
---------34
SELECT COUNT(*) FROM DBA_OBJECTS
WHERE OWNER= REFRESH_SCHEMA
AND OBJECT_TYPE IN( TABLE , JOB , VIEW , PACKAGE , TRIGGER , SYNONYM , FUNCTION
, PROCEDURE , TYPE )
ORDER BY OBJECT_TYPE;
SQL> SELECT COUNT(*) FROM DBA_OBJECTS
WHERE OWNER= REFRESH_SCHEMA
AND OBJECT_TYPE IN( TABLE , JOB , VIEW , PACKAGE , TRIGGER , SYNONYM , FUNCTION
, PROCEDURE , TYPE )
ORDER BY OBJECT_TYPE;
2 3 4
COUNT(*)
---------62
SELECT COUNT(*) FROM DBA_OBJECTS
WHERE OWNER= REFRESH_SCHEMA
AND OBJECT_TYPE IN
TARGET DATABASE:
TESTDB:
------------SQL> select count(*) from dba_objects
where owner= REFRESH_SCHE ; 2
COUNT(*)
---------131
SQL> select count(*) from dba_tables
where owner= APEX4_DEV ; 2
COUNT(*)
----------
34
SQL> SELECT COUNT(*) FROM DBA_OBJECTS
WHERE OWNER= REFRESH_SCHEMA
AND OBJECT_TYPE IN( TABLE , JOB , VIEW , PACKAGE , TRIGGER , SYNONYM , FUNCTION
, PROCEDURE , TYPE )
ORDER BY OBJECT_TYPE;
COUNT(*)
---------62
###Active Session History (ASH)
How to run ASHRPT.SQL script
To generate a text report of ASH information, run the ashrpt.sql script at the S
QL prompt:
@$ORACLE_HOME/rdbms/admin/ashrpt.sql
First, you need to specify whether you want an HTML or a text report.
Enter value for report_type: text
Specify the time frame to collect ASH information by first specifying the begin
time in minutes prior to the system date.
Enter value for begin_time: -10
Note: here you have to just put number in minutes eg: 10 for 10 minutes
Next, enter the duration in minutes that the report for which you want to captur
e ASH information from the begin time. The default duration of system date minus
begin time is accepted in the following example:
Enter value for duration:
Note: left blank for default value. Default value is SYSDATE
The report in this example will gather ASH information beginning from 10 minutes
before the current time and ending at the current time. Next, accept the defaul
t report name or enter a report name. The default name is accepted in the follow
ing example:
Enter value for report_name:
Using the report name ashrpt_1_0310_0131.txt
Note: Left it blank for default value.
The session history report is generated.
Purpose of ASH
ASH is way of sampling the state of sessions connected to an Oracle database in
order to monitory database load as well as drill down into any performance issue
s that may arise. Any session that is connected to the database and is waiting f
or an event that does not belong to the Idle wait class is considered as an acti
ve session.ASH maintains a fixed sized circular buffer in the database System Gl
obal Area (SGA). The fixed
sized circular buffer will be allocated during database start-up time. ASH by de
fault on an Oracle database, samples once every second and logs some 30 to 60 (d
epending on version) pieces of information on any session that is active at the