2 Database Tools on Windows

Oracle Database for Windows includes various tools to perform database functions. This chapter describes preferred tools to perform common database administration tasks and explains how tools can be started.

Unless otherwise noted, features described in this guide are common to all Oracle Database Editions.

This chapter contains these topics:

See Also:

Choosing a Database Tool

Database tools is a collective term for tools, utilities, and assistants that you can use to perform database administration tasks. Some database tools perform similar tasks, though no one database tool performs all database administration tasks. The following sections indicate which database tools can be used on particular operating systems and preferred tools to use for common database administration tasks.

Database Tools and Operating System Compatibility

Almost all database tools are available on all supported versions of Windows. The exceptions are:

Preferred Database Tools

Table 2-1 lists various database tools you can use to perform common database administration tasks. Oracle recommends you use tools listed in the "Preferred Tool" column of the table. After choosing a tool to perform a task, go to Table 2-2, for instructions on how to start the tool.

Note:

The VOLSIZE parameter for the Export and Import utilities is not supported on Windows. If you attempt to use the utilities with the VOLSIZE parameter, then error LRM-00101 occurs. For example:
D:\> exp system full=y volsize=100m;
Password: password
LRM-00101: unknown parameter name 'volsize'
EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
EXP-00000: Export terminated unsuccessfully

Table 2-1 Preferred Database Tools

Administration Task Preferred Tool Other Tools
 

Create database services

Database Configuration Assistant

ORADIM

Delete database services

Database Configuration Assistant

ORADIM

 
 

Change passwords in the database password file

ORAPWD

ORADIM

Update the password of an Oracle Home User

Oracle Home User Control

None

Migrate database users to a directory

User Migration Utility

None

Migrate a database

Oracle Database Upgrade Assistant

Upgrade Information Tool

 

Export data

Data Pump Export (EXPDP)

Export (EXP)

Import data

Data Pump Import (IMPDP)

Import (IMP)

Load data

Oracle Enterprise Manager Load Wizard

SQL*Loader (SQLLDR)

Back up database

Oracle Enterprise Manager Backup Wizard

Recovery Manager (RMAN)

OCOPY

Recover database

Oracle Enterprise Manager Recovery Wizard

Recovery Manager (RMAN)

OCOPY

 

Store encrypted and decrypted Oracle Wallet (Oracle Advanced Security and Oracle PKI integration)

Oracle Wallet Manager

None

Grant database roles

Oracle Enterprise Manager Database Express

Local Users and Groups

SQL*Plus

Create database objects

Oracle Enterprise Manager Cloud Control

SQL*Plus


The following points refer to tools listed in Table 2-1, "Preferred Database Tools":

  • ORADIM can set a password only when none was previously set. If a password has been previously set, then ORADIM can change it only by deleting and re-creating Oracle Database services. Starting with Oracle Database 12c Release 1 (12.1), ORADIM creates the Oracle Database service, Oracle VSS Writer service, and Oracle Scheduler service to run under the Oracle Home User account. If this account is a Local or Domain User Account, then ORADIM prompts for the password for that account and accepts the same through stdin.

    It is possible to specify both the Oracle Home User and its password using the -RUNAS osusr[/ospass] option to oradim. If the given osusr is different from the Oracle Home User, then the Oracle Home User is used instead of osusr along with the given ospass.

  • User Migration Utility can migrate local or external users to enterprise users.

    For more information, see "Using the User Migration Utility" in Oracle Database Enterprise User Security Administrator's Guide.

  • Oracle Database Upgrade Assistant can upgrade the following databases to the current release: Oracle9i Release 2 (9.2), Oracle Database 10g Release 1 (10.1), Oracle Database 10g Release 2 (10.2), Oracle Database 11g Release 1 (11.1), and Oracle Database 11g Release 2 (11.2). Oracle Database Upgrade Assistant can also be used to apply patch sets.

    See Also:

    Oracle Database Upgrade Guide for more information about upgrading single instance and cluster databases
  • Data Pump Export and Data Pump Import are preferred for Oracle Database 10g Release 1 (10.1) and later data; Export and Import are preferred for earlier data.

  • If you back up files while you are shutting down the database, then your backup is invalid. You cannot use an invalid backup to restore files at a later date.

  • You cannot use earlier versions of Oracle Wallet Manager to manage Oracle Database 10g Release 1 (10.1) and later wallets that contain password-based credentials for authentication to Oracle Internet Directory. These credentials are placed in the wallet when an Oracle Database server is registered in Oracle Internet Directory.

    The database wallet that Oracle Database Configuration Assistant automatically generates during database registration can be used only with Oracle Database 10g Release 1 (10.1) or later. You cannot use this database wallet for earlier versions of the database, nor can you use it for Oracle Internet Directory Release 9.0.4 or earlier.

  • For guidelines on creating database objects, see Oracle Database Administrator's Guide.

