Saturday, December 11, 2010

email logfile on windows using blat

syntax:
Blat -to [optional switches (see below)]
Blat -install [[[]]] [-q]
Blat -profile [-delete | ""] [profile1] [profileN] [-q]
Blat -h [-q]

-install [ [ []]]
: set's SMTP server, sender, number of tries and port for profile
( and may be replaced by '-').

: file with the message body ('-' for console input, end with ^Z)
-to : recipient list (also -t) (comma separated)
-tf : recipient list filename
-subject : subject line (also -s)
-f : overrides the default sender address (must be known to server)
-i : a 'From:' address, not necessarily known to the SMTP server.
-cc : carbon copy recipient list (also -c) (comma separated)
-cf : cc recipient list filename
-bcc : blind carbon copy recipient list (also -bcc) (comma separated)
-bf : bcc recipient list filename
-organization : Organization field (also -o and -org)
-body : Message body
-x : Custom 'X-' header. eg: -x "X-INFO: Blat is Great!"
-r : Request return receipt.
-d : Request disposition notification.
-h : displays this help.
-q : supresses *all* output.
-debug : Echoes server communications to screen (disables '-q').
-noh : prevent X-Mailer header from showing homepage of blat
-noh2 : prevent X-Mailer header entirely
-p : send with SMTP server, user and port defined in .
-priority : set message priority 0 for low, 1 for high.
-server : Specify SMTP server to be used. (optionally, addr:port)
-port : port to be used on the server, defaults to SMTP (25)
-hostname : select the hostname used to send the message
-mime : MIME Quoted-Printable Content-Transfer-Encoding.
-enriched : Send an enriched text message (Content-Type=text/enriched)
-html : Send an HTML message (Content-Type=text/html)
-uuencode : Send (binary) file UUEncoded
-base64 : Send (binary) file using base64 (binary Mime)
-try : how many time blat should try to send. from '1' to 'INFINITE'
-attach : attach binary file to message (may be repeated)
-attacht : attach text file to message (may be repeated)
-ti : Set timeout to 'n' seconds.
-u : Username for AUTH LOGIN (use with -pw)
-pw : Password for AUTH LOGIN (use with -u)
-log : Log everything but usage to
-plain : Use AUTH PLAIN to login to SMTP server (use with -u -pw)
-charset : User defined charset. The default is ISO-8859-1

www.blat.net to download blat for windows.

blat %manual_load_logfile% -to

Blat -install

migration procedure for Oracle database 8i on Windows to 10g on Linux

migration procedure for Oracle database 8i on Windows (NT and 2000) to 10g Linux platform.

1.. Identify developers and business owners for the database and set up schedule to move and test the database.
2.. create the new database on Linux box using dbca with template USON_LINUX_DEV.dbt

2a. enable archive log

SQL> archive log list; # if archive log is not enabled, then shutdown database and startup mount, then alter database archivelog;

2b. enable flashback (a good feature for fixing user errors, need to enable archive log).

SQL> select flashback_on from v$database; the return is NO, the put database in mount stage, then alter database flashback on;

3.. check tablespaces on the source database (i.e., database on Windows). Create missing tablespaces in the target database (database on Linux).
Comments: 8i uses RBS, 10g uses UNDOTBS1.

Default tablespaces on 8i: SYSTEM,RBS,USERS,TEMP, and TOOLS.

Default tablespaces on 9i: SYSTEM, UNDOTBS1,USERS,TEMP, and SYSAUX.

Need to create TOOLS and other user defined tablespaces.

On Linux with ASM: create tablespace tools; command to create tablespace.

4.. Check database link on the source database. get a list of all database aliases listed on host column of dba_db_links. Then copy all entries for those database aliases from tnsnames.ora on source database to target database’ tnsnames.ora. Pay attention to the databases have been moved already.

5.. Check all jobs running against this database. For Window NT, at dos prompt, type at command. For Window 2000, use Window’s service.

6.. Move all source code from the source database host to the target database host in $ORACLE_BASE/admin/$ORACLE_SID/script/. Convert the dos batch job into shell script. Add environment variable setting in the shell scripts. Fix all file directories in the scripts. Put batch job log in $ORACLE_BASE/admin/$ORACLE_SID/log and data in $ORACLE_BASE/admin/$ORACLE_SID/data directories.

