Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding unallocated LVs

Status
Not open for further replies.

AIXFinder

IS-IT--Management
Jan 4, 2007
97
US
// AIX 5.2 and Oracle 9i

I have the LVs under /dev:

root:/dev> ls -lrt |grep rprod
bla .....
crw------- 1 oracle dba 46, 48 Dec 04 11:55 rprod_0384_002
crw------- 1 oracle dba 46, 85 Dec 04 11:55 rprod_1024_149
crw------- 1 oracle dba 46, 95 Dec 04 11:55 rprod_4096_179
crw------- 1 oracle dba 72, 1 Dec 04 12:02 rprod_0128_052
crw------- 1 oracle dba 72, 93 Dec 04 12:02 rprod_0256_044
bla ......

If any of the LVs above doesn't exit,

i.e.
select file_name
from dba_data_files
where file_name like '%prod_0384_002%';

this query should return 'no rows selected'. Otherwise, it will return a result. Is there a way to automate these two steps with a script?

thx much
 
Please be careful with this process. I see that you checked the database datafiles, but not the redo logs, control files or temp files to make sure that the LV isn't being used as one of these. I'm not sure what would happen if you tried to allocate an LV that is already being used for something else. Perhaps Oracle would be smart enough to return an error rather than proceed, but I certainly wouldn't want to find out the hard way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top