Starting Database Tools

Oracle Database 12c Release 1 (12.1) has mandated that the administrator starting all administration tools such as Oracle Database Configuration Assistant, Oracle Database Upgrade Assistant, Oracle Net Configuration Assistant, and Oracle ASM Configuration Assistant, must be an operating system administrator. The administrator must also be a member of the ORA_DBA and ORA_ASMADMIN group for using the Oracle Database Configuration Assistant and Oracle Database Upgrade Assistant tools when accessing Oracle ASM. The administrator must be a member of the ORA_ASMADMIN group for using the Oracle ASM Configuration Assistant tool.

Oracle needs the password of Oracle Home User to create new Windows services for Database, Listener, and other entities. To support this, all the administration tools have been modified to prompt for the password of Oracle Home User that is required only when the Oracle Home User is a Local or a Domain Windows User Account and the password for the Oracle Home User is not stored in the Oracle Wallet.

This section describes how to start each of the database tools in the following categories:

Starting Database Tools in Multiple Oracle Homes

If you have multiple Oracle homes on your computer from previous releases, then see Appendix B, "Optimal Flexible Architecture" in Oracle Database Installation Guide for Microsoft Windows for a description of differences between Oracle homes in different releases.

Starting Tools from Multiple Oracle Homes

Each Oracle home, including the first Oracle home you create on your computer, has a unique HOMENAME. To start Oracle Administration Assistant for Windows from any Oracle home, from the Start menu, select All Programs, then select Oracle - HOMENAME, then select Configuration and Migration Tools and then select Administration Assistant for Windows.

Running Tools with Windows User Account Control

To ensure that only trusted applications run on your computer all Windows operating systems supported for Oracle Database 12c Release 1 (12.1) provide User Account Control. If you have enabled this security feature, then, depending on how you have configured it, Oracle Universal Installer prompts you for either your consent or your credentials when installing Oracle Database Client. Provide either the consent or your Windows Administrator credentials as appropriate.

See Also:

"Managing User Accounts with User Account Control" in Oracle Database Installation Guide for Microsoft Windows

You must have Administrator privileges to run some configuration tools, or to run any tool or application that writes to any directory within the Oracle home. If User Account Control is enabled, and you are logged in as the local Administrator, then you can successfully run each of these commands in the usual way. However, if you are logged in as a member of the Administrator group, then you must explicitly run these tasks with Windows Administrator privileges.

The following tools must be run with Administrator privileges:

  • Oracle Administration Assistant for Windows. This tool is available as a Configuration and Migration Tool.

  • Oracle Net Configuration Assistant. This tool is available as a Configuration and Migration Tool.

  • Oracle OLAP Analytic Workspace Manager and Worksheet. This tool is available as an Integrated Management Tool.

  • Oracle Database Configuration Assistant. This tool is available as a Configuration and Migration Tool.

  • Oracle Database Wallet Manager. This tool is available as an Integrated Management Tool.

  • Oracle Database Upgrade Assistant. This tool is available as a Configuration and Migration Tool.

  • Oracle Net Manager. This tool is available as a Configuration and Migration Tool.

  • Oracle ASM Configuration Assistant. This tool is available as a Configuration and Migration Tool.

  • Oracle ASM Disk Stamping Tool (asmtool, asmtoolg). This tool is available as a Configuration and Migration Tool.

To run any Start menu tool with Administrator privileges:

  1. Click the Start menu option.

  2. Select All Programs, then select Oracle - HOMENAME.

  3. Select the name of the tool, then right-click the name of the tool or application you want to run, and then select Run as administrator.

