|
|
|
Install Cygwin-Go to http://www.cygwin.com, download 'setup.exe', run it.-You need the default download plus:
-After the download is done, right click on the icon 'Cygwin' to get the properties and in the options add 'quick edit'. This is in fact the cut and paste of the mouse -Setup.exe has put an icon on your desktop: launch cygwin. Now congrats, you are in a Unix type shell on windows. type : mkdir -p /usr/local/bin If you are not administrator of the windows box, you may have to issue a issue a chmod 755 on sqlplus binary and tnsping The preferred location to install Smenu will be /opt/smenu, so we put tar fil in /opt . tar xvf ./smenu_tar10g.tar This create a directory ./smenu, and 3 files : -install.sh -README.txt -addpar.tail. Here is the content of your directory after the tar xvf :
Now to customize your installation, type : sh install.sh ./install.sh (reply to questions) Installation customized ! To launch Smenu, type :
Change directory to ./smenu and launch smenu.
that's it! To be complete when I usually create a file I call '.bpa' in my home directory. When connect into Cygwin, I type: . ./.bpa and this is enough to load Smenu. The file .bpa usually contains this:
How to add Shortcuts to your environmentShortcuts is just an easy and convenient way to expand your shell. They act as any unix command, except that they trigger Oracle SQL, output the result and return you to the dot prompt. This is an alternate way of using Smenu and also the preferred method.To add the shortcuts in your environment, exit Smenu, go to your SBIN directory (Directory where Smenu is installed), and just type ". ad" ( or . ./ad). Shortcuts works only in ksh.The SBIN directory is the root directory where Smenu is installed Why using Shortcuts : Shortcuts add to your normal prompt a lot of commands. It gives immediate answer to your questions. Instead of journeying in all menu to launch a series of actions, you have the ability to launch these actions in sequence from the prompt. Automated connection : Each time you launch a command or call a Shellscript that requires to connect to the Oracle DB, you must provide an Oracle account and a password. If you don't want to type the same user/password again and again, Smenu gives you the ability to save this information. In order to save this information, launch Smenu (type 'sm' or smenu.sh in SBIN ) and go to module 1 option 2 to add a user and a password. Some shortcuts works only with the user 'SYS', but usually they works using the default user of your SID. General default user and customized default user: Smenu use a general default user (Defined in SM/1.1 and stored in SBIN/smenu.env). This user will be retrieved automatically by Smenu whenever it must connect to a DB. However, there are 4 exceptions to this rule : # The command you launch requires Smenu to use 'SYS'. If SYS is not defined then the command failed to execute TRICK
# Smenu leaves you the ability to override the default user for each instance. Then for each program of Smenu you call, it will first try to fetch the default user for the corresponding ORACLE_SID. Thus it is important to position yourself in a target SID. Use 'oa' which is a nice and handy redifinition of the 'oraenv'. This option is available in Smenu/1.3.
How to add new shortcuts : It is possible to add your own shortcuts : type 'vp' to edit addpar.sh (in SBIN/scripts), add the shortcuts in one of the 4 sections. Any shortcuts before 'sec3' is not visible by any 'sp' (show parameter) commands. However it will be part of your environment. if you add a shortcuts after 'sec3' then run 'rgs' to regen the sp views. Be aware that your own shortcuts will be lost when you update release, so we advise you to keep a separate copy of 'addpar.sh' and reinitialize after each refresh. How to easily add Smenu to your environment: If you don't want to put 'addpar.sh' (ad) in your environment, you may do the following to add quickly smenu just for you Add in you oracle (or what else is the owner of the DB) an alias called smd : alias smd='cd /$SBIN' Where sbin is the Smenu root directory, so that you can directly attack with the next command : '. ad' Use Smenu toward remote DB: The best way to achieve this, is to add a dummy entry in your oratab (so that you can use 'oa' to switch). Add the sid in the tnsnames.ora on your local machine and set the password for the remote user in the form <passwd@<TNS_ENTRY>. This feature is very interesting to manage NT SID as if they were on Unix box or to setup a central Unix box. Troubleshooting after refresh smenu: If you want to install latest version of Smenu without loosing your current setting, you may run 'SBINS/refresh.sh'. This script suppose that you have a new version of Smenu, gzipped or not, in SBIN/.. After the operation you must type 'ad' to add all new shortcuts (refresh.sh automatically regen all shortcuts). Verify that the first line of smenu.env is '#!/bin/ksh' Otherwise your problem lies in $SBINS/addpar.sh. edit this file and verify that 'SBIN=' is pointing to your path. Modify default parameters: Smenu does not provide a crypting function for password. If you have a crypting function in user, you must edit and replace the function 'smenu_get_passwd' in directory './smenu/scripts' with your own function or call. 'install.sh' create a file 'smenu.env' in the SBIN [./smenu] directory. Here is the content of this file :
Email: bpolarsk@yahoo.com Last updated : 06 April 2006 |