Search This Blog

Thursday, January 26, 2012

Basic Shell Script Commands



# Create Directory
mkdir <dirname>
# Remove Directory
rmdir <dirname>
#remove folder with files
rm -r -f <dirname>
# Change Directory
cd <newpath>
# Create new file
vi <newfile.ext>
#insert data into file
vi <openfilename.ext>
esc i <make changes>
#Save file
esc :wq enter
# exit without saving changes
esc :q! enter
# open existing file
vi <existingfilename.ext>
#remove file
rm <filename.ext>
# copy file with same name
cp <sourcedir>/<sourcefilename.ext> <destinationdir>
# copy file with new name
cp <sourcedir>/<sourcefilename.ext> <destinationdir>/<newfilename.ext>
# Move file with same name
mv <sourcedir>/<sourcefilename.ext> <destinationdir>
# move file with data appended to filename in the front
mv <sourcedir>/<sourcefilename.ext> <destinationdir>/`date+%H%M%d%m%y`<filename.ext>
#print line
echo “your text here to print”
#print date
echo `date`

Wednesday, January 4, 2012

Value Formats



The format type you specify in the Format Type field is the format for the segment or parameter value. If you use a validation table for this value set, this format type corresponds to the format type of the value column you specify in the Validation Table Information region, regardless of whether you also specify a hidden ID column.
Because your changes affect all flexfields and report parameters that use the same value set, you cannot change the format type of an existing value set.
All of these format options affect both the values you can enter in the Segment Values windows and the values you can enter in flexfield segments and report parameters.
Format Types
Below are the available Format Types:
Char
Char lets you enter any character values, including letters, numbers, and special characters such as # $ % ( ) . / , & and *. If you choose this format type but enter values that appear to be numbers, such as 100 or 20, you should be aware that these values will still behave as character values. For example, the value 20 will be "larger" than the value 100. If you want such values to behave (and be sorted) more like numeric values, you should check the Numbers Only check box or check the Right-justify and Zero-fill Numbers check box. If you choose this format type but enter values that appear to be dates, such as DD-MON-RR or DD-MON-YYYY, you should be aware that these values will still behave as character values. For example, the value 01-SEP-2007 will be "larger" than the value 01-DEC-2007. If you want such values to behave (and be sorted) like date values, you should use the Standard Date format type.
If you use the Char format type, you can also specify character formatting options. See: Character Formatting Options.
Number
Number lets you ensure that users enter a numeric value. The numeric format allows a radix character ('D' or decimal separator) and a plus or minus sign (although the plus sign is not displayed in the segment). All leading zeros and plus signs are suppressed, and entered data behaves as in a NUMBER field in Oracle Forms or a NUMBER column in the database. Note that this format behaves differently than a "Numbers Only" format, which is actually a character format.
Real numbers are stored with '.' internally and displayed using the current radix separator. Group separators are not used by flexfields. This is also true for Char format, Numbers Only value sets.
Once you have chosen a Number format, you can enter a value in the Precision field. Precision indicates the number of places that should appear after the decimal point in a number value. For example, to display 18.758, you choose a precision of 3. Similarly, to display 1098.5, you choose a precision of 1. To display an integer such as 7, you choose a precision of 0.
Time
Time enforces a time format such as HH24:MI, depending on the maximum size for this value set. The following table lists the supported time formats and value set maximum sizes you can use:
Maximum Size
Time Format
5
HH24:MI
8
HH24:MI:SS
You can use corresponding default values for segments whose value sets use one of the above sizes. You define these defaults when you define your segments or report parameters.
These values are treated and sorted as time values.
Standard Date
Standard Date enforces the user's preferred date format. Users see the dates in the dates in their preferred format while entering data, querying data and using the List of Values.
For flexfield segments using value sets with this format type, the date values are stored in the application tables in the format YYYY/MM/DD HH24:MI:SS if the columns where the values are stored are of type VARCHAR2. For report parameters using these value sets the concurrent manager will pass dates in this format to the report. Because there is no time component in the Standard Date type value set values, the time component is 00:00:00.
Note: The underlying column size must be at least 20.
Value sets with the "Standard Date" and "Standard DateTime" formats can have validation types of "None", "Table", "Independent", "Dependent", "Special", or "Pair".i.
You can specify minimum and maximum boundary values for these value sets in the current NLS date format while defining the value set.
Table validated value sets using the "Standard Date" or "Standard DateTime" formats cannot use the ID column. The VALUE column should be a DATE column or a VARCHAR2 column (which should have the date values in the canonical format YYYY/MM/DD HH24:MI:SS). If the existing values in the table are not in the canonical format you should create a view that will do the conversion to the canonical format or to a date column and the value set should be defined on this view.
These values are treated and sorted as date values, so 01-DEC-2007 is "larger" than 01-SEP-2007.
Standard DateTime
Standard DateTime enforces the user's date/time format. Users see the dates in the dates in their preferred format while entering data, querying data and using the List of Values.
For flexfield segments using value sets with this format type, the date values are stored in the application tables in the format YYYY/MM/DD HH24:MI:SS if the columns where the values are stored are of type VARCHAR2. For report parameters using these value sets the concurrent manager will pass dates in this format to the report.
Note: The underlying column size must be at least 20.
Value sets with the "Standard Date" and "Standard DateTime" formats can have validation types of "None", "Table", "Independent", "Dependent", "Special", or "Pair".
You can specify minimum and maximum boundary values for these value sets in the current session's date format while defining the value set.
Table validated value sets using the "Standard Date" or "Standard DateTime" formats cannot use the ID column. The VALUE column should be a DATE column or a VARCHAR2 column (which should have the date values in the canonical format YYYY/MM/DD HH24:MI:SS). If the existing values in the table are not in the canonical format you should create a view that will do the conversion to the canonical format or to a date column and the value set should be defined on this view.
These values are treated and sorted as date-time values, so 01-DEC-2007 00:00:00 is "larger" than 01-SEP-2007 00:00:00.
Date
Attention: Date and DateTime value set formats will be obsolete in a future release and are provided for backward compatibility only. For new value sets, use the the format types Standard Date and Standard DateTime.
Date enforces a date format such as DD-MON-RR or DD-MON-YYYY, depending on the maximum size for this value set. The following table lists the supported date formats and value set maximum sizes you can use:
Maximum Size
Date Format
9
DD-MON-RR
11
DD-MON-YYYY
You can use corresponding default values for segments whose value sets use one of the above sizes. You define these defaults when you define your segments or report parameters.
These values are treated and sorted as date values, so 01-DEC-2007 is "larger" than 01-SEP-2007.
Note: Date value sets use a fixed date format depending on their maximum size regardless of the user's date format.
DateTime
Attention: Date and DateTime value set formats will be obsolete in a future release and are provided for backward compatibility only. For new value sets, use the the format types Standard Date and Standard DateTime.
DateTime enforces a date format such as DD-MON-RR HH24:MI, depending on the maximum size for this value set. The following table lists the supported date-time formats and value set maximum sizes you can use for DateTime:
Maximum Size
Date Format
15
DD-MON-RR HH24:MI
17
DD-MON-YYYY HH24:MI
18
DD-MON-RR HH24:MI:SS
20
DD-MON-YYYY HH24:MI:SS
You can use corresponding default values for segments whose value sets use one of the above sizes. You define these defaults when you define your segments or report parameters.
These values are treated and sorted as date-time values, so 01-DEC-2007 is "larger" than 01-SEP-2007.
Note: Date value sets use a fixed date format depending on their maximum size regardless of the user's date format.
Value Set Maximum Size
This size represents the longest value you can enter into a segment that uses this value set, as well as the longest Display Size you can specify when you define your flexfield segment or report parameter.
Note: This size is the number of bytes, not characters.
In most cases, this maximum size cannot exceed the size of the segment column in the underlying table for the flexfield that uses this value set. If you set the maximum size longer than that column size, you cannot choose this value set when you define your flexfield segments or report parameters.
If you define your segments or report parameters using a Display Size less than this maximum size, then your pop-up window displays the leftmost characters of the value in the segment. Your user scrolls through the segment to see any remaining characters.
For report parameters, the largest maximum size you can use is 240.
If your Format Type is Standard Date, your maximum size is 11. If your Format Type is Standard DateTime, you maximum size is 20
If you are defining a value set that uses a validation table, your maximum size should reflect the size of the column you specify as your value column. The maximum size must also be equal to or less than the width of the destination segment column. Therefore, after you choose your value column size, you may get a message instructing you to modify the value set maximum size to match your value column width.
However, if you also specify a hidden ID column for your value set, the flexfield determines if the hidden ID value will fit into the underlying column rather than the value column. For example, if you specify your maximum size as 60, which is also the size of your value column, but you also specify a hidden ID column whose size is 15, you could still use that value set for a flexfield whose underlying segment column size is only 20. Such value sets do appear in the value set list of values you see when you define your flexfield segments or report parameters.
Precision
For value sets that contain numeric values (Number format, or Character format with Numbers Only selected), this attribute represents the number of digits after the radix character. Values are stored with exactly this number of digits following the radix character, with zeroes added or rounding applied as needed. If this field is left empty ("NULL precision"), then the radix character may appear anywhere in the value, as long as the other size and value constraints are met.
Character Formatting Options
The following are the available character formatting options:
Numbers Only (0-9)
With the Numbers Only option, you may not enter the characters A-Z, a-z, or special characters such as ! , @, or # , in the segment that uses this value set. You may enter only the values 0-9, minus signs, plus signs, the radix separator (D), and the group separator (G) in any segment or parameter that uses this value set. Note also that your Char format type value set remains Char even without alphabetic characters, and your values will behave and sort as character values.
Attention: If you want to restrict users from entering a negative sign for a value set where you do not allow alphabetic characters, you should enter zero (0) as this value set's minimum value. However, you cannot prevent users from entering a value that contains the radix character (D).
If you are defining a value set that uses a validation table, you should set the value in this field to reflect the characteristics of the values in the value column you specify for your validation table.
Note: The Numbers Only option cannot be used in Translatable Independent and Translatable Dependent value sets.
Uppercase Only
Indicate whether any alphabetic characters you enter as values for a segment using this value set should automatically change to uppercase.
If you are defining a value set that uses a validation table, you should set the value in this field to reflect the characteristics of the values in the value column you specify for your validation table.
Note: The Uppercase Only option cannot be used in Translatable Independent and Translatable Dependent value sets.
Right-justify and Zero-fill Numbers
Indicate whether your flexfield should automatically right-justify and zero-fill numbers when you enter values for this value set. This option affects values that include only the characters 0-9, regardless of whether you select the Numbers Only option. This option has no effect on values that contain alphabetic characters or special characters such as a period or a hyphen.
For example, if you have a five-character value set, and you define a value of 7, your flexfield stores and displays your value as 00007. If you define your flexfield segment to have a display size less than the maximum size and you want to Right-justify and Zero-fill Numbers, your flexfield segment may often display only zeroes (your flexfield segment displays only the number of characters specified by the display size). In these cases, your users need to scroll through the flexfield segment to see a meaningful value, thus slowing data entry or inquiries.
Usually you use this option to ensure that character values that appear to be numbers will be sorted and appear in order as if they were actually number values (for cross-validation rules, value security rules, and reporting, for example). You may also use this option to ensure that numeric-looking values all have the same number of characters so they line up nicely in reports.
If you set Right-Justify and Zero-fill Numbers to Yes, you should ensure that the values in this value set use Right-justify and Zero-fill.
Suggestion: We recommend that you set Right-justify and Zero-fill Numbers to Yes for value sets you use with the Accounting Flexfield and to No for most other value sets.
If you are defining a value set that uses a validation table, you should set the value in this field to reflect the characteristics of the values in your validation table.
If you set the Right-Justify and Zero-Fill Numbers flag to Yes, the values in your value columns should also be right-justified and zero-filled; that is, there should be an exact match in formatting.
Minimum and Maximum Value Range
The following describes value ranges.
Min Value
Enter the minimum value a user can enter in a segment that uses this value set. Your minimum value may not violate formatting options such as the maximum value size you specify for this value set.
You can use the Minimum Value and Maximum Value fields to define a range of valid values for your value set. Once you specify a range of values, you cannot define a new valid value that falls outside this range. The Minimum Value and Maximum Value fields can therefore allow you to create a value set with a validation type of None (non-validated, where any value is valid) where the user cannot enter a value outside the specified range.
For example, you might create a value set with format type of Number where the user can enter only the values between 0 and 100. Or, you might create a value set with format type of Standard Date where the user can enter only dates for a specific year (a range of 01-JAN-2007 to 31-DEC-2007, for example). Since the minimum and maximum values enforce these limits, you need not define a value set that contains each of these individual numbers or dates.
You can define a range of values for a value set that already contains values. Existing combinations or existing data that use values outside the valid range are treated as if they contain expired segment values.
Your minimum or maximum value can differ depending on your format type. For example, if your format type is Char, then 1000 is less than 110, but if your format type is Number, 110 is less than 1000. In addition, when you use a Char format type for most platforms (ASCII platforms), numeric characters are "less" than alphabetic characters (that is, 9 is less than A), but for some platforms (EBCDIC platforms) numeric characters are "greater" than alphabetic characters (that is, Z is less than 0). This window gives you an error message if you specify a larger minimum value than your maximum value for your platform.
Max Value
Enter the maximum value a user can enter in a segment that uses this value set. Your maximum value may not be longer than the maximum size you specify for this value set.
If you leave this field blank, the maximum value for this value set is automatically the largest value possible for your value set.
Examples of Minimum and Maximum Values
If your value set uses Char format, with Numbers Only and maximum size of 3, then your minimum value is '-99' and your maximum value is '999'.
If your value set uses Number format, with maximum size is 5 with precision of 2, then your minimum value is '-9.99' and your maximum value is ' '99.99' (using the US radix character '.').

