Tuesday, August 19, 2008

Httpd

$ httpd -version
Server version: Oracle HTTP Server Powered by Apache/1.3.19 (Unix)

There are some core files which control the behavior of the Oracle HTTP Server. Again most of these files are autoconfig managed , so changes to them should be via the Oracle Applications Manager and autoconfig must be run to propagate these changes to the respective config files.

httpd.conf
This is manin config file for the Apache based OHS. It contains all vital configuration information for the OHS like the port on which the server is running, the portocol used etc.A detailed list of derivates supported by the httpd.conf file can be found in the apache documentation. Again as mentioned before this file is also autoconfig managed.

httpds.conf
The httpds.conf file is similar to the httpd.conf. The httpds.conf filers comes into use when apache runs in the Secure Sockets Layer implementation(SSL).Another way make sure if httpds.conf is being used in your environment or not is to open up the apachectl file in the Apache/bin directory and check if the httpds executable is being used along with the httpd executale. something similar to below

HTTPD=/d01/sam/samsora/iAS/Apache/Apache/bin/httpds

access.conf
The access.conf file is natively used to specify the acess control files for the HTTP server. But in Oracle Implementation of Apache server this file is essentially kept empty and instead the AccessConfig directive in httpd.conf is used.

url_fw.conf
The URL firewall or the url_fw.conf file implementation is used to provide an additional layer of security on the external tier.This file comes into play once you define a node as external. After this is enabled only the urls specified in the url_fw.conf files will be accessible through the external tier in a DMZ architecture.Once enabled the httpd.conf file will have a link to include this file.

security.conf
This file contains the security configuration for the OHS.It has information regarding security auditing and also location of the security audit log file location.

oracle-apache.conf
This a file that stores the configuration information for various supported modules in Oracle applications like imeeting , OEM etc.It will contain entries to include these configuration files. These module specific configuration file like the imeeting.conf will also reside in the Apache/conf directory on the application server.

CRONTAB Part 2

Actually it is called 'cron daemon'. Cron is an automatic task machine. You will use it on your Unix or Linux operating systems for doing some tasks at specific intervals with out your intervention every time. You set the clock and forget. The cron daemon runs the work for you.
What is cron tab?
'Cron tab(CRON TABle)' is a text file that contains a series of cron functions.
What cron will do for you?
>>>If you want to send your email cources to your subscribers at 11.30 night, you will set the cron job on your server.And your cron manager sends the one email every day at 11.30 until all the emails will be finished.

If you want to send them on Sundays, you can schedule it with your cron.

>>>You can schedule it to delete your website members with expired accounts.

>>>You can schedule it to recieve an update on your subscribers from your mailing list manager.

>>>You can check your links on other websites in link exchange programms.
Have your webserver cron enabled?
Have you seen any icon like this?

OR

OR
Have you seen a text link like 'Cron Manager' or 'Cron jobs'?
If you see one, then you are cron enabled.
Ask your host about your cron availability. Some host allows cron with out graphical interface. You have to access it through telnet. If you are hosted on Virtual hosting domains then your system administrator has to set up your cron tabs for you.
What are the components of cron?
=Field====Value====Description=
minute====00-59====exact minute the cron executes
hour======00-23====hour of the day the cron executes(0 means midnight)
day=======01-31====day of the month the cron executes
month=====01-12====month of the year the cron executes
weekday===00-06====day of the week the cron executes(Sunday = 0, Monday = 1, Tuesday = 2, and so forth)
command===Special==complete sequence of commands to execute
Examples how to set cron:
If you have installed a cgi script in your cgi-bin directory called members.cgi and wanted to run this program each night as 11.30 PM as in above example.

You would setup the following crontab line:

30 23 * * * /home/username/www/cgi-bin/members.cgi

30--represents the minute of cron work
23--represents the hour of the day
The * represent every day, month, and weekday.

If you want to set the cron job every sunday at midnight 11.30 PM then it would be like:

30 23 * * 0 /home/username/www/cgi-bin/members.cgi
0--represents the Sunday.
If you want the cron job to run at 1:00 and 2:00 A.M then you can set it like:

* 1,2 * * * /home/username/www/cgi-bin/members.cgi

This runs your cron at 1 and 2 A.M every day, every month and every week.

If you want to run the above task only from Monday to Friday then set it like:

* 1,2 * * 1-5 /home/username/www/cgi-bin/members.cgi
Setting up the cron:
You will be in one of these situations.

