A very large number of file needs to be deleted in short period of time.
created following script.
####################################################################
#!/bin/sh
###################################
#Script to delete large number of files. #Amresh Dubey 09192011
#################################
degree=20
inp_name=xxx.aud
FILE_LOC="/p01/oracle/grid/11.2/rdbms/audit"
find ${FILE_LOC} -name '*.aud' -mtime +7 -print > xxx.aud
file_count=`cat ${inp_name} | wc -l`
if [ $file_count ]
then
rm -f file_list*
cp ${inp_name} file_list
mv ${inp_name} ${inp_name}_$(date +"%m%d%y")
split_count=`expr \( $file_count + $file_count % $degree \) / $degree`
split -$split_count file_list file_list_
for list in `ls file_list_*`
do
( for FILE in `cat ${list}`
do
rm -f ${FILE}
echo "Removed $FILE"
done ) > $list$$.log &
done
wait
fi
##############################################################################
daily oracle
Monday, September 19, 2011
Tuesday, September 13, 2011
Monday, October 12, 2009
Error running SQL and EXEC commands in parallel
Problem:
i got error while performing patch application with hotpatch option.
metalink said to shutdown application process and re-run the patch but it was not possible.
Solution:
I did
ps -eaf | grep adpatch
there were lots of adpatch session ; i killed them one by one and restarted adpatch it was successful.
i got error while performing patch application with hotpatch option.
metalink said to shutdown application process and re-run the patch but it was not possible.
Solution:
I did
ps -eaf | grep adpatch
there were lots of adpatch session ; i killed them one by one and restarted adpatch it was successful.
Friday, September 18, 2009
Oracle document i am reading
Reading about oracle everyday is very important for DBAs, i will update my reading list regularly.
19-Sep-09 (Sat) - http://www.procaseconsulting.com/learning/papers/200303%20oracle%20RAC%20concepts.pdf (Oracle RAC, Data Guard, and Recovery Manager Concepts)
19-Sep-09 (Sat) - http://www.procaseconsulting.com/learning/papers/200303%20oracle%20RAC%20concepts.pdf (Oracle RAC, Data Guard, and Recovery Manager Concepts)
Saturday, April 4, 2009
Issues in Oracle EBS DataBase UPGRADE
I will try to write full document, below is issue list.
Oracle DataBase server component is in INVALID status
Before running the CATUPGRD.SQL , describe the PLAN_TABLE in the SYS schema level.
If you have OTHER_XML column in PLAN_TABLE means , this error wont come.
Otherwise, this error will come when u run the catupgrd.sql for 10.2.0.4.0 patch.
Customers upgrading to 10.2.0.4 or 11.1.0.7 will encounter the bug only and only if they are upgrading a pre-10g (e.g., 9i or 8) db where admin/utlxplan.sql was explicitly run by/as SYS to create a (user) plan table in the SYS schema. I believe this is very rare as DBA won't use the SYS schema to do explain plan of user/application queries.
Customers upgrading to 10.2.0.2, 10.2.0.3, or 11.1.0.6 won't encounter this bug during upgrade because for those releases SQL Performance Analyzer exists in the format of a one-off, which is not run as part of upgrade.
dbms_sqlpa is a package owned by SYS that has a static SQL statement that queries the plan table which is expected to contain the other_xml column. This is why we get an error if SYS.plan_table does not have this column. The other_xml column was introduced in 10.2.0.1 and added to the temporary global plan table plan_table$. plan_table$ was introduced in 10.1 as a replacement to table plan_table which is used to store the result of explain plan command. plan_table has become a public synonym to plan_table$.
Workaround is:
-------------------------
SQL>sqlplus / as sysdba
SQL>drop table plan_table;
SQL>@?/rdbms/admin/utlxplan
SQL>@?/rdbms/admin/prvtspao.plb
SQL>@?/rdbms/admin/utlrp.sql
Following solution didn't work but may work in your case.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
....
Database mounted.
Database opened.
Executed following scripts
SQL> @?/rdbms/admin/catproc.sql
SQL> @?/rdbms/admin/utlrp.sql
Check the status of the components from DBA_REGISTRY
Oracle DataBase server component is in INVALID status
Before running the CATUPGRD.SQL , describe the PLAN_TABLE in the SYS schema level.
If you have OTHER_XML column in PLAN_TABLE means , this error wont come.
Otherwise, this error will come when u run the catupgrd.sql for 10.2.0.4.0 patch.
Customers upgrading to 10.2.0.4 or 11.1.0.7 will encounter the bug only and only if they are upgrading a pre-10g (e.g., 9i or 8) db where admin/utlxplan.sql was explicitly run by/as SYS to create a (user) plan table in the SYS schema. I believe this is very rare as DBA won't use the SYS schema to do explain plan of user/application queries.
Customers upgrading to 10.2.0.2, 10.2.0.3, or 11.1.0.6 won't encounter this bug during upgrade because for those releases SQL Performance Analyzer exists in the format of a one-off, which is not run as part of upgrade.
dbms_sqlpa is a package owned by SYS that has a static SQL statement that queries the plan table which is expected to contain the other_xml column. This is why we get an error if SYS.plan_table does not have this column. The other_xml column was introduced in 10.2.0.1 and added to the temporary global plan table plan_table$. plan_table$ was introduced in 10.1 as a replacement to table plan_table which is used to store the result of explain plan command. plan_table has become a public synonym to plan_table$.
Workaround is:
-------------------------
SQL>sqlplus / as sysdba
SQL>drop table plan_table;
SQL>@?/rdbms/admin/utlxplan
SQL>@?/rdbms/admin/prvtspao.plb
SQL>@?/rdbms/admin/utlrp.sql
Following solution didn't work but may work in your case.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
....
Database mounted.
Database opened.
Executed following scripts
SQL> @?/rdbms/admin/catproc.sql
SQL> @?/rdbms/admin/utlrp.sql
Check the status of the components from DBA_REGISTRY
Tuesday, March 31, 2009
UNZIP all shell script
Below tiny script saved a lot of effort in last production cycle.
#to unzip files in a given folder.
FILES="*.zip"
for f in $FILES
do
echo "Processing $f file..."
unzip -o $f
done
#to unzip files in a given folder.
FILES="*.zip"
for f in $FILES
do
echo "Processing $f file..."
unzip -o $f
done
Sunday, March 29, 2009
Oracle apps JRE plug in update.
download jre plugin from java website and rename it as "j2se16013.exe" {in my case it was update 13 for any other update it should be "j2se160xx.exe" where 'xx' is update number}
uploade "j2se160xx.exe" to web node's $COMMON_TOP/fnd/util/jiit* directory; ftp mode should be bin
Following patch should be applie,
----
5884875
6863618 Mar 28 17:35:27 Mar 28 18:09:22
----------------
=============Patch 5884875===============
cp -r $ORACLE_HOME/forms60/java/oracle/forms/engine/Main.class $ORACLE_HOME/forms60/java/oracle/forms/engine/Main.class.PRE_BUG5884875
cp -r $ORACLE_HOME/forms60/java/oracle/forms/handler/AlertDialog.class $ORACLE_HOME/forms60/java/oracle/forms/handler/AlertDialog.class.PRE_BUG5884875
---
cd $ORACLE_HOME/patch/5884875/oracle/forms/engine
cp Main.class $ORACLE_HOME/forms60/java/oracle/forms/engine/Main.class
cd $ORACLE_HOME/patch/5884875/oracle/forms/handler
cp AlertDialog.class $ORACLE_HOME/forms60/java/oracle/forms/engine/AlertDialog.class
---
Generate JAR Files using Adadmin [Option 1 and 4]
=============Patch 6863618===============
Apply on both tier using adpatch
Run the txkSetPlugin.sh script from the//fnd/bin/
directory, against the web node of your middle tier, where is the directory
in which you unzipped this patch.
uploade "j2se160xx.exe" to web node's $COMMON_TOP/fnd/util/jiit* directory; ftp mode should be bin
Following patch should be applie,
----
5884875
6863618 Mar 28 17:35:27 Mar 28 18:09:22
----------------
=============Patch 5884875===============
cp -r $ORACLE_HOME/forms60/java/oracle/forms/engine/Main.class $ORACLE_HOME/forms60/java/oracle/forms/engine/Main.class.PRE_BUG5884875
cp -r $ORACLE_HOME/forms60/java/oracle/forms/handler/AlertDialog.class $ORACLE_HOME/forms60/java/oracle/forms/handler/AlertDialog.class.PRE_BUG5884875
---
cd $ORACLE_HOME/patch/5884875/oracle/forms/engine
cp Main.class $ORACLE_HOME/forms60/java/oracle/forms/engine/Main.class
cd $ORACLE_HOME/patch/5884875/oracle/forms/handler
cp AlertDialog.class $ORACLE_HOME/forms60/java/oracle/forms/engine/AlertDialog.class
---
Generate JAR Files using Adadmin [Option 1 and 4]
=============Patch 6863618===============
Apply on both tier using adpatch
Run the txkSetPlugin.sh script from the
directory, against the web node of your middle tier, where
in which you unzipped this patch.
Subscribe to:
Posts (Atom)