Monday, January 2, 2012

Workflow Notification Mailer Outbound SMTP Server



We can get the Outbound SMTP Server Name using the following SQL:

select fscpv.parameter_value smtp_server_name
from   fnd_svc_comp_params_tl fscpt
,      fnd_svc_comp_param_vals fscpv
,      fnd_svc_components fsc
where  fscpt.parameter_id = fscpv.parameter_id
and    fscpv.component_id = fsc.component_id
and    fscpt.display_name = 'Outbound Server Name'
and    fsc.component_name = 'Workflow Notification Mailer';


Read it.....

Track and Trace E-Business Suite Concurrent Request - EBS Logs, O/S Process IDs, Locks

 

I often get asked to take a look at an Oracle eBusiness Suite concurrent request to see what it is doing, this can come from a few different angles:
  1. What requests are currently running?
  2. I have an operating system process that is taking too much CPU - what is it doing?
  3. Can you tell me where the request is at? I've clicked on the log but it doesn't show anything!
  4. My request is taking too long - can you check for blocking locks?
There are a number of strategies to track and trace where things are at for a running request, these include:
  1. Monitor the currently running requests in fnd_concurrent_requests
  2. Checking the v$sqlarea to see what SQL statement or PL/SQL is running
  3. Tailing the concurrent request log / output file while it is being written to near realtime - prior to request completing
  4. Checking for locks blocking the concurrent request