ONE:This would be your first cron tab function.

SECOND:You already have cron tab file on your server running one or more cron functions for you.

In any of the above two situations you can further proceed by TWO METHODS.
METHOD ONE:Using Cron tab manager:
If you have a cron tab manager in your webpanel, it will be easy for you to set the cron tab function. You can click on the icon to open cron manager.
There will be some box like text area where you can enter the the perl file path that you want to run the cron job.



Your cron manager may be different but basically it is easy to set up cron job with your cron manager. I highly recommend this unless you want to get to know about the Second Telnet Method.
METHOD TWO:Uploading 'cron.txt' file and checking using telnet:
Cron Commands:

crontab filename
Install filename as your crontab file. On many systems, this command is executed simply as crontab filename (i.e., without the -a option).

crontab -e
Edit your crontab file, or create one if it doesn't already exist.

crontab -l
Display your crontab file.

crontab -r
Remove your crontab file.

crontab -v
Display the last time you edited your crontab file. (This option is only available on a few systems.)
How to do it?
Basically FOUR steps:
• Create cron.txt
• Upload
• Install the txt file as cron file with the command 'crontab cron.txt'
• Check your cron file
1. Open your notepad on your computer and write cron job following the guidelines explained above under 'What are the components of cron?'. For example - If you write your cron job like this:

30 23 * * * /home/username/www/cgi-bin/members.cgi

After writing the above cron job PRESS return key so that a blank line will be there below the cron job line.
2. Always use absolute path for the command line. Turn off the 'Word Wrap' feature with the Notepad.
3. Save the file as 'cron.txt'. Upload it to your root directory ('/'). Or ask your webhost where to upload the cron files. Upload in ASCII mode.

4. Now telnet into your server. (Access easy to follow telnet tutorial, cgi tutorial, cgi debugging tutorial, My sql tutorial and many more...)
5. At command prompt type -

crontab cron.txt

Press Enter.

You will be back at command prompt.

Then type (Small L):

crontab -l

Press Enter.

You will see the list of cron jobs that you have entered in cron.txt.

That's it!!
Cron emails you everytime it runs. How to stop it?
Add this tag at the end of your cron job:

>/dev/null 2>&1

Taking the above example your cron job looks like:

30 23 * * * /home/username/www/cgi-bin/members.cgi>/dev/null 2>&1
TIPS in setting up your cron jobs:
>>>Ask your host about the procedure if you are not sure of a thing.

>>>Check your cron once in a while.For example you set your cron to send your ezine at 11.30 PM. Then you subscribe yourself to see it is working or not. Later you can unsubscribe yourself.

>>>If you are creating cron file first time and uploading it to your server, do it in ASCII mode.

>>>If you are setting the script path in your schedule, the path SHOULD be from your hosts server root. NOT your domain path.

Ex:/home/user/www/cgi-bin/scriptname.cgi

is correct.

http://www.yourdomain.com/cgi-bin/scriptname.cgi

is incorrect.

>>>Script names are case sensitive on Unix. So be careful in entering the script name.

>>>If you are creating cron.txt file and uploading, you should not allow spaces within 1-5 components except between them. (For example 10,30 * * * * is correct not 10 ,30 * * * *)

Tuesday, August 12, 2008

DB Links

Tables dba_db_links, all_db_links, dbms_dblink
Syntax :
CREATE [SHARED] [PUBLIC] DATABASE LINK
CONNECT TO CURRENT_USER
USING '';
Service name
Ex:
conn_link =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = perrito2)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orabase)
)
)
EX:
CREATE DATABASE LINK conn_user USING 'conn_link';
Closing the link
Alter session close the database link
Drop the link
Drop database link


set pages 0
spool drop_gcgx_links.sql;
select 'drop database link ' || db_link || ';' from dba_db_links where owner = 'GCGX';
spool off


drop public database link TCAS_QUOTE.WORLD ;
create public database link TCAS_QUOTE.WORLD connect to tcquote identified BY quote45 using 'TCASDEV.world'

Thursday, August 7, 2008

ADPATCH

