This directory contains scripts for setting up SQL Activity manually.

Script Descriptions
-------------------
dbconfig.sql - master script that sets up SQL Activity in target database
dbunconfig.sql - script to drop response and reuse objects, statspack

above scripts internally run the following scripts.

dbmon.sql - grant privileges to dbsnmp
response.plb - sql response time objects
spset.sql - script called after statspack is installed

Requirements to run the script 
------------------------------
1. Have perfstat tablespace with at least 100MB, if performing advanced install.

To configure the database
----------------------------------
run sqlact.sql in sqlplus 
  sqlplus /nolog
  SQL> @dbconfig.sql <connect_string> <basic_install> <dbm_password> <perfstat_password> <default_tablespace> <temp_tablespace> 

where 
connect_string - If installing and configuring STATSPACK is required, then the user needs to connect as SYSDBA. If only installing and configuring DBSNMP user then a NORMAL role can be used.

basic_install - "Y" if the user wants to only install and configure DBSNMP user. If the user also wants to install and configure STATSPACK then choose "N"

dbm_password - password for DBSNMP user.
The following options can be set as "DEF" for basic_install="Y"

perfstat_password - password for PERFSTAT user.
default_tablespace - tablespace to be used for PERFSTAT user. The minimum size is 100MB.
temp_tablespace - temporary tablespace.

eg:  @dbconfig.sql system/<system_password> Y dbsnmp DEF DEF DEF
 @dbconfig.sql "sys/<sys_password> as sysdba" N dbsnmp perfstat PERFSTAT_TS TEMP


Uninstall objects
-----------------
run dbunconfig.sql in sqlplus using SYSDBA role.
eg: 
  sqlplus /nolog
  SQL> @dbunconfig.sql "sys/<sys_password> as sysdba"

After successfully running either dbconfig.sql or dbunconfig.sql the user needs to recompute dynamic properties of the agent.
emctl reload agent dynamic properties. 

You can run these scripts using emcli. For more information refer to Enterprise Manager Administrative guide.
