<!-- $Id: A305PDA_gen.xml,v 1.6 2007/11/21 16:24:38 mschenke Exp $ -->
<!-- ARCS: $Header: /home/cvs/repository/RDA_4/src/scripting/lib/hcve/A305PDA_gen.xml,v 1.6 2007/11/21 16:24:38 mschenke Exp $ -->
<hcve name="Oracle Portal PreInstall (Generic)" type="A" product="Portal" platform="generic">
<rule condition="==" id="11" mode="RECORD" name="SystemVariables" repeat="1" command_type="SQL">
<command><![CDATA[DEFINE runos=''
COL runos new_value runos_new
VARIABLE checkos VARCHAR2(10)
DECLARE
  oscheck VARCHAR2(25);
BEGIN
  SELECT Decode(Substr(value,1,1),'/','env','set') INTO oscheck FROM v$parameter
    WHERE Upper(name) = 'CONTROL_FILES' ;
  :checkos := oscheck;
END;
/
SELECT :checkos runos FROM dual;
HOST &&runos_new;]]></command>
<description><![CDATA[The rule lists the Operating System (OS) variables.]]></description>
<action type="negative"><![CDATA[NA]]></action>
<action type="positive"><![CDATA[NA]]></action>
</rule>
<rule condition="==" id="12" mode="RECORD" name="OSSpecifics" repeat="1" command_type="SQL">
<command><![CDATA[SELECT host_name FROM v$instance;]]></command>
<description><![CDATA[This rule lists the Operating System requirements.]]></description>
<action type="positive"><![CDATA[A fully qualified hostname includes the name of the server and its Domain. The installer requires that the fully qualified information appear in the configuration file "hosts" for your computer.
Hosts file should have the following format:
  IP_Address Fully_qualified_name Short_name Alias
  Example: 138.1.137.14 acme.us.oracle.com acme acme2
There could be Operating System patches you need to download and install before installing Oracle9iAS. O/S patches are specific to the Operating System on which 9iAS is being installed.
Oracle 9iAs does not support spanning the installation over multiple disks. Space must be available in a single disk.
  J2ee and Web Cache needs 435 MB
  Portal and Wireless needs 1.2 G
  9iAS developer Kits needs 701 MB
A TMP or SWAP space of atleast 1GB is required.
Minimum requirement of Portal and Wireles installation only is 256MB. Additional 9iAS installation products require 512MB
Oracle 9iAS Installation Guide included with the product CDs received from Oracle Corporation. An on-line version of the same is available at: http://otn.oracle.com/docs/products/ias/content.html]]></action>
</rule>
<rule condition="==" id="13" mode="RECORD" name="PortalRepository" repeat="1" command_type="SQL">
<command><![CDATA[SELECT banner FROM v$version;]]></command>
<description><![CDATA[This rule obtains the Portal Repository Database version.]]></description>
<action type="negative"><![CDATA[NA]]></action>
<action type="positive"><![CDATA[For additional information please see:<p>
Oracle MetaLink Note: 199101.1 How to install Portal 9.0.2.x in a Remote Database<br>
Oracle MetaLink Note: 218106.1 Install Oracle9iAS Portal 9.0.2.x Oracle 9.2.x Database]]></action>
</rule>
<rule condition="==" id="21" minimum="%12%:7777" mode="RECORD" name="getInfraInfo" repeat="1" command_type="PROMPT">
<command><![CDATA[Infrastucture Servername:Port]]></command>
<description><![CDATA[Input Infrastructure Servername and Port]]></description>
</rule>
<rule condition="==" id="22" mode="RECORD" name="InfraHttp" repeat="1" command_type="SQL">
<command><![CDATA[SET SERVEROUTPUT ON SIZE 10000 FORMAT WOR
DEFINE InfraServerURL=%21%;
SET DEFINE ON
DECLARE
  req   utl_http.req;
  resp  utl_http.resp;
  name  VARCHAR2(256);
  value VARCHAR2(1024);
  iURL  VARCHAR2(100) := 'http://&InfraServerURL';
  cURL  VARCHAR2(100);
  comp  VARCHAR2(200);
BEGIN
  For x IN 1..3 LOOP
  SELECT Decode (x,1,iURL,2,iURL||'/pls/orasso/orasso.wwsso_app_admin.ls_login',3,iURL||'/oiddas') INTO cURL FROM dual;
  SELECT Decode (x,1,'HTTP Server Listener',2,'Single Sign On',3,'Internet Directory') INTO comp FROM dual;
  dbms_output.put_line(x||'. Testing '||comp||': ');
  req := utl_http.begin_request(cURL);
  utl_http.set_header(req, 'User-Agent', 'Mozilla/4.0');
  resp := utl_http.get_response(req);
  dbms_output.put_line('HTTP response status code: ' || resp.status_code);
  dbms_output.put_line('HTTP response reason phrase: ' || resp.reason_phrase);
  FOR i IN 1..utl_http.get_header_count(resp) LOOP
    utl_http.get_header(resp, i, name, value);
    dbms_output.put_line(name || ': ' || Substr(value,1,225));
  END LOOP;
  dbms_output.put_line('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
  utl_http.end_response(resp);
END LOOP;
END;
/]]></command>
<description><![CDATA[This rule ensures that Oracle9iAS HTTP Server of Infrastructure is started before installing Oracle9iAS Portal.]]></description>
<action type="negative"><![CDATA[Verify if Oracle HTTP Server is Up and runnin
Enter the following URL:  http://servername:port/
If you cannot access this page verify the status of Oracle HTTP Server. You can do this from Oracle Enterprise manager website or from command line using DCM:
  $ dcmctl getstate -v
Starting services using EM site:
EM Site is accessed via a browser using the following URL:
  http://servername:1810
For the correct URL, specific to your installation, refer to setupinfo.txt file located in: $ORACLE_HOME/Apache/Apache
If both Infrastructure and Middle-tier are installed on the same server, then $ORACLE_HOME is Infrastructure $ORACLE_HOME.
- Navigate to the Infrastructure Farm.
- Select the service and Start.
Starting services using DCM:
- Start HTTP Server and OC4J
  $ dcmctl start -v
- Start HTTP Server only
  $ dcmctl start -ct ohs -v
- Start OC4J only
  $ dcmctl start -ct oc4j -v
For more information, please see:
Oracle MetaLink Note:200475.1 9iAS Release 2 (9.0.2) Start/Stop Instructions
Oracle MetaLink Note:226750.1 Post Install checks for the Oracle9i Application Server Release 2 Infrastructure Installation]]></action>
<action type="positive"><![CDATA[For additional information please see: <p>
Oracle MetaLink Note:226750.1 Post Install checks for the Oracle9i Application Server Release 2 Infrastructure Installation]]></action>
</rule>
<rule condition="&gt;=" id="31" minimum="64" mode="VERIFY" name="initParamJavaPoolSize" repeat="1" command_type="SQL">
<command><![CDATA[SELECT value/1024/1024 FROM v$parameter
WHERE Lower(name) = 'java_pool_size';]]></command>
<description><![CDATA[This rule checks the database resources. Portal repository installation requires higher database resources during the installation. These may be reduced after the installation or configuration of Portal in the Database.]]></description>
<action type="negative"><![CDATA[Modify the initialization parameter file (spfile.ora/ init.ora) and restart the database. For more information, see
Oracle MetaLink Note: 202561.1 Recommended Database Resources and Tablespace size required to Install Portal v902]]></action>
<action type="positive"><![CDATA[For more information, see Oracle MetaLink Note: 202561.1 Recommended Database Resources and Tablespace size required to Install Portal v902]]></action>
</rule>
<rule condition="==" id="32" minimum="0" mode="VERIFY" name="initParamLargePoolSize" repeat="1" command_type="SQL">
<command><![CDATA[SELECT value/1024/1024 FROM v$parameter
WHERE Lower(name) = 'large_pool_size';]]></command>
<description><![CDATA[This rule checks the database resources. Portal repository installation requires higher database resources during the installation. These may be reduced after the installation or configuration of Portal in the database.]]></description>
<action type="negative"><![CDATA[Modify the initialization parameter file (spfile.ora/init.ora) and restart the database. For more information, see Oracle MetaLink Note: 202561.1 Recommended Database Resources and Tablespace size required to Install Portal v902]]></action>
<action type="positive"><![CDATA[For more information, see Oracle MetaLink Note: 202561.1 Recommended Database Resources and Tablespace size required to Install Portal v902]]></action>
</rule>
<rule condition="&gt;=" id="33" minimum="100" mode="VERIFY" name="initParamSharedPoolSize" repeat="1" command_type="SQL">
<command><![CDATA[SELECT value/1024/1024 FROM v$parameter
WHERE Lower(name) = 'shared_pool_size';]]></command>
<description><![CDATA[This rule checks the database resources. Portal repository installation requires higher database resources during the installation. These may be reduced after the installation or configuration of Portal in the database.]]></description>
<action type="negative"><![CDATA[Modify the initialization parameter file (spfile.ora/init.ora) and restart the database. For more information, see Oracle MetaLink Note: 202561.1 Recommended Database Resources and Tablespace size required to Install Portal v902]]></action>
<action type="positive"><![CDATA[For more information, see Oracle MetaLink Note: 202561.1 Recommended Database Resources and Tablespace size required to Install Portal v902]]></action>
</rule>
<rule condition="&gt;=" id="34" minimum="8192" mode="VERIFY" name="initParamDbBlockSize" repeat="1" command_type="SQL">
<command><![CDATA[SELECT value FROM v$parameter
WHERE Lower(name) = 'db_block_size';]]></command>
<description><![CDATA[This rule checks the database resources. Portal repository installation requires higher database resources during the installation. These may be reduced after the installation or configuration of Portal in the database.]]></description>
<action type="negative"><![CDATA[Modify the initialization parameter file (spfile.ora/init.ora) and restart the database. For more information, see Oracle MetaLink Note: 202561.1 Recommended Database Resources and Tablespace size required to Install Portal v902]]></action>
<action type="positive"><![CDATA[For more information, see Oracle MetaLink Note: 202561.1 Recommended Database Resources and Tablespace size required to Install Portal v902]]></action>
</rule>
<rule condition="&gt;=" id="35" minimum="50" mode="VERIFY" name="initParamDbCacheSize" repeat="1" command_type="SQL">
<command><![CDATA[SELECT value/1024/1024 FROM v$parameter
WHERE Lower(name) = 'db_cache_size';]]></command>
<description><![CDATA[This rule checks for the database resources. Portal repository installation requires higher database resources during the installation. These may be reduced after the installation or configuration of Portal in the database.]]></description>
<action type="negative"><![CDATA[Set the DB_CACHE_SIZE parameter value to a minimum of 52428800 bytes (50MB). Modify the initialization parameter file (spfile.ora/init.ora) and restart the database.]]></action>
<action type="positive"><![CDATA[For more information, see Oracle MetaLink Note: 202561.1 Recommended Database Resources and Tablespace size required to Install Portal v902]]></action>
</rule>
<rule condition="&gt;" id="36" minimum="150" mode="VERIFY" name="initParamProcesses" repeat="1" command_type="SQL">
<command><![CDATA[SELECT value FROM v$parameter
WHERE Lower(name) = 'processes';]]></command>
<description><![CDATA[This rule checks the database resources. Portal repository installation requires higher database resources during the installation. These may be reduced after the installation or configuration of Portal in the database.]]></description>
<action type="negative"><![CDATA[Modify the initialization parameter file (spfile.ora/init.ora) and restart the database.]]></action>
<action type="positive"><![CDATA[For more information, see Oracle MetaLink Note: 202561.1 Recommended Database Resources and Tablespace size required to Install Portal v902]]></action>
</rule>
<rule condition="&gt;=" id="37" minimum="165" mode="VERIFY" name="initParamSessions" repeat="1" command_type="SQL">
<command><![CDATA[SELECT value FROM v$parameter
WHERE Lower(name) = 'sessions';]]></command>
<description><![CDATA[This rule checks the database resources. Portal repository installation requires higher database resources during the installation. These may be reduced after the installation or configuration of Portal in the database.]]></description>
<action type="negative"><![CDATA[The SESSIONS parameter value is expected to be at least 110% of the value set for the PROCESSES parameter. Modify the initialization parameter file (spfile.ora/init.ora) and restart the database.]]></action>
<action type="positive"><![CDATA[For more information, see Oracle MetaLink Note: 202561.1 Recommended Database Resources and Tablespace size required to Install Portal v902]]></action>
</rule>
<rule condition="==" id="38" minimum="AMERICAN" mode="VERIFY" name="initParamNlsLanguage" repeat="1" command_type="SQL">
<command><![CDATA[SELECT value FROM v$parameter
WHERE Lower(name) = 'nls_language';]]></command>
<description><![CDATA[This rule checks for the database resources. Portal repository installation requires higher database resources during the installation. These may be reduced after the installation or configuration of Portal in the database.]]></description>
<action type="negative"><![CDATA[Modify the initialization parameter file (spfile.ora/init.ora) and restart the database. For more information, see Oracle MetaLink Note: 202561.1 Recommended Database Resources and Tablespace size required to Install Portal v902]]></action>
<action type="positive"><![CDATA[For more information, see
Oracle MetaLink Note: 202561.1 Recommended Database Resources and Tablespace size required to Install Portal v902]]></action>
</rule>
<rule condition="&gt;" id="41" minimum="10000" mode="VERIFY" name="javaObjectsSYS" repeat="1" command_type="SQL">
<command><![CDATA[SELECT count(*) FROM dba_objects
WHERE object_type LIKE 'JAVA%'
AND owner = 'SYS';]]></command>
<description><![CDATA[This rule checks the number of Java objects in the SYS schema.]]></description>
<action type="negative"><![CDATA[Oracle JVM is either not enabled or configured incorrectly in the database. At least 11125 Java objects are expected in the SYS schema.]]></action>
<action type="positive"><![CDATA[The total number of Java objects in the SYS schema in an Oracle 9i database is expected to be at least 11125.]]></action>
</rule>
<rule condition="&gt;=" id="42" minimum="863" mode="VERIFY" name="javaObjectsORDSYS" repeat="1" command_type="SQL">
<command><![CDATA[SELECT count(*) FROM dba_objects
WHERE object_type LIKE 'JAVA%'
AND owner = 'ORDSYS';]]></command>
<description><![CDATA[This rule checks the number of Java objects in the ORDSYS schema.]]></description>
<action type="negative"><![CDATA[Oracle JVM is either not enabled or configured incorrectly in the database. At least 863 Java objects are expected in the ORDSYS schema.]]></action>
<action type="positive"><![CDATA[The total number of Java objects in the ORDSYS schema in an Oracle 9i database is expected to be at least 863.]]></action>
</rule>
<rule condition="&gt;=" id="43" minimum="40" mode="VERIFY" name="javaObjectsWKSYS" repeat="1" command_type="SQL">
<command><![CDATA[SELECT count(*) FROM dba_objects
WHERE object_type LIKE 'JAVA%'
AND owner = 'WKSYS';]]></command>
<description><![CDATA[This rule checks the number of Java objects in the WKSYS schema.]]></description>
<action type="negative"><![CDATA[Oracle JVM is either not enabled or configured incorrectly in the database. At least 40 java objects are expected in the WKSYS schema.]]></action>
<action type="positive"><![CDATA[The total number of Java objects in the WKSYS schema in an Oracle 9i database is expected to be at least 40.]]></action>
</rule>
<rule condition="==" id="44" mode="RECORD" name="EMWebsite" repeat="1" command_type="SQL">
<command><![CDATA[SET SERVEROUTPUT ON SIZE 10000 FORMAT WOR
DEFINE EMWebsiteHost=%12%;
SET DEFINE ON
DECLARE
  req   utl_http.req;
  resp  utl_http.resp;
  name  VARCHAR2(256);
  value VARCHAR2(1024);
  iURL  VARCHAR2(100) := 'http://&EMWebsiteHost:1810/';
BEGIN
  req := utl_http.begin_request(iURL);
  utl_http.set_header(req, 'User-Agent', 'Mozilla/4.0');
  resp := utl_http.get_response(req);
  IF resp.status_code = '200' THEN
    dbms_output.put_line('Ensure Enterprise Manager Website(EMCTL) is shutdown before installation.');
    dbms_output.put_line('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
    dbms_output.put_line('HTTP response status code: ' || resp.status_code);
    dbms_output.put_line('HTTP response reason phrase: ' || resp.reason_phrase);
    FOR i IN 1..utl_http.get_header_count(resp) LOOP
      utl_http.get_header(resp, i, name, value);
      dbms_output.put_line(name || ': ' || Substr(value,1,225));
    END LOOP;
  ELSE
    dbms_output.put_line('Enterprise Manager Website(EMCTL) is not started');
  END IF;
END;
/]]></command>
<description><![CDATA[This rule ensures that the Enterprise Manager Web site is shut down.]]></description>
<action type="positive"><![CDATA[If Application Server is being installed on a Server with an existing 9i product (Oracle Server or Application Server) then Enterprise Manager (EMCTL) is shutdown before installation.
Set the infrastructure environment:
	$ emctl stop
or
	Services Control Panel => Stop the EMWebsite Services]]></action>
</rule>
</hcve>
