Update: Between Brian's suggestion for native oidadmin and the arrival of Oracle 10gR2 for Mac OS X Intel, which includes the oidadmin utility, there are now much better ways to run oidadmin on OS X than the route described in this post.
It's almost a perfect setup. Between SQL Developer, JDeveloper, and Instant Client, I can do a lot of Oracle-related work natively on my Mac. For those instances where I need a tool that doesn't exist for OS X, virtualization software like Parallels and VMware Fusion can help to fill in the gaps. One feature of VMware Fusion that I really like is Unity, especially now that it's available for Linux in Fusion 2.0. Simply put, Unity allows the display of individual windows from a virtual machine without displaying that VM's desktop, offering a slightly more seamless user experience. The application launched from the VM behaves like any other application window on the Mac desktop: it appears in the Dock; I can use Cmd-Tab to select the app, minimize it, etc.
To tie all of that introductory rambling together, here's the topic of the post: an example of creating a Linux Unity application for an Oracle tool that I miss having on my Mac. I use Linux Unity to launch the Oracle 10gAS oidadmin client. The method I'm about to describe is a little bit clunky, but until VMware provides a more straightforward way to add your own apps, it'll do.
- Launch a Linux virtual machine that has the oidadmin tool installed. For my example, I just installed the 10gR2 client software in an OEL5 VM, which was pretty straightforward. Michael McLaughlin has some good material on his blog on installing and configuring Oracle software in VMware Fusion, if you're looking for more direction.
- Log in to your VM as a user that can run the oidadmin tool.
- Invoke Unity mode. (cmd-ctrl-U)
- Launch an application from the VMware Fusion Applications menu (cmd-L). I used Terminal for this example, which for me is the under Utility menu. This will create an application at the host level in your VM bundle, which you'll be using to create an application (oidadmin) of your own. Note: in the course of testing these instructions, I found that I needed to launch Terminal twice to generate the application bundle used in subsequent steps. YMMV.
- Locate the package on your host that contains your VM, navigate to the folder named Applications, and create a copy of the Terminal application. If you're doing this in Finder, you'll need to 'Show package contents' on the VM bundle, as shown:
- Rename the copied application to something suitable. In my case, I chose 'oidadmin'.
- Open the Contents folder of the copied application (again, if you're using Finder, you'll need to Show Package Contents on the app bundle):
- Edit the Info.plist file, and change the values of the CFBundleDisplayName, CFBundleName, and DOGuestAppURI keys to the appropriate values. the first two should reflect the new name of your app, and DOGuestURI needs to contain the absolute path to your oidadmin executable in your VM:
- Save the changes to Info.plist and close the file.
- Launch your new application!
Wow, that's a lot of screenshots
It's true; I went a little Flysketch-happy with this one. If you prefer the command line, here are alternatives to steps 5-8:
- Use cd to navigate to the Applications folder of the VM bundle. No need to 'show package contents,' since the VM bundle just appears as a directory. In my example, the command would be:
- Make a copy of the app bundle created in step 4:
cp -r Terminal\ —\ ClientSoup.app oidadmin\ —\ ClientSoup.app
- Use your favorite text editor to modify the Info.plist file:
vi oidadmin\ —\ ClientSoup.app/Contents/Info.plistThe contents won't be as pretty to browse as they are with the Property List Editor, but hey, they're all just strings, right?
- Enjoy having one less step than those non-command-line people.
Launching the app
Here's your reward for all that hard work:
Once the new application is created, you can launch it just as you would any other Mac application. For best results, your virtual machine should be running and logged in as the use that can launch oidadmin. It's worth noting, however, that if the VM is suspended, attempting to launch the application will resume the VM. You'll just need to wait for the VM to restore its previous state. Here are just a few ways to launch the new oidadmin application:
- Navigate to the Applications folder of your VM package, as in step 5 above, to find the oidadmin.app and launch it directly. (yeah, I know: Ugh.)
- Create an alias to the new application and put the alias somewhere that's easier to access.
- For launching from the command line, you could create an alias:
zathras:~ jpiwowar$ alias oidadmin='open -a ~/VMs/VMware/ClientSoup.vmwarevm/Applications/oidadmin\ —\ ClientSoup.app' zathras:~ jpiwowar$ oidadmin
- Use QuickSilver, if you're into that sort of thing:
It's still not perfect
I'm still tinkering with using the Unity feature in Linux VMs, and figuring out whether the limitations I'm seeing are perceived or real. This is what I've seen so far that is less than ideal:
- I haven't found a way to easily add my own applications to the seeded list in the Applications menu, which is why I engage in the copy app/rename app/edit info.plist cycle described above.
- The host OS doesn't seem to always recognize when an application launched from the VM has exited. Even after closing the window on the VM, an icon for the app still remains in the Dock. To re-open the application, I've found that I either have to launch it twice, or click on the orphan Dock icon to make it go away prior to attempting a re-launch.
That's all, folks
And that's how I run oidadmin on my Mac. I hope that someone out there in Internet-land finds this to be useful. If so, toss me a comment!