ADPATCH OptionsAfter having talked about the best practices related to applications patching. In today’s post i will talk about some frequently used options with adpatch. It is important to note here that the options described here are for information purposes only and you must understand them completely before using them on your system. Also any special instructions specified in the patch readme file automatically overrides the information cointained in this post.You can execute adpatch by logging in as the applications OS user and sourcing the appropriate environment file.
#su - applmgr $cd SAMAPPL
$. ./APPSORA.env
$adpatch
Running a patch in test modeYou can use the apply clause with adpatch to specify weather to run the patch in TEST mode or not, when you run the patch in test mode it does not do any changes but runs generates a log file with all the actions it would have performed. Applications should be maintenance mode.$adpatch apply=ny The default is apply=y
Pre-install ModeYou can also run a patch in pre install mode, this would be done normally during an upgrade or consolidated update. When a patch is applied in a preinstall mode the all the AD utilities are updated before the upgrade or update.$adpatch preinstall=yThe default is preinstall=n

AutoconfigYou can use the options=noautoconfig top specify autopatch that you do not wish to run autoconfig as a part of the patch application. This can be useful when applying a large number of patches when they are not merged. By default autoconfig is run as a part of adpatch. $adpatch options=noautoconfig

CheckfileThe chekfile option of adpatch tells adpathc to check for already executed exec, SQL, and exectier commands.You can use options=nocheckfile skips this check, however this can cause performance overheds so should be used only when specified.$adpatch options=nocheckfile

Compile DatabaseBy defaulty autopatch compiles the invalid objects after the patch application, in case you wish not to do so you can specify options=nocompiledb along with autopatch.$adpatch options=nocompiledb

Compile JSPBy defaulty autopatch compiles the java server pages (jsp) after the patch application, in case you wish not to do so you can specify options=nocompilejsp along with autopatch.$adpatch options=nocompilejsp

Copy PortionIf you wish adpatch not to execute the commands present in the copy driver portion of the patch you can use the options=nocopyportion.$adpatch options=nocopyportion

Database PortionIf you wish adpatch not to execute the commands present in the database driver portion of the patch you can use the options=nodatabaseportion.$adpatch options=nodatabaseportion

Generate PortionIf you wish adpatch not to execute the commands present in the generate driver portion of the patch you can use the options=nogenerateportion$adpatch options=nogenerateportion

Maintenance ModeIf you wish to apply a patch regardless of the system being in maintenance mode you can use options=hotpatch.$adpatch options=hotpatch

Integrity CheckIf you wish to check the integrity of the patch you can use the options=integrity. Since metalink patches are pre checked for their integrity it is generally not required to do an explicit check and the default value is nointegrity.$adpatch options=integrity

Maintain MRCYou can use the maintainmrc option to specify weather you wish adpatch to execute the Maintain MRC schema as a part of the patch application or not. By default maintain MRC is done for standard patches and is disbaled for tarnslation and documentation patches.$adpatch options=nomaintainmrc

Pre requisite Patch CheckIf you wish adpatch not to check for pre requisite patches before application of the main patch you can use options=noprereq.By default pre requsite checking is enabled.
$adpatch options=noprereq

Validate SchemasIf you wish adpatch to explicitly validate all the registed schems by making a connection you can use options=validate. By default this validation is not performed.$adpatch options=validate

Java ClassesIf you wish adpatch not to copy new java classes from the patch you can use options=nojcopy.By default java classes are copied.$adpatch options=nojcopy

Force CopyBy default adpatch copies the files without check the version of the existing files already present on the system.If you do not wish the newer version of the file to be replaced by the older version contained in the patch use options=noforcecopy.$adpatch options=noforcecopy

RelinkingIf you wish adpatch not do perform relinking you can use options=nolink.$adpatch options=nolink

Generate FormsIf you wish adpatch not to generate the forms files you can specify options=nogenform.$adpatch options=nogenform

Generate ReportsIf you wish adpatch not to generate the report files you can specify options=nogenrep.$adpatch options=nogenrepYou could specify multiple options at the command line using the , delimiter.$adpatch options=hotpatch,nojcopy

ADPATCH Utility Has An OPTIONS=NOREVCACHE. Will a Newer Version Of A Package Be Overwritten By An Older Version? [ID 150964.1]



The filesystem-level version checking will not overwrite a newer version of the 
file with an older version.  Using options=norevcache will cause the same 
packages to be re-created at their current revision, not create a lower 
revision of the packages.



user level export and import

expdp parfile=PLCT170.par oracle@uslp123sd7dfcvxsza > more PLCT050.par userid= "/ as sysdba" dumpfile=T050.dmp logfile=expdpT0...