Archive for the ‘Oracle’ Category
To reset the sys password of a database, do the following:
1) rename/delete ${ORACLE_HOME}/database/PWD{ORACLE_SID}.ora
2) enter the command: orapwd file=${ORACLE_HOME}/database/PWD{ORACLE_SID}.ora password=newpassword
3) start “sqlplus /nolog”
4) login with sys and the newpassword (SQL> connect sys/newpassword as sysdba)
5) now reset other passwords or just be done
Hope this help (especially me)
Bye
Riccardo
Print This Post
This post will assume you just have a fully functional working mail server and you want do download all emails from some mailboxes located on another mail server, tipically located on your service provider’s one.
This post guide will guide you to install and configure fetchmail and use it with your RHEL 5 or newer, you should use all the following information also with CentOS without change any line, but you shoud adapt it to every Linux distribution.
Most likely you want to setup fetchmail to download your domain mailbox over pop3 and inject into Postfix (or whatever you use as MTA).
To install fetchmail use the following :
yum install fetchmail -y
You should decide how to use fetchmail :
* as a daemon
* as a cron scheduled task
This post will show a backup script used to create copies for a server running Oracle 10.2, some application server like FourJS and JBoss and some custom application written in java.
The backup process is divided in some parts :
- Variable declaration and export
- Oracle export and compress
- Data folder export and compress
- Application Server export and compress
- Tape writing of all compress file
- Tape checking
- Mail logging
This post assume you have the following enviroments, if you have something different you should only change variable declaration and comment some lines to have this script works.
- Oracle SID : DB01
- Oracle main folder : /oracle/product/10.2/db_1
- Oracle user/password : system/system
- DATA main folder to backup : /data
- APPSERVER main Folder : /appsrv
- Main backup folder : /data/backup
- Tape device : /dev/st0
Read the rest of this entry »
When using Oracle 10g Release 2, a call to “dbstart" might result (perhaps every time) in the following error message:
Failed to auto-start Oracle Net Listener using /ade/vikrkuma_new/oracle/bin/tnslsnr
This is due to an internal path in the dbstart script.
To correct this, edit the “$ORACLE_HOME/bin/dbstart” script and replace the following line :
ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
With this:
ORACLE_HOME_LISTNER=$ORACLE_HOME
The dbstart script shold now start the listener as expected.
Automating Shutdown and Startup (10.2)
Automating Startup and Shutdown (10.1)
Automating Database Startup and Shutdown (9.2)
Hope this help
Bye
Riccardo
The following is a very simple init script for Oracle on Red Hat Enterprise Linux.
I’m using it successfully in RHEL 5.2 but you can use it on other systems, only double check the various path.
#!/bin/sh
#
# ORACLE Control Script
# chkconfig: 3 80 20
#
# Description: Here is a little startup/shutdown script for Oracle 10g on RedHat systems
#
# Author : Riccardo Riva
#
# Source LSB function library.
[ -f /lib/lsb/init-functions ] && . /lib/lsb/init-functions
#Assuming have Oracle installed on :
# /oracle/product/10.2.0/db1
ORACLE_HOME=/oracle/product/10.2.0/db_1
#Assuming have “oracle” user
ORACLE_OWNER=oracle
# Edit this with your DB instance name
ORACLE_DB=DB_INSTANCE_NAME
if [ ! -f $ORACLE_HOME/bin/dbstart ]
then
echo “Oracle startup: cannot start”
exit
fi
case “$1″ in
’start’)
# Start the Oracle databases:
su – $ORACLE_OWNER -c “$ORACLE_HOME/bin/lsnrctl start”
su – $ORACLE_OWNER -c $ORACLE_HOME/bin/dbstart
;;
’stop’)
# Stop the Oracle databases:
su – $ORACLE_OWNER -c $ORACLE_HOME/bin/dbshut
su – $ORACLE_OWNER -c “$ORACLE_HOME/bin/lsnrctl stop”
;;
’status’)
if su -l $ORACLE_OWNER -c “${ORACLE_HOME}/bin/tnsping ${ORACLE_DB} >/dev/null 2>&1″
then
exit 0
else
exit 1
fi
;;
esac
Create this script and put it in your /etc/init.d/ directory
Make this script excutable
Use “chkconfig” to set the startup or the shutdown for this script in the desired runlevels.
Hope this help avoid wasting time
Bye
Riccardo
Some days ago I had to install an Oracle 10.2.0 x64 on system with Red Hat Enterprise Linux 5.2 x64.
I found some problem, and the following is the prerequisites and some tricks to make the setup process works.
Prerequisites packages :
binutils-2.17.50.0.6-2.el5
compat-gcc-34-3.4.6-4
compat-gcc-34-c++-3.4.6-4
compat-libstdc++-33-3.2.3-61
compat-libstdc++-33-3.2.3-61(i386)
control-center-2.16.0-14.el5
gcc-4.1.1-52.el5
gcc-c++-4.1.1-52.el5
gdbm-1.8.0-26.2.1
glibc-2.5-12
glibc-common-2.5-12
glibc-devel-2.5-12
glibc-devel-2.5-12(i386)
libgcc-4.1.1-52.el5(i386)
libgcc-4.1.1-52.el5(x86_64)
libgnome-2.16.0-6.el5
libstdc++-devel-3.4.3-22.1
libXp-1.0.0-8.i386
libXp-1.0.0-8.x64
make-3.81-1.1
sysstat-7.0.0-3.el5.x86_64.rpm
util-linux-2.13-0.44.e15.x86_64
Tricks
- Make sure to put in your /etc/hosts the ip address and the name and FQDN name of your server as the folowing example :
192.168.1.1 server.myfactory.local server
- Make sure you have SELINUX disabled, using the following command :
cat /etc/selinux/config | grep SELINUX
- Create some necessary user and group :
groupadd oinstall
groupadd dba
groupadd oper
useradd –g oinstall –G dba oracle
- Assing a password to “oracle” user and don’t forget to assign it a usfeul shell, because you must login with “oracle” to an X-Session to run the installer.
Setup Procedure
After checking all the above, you must login as “oracle” to an X-Session (local or remote as you prefer) and run the following command :
runInstaller -ignoreSysPrereqs
You must use “-ignoreSysPrereqs” because RHEL5 is not in the operative system supported list.
This is not a problem, and you could use that option to avoid installer exit with a warning.
If all prerequisites and tricks is fine, you could now procede with Oracle installation.
Hope this help someone avoid wasting time.
Bye
Riccardo
Print This Post
Here is the code for an advanced startup/shutdown script for JBoss.
I’m using it with JBoss 3.2.6 on a RHEL 5.2 Advanced Platform, and all works well.
I’ve added the “status” function for use it in a cluster suite and a new function to check if Oracle DB Server is up and running, otherwise JBoss doesn’t deploy well all developers files.
When you use “start” function, the script use a simple “tnsping” based function that loop into themselves until Oracle is not fully working and then sleep other 10 seconds to start JBoss.
JBoss startup/shutdown script with Oracle Support
Hope this help
Bye
Riccardo
Print This Post
In these days I had to install Oracle 9i (a new version … don’t think so ..) on a RHEL 5 Advanced Platform and after some troubles all works good.
The followings is the steps for a correct setup.
Here we go (skipped basic steps as user creation, standard kernel params and limits settings):
1. Check for required packages:
rpm -q compat-db compat-gcc-34 compat-gcc-34-c++ compat-libgcc-296 compat-libstdc++-296
and
rpm -q compat-libstdc++-33 gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libgcc make libXp
2. Set environment
ORACLE_BASE=/opt/oracle
ORACLE_HOME=$ORACLE_BASE/920
ORACLE_SID=ORCL
LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$PATH:$ORACLE_HOME/binexport ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH
2. Workaround #1
su -
cd /usr/lib
ln -s libstdc++-3-libc6.2-2-2.10.0.so libstdc++-libc6.1-1.so.2
3. Download and Install:
compat-libcwait-2.1-1.i386.rpm
compat-oracle-rhel4-1.0-5.i386.rpm
rpm -Uvh compat-libcwait-2.1-1.i386.rpm
rpm -Uvh compat-oracle-rhel4-1.0-5.i386.rpm –nodeps
4. Workaround #2
su -
cd /usr/bin
ln -s gcc34 gcc32
5. Workaround #3
su -
cd /usr/lib
ln -s libgdbm.so.2.0.0 libdb.so.2
6. runInstaller
7. When NETCA/DBCA will fail
8. Workaround #4
I suggest to apply 9.2.0.8 patchset before.
cd $ORACLE_HOME
rm JRE
ln -s $ORACLE_BASE/jre/1.3.1 JRE
cd JRE/bin
ln -s java jre
cd i386/native_threads/
ln -s java jre
Hope this help someone to avoid waste my same time.
Bye
Riccardo
Print This Post























