select name from v$controlfile
This will show all control files with the paths. shutdown database (shutdown immediate) and copy the available control file to the path from where it is lost or corrupted with the same name as above query is showing. After replacing control file, start your database.- If RMAN is configured and at least once backup of control file is taken from RMAN. If yes then connect to RMAN as following
# rman connect target /
Now once connected with RMAN issue any of below mentioned command.
RMAN>restore controlfile from 'PATH and NAME of available Controlfile';
RMAN>restore controlfile from autobackup;
That's it. Just restart your database and monitor alert log file.
Cheers!
Monday, November 21, 2011
Recovering if Control file gets corrupted / missing
If any of control file is missing or get corrupted oracle database won't startup. There are two ways to recover from this error.
Sunday, October 16, 2011
How to resize/recreate /tmp parition in linux
Today I am going to explain about how to resize/recreate /temp partition in Linux. Why you need it? Many software like MySQL writes temporary files in /tmp partition and if /tmp is of less space then sometimes software are unable to function properly. Following are the steps I use to fix this problem:
- umount -l /tmp
- dd if=/dev/zero of=/usr/tmpDSK bs=1024 count=512000
- mkfs.ext3 /usr/tmpDSK
- mount -o loop,rw,noexec,nosuid /usr/tmpDSK /tmp
- usermod -G mysql /tmp
- chmod 0770 -R /tmp
Thursday, May 12, 2011
Shell script that FTP multiple files whose creation time is last 60 minutes
Sometimes you need to write a shell script which can FTP files(specific types) whose creation time is for example in last one hour. I've written following shell script which does the same. I hope it will help you.
#!/bin/bash
cd /opt/archive/
movedFile=`find . '*.csv' -cmin -60 `
HOST=192.168.0.15
USER='user'
PASSWD='xxxx'
for i in $movedFile; do
echo "Uploading file $i ...."
/usr/bin/ftp -n $HOST <
quote USER $USER
quote PASS $PASSWD
binary
cd Records
put $i
quit
END_SCRIPT
mv $i /root/backup/
done
#!/bin/bash
cd /opt/archive/
movedFile=`find . '*.csv' -cmin -60 `
HOST=192.168.0.15
USER='user'
PASSWD='xxxx'
for i in $movedFile; do
echo "Uploading file $i ...."
/usr/bin/ftp -n $HOST <
quote PASS $PASSWD
binary
cd Records
put $i
quit
END_SCRIPT
mv $i /root/backup/
done
Subscribe to:
Posts (Atom)