1. Relink the AutoInvoice Master program (report) as follows: (refer to Doc ID 1209514.1)
a) Log into the Operating System as APPLMGR (on CM node)
b) $ cd $AR_TOP/bin
c) Make a backup copy on file RAXMTR
d) Make sure that Autoinvoice is not running (by checking concurrent jobs)
e) Run the relink script
$ adrelink.sh force=y ranlib=y "ar RAXMTR"
=====log on the screen ==============================
.....
Done with link of ar executable 'RAXMTR' on Fri Jul 18 12:51:41 EDT 2014
Done relinking module RAXMTR in product ar
Done with link of product 'ar' on Fri Jul 18 12:51:41 EDT 2014
adrelink is exiting with status 0
End of adrelink session
Date/time is Fri Jul 18 12:51:41 EDT 2014
2. To relink 10.1.2 reports executables:
a) $ cd $ORACLE_HOME/reports/lib (or $ORACLE_HOME/reports/lib32)
b) $ make -f ins_reports.mk install
3.To relink 10.1.2 forms executables:
a) $ cd $ORACLE_HOME/forms/lib (or $ORACLE_HOME/forms/lib32)
b) $ make -f ins_forms.mk install
4. Use adadmin to relink all apps programs
choices: 2 => 1
If all worked, you will see " adrelink is exiting with status 0 " at the end.
Log file is $APPL_TOP/admin/${TWO_TASK}/log/adrelink.log
5. Regenerate the jar files with force:
$ adadmin
1 => 4. Make sure that you choose force equals Yes.
NOTES/UPDATES
1: Oracle usually suggests "regenerate the jar files with force" after "relink" all form excutables.
2: If below errors exist in the make log file:
/usr/lib/libXtst.so.6: undefined reference to `__stack_chk_fail@GLIBC_2.4'
/usr/lib/libXtst.so.6: undefined reference to `__fprintf_chk@GLIBC_2.3.4'
/usr/lib/libXtst.so.6: undefined reference to `__sprintf_chk@GLIBC_2.3.4'
The fix is to update a required link to a Motif library (as root)
# unlink /usr/lib/libXtst.so.6
# ln -s /usr/X11R6/lib/libXtst.so.6.1 /usr/lib/libXtst.so.6
Before the change
$ ls -al /usr/lib/libXtst.so.6
lrwxrwxrwx 1 root root 16 Oct 11 2012 /usr/lib/libXtst.so.6 -> libXtst.so.6.1.0
After the fix, the result shall be
$ ls -al /usr/lib/libXtst.so.6
lrwxrwxrwx 1 root root 29 Jun 18 2014 /usr/lib/libXtst.so.6 -> /usr/X11R6/lib/libXtst.so.6.1
$ ls -al /usr/X11R6/lib/libXtst*
lrwxrwxrwx 1 root root 14 Oct 18 2011 /usr/X11R6/lib/libXtst.so -> libXtst.so.6.1
lrwxrwxrwx 1 root root 14 Oct 18 2011 /usr/X11R6/lib/libXtst.so.6 -> libXtst.so.6.1
-rwxr-xr-x 1 root root 17204 Feb 26 2008 /usr/X11R6/lib/libXtst.so.6.1
3: On Linux RHEL 6 and 7, R12.1 adadmin relink and/or adpatch may hit error
libgcc_s.so: undefined reference to `__stack_chk_fail@GLIBC_2.4'
The fix is to apply patch 12415211 to 10.1.2 AND 10.1.3 ORACLE HOMES manually (see Doc ID 1525823.1). Below script shall do the job.
#!/bin/ksh
# Steps from Doc ID 761566.1 - search keyword 12415211 (patch number)
# copy file libgcc_s-2.3.2-stub.so from patch folder ($HOME/RHEL6 in this script) to
# $ORACLE_HOME/lib/stubs and $IAS_ORACLE_HOME/lib/stubs
echo $ORACLE_HOME
cd $ORACLE_HOME/lib
cp -p -R stubs stubsORIG_`date +%H%M`
pwd
cd stubs
ls -al libgcc_s-2.3.2-stub.so*
cp -p $HOME/RHEL6/libgcc_s-2.3.2-stub.so .
ln -s libgcc_s-2.3.2-stub.so libgcc_s.so.1
ln -s libgcc_s.so.1 libgcc_s.so
ls -al libgcc_s*.*
# -rw-r--r-- 1 id xxx 12246 Jul 27 2011 $ORACLE_HOME/lib/stubs/libgcc_s-2.3.2-stub.so
# lrwxrwxrwx 1 id xxx 13 Jun 2 16:32 $ORACLE_HOME/lib/stubs/libgcc_s.so -> libgcc_s.so.1
# lrwxrwxrwx 1 if xxx 22 Jun 2 16:32 $ORACLE_HOME/lib/stubs/libgcc_s.so.1 -> libgcc_s-2.3.2-stub.so
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo $IAS_ORACLE_HOME
cd $IAS_ORACLE_HOME/lib
cp -p -R stubs stubsORIG_`date +%H%M`
pwd
cd stubs
ls -al libgcc_s-2.3.2-stub.so*
cp -p $HOME/RHEL6/libgcc_s-2.3.2-stub.so .
ln -s libgcc_s-2.3.2-stub.so libgcc_s.so.1
ln -s libgcc_s.so.1 libgcc_s.so
ls -al libgcc_s*.*
4: One day, after I applied patches to ORACLE HOMEs and applied an
AR patch, some AR forms hang and get frozen forever without any error or
warning message. The issue was fixed by running steps 3 and 5 above (on each Web
node).
Monday, August 18, 2014
Friday, August 8, 2014
R12 Patchset Level, R12 Apps code Level
1. As applmgr or OS environment owner
(a) source environment
(b) login as apps
(c) SQL> @$AD_TOP/sql/adutconf.sql
The adutconf.sql script will create a text file adutconf.lst containing version information and product top information. There is a section->”Product Installation Status, Version Info and Patch Level”, e.g.
Product Appl Status Version Patchset Level
AD Shared 12.0.0 R12.AD.B.3
FND Installed 12.0.0 R12.FND.B.3 <-- call this "FND code level" also
- Implemented product has status Installed.
- Not installed Product has the Status Inactive.
- Products with status Shared are not fully implemented - only partially installed for dependent Product(s).
AD = Applications DBA, FND = Application Object Library (AOL, i.e. Foundation tables).
2. Doc ID 550654.1 (for R12.1)
Login to OAM. Choose menu “OAM Support Cart” in upper right hand corner
Navigate to :
(a) Support Cart –> Applications Signature –> Collect –> Check “Product Information” box
(b) Click on “View” (eyeglasses) to get the patchset level report
3. Script (similar to the one for 11i in Doc ID 443699.1)
SELECT a.application_name, a.application_short_name, a.product_code, b.patch_level, DECODE (b.status, 'I', 'Installed', 'S', 'Shared', 'Not Installed - N/A') status, b.last_update_date, b.tablespace
FROM apps.fnd_product_installations b, apps.fnd_application_vl a,
WHERE a.application_id = b.application_id
-- and b.status=’I’
order by a.application_short_name asc;
-- Not sure what is in this table
SELECT app_short_name, MAX(patch_level)
FROM apps.ad_patch_driver_minipks
GROUP BY app_short_name order by app_short_name;
Applications code level?
SQL> select release_name from apps.fnd_product_groups;
12.1.3
Tuesday, July 22, 2014
WFLOAD, FNDLOAD
1. Oracle EBS provides a UNIX command to get workflow definition file.
WFLOAD <apps_user_name>/<password>@db 0 Y DOWNLOAD apinvapr.wft APINVAPR
apinvapr.wft will be created in the same directory that this command was ran from. APINVAPR is the workflow name.
2. FNDLOAD utility:
Here is an example on how to use FNDLOAD:
a) Use FNDLOAD to download a custom current program from Dev environment:
Additional examples:
WFLOAD <apps_user_name>/<password>@db 0 Y DOWNLOAD apinvapr.wft APINVAPR
apinvapr.wft will be created in the same directory that this command was ran from. APINVAPR is the workflow name.
2. FNDLOAD utility:
Here is an example on how to use FNDLOAD:
a) Use FNDLOAD to download a custom current program from Dev environment:
FNDLOAD apps/<PWD> 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct XXX_AWARD_FEEDBACK.ldt PROGRAM APPLICATION_SHORT_NAME="SQLAP" CONCURRENT_PROGRAM_NAME="XXX_AWARD_FEEDBACK"
NOTES: Somehow, FNDLOAD does not get full execution, if above line is saved to a shell script file .sh to run it.
b) Copy file XXX_AWARD_FEEDBACK.ldt to QA environment
c) Use FNSLOAD to upload it to QA environment
FNDLOAD apps/<QA_PWD> 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct XXX_AWARD_FEEDBACK.ldt WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
Download a profile option:
FNDLOAD apps/<PWD> O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct XXX_LOOKUP_CODE.ldt PROFILE PROFILE_NAME="XXX_LOOKUP_CODE" APPLICATION_SHORT_NAME="SQLAP"
Download a lookup type:
FNDLOAD apps/<PWD> O Y DOWNLOAD $FND_TOP/patch/115/import/aflvmlu.lct XXX_UNIT_LT.ldt FND_LOOKUP_TYPE APPLICATION_SHORT_NAME="SQLAP" LOOKUP_TYPE="XXX_UNIT_LT"
Download a value set:
FNDLOAD apps/Ebs#8myPwd 0 Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct XXX_OPTIONS_VS.ldt VALUE_SET FLEX_VALUE_SET_NAME="XXX_OPTIONS_VS"
Download a request group:
FNDLOAD apps/<PWD> O Y DOWNLOAD $FND_TOP/patch/115/import/afcpreqg.lct filename.ldt REQUEST_GROUP REQUEST_GROUP_NAME='GL Concurrent Program Group' APPLICATION_SHORT_NAME='SQLGL'
Doc ID 2058269.1 is about Transaction Analyzer. But it can serve as a good example on how to use FNDLOAD to register a concurrent program (Doc ID 1587455.1 EBS Payments Funds Disbursement Analyzer does also):
$FND_TOP/bin/FNDLOAD apps/<PWD> 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct artrxanalzr.ldt CUSTOM_MODE=FORCE UPLOAD_MODE=REPLACE
NOTES additional steps to assign / grant "Transaction Analyzer" to custom responsibility AR_SupperUser:
Security --> Responsibilites --> Define --> "AR_SuperUser" to find it belongs to which "Request Group": AR SuperUser
Security --> Responsibilitie --> Request --> "AR SuperUser" --> add "Transaction Analyzer" to the group.
Now, responsibility AR_SupperUser can submit the new concurrent job "Transaction Analyzer".
FNDLOAD apps/<PWD> O Y DOWNLOAD $FND_TOP/patch/115/import/afcpreqg.lct filename.ldt REQUEST_GROUP REQUEST_GROUP_NAME='GL Concurrent Program Group' APPLICATION_SHORT_NAME='SQLGL'
Doc ID 2058269.1 is about Transaction Analyzer. But it can serve as a good example on how to use FNDLOAD to register a concurrent program (Doc ID 1587455.1 EBS Payments Funds Disbursement Analyzer does also):
$FND_TOP/bin/FNDLOAD apps/<PWD> 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct artrxanalzr.ldt CUSTOM_MODE=FORCE UPLOAD_MODE=REPLACE
NOTES additional steps to assign / grant "Transaction Analyzer" to custom responsibility AR_SupperUser:
Security --> Responsibilites --> Define --> "AR_SuperUser" to find it belongs to which "Request Group": AR SuperUser
Security --> Responsibilitie --> Request --> "AR SuperUser" --> add "Transaction Analyzer" to the group.
Now, responsibility AR_SupperUser can submit the new concurrent job "Transaction Analyzer".
Thursday, June 12, 2014
du / find to check space & Linux commands
More OS commands are used as an EBS apps admin than a database DBA. More notes are added to this post after I feel they are useful.
~~~~~~~~~~~~~~~~~~~~~~~ du ~~~~~~~~~~~~~~~~~~~~~~~
Below command will show the disk space used by first level of each folder in RH Linux. It is a good way to find which folder fills up the disk space.
$ du -h --max-depth=1
To get size of current directory:
$ du -sh * <== List space used by each file & folder under it
~~~~~~~~~~~~~~~~~ list folders ~~~~~~~~~~~~~~~~~
- Get the list of directories. Below were tested in K Shell
$ echo $SHELL
/bin/ksh
1.
$ find /u01/app/patches/* -prune -type d (Or go to the directory first, $ find * -prune -type d )
/u01/app/patches/11902981
/u01/app/patches/13006289
/u01/app/patches/16367827
Note: if just want the list of files, use "find * -prune -type f"
2. -- List directories older than two days
$ find * -prune -type d -mtime +2
3.
$ ls -l |egrep "^drw" |awk '{print $9}'
-- Loop through the list to do whatever you want
$ for x in `ls -l |egrep "^drw" |awk '{print $9}'`
do
echo $x;
done
4.
-- Note: FS is used to define the delimiter in AWK
The default is defined by OS env variable $FS
$ ls -1d */ | awk 'BEGIN {FS="/"};{print $1}'
~~~~~~~~~~~~~~~~~~~~~~~ du ~~~~~~~~~~~~~~~~~~~~~~~
Below command will show the disk space used by first level of each folder in RH Linux. It is a good way to find which folder fills up the disk space.
$ du -h --max-depth=1
To get size of current directory:
$ du -sh * <== List space used by each file & folder under it
$ du -sh (or, $ du -sk ) <== Get the total space used in current location
$ du -k . <== List all details under current location. Not useful.
But, file size reported by "du -sh filename.txt" is much less than the size from "ls -al filename.txt". The difference is big for a large file. A good thing is both "du --apparent-size -m filename.txt" and "ls -lh filename.txt" agree on file size on my RHEL servers.
~~~~~~~~~~~~~~~~~~~~~ find big files ~~~~~~~~~~~~~~~~~
Find the big files under a directory in Linux, which is useful when disk space is filling up:
$
For example
$ find /u01/app -type f -size +1000000 -exec ls -alh {} \;
-rw-rw-r-- 1 ebs oracle 953M Aug 9 2011 /path/to/ftp/out/gl_journal_to_adam.txt
$ du -k . <== List all details under current location. Not useful.
But, file size reported by "du -sh filename.txt" is much less than the size from "ls -al filename.txt". The difference is big for a large file. A good thing is both "du --apparent-size -m filename.txt" and "ls -lh filename.txt" agree on file size on my RHEL servers.
~~~~~~~~~~~~~~~~~~~~~ find big files ~~~~~~~~~~~~~~~~~
Find the big files under a directory in Linux, which is useful when disk space is filling up:
$
find /home -size +1000000 -exec ls -alh {} \;For example
$ find /u01/app -type f -size +1000000 -exec ls -alh {} \;
-rw-rw-r-- 1 ebs oracle 953M Aug 9 2011 /path/to/ftp/out/gl_journal_to_adam.txt
-rw-r----- 1 ebs oracle 1.8G Sep 27 2013 /path/to/ora/10.1.3/Apache/ssl_engine_log
-rw-r--r-- 1 ebs oracle 8.3G Mar 30 13:24 /path/to/ora/10.1.3/j2ee/oacore/oacore_default_group_1/application.log
You can search for exact file size, or just for bigger (+) or smaller (–) files. For example all bigger than 512k files would be found with command:
$
units:
b – for 512-byte blocks (this is the default if no suffix is used)
c – for bytes
w – for two-byte words
k – for Kilobytes (units of 1024 bytes)
M – for Megabytes (units of 1048576 bytes)
G – for Gigabytes (units of 1073741824 bytes)
~~~~~~~~~~~~~~~~~~~~ find the total files ~~~~~~~~~~~~~~~~~~~
Find the total number of files under a directory:
$
$
~~~~~~~~~~~~~~~~~~~~ find then sort ~~~~~~~~~~~~~~~~~~~~~~
Find and sort by timestamp:
$ find /path/. -name '*.*' -printf "%T+\t%s\t%p\n" | sort | more
%T+ - modification time (and date)
%s - size
%p - path of file
~~~~~~~~~~~~~~~~~~~~ find then replace ~~~~~~~~~~~~~~~~~~~
Use below line to replace wrong file owner under a directory:
# find /u01 -user wrongUserID -print | wc -l
-rw-r--r-- 1 ebs oracle 8.3G Mar 30 13:24 /path/to/ora/10.1.3/j2ee/oacore/oacore_default_group_1/application.log
You can search for exact file size, or just for bigger (+) or smaller (–) files. For example all bigger than 512k files would be found with command:
$
find /home -type f -size +512k -exec ls -lh {} \; units:
b – for 512-byte blocks (this is the default if no suffix is used)
c – for bytes
w – for two-byte words
k – for Kilobytes (units of 1024 bytes)
M – for Megabytes (units of 1048576 bytes)
G – for Gigabytes (units of 1073741824 bytes)
~~~~~~~~~~~~~~~~~~~~ find the total files ~~~~~~~~~~~~~~~~~~~
Find the total number of files under a directory:
$
find folder_name -type f | wc -l$
find folder_name -maxdepth 1 -type f | wc -l <== to exclude subdirectories~~~~~~~~~~~~~~~~~~~~ find then sort ~~~~~~~~~~~~~~~~~~~~~~
Find and sort by timestamp:
$ find /path/. -name '*.*' -printf "%T+\t%s\t%p\n" | sort | more
%T+ - modification time (and date)
%s - size
%p - path of file
~~~~~~~~~~~~~~~~~~~~ find then replace ~~~~~~~~~~~~~~~~~~~
Use below line to replace wrong file owner under a directory:
# find /u01 -user wrongUserID -print | wc -l
# find /u01 -user wrongUserID -exec chown rightUserID:userGroup {} \;
To find/list all files under current directory tree that is not owned by you (applMgr):
To find/list all files under current directory tree that is not owned by you (applMgr):
$ find . ! -user applMgr
$ find . ! -user applMgr -exec ls -altr {} \;
~~~~~~~~~~~~~~~~~~~ find then delete ~~~~~~~~~~~~~~~~~~~~
Use find to delete files:
One day, CM log file and Output file can not be opened by browser with error "Authentication failed." I found the disk space was full with 11GB of Apache folder. Use "find" to delete old files (-r will also delete sub-folders):
$ cd $LOG_HOME/ora/10.1.3/Apache
$ find *.* -type f -mtime +7 -exec rm -rf {} \;
NOTES: If there is a huge pile of files, above command may get error. Try a different way by placing * inside the single quotes so that it is used as a matching wildcard and not for shell filename expansion:
$ find . -name '*.tmp' | wc -l
$ find . -name '*.tmp' -mtime +7 -exec rm -f {} \;
Below first line worked for me (in cron also) to delete files from a folder with more than 15K files. But the 2nd line failed.
$ /usr/bin/find /u01/path/utl_dir/. -name '*.tmp' -mtime +60 -exec rm -f {} \;
$ /usr/bin/find /u01/path/utl_dir/*.tmp -mtime +60 -exec rm -f {} \;
-ksh: /usr/bin/find: /usr/bin/find: cannot execute [Argument list too long]
~~~~~~~~~~~~~~~~~~~~~ zip ~~~~~~~~~~~~~~~~~~~~~~~~~~
To Zip up a folder, including all subdirectories:
$ cd /path/to/parent_folderName <= go to the upper folder first
$ zip -r file_name.zip folderName
this is useful when use "admrgpch -s source_path -d target_path -manifest manifest.txt" to merge patches and then copy the merged folder to different node.
~~~~~~~~~~~~~~~~~~ grep / egrep ~~~~~~~~~~~~~~~~~~~~~~~
To find multiple words in a text file:
$ /bin/grep -i -e 'drop ' -e 'alter ' -e 'grant ' -e 'commit ' ascii_file.sql
$ egrep -i 'fail|error' long_file_name.log
~~~~~~~~~~~~~~~~~~~ lsof ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lsof to find open files. it is useful when the system acts strangely
$ lsof /home | wc -l
$ lsof | grep deleted | wc -l (files in being deleted queue)
Use find to delete files:
One day, CM log file and Output file can not be opened by browser with error "Authentication failed." I found the disk space was full with 11GB of Apache folder. Use "find" to delete old files (-r will also delete sub-folders):
$ cd $LOG_HOME/ora/10.1.3/Apache
$ find *.* -type f -mtime +7 -exec rm -rf {} \;
NOTES: If there is a huge pile of files, above command may get error. Try a different way by placing * inside the single quotes so that it is used as a matching wildcard and not for shell filename expansion:
$ find . -name '*.tmp' | wc -l
$ find . -name '*.tmp' -mtime +7 -exec rm -f {} \;
Below first line worked for me (in cron also) to delete files from a folder with more than 15K files. But the 2nd line failed.
$ /usr/bin/find /u01/path/utl_dir/. -name '*.tmp' -mtime +60 -exec rm -f {} \;
$ /usr/bin/find /u01/path/utl_dir/*.tmp -mtime +60 -exec rm -f {} \;
-ksh: /usr/bin/find: /usr/bin/find: cannot execute [Argument list too long]
~~~~~~~~~~~~~~~~~~~~~ zip ~~~~~~~~~~~~~~~~~~~~~~~~~~
To Zip up a folder, including all subdirectories:
$ cd /path/to/parent_folderName <= go to the upper folder first
$ zip -r file_name.zip folderName
this is useful when use "admrgpch -s source_path -d target_path -manifest manifest.txt" to merge patches and then copy the merged folder to different node.
~~~~~~~~~~~~~~~~~~ grep / egrep ~~~~~~~~~~~~~~~~~~~~~~~
To find multiple words in a text file:
$ /bin/grep -i -e 'drop ' -e 'alter ' -e 'grant ' -e 'commit ' ascii_file.sql
$ egrep -i 'fail|error' long_file_name.log
~~~~~~~~~~~~~~~~~~~ lsof ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lsof to find open files. it is useful when the system acts strangely
$ lsof /home | wc -l
$ lsof | grep deleted | wc -l (files in being deleted queue)
~~~~~~~~~~~~~~~~~~ port ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To find what is using a port in Linux:
To find what is using a port in Linux:
Below line will tell if a port is used or not on the server:
$ netstat -tuanp | grep 6230
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 167.69.109.82:6230 0.0.0.0:* LISTEN 31876/opmn
Then the process owner (or root) can use below line to see more details on using the port:
$ lsof -i :6230
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
opmn 31876 ebsdev 9u IPv4 42886593 0t0 TCP server3d.domain.com:6230 (LISTEN)
Below line may also works (Note: "lsof" may show result only to root or process owner):
$ ls -l /proc/31876/exe <= use the PID from above line
lrwxrwxrwx 1 ebiz user 0 Mar 5 11:19 /proc/31876/exe -> /u05/app/EBSDEV/apps/tech_st/10.1.3/opmn/bin/opmn
NOTES: even a port is free and available on a server, it can be blocked by firewall and such to prevent access from other servers.
~~~~~~~~~~~~~~~~~ screen ~~~~~~~~~~~~~~~~~~~~~~~
$ ls -l /proc/31876/exe <= use the PID from above line
lrwxrwxrwx 1 ebiz user 0 Mar 5 11:19 /proc/31876/exe -> /u05/app/EBSDEV/apps/tech_st/10.1.3/opmn/bin/opmn
NOTES: even a port is free and available on a server, it can be blocked by firewall and such to prevent access from other servers.
~~~~~~~~~~~~~~~~~ screen ~~~~~~~~~~~~~~~~~~~~~~~
First of all, make sure "screen" is installed (in /usr/bin). To check its version, type:
$ screen -version
To start a "screen" session for a long-run job:
$ screen
$ adop phase=fs_clone
... ...
To list running screen/background session:
$ screen -list (Or, $ screen -l)
There are screens on:
1653.pts-5.server2d (Attached)
23515.pts-3.server2d (Attached)
2 Sockets in /var/run/screen/S-userID.
To re-attach a session:
$ screen -r -d 23515
Session ID: 16
Node: server2d
Phase: fs_clone
Phase: fs_clone
Log: $ADOP_LOG_HOME/16/xxxxxx_201956/adop.log
... ...
~~~~~~~~~~~~~~~~~ rsync ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To copy a folder to another folder on the SAME server and preserve exactly all attributes. For example, in EBS R12.2, to synchronize custom folder xxap from PATCH file system to RUN file system:
$ rsync -a --delete $PATCH_BASE/EBSapps/appl/xxap $RUN_BASE/EBSapps/appl
Notes: add rsync -a --delete %s_current_base%/EBSapps/appl/xxap %s_other_base%/EBSapps/appl to file $APPL_TOP_NE/ad/custom/adop_sync.drv
If contents of a folder are static, add rsync -zr %s_current_base%/EBSapps/appl/xxe4a %s_other_base%/EBSapps/appl to file $APPL_TOP_NE/ad/custom/adop_sync.drv
The option -a is very powerful, it will copy the directory and all its sub-directories recursively, and preserve symbolic links, modification times, group, ownership, and permissions.
-a option is a combination of a bunch of other options:
-r Recurse into directories
-l Copy symlinks as symlinks
-p Preserve file permissions
-t Preserve modification times
-g Preserve group
-o Preserve owner
-D Preserve device and special files
"-- delete" will DELETE files in Target folder but not in Source folder.
Below line will copy the folder structure with same permissions to current location, without copying files:
$ cd /path/to/target
$ rsync -av -f"+ */" -f"- *" /path1/to/source .
$ cd /path/to/target
$ rsync -av -f"+ */" -f"- *" /path1/to/source .
Copy a folder to a different server (and preserve exactly all attributes):
$ cd /to/path/source_FOLDER
$ rsync --progress -avze ssh applmgr@nodeName:/to/path/target_FOLDER
~~~~~~~~~~~~~~~~~~ Stickybit ~~~~~~~~~~~~~~~~~~~~~
If your ID owns /path/to/LOG directory and you want to allow users in other Groups to rename the files in that directory, you have to remove Stickybit on LOG directory (by chmod -t) if it is enabled, because enabled Stickybit makes other users unable to rename/delete the files under LOG directory.
$ ls -al /path/to/LOG
drwxrwxrwt 10 user group 134 Aug 14 09:57
$ chmod -t /path/to/LOG # remove Stickybit
$ ls -al /path/to/LOG
drwxrwxrwx 10 user group 134 Aug 14 09:57
Right permission is needed for others to write/modify your file. To get 664 permissions (-rw-rw-r--) on all files created by your ID, add one line to .bashrc or .kshrc or .profile of your OS ID, or add the line to the shell script for generating the file:
set umask to 0002 (or 002 ?)
or
umask u=rwx,g=rwx,o=rx
~~~~~~~~~~~~~~~~~ chmod -R ~~~~~~~~~~~~~~~~~~~~
Run "chmod -R" to change permission on a folder and all subfolders & files under it. For example, to make a folder and all subfolders & all files under it "readable":
$ chmod -R +r /path/to/LOG
- To list all folders (sub-directories called "fs_clone") under a location:
$ find . -name fs_clone -type d -print
- Get the list of directories. Below were tested in K Shell
$ echo $SHELL
/bin/ksh
1.
$ find /u01/app/patches/* -prune -type d (Or go to the directory first, $ find * -prune -type d )
/u01/app/patches/11902981
/u01/app/patches/13006289
/u01/app/patches/16367827
Note: if just want the list of files, use "find * -prune -type f"
2. -- List directories older than two days
$ find * -prune -type d -mtime +2
3.
$ ls -l |egrep "^drw" |awk '{print $9}'
-- Loop through the list to do whatever you want
$ for x in `ls -l |egrep "^drw" |awk '{print $9}'`
do
echo $x;
done
4.
-- Note: FS is used to define the delimiter in AWK
The default is defined by OS env variable $FS
$ ls -1d */ | awk 'BEGIN {FS="/"};{print $1}'
Monday, April 7, 2014
Apply Oracle database 11G Security Patch Update (SPU) on AIX
January 2014 Database SPU Installation steps:
1. Check/install opatch:
Above patches require opatch version 11.2.0.3. Check current version of opatch and install correct version if required. To check:
$ cd /app/oracle/product/OPatch
$ ./opatch version
To install opatch newer version 11.2.0.3, download patch 6880880 and unzip it:
$ cd /app/oracle/product
$ rm -rf OPatch
$ unzip opatch_p6880880_112000_AIX64-5L.zip
$ rm opatch_p6880880_112000_AIX64-5L.zip
$ export PATH=/app/oracle/product/OPatch:$PATH
$ opatch version <= to verify opatch version. It should be 11.2.0.3
2. FTP/unzip SPU patch:
$ mkdir $ORACLE_BASE/patches/spu_jan14_11203
$ cd $ORACLE_BASE/patches/spu_jan14_11203
$ unzip p17478415_112030_AIX64-5L.zip
$ rm p17478415_112030_AIX64-5L.zip
3. Check/set environment:
- Set correct ORACLE_HOME
Set ORACLE_BASE
$ export ORACLE_BASE=/app/oracle
Set LIBPATH
$ export LIBPATH=$ORACLE_HOME/lib
Set LD_LIBRARY_PATH
$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib
- Ensure that the $PATH has the following executables: make, ar, ld, and nm.
$ which make
$ which ar
$ which ld
$ which nm
The location of these executables depends on your operating system. On many operating systems, they are located in /usr/ccs/bin, in which case you can set your PATH as follows:
$ export PATH=/usr/ccs/bin:$PATH
- Check jdk version: It should be version 1.4.2 or higher.
$ java -version
If java version is lower, check if version 1.4.2 or higher is available on the host.
$ lslpp -L | grep Java
(or)
$ lslpp -L | grep Java14
$ export PATH=/usr/java14/bin:$PATH
If available, adjust PATH accordingly and check again.
If java version 1.4.2 or higher is not available, work with System Admin to have it installed.
- Check location of oracle inventory in /etc/oraInst.loc
- Run oracle inventory
$ cd /app/oracle/product/OPatch
$ ./opatch lsinventory
Make sure that Oracle version is 11.2.0.3.
- Check XDB: XDB must be VALID.
SQL> select status from dba_registry where comp_id='XDB'
If XDB is invalid, re-install DB – reference Oracle Support note 1292089.1
4. List invalid objects:
For each database on the server, save a list of invalid objects for comparison after SPU patch.
SQL> select owner, object_name, object_type from dba_objects
where status= 'INVALID';
5. Stop database replication tool if any.
6. Stop database monitoring tools, such as Grid Control agent.
7. Shutdown databases for the Oracle Home being patched and stop listener.
8. Check processes:
Make sure that there are no oracle processes running except aioserver process.
$ ps -fu'oracle’ | grep -v aioserver
$ ps -ef | grep sqlplus
Make sure that there are no oraggs processes running except aioserver process.
$ ps -fu'oragg’
9. Check shared file in use:
Following commands should not return any file name:
$ genld -l | grep $ORACLE_HOME
$ genkld | grep $ORACLE_HOME
If these return any file name, have system administrator run following command
$ /usr/sbin/slibclean
Check again.
10. Apply patch
$ cd $ORACLE_BASE/patches/spu_jan14_11203/17478415
$ /app/oracle/product/OPatch/opatch napply -skip_subset -skip_duplicate
An observation: During installation on one host, it might as for Oracle Support login ID / password to make an internet connection to Oracle Support website for any latest information relating patch. Just press return.
Patch will possible complete with warnings, as listed below. Per Oracle these can safely be ignored:
ld: 0711-319 WARNING: Exported symbol not defined: ****
Symbol xxxxxx is already exported.
ld: 0711-773 WARNING: Object ***, imported symbol ***
Symbol was expected to be local.
ld: 0711-783 WARNING: TOC overflow. TOC size: Maximum size:
0711-224 WARNING: Duplicate symbol
Check the following log files in $ORACLE_BASE/cfgtoollogs/catbundle for any errors:
catbundle_CPU_<database SID>_APPLY_<TIMESTAMP>.log
catbundle_CPU_<database SID>_GENERATE_<TIMESTAMP>.log
11. Check inventory again:
$ /app/oracle/product/OPatch/opatch lsinventory
12. Load modified SQL files into databases:
For each database instance running on the Oracle home being patched, connect to the database using SQL*Plus. Connect as SYSDBA and run the catbundle.sql script as follows:
$ cd $ORACLE_HOME/rdbms/admin
$ sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql cpu apply
SQL> @utlrp.sql
SQL> QUIT
Note: Start the LISTENER
For information about the catbundle.sql script, see My Oracle Support Note 605795.1 Introduction to Oracle Database catbundle.sql.
Check the following log files in $ORACLE_BASE/cfgtoollogs/catbundle for any errors:
catbundle_CPU_<database SID>_APPLY_<TIMESTAMP>.log
catbundle_CPU_<database SID>_GENERATE_<TIMESTAMP>.log
13. Invalid objects check
For each database on the server, make a list of invalid objects and compare with the list saved before patching. Take appropriate action if there are new invalid objects
14. Check XDB
If XDB is invalid, there is a possibility that LIBPATH has not been set correctly.
To check status of XDB:
SQL> select status from DBA_REGISTRY where comp_id='XDB'
If status is INVALID:
$ export LIBPATH=$ORACLE_HOME/lib
Shutdown database
Startup database
Run utlrp
If XDB is still invalid, re-install DB – reference Oracle Support note 1292089.1
15. Final check on registry:
$ sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> SELECT * FROM sys.registry$history where comments='CPUJan2014';
It should return one line for CPUJan2014.
1. Check/install opatch:
Above patches require opatch version 11.2.0.3. Check current version of opatch and install correct version if required. To check:
$ cd /app/oracle/product/OPatch
$ ./opatch version
To install opatch newer version 11.2.0.3, download patch 6880880 and unzip it:
$ cd /app/oracle/product
$ rm -rf OPatch
$ unzip opatch_p6880880_112000_AIX64-5L.zip
$ rm opatch_p6880880_112000_AIX64-5L.zip
$ export PATH=/app/oracle/product/OPatch:$PATH
$ opatch version <= to verify opatch version. It should be 11.2.0.3
2. FTP/unzip SPU patch:
$ mkdir $ORACLE_BASE/patches/spu_jan14_11203
$ cd $ORACLE_BASE/patches/spu_jan14_11203
$ unzip p17478415_112030_AIX64-5L.zip
$ rm p17478415_112030_AIX64-5L.zip
3. Check/set environment:
- Set correct ORACLE_HOME
Set ORACLE_BASE
$ export ORACLE_BASE=/app/oracle
Set LIBPATH
$ export LIBPATH=$ORACLE_HOME/lib
Set LD_LIBRARY_PATH
$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib
- Ensure that the $PATH has the following executables: make, ar, ld, and nm.
$ which make
$ which ar
$ which ld
$ which nm
The location of these executables depends on your operating system. On many operating systems, they are located in /usr/ccs/bin, in which case you can set your PATH as follows:
$ export PATH=/usr/ccs/bin:$PATH
- Check jdk version: It should be version 1.4.2 or higher.
$ java -version
If java version is lower, check if version 1.4.2 or higher is available on the host.
$ lslpp -L | grep Java
(or)
$ lslpp -L | grep Java14
$ export PATH=/usr/java14/bin:$PATH
If available, adjust PATH accordingly and check again.
If java version 1.4.2 or higher is not available, work with System Admin to have it installed.
- Check location of oracle inventory in /etc/oraInst.loc
- Run oracle inventory
$ cd /app/oracle/product/OPatch
$ ./opatch lsinventory
Make sure that Oracle version is 11.2.0.3.
- Check XDB: XDB must be VALID.
SQL> select status from dba_registry where comp_id='XDB'
If XDB is invalid, re-install DB – reference Oracle Support note 1292089.1
4. List invalid objects:
For each database on the server, save a list of invalid objects for comparison after SPU patch.
SQL> select owner, object_name, object_type from dba_objects
where status= 'INVALID';
5. Stop database replication tool if any.
6. Stop database monitoring tools, such as Grid Control agent.
7. Shutdown databases for the Oracle Home being patched and stop listener.
8. Check processes:
Make sure that there are no oracle processes running except aioserver process.
$ ps -fu'oracle’ | grep -v aioserver
$ ps -ef | grep sqlplus
Make sure that there are no oraggs processes running except aioserver process.
$ ps -fu'oragg’
9. Check shared file in use:
Following commands should not return any file name:
$ genld -l | grep $ORACLE_HOME
$ genkld | grep $ORACLE_HOME
If these return any file name, have system administrator run following command
$ /usr/sbin/slibclean
Check again.
10. Apply patch
$ cd $ORACLE_BASE/patches/spu_jan14_11203/17478415
$ /app/oracle/product/OPatch/opatch napply -skip_subset -skip_duplicate
An observation: During installation on one host, it might as for Oracle Support login ID / password to make an internet connection to Oracle Support website for any latest information relating patch. Just press return.
Patch will possible complete with warnings, as listed below. Per Oracle these can safely be ignored:
ld: 0711-319 WARNING: Exported symbol not defined: ****
Symbol xxxxxx is already exported.
ld: 0711-773 WARNING: Object ***, imported symbol ***
Symbol was expected to be local.
ld: 0711-783 WARNING: TOC overflow. TOC size: Maximum size:
0711-224 WARNING: Duplicate symbol
Check the following log files in $ORACLE_BASE/cfgtoollogs/catbundle for any errors:
catbundle_CPU_<database SID>_APPLY_<TIMESTAMP>.log
catbundle_CPU_<database SID>_GENERATE_<TIMESTAMP>.log
11. Check inventory again:
$ /app/oracle/product/OPatch/opatch lsinventory
12. Load modified SQL files into databases:
For each database instance running on the Oracle home being patched, connect to the database using SQL*Plus. Connect as SYSDBA and run the catbundle.sql script as follows:
$ cd $ORACLE_HOME/rdbms/admin
$ sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql cpu apply
SQL> @utlrp.sql
SQL> QUIT
Note: Start the LISTENER
For information about the catbundle.sql script, see My Oracle Support Note 605795.1 Introduction to Oracle Database catbundle.sql.
Check the following log files in $ORACLE_BASE/cfgtoollogs/catbundle for any errors:
catbundle_CPU_<database SID>_APPLY_<TIMESTAMP>.log
catbundle_CPU_<database SID>_GENERATE_<TIMESTAMP>.log
13. Invalid objects check
For each database on the server, make a list of invalid objects and compare with the list saved before patching. Take appropriate action if there are new invalid objects
14. Check XDB
If XDB is invalid, there is a possibility that LIBPATH has not been set correctly.
To check status of XDB:
SQL> select status from DBA_REGISTRY where comp_id='XDB'
If status is INVALID:
$ export LIBPATH=$ORACLE_HOME/lib
Shutdown database
Startup database
Run utlrp
If XDB is still invalid, re-install DB – reference Oracle Support note 1292089.1
15. Final check on registry:
$ sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> SELECT * FROM sys.registry$history where comments='CPUJan2014';
It should return one line for CPUJan2014.
Subscribe to:
Comments (Atom)