another paper on Oracle/NT, probably originally from the 
OOW 2000 web site.

9.6K


[reformatted in plain MS DOS text]

Paper 143: Oracle8 on NT - Tips and Techniques

Bruce McCartney and Steve Recsky

DBCORP Information Systems Inc.

Introduction  


The purpose of this paper is to provide the audience with tips and 
techniques gained through experiences with Oracle8 on Windows NT.  It 
is intended for the DBA who is somewhat familiar with Oracle7 or 
Oracle8 on the Unix platform, but is not familiar with Windows NT.  
As NT becomes a more popular operating system, more and more companies 
are considering and deploying database servers on the NT platform.  
This paper will outline some of the architectural differences between 
NT and Unix, as well as some considerations for implementing system 
management, security, and backup and recovery processes.  Finally, we 
will explore some of the unique NT facilities for monitoring 
performance of the database server.


     ***** Throughout this paper, we will identify specific 
           tips and techniques to improve your NT installation 
           with this format.

Oracle Architecture on Windows NT 

     NT vs. Unix 

The Windows NT operating system has a number of distinctive features 
that are new to Unix users. While it continues to improve, you can 
count on a less stable and more mysterious operating environment for
database serving than Unix. Windows NT still requires frequent 
re-boots (install a browser) and locks up more frequently than Unix 
- but if steps are taken to ensure Oracle has been configured to work
on NT, Windows NT offers a simple, cost-effective database server 
platform.

One of the first decisions the administrator must make is what FILE 
SYSTEM to use.  Windows NT still supports the FAT (circa 1980) file 
systems but a superior choice for Oracle database, log and control 
files is the NTFS.  This is because NTFS provides a journaled file 
system for roll-forward and roll-backward recovery, RAID 0, 1 and 5 
supported in the OS, and enhanced auditing support and security 
functionality.  NTFS will also outperform FAT on larger disk volumes.
For the BOOT partition, it is recommended to use FAT for floppy boot
capability.  

     ***** Use NTFS files system for ORACLE files, FAT for the 
           boot partition only.

A few of the unique features of NT files systems are file locking, 
search paths and lack of symbolic links.  Once Oracle acquires a lock 
on a database file it is not possible to move that file while the 
ORACLE is running. This can make on-line data file moves difficult, as
you must COPY the file using the OCOPY program from Oracle.

     ***** Make sure you don't allow datafiles to exceed 4GB 
           Bug:711563. 

Starting with release 8.04, it is now possible to install Oracle 
software in a multiple ORACLE_HOME structure for minor 'dot' releases 
of Oracle.  You could previously install an ORACLE_HOME for Oracle 7.2
and Oracle 7.3, but not for 7.3.2 and 7.3.3.  This new capability 
effects the location of product files, the PATH variable, Service 
names, Program Groups and registry entries.  The benefit of this is 
that it is possible to install patches and maintain certification 
levels of Oracle software, if you need to.  There are some limitations
for multiple ORACLE_HOME use to be aware of.  Oracle Installer checks
to see if the product you are installing exists in another ORACLE_HOME 
and forces you to de-install it before continuing.  Also, in the case 
of 8.05, you can't install OEM 1.6 into and 8.0.4 ORACLE_HOME without 
upgrading the database to 8.0.5.  

     ***** If you want to use OEM 1.6 against an 8.0.4 database, 
           you need to de-install OEM from the 8.0.4 ORACLE_HOME 
           and install OEM 1.6 into a new 8.0.5 ORACLE_HOME.  

Finally, to make multiple ORACLE_HOME work, you need to manipulate the
PATH environment variable.  This can be done using the ORACLE_HOME 
Selector Icon, using the Control Panel | System Properties, or via the 
command line.

The main architectural difference between NT and Unix for Oracle DBAs 
is the concept of a [***]Service[***] and [***]Thread[***]. An NT 
Service is a program that launches automatically with the start-up of
the server, and runs in the background.  A thread is a sub-task 
started under a program executing on NT.  Oracle8 is started as a 
service, and launches multiple threads for its background services 
(DBW0, RECO, LGWR etc). It is important to realize that the Oracle 
service may be started, but the Oracle instance may be down. This can
happen if the start-up failed for some reason (i.e. invalid INIT.ORA 
parameter).

Oracle8 for NT includes the following Services:

     OracleServiceSID

This service contains the ORACLE80.EXE program and all of the 
associated background processes or threads.  By default, when the NT 
Service is stopped, all the threads are killed and it is equivalent to
a shutdown abort.  The service can be stopped via the Control Panel, 
at NET STOP command or by an NT Shutdown.

     OracleStartSID

