remove file/inode entry


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users remove file/inode entry
# 1  
Old 02-28-2012
remove file/inode entry

Hello all,

I am on hpux itanium 11.31...and we run a oracle DB on it. I am testing some backup and restore situation.... first i select some data from the DB.....now i remove some files from the DB where my data is being selected from.....now i select the same data from the DB but i still get my results back.... one would expect my DB would not give me the results as the datafile has been moved at OS level using RM cmd....But futher digging i found that.....the file did NOT actually get deleted.The OS maintains the file while it is held open by any/every process. All I really did was remove the inode entry from the directory file.

so my question is how can i get rid of that inode entry....so when i select the data i would actually get the error saying file is missing....
# 2  
Old 02-28-2012
It's probably better to delete data using the DBMS than by arbitrarily deleting files you don't want the DBMS to use -- that's what the DBMS is there for.

But what's done is done. To remove a deleted file that's in use, stop using it -- i.e., restart the database.
# 3  
Old 02-28-2012
Quote:
Originally Posted by Corona688
It's probably better to delete data using the DBMS than by arbitrarily deleting files you don't want the DBMS to use -- that's what the DBMS is there for.

But what's done is done. To remove a deleted file that's in use, stop using it -- i.e., restart the database.
Thanks for the info...yes i do know we can use DBMS to delete the data...but as i mentioned this is to test our restore situation...what if someone removes the files at OS level and we have to do a restored ?
# 4  
Old 02-28-2012
In that case, rejoice -- if someone removes DB files in use, they will still exist, potentially giving you the opportunity to dump data then re-import any changes after you've restored from backup.

On the other hand, it can mean that you may not even notice when a file is deleted, until the next DB restart, when havoc results... Or strange behavior later if it turns out not all of them were open... Files that aren't present in the folder probably won't be backed up either, so hopefully it hasn't been deleted for TOO long...

You still need to restart the DBMS for the files to truly be deleted.

Last edited by Corona688; 02-28-2012 at 02:10 PM..
# 5  
Old 02-28-2012
Quote:
Originally Posted by Corona688
In that case, rejoice -- if someone removes DB files in use, they will still exist, potentially giving you the opportunity to dump data then re-import any changes after you've restored from backup.

On the other hand, it can mean that you may not even notice when a file is deleted, until the next DB restart, when havoc results... Or strange behavior later if it turns out not all of them were open... Files that aren't present in the folder probably won't be backed up either, so hopefully it hasn't been deleted for TOO long...

You still need to restart the DBMS for the files to truly be deleted.
is there a way to do it without restarting the DBMS for the file to be truly deleted ??
# 6  
Old 02-28-2012
You could restore from backup, restart the db, then truncate the files, perhaps. That would cause way bigger problems than deleting them, since the inode table can't save you from it. Meanwhile..

You didn't plan with this feature in mind, so have started looking for ways to crash it manually -- are you sure it's not time to change your test to fit reality, instead of vice versa? Your test will become "what if I had a hardware failure", not "what if someone deleted these files".

Restarting the database is exactly what you should be doing, since that is when someone cavalierly deleting a file will cause problems, when it will be detected.

There's no way to force-delete the files that doesn't mean either forcibly unmounting a partition or killing the database process in some way, no.

Last edited by Corona688; 02-28-2012 at 06:27 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Specify the inode of a file?

Is there any way to create a file on Solaris 10 (ZFS preferably, but UFS would be helpful as well) with a specific inode number? I need to create a file with a large inode, greater than a 32bit integer. I am trying to test a piece of software which may be incorrectly truncating large inodes down... (16 Replies)
Discussion started by: unblockable
16 Replies

2. Shell Programming and Scripting

sed remove cron entry

Hello, I am not having much luck with removing a entry in cron. I would like to get rid of the following line in /var/spool/cron/root. 1 09 * * 1-5 /etc/init.d/snmpd stop > /dev/null 2>&1I have tried this with no luck. sed -i 's#1 09 * * 1-5 /etc/init.d/snmpd stop >... (3 Replies)
Discussion started by: jaysunn
3 Replies

3. Shell Programming and Scripting

remove brackets and put it in a column and remove repeated entry

Hi all, I want to remove the remove bracket sign ( ) and put in the separate column I also want to remove the repeated entry like in first row in below input (PA156) is repeated ESR1 (PA156) leflunomide (PA450192) (PA156) leflunomide (PA450192) CHST3 (PA26503) docetaxel... (2 Replies)
Discussion started by: manigrover
2 Replies

4. AIX

How to remove the entry for the path in aix

Hi The below command shows as root@cbspsdb02 #export MQSI_USER_EXIT_PATH64=/opt/IBM/ITM/aix513/d4/KD4/config/wmb61/lib root@cbspsdb02 #print $MQSI_USER_EXIT_PATH64 /opt/IBM/ITM/aix513/d4/KD4/config/wmb61/lib I need to remove the entry for the path "$MQSI_USER_EXIT_PATH64". That is... (3 Replies)
Discussion started by: samsungsamsung
3 Replies

5. UNIX for Dummies Questions & Answers

Is there a way to completely remove an inode when the Link count is 2 ?

Currently my data is organised in a volume which has a cache directory (where all the files are first created or transferred). After that there are suitable directories on the volume which in their subdirs, contain files hardlinked to files in the cache. This is done so that the same inode... (1 Reply)
Discussion started by: abcdino
1 Replies

6. Shell Programming and Scripting

Remove copies/duplicates of same entry

Hi, I have a very big (with around 1 million entries) txt file with IPv4 addresses in the standard format, i.e. a.b.c.d The file looks like 10.1.1.1 10.1.1.1 10.1.1.1 10.1.2.4 10.1.2.4 12.1.5.6 . . . . and so on.... There are duplicate/multiple entries for some IP... (1 Reply)
Discussion started by: sajal.bhatia
1 Replies

7. AIX

how to remove the stale entry without a reboot??

my AIX server used to have scsi disk hdisk4. Now i removed that disk. But still it is still listed in lspv. So how can i remove the stale entry of it ? (6 Replies)
Discussion started by: navadeep
6 Replies

8. Ubuntu

fd.file-max against inode

Hi, If inodes need to be 3-4 times greater than fd.file-max. Can you modify the current inode in the filesystem? Can you modify it on the fly? Or only in the creation of FS. I'm using redhat ent 4. Thank you for any comment you may add. (1 Reply)
Discussion started by: itik
1 Replies

9. UNIX for Dummies Questions & Answers

Remove duplicate entry in one line

Can anyone help me how can i print only the unique entry in a line? MI_AP MI_AP MI_CM MI_MF RC_NAP MBS_AP SF_RAN MBS_AP NT_CAR so that it will on output the one unique entry per line. MI_AP MI_CM MI_MF RC_NAP MBS_AP SF_RAN NT_CAR I can't find the same situation on the knowledge... (5 Replies)
Discussion started by: kharen11
5 Replies

10. Solaris

remove an entry in crontab

Hi I have a crontab file of only 1 entry. When I edit it and delete the line, then do crontab -l, the crontab still show the entry that is supposed to be deleted. I did crontab -r to remove the crontab. Is there a way to delete just one entry in the crontab?? thx. (1 Reply)
Discussion started by: melanie_pfefer
1 Replies
Login or Register to Ask a Question