These steps describe how to start a tool as an Administrator from the command prompt:

  1. Create a shortcut for the command prompt window on your desktop. An icon for that shortcut appears on the desktop.

  2. Right-click the icon for the newly created shortcut, and specify Run as administrator.

    When you open this window, the title bar reads Administrator: Command Prompt. Commands running within this window are run with Administrator privileges.

Starting Database Tools from the Start Menu

Table 2-2 describes how to start assistants and other tools from the Start menu. It also tells where to go for further information on using these products.

Note:

When you use an assistant, you must have read and write access to the directory where database files are created or moved to. To create an Oracle Database instance, you must have the administrator privilege. If you run Database Configuration Assistant from an account that is not part of the Administrators group, then the tool exits without completing the operation.

Note:

All Start menu paths begin with the Start menu where you select All Programs, then select Oracle - HOMENAME and so on.

Table 2-2 Starting Database Tools from the Start Menu

Tool Start Menu Path More Information

Microsoft ODBC Administrator

From Configuration and Migration Tools, select Microsoft ODBC Administration

Microsoft ODBC Administration online help

Oracle Administration Assistant for Windows

From Configuration and Migration Tools, select Administration Assistant for Windows

Chapter 10, "Authenticating Database Users with Windows"

Oracle Automatic Storage Management Configuration Assistant

From Configuration and Management Tools, select Automatic Storage Management Configuration Assistant

Oracle Grid Infrastructure Installation Guide

Oracle Database Configuration Assistant

From Configuration and Migration Tools, select Database Configuration Assistant

"Overview of Database Creation on Windows Using Oracle Database Configuration Assistant"

Oracle Directory Manager

From Integrated Management Tools, select Oracle Directory Manager

Oracle Internet Directory Administrator's Guide

Oracle Locale Builder

From Configuration and Migration Tools, select Locale Builder

Oracle Database Globalization Support Guide

Oracle Net Configuration Assistant

From Configuration and Migration Tools, select Net Configuration Assistant

Oracle Database Net Services Administrator's Guide

Oracle Net Manager

From Configuration and Migration Tools, select Net Manager

Oracle Database Net Services Administrator's Guide

 

Oracle Wallet Manager

From Integrated Management Tools, select Wallet Manager

Oracle Database Enterprise User Security Administrator's Guide

SQL*Plus

From Application Development, select SQL*Plus

SQL*Plus User's Guide and Reference

"Starting and Shutting Down a Database with SQL*Plus"

 

Starting Database Tools from the Command Line

Table 2-3 describes how to start Oracle Database tools from the command line, and where to go for further information on using these products.

Table 2-3 Starting Database Tools from the Command Line

Tool Enter at Prompt More Information

Oracle ASM Disk Stamping Tool

Oracle ASM Disk Stamping Tool (GUI version)

  • C:\> asmtool

    Following are the list of options:

    C:\> asmtool -add

    C:\> asmtool -addprefix

    C:\> asmtool -list

    C:\> asmtool -delete

  • C:\> asmtoolg

    Note: asmtoolg is the GUI-based tool that performs the same actions as the command-line asmtool tool. To run asmtool and asmtoolg tools, follow the instructions documented in the "Running Tools with Windows User Account Control" section.

"Marking Disk Partitions for Oracle ASM Before Installation" in Oracle Grid Infrastructure Installation Guide

DBVERIFY

C:\> dbv

DBVERIFY starts and prompts you for a file name parameter. To obtain a list of parameters, enter:

C:\> dbv help=y

Oracle Database Utilities

Data Pump Export

C:\> expdp user name

EXP starts and prompts you for parameters. To obtain a list of these parameters, enter:

C:\> exp help=y

Oracle Database Utilities for instructions on use of Data Pump Export

Oracle Database Error Messages for information on error messages

Data Pump Import

C:\> impdp user name

IMP starts and prompts you for parameters. To get a list of these parameters, enter:

C:\> imp help=y

Oracle Database Utilities for instructions on use of Data Pump Import

Oracle Database Error Messages for information on error messages

Database Configuration Assistant

C:\> dbca

Oracle Database Configuration Assistant tool starts in interactive mode. For silent options and other command-line options, enter:

C:\> dbca -help

"Starting DBCA" in Oracle Database 2 Day DBA