So without further ado, let's take a look at the following sweet query:
set pages 9999 feed on lines 150
col user_concurrent_program_name format a40 head PROGRAM trunc
col elapsed format 9999
col request_id format 9999999 head REQUEST
col user_name format a12
col oracle_process_id format a5 head OSPID
col inst_name format a10
col sql_text format a30
col outfile_tmp format a30
col logfile_tmp format a30
select /*+ ordered */
       fcp.user_concurrent_program_name
,      fcr.request_id
,      round(24*60*( sysdate - actual_start_date )) elapsed
,      fu.user_name
,      fcr.oracle_process_id
,      sess.sid
,      sess.serial#
,      inst.inst_name
,      sa.sql_text
,      cp.plsql_dir || '/' || cp.plsql_out outfile_tmp
,      cp.plsql_dir || '/' || cp.plsql_log logfile_tmp
from   apps.fnd_concurrent_requests fcr
,      apps.fnd_concurrent_programs_tl fcp
,      apps.fnd_concurrent_processes cp
,      apps.fnd_user fu
,      gv$process pro
,      gv$session sess
,      gv$sqlarea sa
,      sys.v_$active_instances inst
where  fcp.concurrent_program_id = fcr.concurrent_program_id
and    fcp.application_id = fcr.program_application_id
and    fcr.controlling_manager = cp.concurrent_process_id
and    fcr.requested_by = fu.user_id (+)
and    fcr.oracle_process_id = pro.spid (+)
and    pro.addr = sess.paddr (+)
and    sess.sql_address = sa.address (+)
and    sess.sql_hash_value = sa.hash_value (+)
and    sess.inst_id = inst.inst_number (+)
and    fcr.phase_code = 'R' /* only running requests */
;