7.. Put the source database in the restrict mode.

8.. Make a full export of the target database on the database host (using the original exp command: i.e, 8i)

Exp system/manager full=y file=exp_full_${ORACLE_SID|.dmp log=exp_full_${ORACLE_SID}.log

9.. shutdown the source database.
10.. ftp the dump file and log file over to the target host in the binary mode. Put files in $ORACLE_BASE/admin/$ORACLE_SID/exp

11.. perform a full import with the ignore parameter enabled on the target database.


Imp system/manager full=y file=exp_full_${ORACLE_SID}.dmp log=imp_full_${ORACLE_SID}.log IGNORE=y

12.. review the import log file, fix error, work with developer to test the batch jobs. Ask developers to test the moved database.

sudo for oracle account

Add following to /etc/sudoers

oracle ALL=(ALL) NOPASSWD:ALL



This will enable oracle os account to run root.sh.

For remote OEM agent installation, this is required too.

mirror 10gR2 OCR and voting disks

During the ClusterWare installation phase, there is an option to choose mirroring of OCR and Voting Disks. As we did not mirror them, we did it. Here is the instruction for doing it.


VOTING DISKS
1. Login as root on pind22
2. . /home/oracle/.profile_crs ## source env
3. crsctl query css votedisk ##should return /dev/raw/raw6
4. take a backup: dd if=/dev/raw/raw6 of=/data/oradata/votingdisk.linn.bk
5. ls -al /dev/raw/* ##check pending disk device
6. add /dev/raw/raw7 and /dev/raw/raw8 as mirrors of voting disks online.
crsctl add css votedisk /dev/raw/raw7
crsctl add css votedisk /dev/raw/raw8
7. if adding online failed
crsctl stop crs ###on pind21/22, very important, need to shutdown crs on all cluster nodes
crsctl add css votedisk /dev/raw/raw7 -force
crsctl add css votedisk /dev/raw/raw8 –force
crsctl start crs ###on pind21/22
8. crsctl query css votedisk ## should return /dev/raw/raw6, /dev/raw/raw7, /dev/raw/raw8

OCR
1. login as root on pind22
2. . /home/oracle/.profile_crs ## source env
3. ocrcheck ## should return /dev/raw/raw5
4. ls –al /dev/raw/* ## /dev/raw/raw9 is pending disk device
5. ocrconfig –export /data/oradata/ocr.linn.dmp –s online ## for backup
6. ocrconfig –replace ocrmirror /dev/raw/raw9 ## add ocr mirror
7. ocrcheck ## should return /dev/raw/raw5 and /dev/raw/raw9 as ocr disk device


Output log:

[root@pind22 ~]# cd /home/oracle/
[root@pind22 oracle]# . .profile_crs
crs.root.pind22>crsctl query css votedisk
0. 0 /dev/raw/raw6

located 1 votedisk(s).
crs.root.pind22>dd if=/dev/raw/raw6 of=/data/oradata/votingdisk.linn.bk
2064384+0 records in
2064384+0 records out
1056964608 bytes (1.1 GB) copied, 399.387 seconds, 2.6 MB/s
crs.root.pind22>ls -al /dev/raw/*
crw-r----- 1 root oinstall 162, 5 Aug 13 10:45 /dev/raw/raw5
crw-rw-rw- 1 oracle oinstall 162, 6 Aug 24 13:18 /dev/raw/raw6
crw-rw-rw- 1 oracle oinstall 162, 7 Aug 13 10:45 /dev/raw/raw7
crw-rw-rw- 1 oracle oinstall 162, 8 Aug 13 10:45 /dev/raw/raw8
crw-r----- 1 root oinstall 162, 9 Aug 13 10:45 /dev/raw/raw9
crs.root.pind22>crsctl add css votedisk /dev/raw/raw7
Cluster is not in a ready state for online disk addition
crs.root.pind22>crsctl stop crs
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
crs.root.pind22>crsctl add css votedisk /dev/raw/raw7
Cluster is not in a ready state for online disk addition
crs.root.pind22>crsctl add css votedisk /dev/raw/raw7 -force
Now formatting voting disk: /dev/raw/raw7
successful addition of votedisk /dev/raw/raw7.
crs.root.pind22>crsctl add css votedisk /dev/raw/raw8 -force
Now formatting voting disk: /dev/raw/raw8
successful addition of votedisk /dev/raw/raw8.
crs.root.pind22>crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
crs.root.pind22>crsctl query css votedisk
0. 0 /dev/raw/raw6
1. 0 /dev/raw/raw7
2. 0 /dev/raw/raw8

located 3 votedisk(s).
crs.root.pind22>

crs.root.pind22>ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 1031920
Used space (kbytes) : 3320
Available space (kbytes) : 1028600
ID : 330979008
Device/File Name : /dev/raw/raw5
Device/File integrity check succeeded

Device/File not configured

Cluster registry integrity check succeeded

crs.root.pind22>ls -al /dev/raw/*
crw-r----- 1 root oinstall 162, 5 Aug 24 13:24 /dev/raw/raw5
crw-rw-rw- 1 oracle oinstall 162, 6 Aug 24 13:25 /dev/raw/raw6
crw-rw-rw- 1 oracle oinstall 162, 7 Aug 24 13:25 /dev/raw/raw7
crw-rw-rw- 1 oracle oinstall 162, 8 Aug 24 13:25 /dev/raw/raw8
crw-r----- 1 root oinstall 162, 9 Aug 13 10:45 /dev/raw/raw9
crs.root.pind22>ocrconfig -export /data/oradata/ocr.linn.dmp -s online
crs.root.pind22>ocrconfig -replace ocrmirror /dev/raw/raw9
crs.root.pind22>ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 1031920
Used space (kbytes) : 3320
Available space (kbytes) : 1028600
ID : 330979008
Device/File Name : /dev/raw/raw5
Device/File integrity check succeeded
Device/File Name : /dev/raw/raw9
Device/File integrity check succeeded

Cluster registry integrity check succeeded

crs.root.pind22>


Due to bug 3972986 (see ref 2), Cluster is not in a ready state for online disk addition. Need to shutdown all databases and ASM, and then shutdown CRS.



REF:

1. OCR / Vote disk Maintenance Operations: (ADD/REMOVE/REPLACE/MOVE), including moving from RAW Devices to Block Devices. [ID 428681.1]
2. OCR Corruption after Adding/Removing voting disk to a cluster when CRS stack is running [ID 390880.1]

myadpatch

cd to patchtop (which has unzipped patchfiles)

adpatch patchtop=`pwd` driver=`ls u*.drv` logfile=adpatch_`ls u*drv|cut -d . -f 1`.log workers=$((2*`grep -c processor /proc/cpuinfo`))


for none interactive, set defaultsfile for adpatch.
defaultsfile=$APPL_TOP/admin/$TWO_TASK/adalldefaults.txt

fnd_conc_clone.setup_clean, cmclean.sql and fnd_net_services.remove_server

In fnd_net_services.remove_server

delete from fnd_app_servers
delete from fnd_appl_tops
delete from fnd_database_assignments
delete from fnd_database_instances
delete from fnd_database_services
delete from fnd_databases
delete from fnd_db_service_members
delete from fnd_oracle_homes
delete from fnd_system_server_map
delete from fnd_tns_alias_address_lists
delete from fnd_tns_alias_addresses
delete from fnd_tns_alias_descriptions
delete from fnd_tns_alias_set_usage
delete from fnd_tns_alias_sets
delete from fnd_tns_aliases
delete from fnd_tns_listener_ports
delete from fnd_tns_listeners


In fnd_conc_clone.setup_clean

Delete from fnd_concurrent_queue_size
Delete from fnd_concurrent_queues_tl
Delete from fnd_concurrent_queues
Delete from fnd_nodes;

truncate_table(OracleUserFND , 'FND_OAM_CONTEXT_FILES');
truncate_table(OracleUserFND , 'FND_OAM_APP_SYS_STATUS');

-- Added following JTF tables based on bug 2949216
truncate_table(OracleUserJTF , 'JTF_PREFAB_HA_COMPS');
truncate_table(OracleUserJTF , 'JTF_PREFAB_HA_FILTERS');
truncate_table(OracleUserJTF , 'JTF_PREFAB_HOST_APPS');
truncate_table(OracleUserJTF , 'JTF_PREFAB_WSH_POES_B');
truncate_table(OracleUserJTF , 'JTF_PREFAB_WSH_POES_TL');
truncate_table(OracleUserJTF , 'JTF_PREFAB_WSHP_POLICIES');
truncate_table(OracleUserJTF , 'JTF_PREFAB_CACHE_STATS');

truncate_table(OracleUserFND,'FND_APP_SERVERS');
truncate_table(OracleUserFND,'FND_APPL_TOPS');
truncate_table(OracleUserFND,'FND_APPS_SYSTEM');
truncate_table(OracleUserFND,'FND_DATABASE_ASSIGNMENTS');
truncate_table(OracleUserFND,'FND_DATABASE_INSTANCES');
truncate_table(OracleUserFND,'FND_DATABASE_SERVICES');
truncate_table(OracleUserFND,'FND_DATABASES');
truncate_table(OracleUserFND,'FND_DB_INSTANCE_PARAMS');
truncate_table(OracleUserFND,'FND_DB_SERVICE_MEMBERS');
truncate_table(OracleUserFND,'FND_OAM_CONTEXT_FILES');
truncate_table(OracleUserFND,'FND_ORACLE_HOMES');
truncate_table(OracleUserFND,'FND_SYSTEM_SERVER_MAP');
truncate_table(OracleUserFND,'FND_TNS_ALIAS_ADDRESS_LISTS');
truncate_table(OracleUserFND,'FND_TNS_ALIAS_ADDRESSES');
truncate_table(OracleUserFND,'FND_TNS_ALIAS_DESCRIPTIONS');
truncate_table(OracleUserFND,'FND_TNS_ALIAS_SET_USAGE');
truncate_table(OracleUserFND,'FND_TNS_ALIAS_SETS');
truncate_table(OracleUserFND,'FND_TNS_ALIASES');
truncate_table(OracleUserFND,'FND_TNS_LISTENER_PORTS');
truncate_table(OracleUserFND,'FND_TNS_LISTENERS');


fnd_conc_clone.setup_clean truncates all tables mentioned in fnd_net_services.remove_server procedure, thus do not need to run fnd_net_services.remove_server during cloning after running fnd_conc_clone.setup_clean.


In cmclean.sql

UPDATE fnd_concurrent_processes
UPDATE fnd_concurrent_queues
UPDATE fnd_concurrent_requests
UPDATE fnd_conflicts_domain
UPDATE fnd_concurrent_conflict_sets


As cmclean.sql and fnd_conc_clone.setup_clean touch different sets of concurrent request tables, it is better to run both during clone.

EBS Internal Concurrent Manager (ICM) starts all concurrent managers every minute

It was Friday morning at about 10:00am, we need to bounce the integration instance INT database tier to disable the archive log mode and apply a small patch in GL area. It was slow to shutdown and startup database. For the application patch, in the DEV, it only needs about 6 minute. However, in INT, it took about an hour.

The slowness of database caused a big problem to startup application tier. There are timeout when I tried to startup all nodes (two web/forms nodes and two concurrent manager and admin server nodes). Furthermore, the load average of database increased rapidly to about 500 and the server is no longer responding. We have to reboot the server.

After some digging, I also found that there are many processes on concurrent manager tier. The internal concurrent manager (ICM) log shows that ICM was starting all concurrent managers every minute. As there are a few concurrent processes configured for each manager, starting the concurrent manager will start all the concurrent processes. Each concurrent process has a corresponding database process. Thus, database server got overloaded and could not respond to new client request.

The slowness of database was determined to be a hugepage setting on Linux. The initial setting is for 8GB SGA. However, the INT database’s SGA got changed to 16GB. After resetting SGA back to 8GB, INT is back to normal.

However, ICM starts all concurrent managers when the database is 10 times slower than normal. This exposed a design fault for ICM. It appears that ICM is checking fnd_current_queues.target_processes and running_processes. If these two columns match, then ICM will go to sleep. Otherwise, start concurrent managers again. It appears the ICM is not checking timeout, Oracle errors etc.

A service request has been opened for Oracle to give us a patch to fix the ICM restarting concurrent managers very minute.