Database Upgrade Assistant

C:\> dbua

Oracle Database Upgrade Assistant wizard starts in interactive mode. For silent options and other command line options enter:

C:\> dbua -help

Oracle Database Upgrade Guide

Export

C:\> exp user name

EXP starts and prompts you for parameters. To obtain a list of these parameters, enter:

C:\> exp help=y

Oracle Database Utilities for instructions on use of Export

Oracle Database Error Messages for information on error messages

Import

C:\> imp user name

IMP starts and prompts you for parameters. To get a list of these parameters, enter:

C:\> imp help=y

Oracle Database Utilities for instructions on use of Import

Oracle Database Error Messages for information on error messages

Net Services Configuration

C:\> netca

Oracle Net Configuration Assistant tool starts in interactive mode. For silent options and other command-line options, enter:

C:\> netca -help

Oracle Database Upgrade Guide

ORADIM

C:\> oradim options

To get a list of ORADIM options, enter either of the following:

C:\> oradim

C:\> oradim -? | -h | -help

"About Administering an Oracle Database Instance Using ORADIM"

Oracle Wallet Manager

C:\> cd ORACLE_HOME\bin

C:\ORACLE_HOME\bin> launch.exe ORACLE_HOME\bin owm.cl

Chapter 12, "Storing Oracle Wallets in the Windows Registry"

Password Utility (ORAPWD)

C:\> orapwd

Password file is hidden. Use Windows Explorer to see it in a file list. From the View menu, select Options, then select View and then select Show All Files.

"Creating and Populating Password Files"

Recovery Manager (RMAN)

C:\> rman parameters

Oracle Database Backup and Recovery User's Guide

SQL*Plus (SQLPLUS)

C:\> sqlplus

SQL*Plus User's Guide and Reference

"Starting and Shutting Down a Database with SQL*Plus"

SQL*Loader (SQLLDR)

C:\> sqlldr

SQL*Loader displays a Help screen with available keywords and default values.

Oracle Database Utilities

Oracle Database Error Messages

"Starting Windows Tools"

TKPROF

C:\> tkprof

Oracle Database Performance Tuning Guide

User Migration Utility

C:\> umu parameters

To get a list of parameters, enter:

C:\> umu help=yes

"Using the User Migration Utility" in Oracle Database Enterprise User Security Administrator's Guide


Note:

  • Three special conditions apply when running Export or Import utilities on Windows. First, default values for BUFFER and RECORDLENGTH parameters are 4 KB and 2 KB respectively. This default RECORDLENGTH parameter does not depend on the value of BUFSIZ defined in the system header file. If you specify a value larger than USHRT_MAX (64 KB), you get a warning message. Second, the VOLSIZE parameter is not supported. Third, to export an entire database, you must use the EXP_FULL_DATABASE role.

  • Oracle Enterprise Manager Database Express is another database tool for managing the database. For information about logging in to Oracle Enterprise Manager Database Express, see "Configuring the HTTP Port for EM Express" in Oracle Database 2 Day DBA.

Starting Windows Tools

Table 2-4 describes how to start each Windows tool and where to go for more information on using these products.

Table 2-4 Starting Windows Tools

Tool Start Procedure More Information

Event Viewer

From the Start menu, select All Programs, then select Administrative Tools and then select Event Viewer.

"Using Event Viewer to Monitor a Database"

Your operating system documentation

Local Users and Groups

From the Start menu, select Settings, then select Control Panel. Double-click Administrative Tools. Double-click Computer Management. In the console tree, click Local Users and Groups.

"Using Local Users and Groups to Manage Users and Groups"

Chapter 10, "Authenticating Database Users with Windows"

Your operating system documentation

Microsoft Management Console (MMC)

From the Start menu, select All Programs, then select Oracle - HOMENAME, then select Configuration and Migration Tools and then select Administration Assistant for Windows.

Your operating system documentation

 

Registry Editor

At the command prompt, enter:

C:\> regedit

"Using Registry Editor to Modify Configuration Information"

Chapter 16, "Configuration Parameters and the Registry"

Your operating system documentation

Task Manager

Right-click the Task bar and select Task Manager.

"Using Task Manager to Monitor Applications and Processes"

Your operating system documentation


Note:

