Main Problem: The SAN storage which is storing the ORACLE ASM database, cannot reclaim the free space after you eliminate one or more databases or tablespaces. Therefore at the end the storage will go offline as it indicates that the storage capacity is over and there is no more free space, whereas in reality there might be hundreds of GB free space.

Solution: Don't even think about any other solution rather than the one which I'm going to mention here. To overcome this problem, there is a utility which has been created by cooperation of HP 3PAR and Oracle, known as ASM Reclamation Utility (ASRU).

Perl problem: Now I'm stuck because when I try to use this utility it will throw me an error at the middle of the reclamation process saying that "Zerofill is not executable". This utility is containing 2-3 scripts which are written in Perl language, and when I run the main script (ASRU.pl) by using "perl ASRU.pl - MyDiskGroupName" it will start the process and at the middle that sounds that it wants to call the second script (zerofill), but it can not and say that : Zerofill is not executable

Specifications: OS : Win Server 2008 R2 x64 Oracle : 11gR2 x64 Visual Studio 2012 is installed to run the script from its command line All Microsoft .Net framework is are installed Windows SDK is installed The latest version of ActivePerl is installed and ppm is used to install and update all required packages (such as DBI, and DBD,...)

I can be considered a novice in Perl, but I need this problem of mine by this utility. I don't know how can you guys help me, but I'll appreciate your assists in advance.

First of all thanks for your reply, and your willingness to help me. No, I can not do such a thing, e.g. executing "C:\>ASRU.pl". How to fix? what do you mean by fix, and how am I supposed to fix? Windows CMD does not recognize ASRU.pl as a command. I did not find anything about zerofill in ASRU.pl script to modify it.

Hi, Thanks for your assists, I found out the permission in windows is different in Unix or Linux, and you can not modify these permissions in windows. So I installed "Cygwin" to do that. I went to the directory in which the zerofill file exist and then I did like this: chmod ugoa+rwx zerofill

another time I did like this: chmod 777 zerofill

also I've given the whole directory full permission to everyone, but it does not make any change at all, and every time I use this command: ls -l zerofill I'll get this result: -rwxrwxrwx+ 1 Administrator None 4235 Nov 26 05:14 zerofill

Your original error message was not related to file permissions. It was due to the fact that Windows did not know how to execute the script because there was no .pl file type association. You'd have the same error/problem running batch files if you remove the .bat file type association.

With a normal install of Activestate perl, the install process will create that .pl file type association. However, you can uncheck that option and not have it create that association, which is what it appears you did. So now you need to manually create that file type association.

When running scripts under Cygwin, instead of using a file extension to determine how to execute a script, it uses the shebang line (the first line in the script) to point to the interpreter. In addition to that, the execute bit needs to be set which is done via the chmod command and you need to execute it under the Cygwin environment instead of the Windows prompt.

What error message do you get when running the script under the cygwin environment?

I appreciate your willingness for helping me. the "zerofill" file does not have any extension such as ".pl"

As I said the main file is "ASRU.pl" that I run it in the Visual studio's command line using the follwing command: "perl ASRU.pl MyDiskGroupName" Then it shows the progress, but at the middle of running it needs to call "zerofill" (NOT zerofill.pl) it will ask me that specify where the "zerofill" is located because of these lines of code:

and then it will tell me that the file which I am indicating is not an executable script because of this:

if(! -x $script) { print "\n $script is not executable\n"; return; }

whereas, if everything was fine it was not supposed to ask anything or throw me this error, but also it is supposed to execute the "zerofill" (and other files) to accomplish the job automatically.

I am not that much into programing or writing scripts, as my background is in storage, cloud computing, and network. So I can be seen as a novice in this area. But my problem needs to be solved by running this script.

I read the script and I thought that it should be because of permission issues as I investigated in the switch in the script. "x" is used with "chmod" for making a file executable as I understood, and when according to my system's environment and configuration the script's trend is navigated to this switch it is set to warn me that the "zerofill" file is not executable.

I tried to make the attribute of this file "executable" (or something like full permission for everyone). But very soon, I got to know that with windows permission can not modify the permission which is given to a file in a Linux or UNIX. Even I planned to change the permission of this file in Linux, and then bring it back to windows, but again I understood that you can do this, but again when the file come back to windows it will loos the execute permission permission as it could not keep execute permission when I took these scripts for the first time (though I did not try this way, and I just read about it).

That's why I installed Cygwin to provide a Linux command line environment to be able to give the required permission (not for running the script, although after that I tried to use it to run the script inside, but bunch of errors appeared and I just forgot this idea). I don't know how silly that sound to you, but that is my challenge and I've to find a way for that.

Then I tried this one: "chmod ugoa+rwx zerofill"

and so many other chmod, but whenever I used "ls -l zerofill", I could see that no change is applied to the file.

I don't know what to do and I don't really know whether the problem is with permission or not.

I'll be happy if you or anyone else share their idea about this with me.

Again I want to emphasize that the "zerofill" does not have any extension like ".pl", and my question is that, can it be because of that or not.

Your main problem is that you're not understanding the differences between Windows and *nix in how they determine how to execute programs/scripts.

Windows uses the file extension and *nix uses the shebang line.