This service is used by Oracle to start the database instance.  By 
default, it calls the executable STRTDB80.EXE which calls the file 
%ORACLE_HOME%\DATABASE\STRTSID.CMD containing the command:

oradim80.exe -startup -sid ORCL -usrpwd passwd -starttype srvc,inst -pfile 
c:\orant\database\initorcl.ora 

     ***** If problems occur at startup, check the 

           %ORACLE_HOME%\RDBMS80\ORADIM80.LOG


     OracleTNSListner80

This service is the TNS Listener program for SQL*NET (NET80), it runs 
the LISTNER80.EXE program.  You can still use the command-line program
LSNRCTL80 to check the status and start/stop the listener if you prefer.

     OracleAgent

This service is used be Oracle Enterprise Manager to communicate with 
the Enterprise Manager Console.

One thing we have found useful is a couple of freeware utilities that 
provides Unix-like functionality on Windows NT.  The first is a 
command-line sendmail program called BLAT 
(http://gepasi.dbs.aber.ac.uk/softw/Blat.html).

     ***** This utility can be used to email from within CMD 
           scripts for things like backups and monitoring 
           scripts. 

Another useful utility is called BASH, which is an Unix-like shell 
that can be used to run shell scripts on NT 
(http://sourceware.cygnus.com/cygwin/).  BASH is distributed via the 
GNU for Win32 project and is able to run most shell scripts and other 
Unix utilities. 

     ***** You can use BASH to run your existing Unix shell 
           scripts without porting them to CMD files.

One thing to be aware of is that Windows NT has a default behavior 
that is different from Unix for running scripts.  In Unix, if you call 
a HOST command on SQL*PLUS, your scripts waits for return before 
executing the next HOST command.  With NT, your calling script will 
continue without waiting and this can cause problems if commands need 
to be executed in order.  To get around this in your scripts, you can 
use the command-line SQLPLUS (PLUS33.EXE) and call the programs with 
the following syntax:

   SQL> HOST start/wait PROGRAM.EXE

   Or 

   SQL> HOST start CALL PROGRAM.EXE

In Unix, the 'ps' command was used to observe and potentially kill 
Oracle processes, in NT this is not possible. In Oracle for NT, we 
need to observe the threads within ORACLE80.EXE.  To make this easier,
Oracle support published the articles 61674.1 on the Oracle Metalink 
web site to [create] a view:

[reformatted from the original]

create or replace view 
       nt_threads 
    as 
       select 
              Lang_Integer.parseInt(p.spid, 16) "ID_THREAD",
              p.background                      "BACKGROUND", 
              b.name                            "NAME", 
              s.sid                             "SID", 
              s.serial#                         "SERIAL#", 
              s.username                        "USERNAME", 
              s.status                          "STATUS", 
              s.osuser                          "OSUSER", 
              s.program                         "PROGRAM" 
         from 
              v$process   p, 
              v$bgprocess b, 
              v$session   s
        where 
              s.paddr = p.addr 
          and 
              b.paddr(+) = p.addr;

Using this view, you can use the THREAD ID and SERIAL NUMBER to 
observe the Oracle processes in Performance Manager (see below).  

Starting and stopping Oracle can be accomplished in a number of ways:

1.      Stopping the Oracle Service(s)

This method can be done via the Control Panel, the NET STOP command or
by a Windows NT shutdown.  By default, this method kills the Oracle 
processes, which is equivalent to a "shutdown abort".  This method is
not recommended as it causes an automatic recovery to be performed at
the next startup and can occasionally cause other problems.  

     ***** To prevent this behavior, you can change the registry entry 

           HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ORA_%SID%_SHUTDOWN 

           to TRUE.  This will cause a SHUTDOWN IMMEDIATE to be issued 
           when the service is terminated.

2.      Using the Oracle Database Instance Manager ORADIM80.EXE 

You can use this program to control all aspects of Oracle services.  
For example, to shutdown the database use the command:

oradim80.exe -shutdown -sid ORCL -usrpwd passwd -shuttype (srvc,inst) -shutmode I

where shutmode can be a-abort; i-immediate or n-normal.

3.      Use SVRMG30 

You can use command-line server manager to CONNECT INTERNAL and issue 
the shutdown command.

4.      Use Oracle Enterprise Manager Instance Manager

Also, you can use OEM Instance Manager to start and shutdown a database
via a GUI.

[end 1 of 4]

Reply via email to