Oracle Consulting Oracle Training Oracle Support Development
Home
Catalog
Oracle Books
SQL Server Books
IT Books
Job Interview Books
eBooks
Rampant Horse Books
911 Series
Pedagogue Books

Oracle Software
image
Write for Rampant
Publish with Rampant
Rampant News
Rampant Authors
Rampant Staff
 Phone
 800-766-1884
Oracle News
Oracle Forum
Oracle Tips
Articles by our Authors
Press Releases
SQL Server Books
image
image

Oracle 11g Books

Oracle tuning

Oracle training

Oracle support

Remote Oracle

STATSPACK Viewer

Privacy Policy

 

 
   

Oracle on Windows � Things to Know Plus a Few Tricks Part 2

Expert Oracle Tips by Mark Sorger.


By Mark Sorger

OFA on Windows

In Windows, you can still use OFA for your file layout. The idea is the same as UNIX or anyplace else. Here is the 10g Release 1 layout.

Example of OFA on Windows - Source: Oracle Database Platform Guide 10g Release 1 for Windows

C:\oracle          --First logical drive
   \ora10          --Oracle home
    \bin           --Subtree for Oracle binaries
    \network       --Subtree for Oracle Net
    \...
   \admin          --Subtree for database administration files
    \prod          --Subtree for prod database administration files
     \adhoc        --Ad hoc SQL scripts
     \adump        --Audit files
     \bdump        --Background process trace files
     \cdump        --Core dump files
     \create       --Database creation files
     \exp          --Database export files
     \pfile        --Initialization parameter file
     \udump        --User SQL trace files
F:\oracle          --Second logical drive (two physical drives, striped)
  \oradata         --Subtree for Oracle Database files
   \prod           --Subtree for prod database files
    redo01.log     --Redo log file group one, member one
    redo02.log     --Redo log file group two, member one
    redo03.log     --Redo log file group three, member one
G:\oracle          --Third logical drive (RAID level 5 configuration)
  \oradata         --Subtree for Oracle Database files
   \prod           --Subtree for prod database files
    control01.ctl  --Control file 1
    indx01.dbf     --Index tablespace datafile
    rbs01.dbf      --Rollback tablespace datafile
    system01.dbf   --System tablespace datafile
    temp01.dbf     --Temporary tablespace datafile
    users01.dbf    --Users tablespace datafile
H:\oracle          --Fourth logical drive
  \oradata         --Subtree for Oracle Database files
   \prod           --Subtree for prod database files
    control02.ctl  --Control file 2

Windows to UNIX Commands

There are commands that do the same things in Windows from the command prompt as in UNIX, they�re just different (of course). This, as we will see, allows us to do some scripting as well as work at the command prompt. Below is a simple table showing some common UNIX commands and their Windows counterparts.

UNIX            WINDOWS
cat          type, copy
cd           cd (plus if changing drives, type the drive letter first)
             e.g. C:>D:
                  D:>cd
D:\test
cp           copy, xcopy
cron         at, Task Scheduler
ftp          ftp
grep         find, findstr
ls           dir
man          help
mkdir        mkdir
more         more
mv           rename - to rename, move - actually move a file
netstat      netstat
nslookup     nslookup
ping         ping
ps           Task Manager, tasklist
pwd          cd
rm           del
rmdir        rmdir
telnet       telnet
traceroute   tracert
who          net session

 

Some Commands are actually the same�.

You will be happy to see that there are some things that work the same way as in UNIX�.

  • ping

  • netstat

  • ftp

  • more

  • mkdir

  • nslookup

  • Pipes

          Example:: dir | findstr �<DIR>�

 A quick word about FTP�.

The ftp client piece on Windows (outbound) from your server will work from the command prompt. However, if you want to FTP to your Windows Server, you will need to install Microsoft IIS (Internet Information Services), and specify the FTP Service. The FTP Service does not get installed by default in the Windows Server 2003 IIS Installation.

Another quick word - about ODBC on 64bit�.

Sometimes you will need to run a 32bit application on a 64bit server that requires an ODBC connection. If you simply run the Microsoft ODBC Administrator and add the datasource, your 32bit application will not see it.

You will need to run the 32bit Microsoft ODBC Administrator, which is located in the SYSWOW64 folder in your Windows software directory. For example:

C:\Windows\SYSWOW64\odbcad32.exe

Windows 2008 UAC

Windows 2008 has a feature called UAC (User Account Control). In a nutshell, what it does is break your session token into a privileged and non-privileged token. By default, everything you do is done non-privileged unless you tell Windows differently.

This will require you to use �run as administrator� for anything you wish to do that requires elevated access, even command prompt or explorer. You will need to check �run with highest privileges� on batch jobs if they require privileges. UAC can be disabled if your IT Security allows it. Usually you need to live with it.

Microsoft Technet has a good writeup on UAC

Batch Jobs with the �at� command

Batch jobs can of course be submitted using the Windows Scheduled Tasks GUI.

However, the �at� command allows you to submit batch jobs from the command line, using the syntax:

at hh:mm /every:d  <path_to_batch_file>

Example:

at 20:00 /every:M,T,W,Th,F c:\adminscripts\exports\export.bat

If you want a logfile, use cmd.exe /c, and use the > to direct the output. The path to the script and the output need to be in the same set of quotes.

Example:

at 20:00 /every:M,T cmd.exe /c "c:\scripts\export.bat > c:\scripts\export.log"

Two Handy Utilities

  • Blat.exe � a public domain program to send emails. What it does is forward the email to your email spooler/server. This is very simple to use; just download the utility, place blat.exe in the c:\windows\system32 folder, and point it to your email server.

    Once you�ve done that, you can use the blat command to send emails from scripts.Example of initial setup (only done once): Blat �install my_smtp.edu Userid_on_email_server Using blat to send an email:

    Syntax: Blat <filename> -t <destination emailaddress> -s <subject>blat D:\oracle\oradata\orcl\export\exp.log -t admin@email.com -s "Exp complete"
  • Soon.exe � found in the Windows 2000 Resource Kit, allows you to run a batch job every xx seconds. You can also schedule recurring tasks in the Task Manager in Windows 2000 and above, but it�s a bit tricky. You need to schedule the task, open the Properties after, choose the schedule tab, click the advanced button, and check recurring event.

    Example of rerunning a script every 2 minutes using soon.exe:

    c:\adminscripts\soon\soon.exe 0120 c:\adminscripts\uptime\check_DBSvc.cmd

 
 
 
Get the Complete
Oracle Tuning Details 

The landmark book "Oracle Tuning: The Definitive Reference Second Edition" has been updated with over 1,150 pages of expert performance tuning tips. It's packed with scripts and tools to hypercharge Oracle 11g performance and you can buy it for 40% off directly from the publisher.
 


Download your Oracle scripts now:

www.oracle-script.com

The definitive Oracle Script collection for every Oracle professional DBA

 

 
   

 Copyright © 1996 -2016 by Burleson. All rights reserved.


Oracle® is the registered trademark of Oracle Corporation. SQL Server® is the registered trademark of Microsoft Corporation. 
Many of the designations used by computer vendors to distinguish their products are claimed as Trademarks
 

 

Linux Oracle commands syntax poster

ION Oracle tuning software

Oracle data dictionary reference poster



Oracle Forum

BC Oracle consulting support training

BC remote Oracle DBA