For example, a plain text file with an extension of .txt is not by itself executable, but if you double click on it, it will open in your default text editor. That's because you have a .txt file type association that Windows uses to know which program (text editor) to pass the file to in order to open it up.

You need to either add the .pl ext to zerofill and do the same in the script and create the .pl file type association OR you need to adjust the script to execute perl and pass zerofill as its argument just like you're doing when you execute "perl ASRU.pl MyDiskGroupName".

At this point I'm assuming you're running the script at the Windows cmd prompt which uses your Activestate perl installation. If you're running the script under the cygwin environment, which is an emulated bash shell, you would then need to use chmod to set the correct permissions and verify that the shebang line in each of the scripts is correct.

I did this one: You need to either add the .pl ext to zerofill and do the same in the script and create the .pl file type association

but same error apears, but this time intead of saying "zerofill is not executable" it throws me this error: "zerofill.pl is not executable"

while I modified the codes correctly.

Also take a look at this one please:

ASRU is a shell script wrapper for ASRU.pl. It calls ASRU.pl with appropriate arguements.

ASRU.pl has the code that does the necessary actions to reclaim the allocated but unused space. It calls the zerofill script with appropriate arguements appended.

zerofill script takes the power, name of the disks and ranges to be zeroed as arguements. It writes zeroes using the 'dd' command. This script can be customized.

But I cannot run asru (not asru.pl), as it gives me this error:

Can't exec /bin/sh at asru line 1.

that's why I ignored it, and started by running ASRU.pl not ASRU. I think if I can solve this problem, it will solve zerofill problem as well, as both of them have same problem which is not executing in windows command prompt. What do you think?

All of those scripts are written for and expected to be run on a *nix system. If you want to run them on Windows, you'll need to make the appropriate changes to the scripts. I need to start prepping for thanksgiving dinner, so I can't spend any time today showing or explaining or teaching you Perl.

Thanks for your reply, You are totally right. This is exactly what I've beleived from the beginning but I need to know how to change it in windows. This is my question. Don't ask me to change my OS or don't nag at me that why I'm using Windows as the OS here. There are so may other thing which forced me to use windows and I don't want to go through that as it is irrelevent.

Although I might not know Perl that much you know, but I can rationally realize that unlike you, I believe it is because of permission issues not extension or file associations. The problem is how to change these permission in windows, even when I used Cygwin, and used appropriate commands which are mentioned in previous posts, still they won't be changed while I can change other file's permission!

Perl scripts are plain text files. They are not executable binary files.

As I said earlier, to execute Perl scripts in windows you need to either create a .pl file type association that point to the perl interpreter (i.e. perl.exe) or you need to execute the perl interpreter (perl.exe) and pass the filename of the script to it as an argument. The other option is to run the scripts under the cygwin environment which uses the shebang line in the script to point to the interpreter.

Did you look over the links I provided that show you how to create the .pl file type association?

I'll look at the links in which you gave me right now to see what you mean exactly, but before that I want to emphesize one more time that, I do not have any problem by running any .pl file in my windows CMD enviornment at all. I just run any .pl file like this: "perl AnyPerlFile.pl" And they all will be executed without any problem, and all .pl files are associated with ActivePerl in my PC. The "zerfill" does not have any extension. I don't know whether it is a problem or not. I just can obviously see that, when the code in "ASRU.pl" wants to check the "zerofill" file permission, it will be seen as a file in which does not have execute permission. Now I'll double check the links that you posted before. Thanks.

FishMonger is correct. Your utility is written for Unix. You only have two choices. You either use Unix or rewrite the utility for windows. You have already excluded the former. You may have legal as well as technical problems with the other. It is worth a great deal of effort to find a windows compatible program that will do the job for you.

Ok, you have decided to take on the job yourself. Do not fool yourself into thinking that the current symptom is all that you have to fix. That approach would be much like peeling an onion. You would never be done (or would not know it if you were.) First read all of the document perlport (type: perldoc perlport). Take any advice that FishMonger offers. You have a lot to learn about both operating systems as well as Perl before you have any chance of success. Good Luck, Bill

Yes, I did. And no change in permission at all. let's assume I don't know what is Windows and perl at all. How will you justify this?

Anyway, many thanks for your helps, and I'll try to read more about perl and also I'll take your advice about file association in Windows and will read the links and apply them in my PC and will let you know about the result later on.

I uninstalled and reinstalled the Cygwin and again tried these and got the following results:

chmod ugoa+rwx zerofill

ls -l zerofill

-rwxrwxrwx 1 Administrator None 4235 Nov 26 05:14 zerofill

then:

chmod 777 zerofill

-rwxrwxrwx 1 Administrator None 4235 Nov 26 05:14 zerofill

Now, I'm pretty sure that, the problem is with permission, but I can not change it in windows, and the real problem is running these codes in windows. And I have to run them in windows for some reasons.

Can you tell me in general case how should a file's permission be shown to be able to execute or even more to have the full permission for everyone?

And what is the difference between giving permission by numbers and giving by words?(ugoa+rwx & 777)

I'll be so thankful if anyone can help me with this issue, and tell me how to change a linux or unix file's permission in Windows. Thanks in advance.