Home » RDBMS Server » Enterprise Manager » Useful tips to run the Database smoothly on Windows
| Useful tips to run the Database smoothly on Windows [message #150852]
||Sun, 11 December 2005 03:22
Registered: February 2005
How I maintain an Oracle10g Database on my PC|
Hello friends. I think I am a newbie, but I like to share my way of handling the post installation tasks. (This is for an Installation on a Microsoft ® Windows XP Professional based Personal Computer and no Server).
Don’t forget to give a password to you OS account through which u use the EM.
My Systems Specifications:
1. Processor: AMD Sempron 2600+
2. RAM: 1 GB.
2. OS: Windows XP Professional (SP1).
3. Database Release: Oracle 10g Database Release1.
4. Other useful Software’s Installed: a) Open Office
b) Adobe Acrobat.
5. Hard Disk: Seagate 80GB.
6. Hard Disk Partitions (10 GB for OS + 10 GB + 30 GB + 30 GB).
I have installed the Operating System on my root C:\ drive and Oracle 10g Database on my D:\ drive.
About the database:
a) Global Database Name : orcl.india.com
b) SID: orcl
c) ORACLE_HOME: D:\oracle\product\10.1.0\db_1
1. Setting the ORACLE_SID parameter:
Open up the “System Properties” page by pressing the “Windows” key and “Pause” key simultaneously. Now go to the “Advanced” page and click the “Environment Variables” button. Here under the “System Variables” I click on “New” and create a new variable named “ORACLE_SID” (without the double quotes) and enter the value as “orcl” (again without the double quotes. I mentioned so, as I gave that name as the SID while I was installing Oracle). I click on “Ok” and exit from it.
2 Please give a password to your Operating System Account.
3. Setting right, the HOST CREDENTIALS PROBLEM:
Open the Start Menu Administrative Tools / Control Panel – Administrative Tools Local Security Policy Local Policies.
Now look on the right hand side of the pane for the Policy Named “Log On as a Batch Job”.
Double click on the value (or) Press “Enter” (or) Right Click and open the “Properties”.
Press the “Add User Or Group” button.
Now, either add the OS username through which u are logging in to your OS or add the Group u belong to E.g. If u are a member of the “Administrator” group, instead of adding your OS username add the “Administrator” group, so that all users of that “Administrator” group can be privileged.
Make sure that you are also a member of the “ORA_DBA” group. (you can check by navigating through Control Panel Administrative Tasks Computer Management Local Users and Groups Users.
You will find your account on the right hand side of the page. Double click it and go to the “Member Of” tab page. Here you will find information pertaining to which all groups you are a member of.)
3. All the major tasks are almost done.
4. Now check whether iSQL*PLUS (http://localhost:5560/isqlplus) and Enterprise Manager 10g (http://localhost:5500/em) are running.
If in case they are not running, try starting them from the command prompt by using these commands: a) lsnrctl start/stop
b) isqlplusctl start/stop
c) emctl start/stop/status dbconsole
Write down OS Shutdown scripts to cleanly shutdown the Oracle related Services on your system. By doing so, you could cleanly turn down services and make your Hard Drive error free ( I had a problem by exposing my Hard Disk to Bad Sectors when I without knowledge tried to shutdown improperly).
How did I do that?
To find out which services are running on your system, go to the command prompt and type “net start” (without the double quotes). This shows you all the running services on your system. Try filtering out the Oracle related services (Oracle services all start with ORACLE).
If you think, you are lazy to type in all those service names as it is, then try this:
Open a command prompt and type “net start > c:\services.txt” (without the double quotes). This creates a text file called “services.txt” in the c:\ drive.
Find out all the Oracle services and copy all the services into a new text file called “stopserver” and save it. Rename the “stopserver.txt” file to “stopserver.bat” and place it in “c:\Windows\System32\GroupPolicy\Machine\Scripts\Shutdown” folder with some modifications in the script file as shown below.
E.g: In the services list running on my system, I had these Oracle services in them:
After I have extracted this service names into the “stopservices.bat” file, I modified the contents of that script file as
net stop OracleCSService
net stop OracleOraDb10g_home1iSQL*Plus
net stop OracleOraDb10g_home1TNSListener
net stop OracleServiceORCL
net stop OracleDBConsoleorcl
This “stopserver.bat” file has to be registered with the OS.
At the RUN in the Start Menu, type “gpedit.msc” (without the quotes. This is the group policy editor). After opening, navigate to, Local Computer Policy Computer Configuration Windows Settings Scripts (Startup/ Shutdown). Towards the right hand side, double click the “Shutdown” name. Add the “stopserver.bat” file location in the “Script Name”. (When you click “Browse”, u can see the “stopserver.bat” file. Point to it).
Do not add any script parameters.
That’s it. All the post installation tasks are done…
Me setting the system to automatically stop the Oracle related services before the OS shuts down lets the OS and the Database runs fit n fine.
BUT, there is a problem with the “OracleDBConsoleorcl” service, as it asks for a manual Y/N before shutting down. Since WINDOWS does not show us what is going on the backend, we might end up in a very long time (~9 minutes on my system) for the system to shut down.
So what i advice my dear friends is that, you yourself manually invoke the “stopserver.bat” and shutdown the scripts (By placing a shortcut to the “stopserver.bat” on the Desktop or on the Start Menu). By this process, a DOS box appears and you can press the ‘y’ for the “OracleDBConsoleorcl” service to complete and all the Oracle related service shutdown successfully.
By doing the manual shutdown, it takes only ~1-1.5 minutes to shutdown the system (yes including the services shutdown).
OOPS, I did not manually invoke the script, now what????
All u have to do is to wait for the system to shutdown .
Restart the system, and remove the “shutdown” privilege to your OS account, through which you access Oracle. (You can do this by, Control Panel Administrative Tools Local Security Settings. In the pane on the right hand side, locate the “Shutdown the system” policy. Open it. From there, u delete your OS user from the list.)
What the hell is this about?
As said above, u may face a situation when accidentally u shutdown the system without shutting down the services, Then u have to wait for a long time.
By removing the “Shutdown System” privilege from your account, you will only be able to “log off” from your system, but not shutdown. Then you will come to remember that I have not shutdown the services. Then you login and do the things right.
Thank you for reading all this.
If there are any mistakes or any suggestions, please please let me know.
BYE and always keep smiling,
(OCP 9i Application Developer,
OCA 10g Database Administrator)
Current Time: Thu Dec 02 04:00:27 CST 2021