PROGRAM                                   REQUEST ELAPSED USER_NAME    OSPID        SID    SERIAL# INST_NAME  SQL_TEXT                       OUTFILE_TMP                    LOGFILE_TMP
---------------------------------------- -------- ------- ------------ ----- ---------- ---------- ---------- ------------------------------ ------------------------------ ------------------------------
Workflow Background Process               2960551       1 VIRTUATE     24814        130      29699 APPLPROD1  BEGIN WF_ENGINE.BACKGROUNDCONC /usr/tmp/o0068194.tmp          /usr/tmp/l0068194.tmp
                                                                                                              URRENT(:errbuf,:rc,:A0,:A1,:A2
                                                                                                              ,:A3,:A4,:A5); END;

1 row selected.

From the above we can see key information:

  • The running Concurrent Request Program Name and Request_ID
  • The database node operating system process id (OSPID) so we can monitor usage via top / iostat / vmstat
  • The SID / Serial in case we want to kill the session via alter system kill session '130,29699';
  • The instance name the database session is running on in a RAC environment
  • The currently running SQL text
  • The temporary files where concurrent request log/out is being written to via utl_file while running. These files are copied over to the Concurrent Tier $APPLCSF/$APPLOUT and $APPLLOG after completion of the request.
We can break out the above into a few queries and procedures to drill into specific information information from the core EBS tables and DBA v$ views

Read carefully........