Microsoft Management Console is started whenever Oracle Administration Assistant for Windows is started.

Using the Oracle Home User Control Tool

Oracle Database 12c Release 1 (12.1) has introduced a new Windows tool called the Oracle Home User Control. This is a command-line tool that displays the Oracle Home User name associated with the current Oracle home and updates the password for the Windows services for the Oracle home. The input password must match the password for the Windows User Account used as the Oracle Home User. So, first use Windows operating system tools to change the Windows password and then use this tool. This tool updates all Windows services used by Oracle to use the new password and updates it in the Oracle Cluster Registry wallet too, if one exists.

Installer also creates a shortcut Update Password for Oracle Home User which starts the tool.

The Oracle Home User Control tool accepts the new password at the tool's prompt for password entry and validates the password provided against the password of the Windows User Account. The tool terminates if password validation fails. Moreover, the user starting the orahomeuserctl command must have Administrator privileges. The command must be in the following format:

orahomeuserctl list
orahomeuserctl updpwd [-user username] [-host hostname1, hostname2, …] [-log logfilename]

For this command, note the following:

  • list: This utility displays the Oracle Home User name associated with the Oracle home.

  • updpwd: This utility prompts for a new password and updates the password for all Oracle Database services associated with the named Oracle Home User on the node. When updpwd is started on a node within an Oracle RAC installation, then the command first updates the Oracle Cluster Registry wallet with the new password, then updates all Oracle Database services associated with the user on all active nodes within a cluster. If there is no Oracle Cluster Registry Wallet, then the utility updates only all the Oracle Database services.

  • -user: This option updates the passwords for all services owned by a specific user, or the password of current Oracle Home User if no user is specified.

  • -host: This option updates the passwords for all services belonging to the named Oracle Home User on the specified hosts. To update the password on a remote host, the user must be a Windows Domain User.

  • -log: This option appends the time-stamped results of the password update action to the specified log file for every node and service name receiving the new password. The default log file name and location is %ORACLE_HOME%\log\orahomeuserctl.log.

Using SQL*Loader

This section describes Windows-specific information for using SQL*Loader (SQLLDR).

Windows Processing Options

This section discusses possible values for the operating system-dependent file processing specifications string option (os_file_proc_clause), referred to in "Specifying Data File Format and Buffering" in Chapter 9, "SQL*Loader Control File Reference", in Oracle Database Utilities.

Default (No Processing Option) or "str terminator_string"

Stream record format in which each record is terminated by a record terminator. If str terminator_string is not specified, then the record terminator defaults to either the Windows-style record terminator (the two-character sequence carriage return, \r, followed by line feed, \n) or the UNIX-style record terminator (single-character line feed, \n). Maximum record size is 48 KB.

When processing stream format data files, SQL*Loader can usually recognize record terminators automatically, whether they are Windows-style or UNIX-style. So you usually must not specify which record terminator you are using.

For external table loads, however, only Windows-style record terminators are recognized automatically. If your data file contains UNIX-style record terminators, you must specify the record terminator. If you are using SQL*Loader (with the external_table option), then specify the UNIX-style record terminator by specifying "str '\n'" on the INFILE line in the SQL*Loader control file. For example:

INFILE mydata.dat "str '\n'"

You can also specify the record terminator in hex, by specifying "str x'0a'" (assuming an ASCII-based character set). For example:

INFILE mydata.dat "str x'0a'"

Note that the "0" (zero) before the "a" is required. If you are using SQL with an access parameter list to create the external table, then you must specify '\n' in a RECORDS DELIMITED BY clause. For example:

RECORDS DELIMITED BY '\n'

You can also use a hex string in this case. For example:

RECORDS DELIMITED BY 0x'0a'

Note that in this case, the "0" (zero) before the "x" and the "0" (zero) before the "a" are both required.

Control File Conventions

When preparing SQL*Loader control files (.ctl), you must follow certain syntax and notational conventions.

In full path descriptions, backslashes do not require escape characters or other special treatment. When embedding a single or double quotation mark inside a string delimited by double quotation marks, place a backslash escape character before the embedded quotation mark.

