Call (800) 766-1884 for Oracle support & training
Free Oracle Tips


Oracle Consulting Support
Oracle Upgrades
Use New Oracle Features
Oracle Replication Support
Oracle Training
Remote Oracle DBA
System Documentation
Oracle Tips
Oracle Performance
 

Free Oracle Tips


 

HTML Text

BC Oracle tuning

Oracle training

Oracle support

Remote Oracle

 

Starting and Stopping Oracle on Windows

Oracle Tips by Burleson

Advanced Oracle Utilities: The Definitive Reference by Rampant TechPress is written by top Oracle database experts (Bert Scalzo, Donald Burleson, and Steve Callan).  The following is an excerpt from the book.

Starting and Stopping on Windows

As mentioned in the previous chapter, the dbstart and dbstop shell scripts do not exist on Windows platforms. The Oracle database startup and shutdown is implemented quite differently. The oradim utility is used on the Windows platform to perform these tasks.

 

C:\Oracle\bin\oradim -startup -sid ORCL92 –usrpwd manager
-starttype SRVC,INST -pfile C:\Oracle\admin\ORCL92\pfile\init.ora

  • startup — Indicates that the specified instance should be started.

  • sid — The SID of the database to start.

  • usrpwd — The password for the database user.

  • starttype — Specifies whether to start the instance, the service, or both (SRVC, INST).

 The following command can be used to shut down the instance with oradim:

 

C:\Oracle\bin\oradim -shutdown -sid ORCL92 -shutttype SRVC,INST
–shutmode A

 

Notice that no password is needed to perform this task.

 

The shuttype parameter specifies what is to be stopped – the service (SRVC), the instance (INST), or both (SRVC, INST). The shutmode specifies the method that should perform the shutdown – (A)bort, (I)mmediate, or (N)ormal.

 

Each operation, regardless of success, is logged in the oradim log file (ORACLE_HOME\database\OraDim.Log). This file should be checked for errors after each oradim command is executed.

 

The oradim utility provides more than just the ability to start and stop Windows databases. Oradim can create and edit databases. It also allows DBAs to configure script-based installation mechanisms, bypassing the Oracle Database Configuration Assistant’s graphical user interface (GUI).

 

For a reference of all oradim commands, use the oradim–help command.   A good Oracle DBA will make him or herself intimately familiar with the oradim options, and DBAs that start in Linux will often create his own dbstart/dbshut scripts that call the oradim procedure.

External job scheduling

The cron daemon is the Unix system task that runs scripted jobs on a predetermined schedule.  The crontab command is used to set up the schedule for the execution of those jobs.  Much of the job of crontab can now be managed by the Oracle scheduler. However, many DBAs still use crontab rather than Oracle scheduler so that scheduled jobs can be managed from a single location.

 

As shown in Table 4.1, the crontab command has several options with different purposes.

 

Option

Purpose

-e

edit the current crontab file using the text editor  specified by the EDITOR environment variable or the VISUAL environment variable

-l

list the current crontab file

-r

remove the current crontab file

-u

specifies the user’s crontab to be manipulated. This is usually used by root to manipulate the crontab of other users or can be used to correctly identify the crontab to be manipulated if the su command has been used to assume another identity.

                    Table 4.1:  Crontab Options and Purposes

 

Crontab also accepts a file name and will use the specified file to create the crontab file.  Many users prefer to use this option rather than the crontab -e command because it provides a master file from which the crontab is built, thus providing a backup to the crontab.   The following example specifies a file called mycron.tab to be used as the input for crontab.

 

$ crontab mycron.tab

 

The crontab -l command is used to list the contents of the current crontab, as in the example below.

 

$ crontab -l

#**********************************************************
# Run the Weekly file cleanup task at 6:00AM every Monday
# and send any output to a file called cleanup.lst in the
# /tmp directory
#**********************************************************
00 06 * * 1 /home/terry/cleanup.ksh > /tmp/cleanup.lst

#**********************************************************
# Run the Weekly Management Report every Monday at 7:00 AM
# and save a copy of the report in my /home directory
#**********************************************************

00 07 * * 1 /home/terry/weekly_mgmt_rpt.ksh wprd > /home/terry/weekly_mgmt_rpt.lst

 

Now, if deleting all the entries in the crontab is desired, use the –r option.

 

$ crontab -r

The format of the crontab file

The crontab file consists of a series of entries specifying what shell scripts to run and when to run it.  It is also possible to document crontab entries with comments.  Lines which have a pound sign (#) as the first non-blank character are considered comments.  Blank lines are completely ignored.  Comments cannot be specified on the same line as cron command lines; comments must be kept on their own lines within the crontab.

 

There are two types of command lines that can be specified in the crontab: environment variable settings and cron commands.

 

Oracle Consulting

  
 

Oracle performance tuning software 
 
 
 
 

Oracle performance tuning book

 

 
 
 
Oracle performance Tuning 10g reference poster
 
 
 
Oracle training in Linux commands
 
Oracle training Excel
 
Oracle training & performance tuning books
 
   

Copyright © 1996 -  2011 by Burleson Enterprises. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.