Friday, September 7, 2007

Working with Paramter files

My best practice and always prefer the following when working with the parameter files,since it will always eliminate the accidental overwriting of init.ora file,

sunbolt01:
.........

$/optware/product/oracle/10.2.0.2/dbs/initnamaste.ora

the content of the initnamaste.ora is,

$cat initnamaste.ora
pfile=/nutsnbolts/oradata/namaste/spfilenamaste.ora


(I always keep the spfile along with the database datafiles)

now when I want to edit the parameter file for changing or adding a parameter,will do as follows,
$sqlplus "/ as sysdba"
SQL>create pfile='editnamaste.ora' from spfile;
SQL>shutdown immediate;
SQL>exit

now I will work with the editnamaste.ora and change or add the new paramter to editnamaste.ora
after that I'll create the spfile from editnamaste.ora, so no hassle of missing backup of existing init.ora and spfiles and
overwriting of parameter file etc.,
SQL>sqlplus "/ as sysdba"

SQL>create spfile='/nutsnbolts/oradata/namaste/spfilenamaste.ora' from pfile='editnamaste.ora';
SQL>startup
SQL>exit

Wednesday, September 5, 2007

One userid I never want to loose.....

If you ask me which is very very important in my day to day life,
I'll say and never dare to think that I can live in my career
without having that!
That is,
my Metalink Userid.
Metalink became part of my life and I cannot live with out accessing the metalink even for a single day.

What is your say?

Sunday, September 2, 2007

Game Theory

Two concepts of Game Theory:-
"minimizing the maximum loss and maximizing the minimum gain."
Try to apply the theory whether is managing the databases or protecting the data.

Saturday, September 1, 2007

Shell script to rename set of files

For me the need to rename the files under unix is almost a frequent task,
like backup the set of unix files while some activity will overwrite the existing files or using the database creation template scripts to create another new database.
I use the following simple shell script to rename the files,

For example we have a set of files as follows,
/var/tmp/orainstall1.sql
/var/tmp/orainstall2.sql
/var/tmp/orainstall3.sql
/var/tmp/orainstall4.sql
/var/tmp/orainstall5.sql
and I want to rename them as
oracreate1.sql,
oracreate2.sql,
oracreate3.sql,
oracreate4.sql,
oracreate5.sql
I am listing the files under /var/tmp
$cd /var/tmp
$pwd
$/var/tmp
$ls ora*.sql
$orainstall1.sql
orainstall2.sql
orainstall3.sql
orainstall4.sql
orainstall5.sql
--script start here
$for file in orainstall*.sql;do
newfile=`echo $file | sed 's/install/create/'`
mv $file $newfile
done

--script end here
Checking the files for change
$pwd
/var/tmp
$ls ora*.sql
oracreate1.sql
oracreate2.sql
oracreate3.sql
oracreate4.sql
oracreate5.sql
$

Happy testing..