When specifying data types in the SQL*Loader control file, note that the default sizes of native data types shown in Table 2-5 are specific to Windows. These data types can be loaded with correct results only between systems where they have the same length in bytes. You cannot override these defaults in the control file. If the byte order is different between the systems, you can indicate the byte order of the data with the BYTEORDER parameter, or you can place a byte-order mark (BOM) in the file.

Table 2-5 Default Sizes of Native Data types

Native Data Types Default Field Length

DOUBLE

8

FLOAT

4

INTEGER

4

SMALLINT

2


Note:

The default listed is correct if INTEGER is specified without a size. But INTEGER(n) is also allowed. In that case, n specifies the size of the INTEGER field in bytes.

See Also:

Oracle Database Utilities for a complete list of options and instructions on using SQL*Loader

Using Windows Tools

You can use Windows tools in various ways to manage Oracle Database:

Using Event Viewer to Monitor a Database

Event Viewer lets you monitor events in your system. An event is an important occurrence in the system or application (such as Oracle Database) that requires user notification. While messages for major events can appear on-screen as you work at your computer, events not requiring your immediate attention are recorded by Windows in the Event Viewer log file. You can then view this information at your convenience.

Use Event Viewer to monitor Oracle Database events, such as:

  • Initialization of System Global Area for active instance

  • Initialization of Program Global Area (PGA) for background processes of the active instance

  • Connection to Oracle Database using AS SYSDBA

In addition, the operating system audit trail is logged in the Event Viewer log file, which can be viewed using Event Viewer.

See Also:

Chapter 7, "Monitoring a Database on Windows" for specific instructions on accessing and using Event Viewer to monitor Oracle Database events

Using Microsoft Management Console to Administer a Database

Microsoft Management Console provides a central location for network administration. Microsoft Management Console hosts applications (called snap-ins) that administrators can use to manage their networks. Oracle snap-ins enable database administrators to:

  • Configure Oracle Database administrators, operators, users, and roles so the Windows operating system can authenticate them

  • Configure OracleServiceSID

  • Modify registry parameters for all Oracle homes on the computer

  • Modify the computer host name, username, and password for the database

  • View and terminate an Oracle Database thread

Using Registry Editor to Modify Configuration Information

Oracle Database stores its configuration information in a structure known as the registry. You can view and modify this configuration information through Registry Editor. The registry contains configuration information for your computer and must not be accessible for editing by inexperienced users. Only experienced administrators should view and change this information.

Registry Editor displays configuration information in a format similar to Windows Explorer. In the left-hand window is a tree-like format consisting of keys (or folders). When one of these keys is highlighted, parameters and values assigned to that key are displayed in the right-hand window.

When you install products from your media, configuration parameters are automatically entered in the registry. These parameters are read each time your Windows computer is started and whenever an Oracle Database product is started. These parameters include settings for:

  • Oracle home directory

  • Language

  • Company name

  • Oracle home subdirectories for individual products

  • Individual products such as SQL*Plus

  • Services

    See Also:

    Chapter 16, "Configuration Parameters and the Registry" for definitions of Oracle Database configuration parameters and specific instructions on using the registry to modify Oracle Database configuration parameters

Using Task Manager to Monitor Applications and Processes

Task Manager has four tabs:

  • Applications tab displays what applications run. This is useful for identifying and ending unresponsive tasks. (Oracle Database does not appear as an application because it runs as a service.)

  • Processes tab displays details of currently running processes and their resource usage. Columns are customizable.

  • Performance tab graphically displays real-time CPU and memory usage, which is useful for spotting sudden changes.

  • Networking tab graphically displays the network traffic taking place over the computer's network connections.

Using Local Users and Groups to Manage Users and Groups

Local Users and Groups enables you to manage users and groups on Windows. Specifically, you can:

  • Create and modify Local User Accounts

  • Create and modify user profiles

  • Create, add, and delete local groups

Optional Windows Diagnostic and Tuning Utilities

Windows Resource Kit includes several diagnostic and tuning utilities.

Process Viewer summarizes resource usage by a process.

Process Monitor displays real-time file systems, the registry, and process-thread activity. It combines Filemon and Regmon utilities and provides reliable process information.

Process Explorer provides a detailed display of resource usage by a process.

Task List displays resource usage and other details of a process when its processor identifier or process name is given as an argument. This tool also displays a list of executables and dynamic link libraries (DLLs) associated with a process.