If no PFILE is specified, then the command looks for an SPFILE in ORACLE_HOME\database. If the command finds one, then the command uses it to start the database. If it does not find an SPFILE, then it uses the default initialization parameter file located in ORACLE_BASE\ADMIN\db_name\pfile.

To stop a database, enter:

SQL> SHUTDOWN [mode]

where mode is normal, immediate, or abort.

In a normal shutdown, Oracle Database waits for all currently-connected users to disconnect and disallows any new connections before shutting down. This is the default mode.

In an abort shutdown, Oracle Database terminates active transactions and disconnects users; it does not roll back transactions. The database performs automatic recovery and rollback the next time it is started. Use this mode only in emergencies.

5.3Starting and Shutting Down a Database Using Services

You can start or shut down Oracle Database by starting or stopping service OracleServiceSID in the Control Panel. Starting OracleServiceSID is equivalent to using the STARTUP command or manually entering:

To start or stop Oracle Database through Oracle Database Services, set the following registry parameters to the indicated values:

ORA_SID_AUTOSTART

When set to true, the default value, this parameter causes Oracle Database to start when OracleServiceSID is started.

ORA_SID_PFILE

This parameter sets the full path to the initialization parameter file. If this entry is not present, then oradim will try to start the database with an SPFILE or PFILE from ORACLE_HOME\database.

ORA_SHUTDOWN

When set to true, this parameter enables the selected instance of Oracle Database to be shut down when OracleServiceSID is stopped. This includes any database in the current Oracle home. Default value is false.

ORA_SID_SHUTDOWN

When set to true, the default value, this parameter causes the instance of Oracle Database identified by the SID value to shut down when OracleServiceSID is stopped manually—using either the Control Panel or Net stop command.

Caution:

If ORA_SHUTDOWN or ORA_SID_SHUTDOWN is set to false, then manually shutting down OracleServiceSID will still shut down Oracle Database. But it will be an abnormal shutdown, and Oracle does not recommend it.

The following two registry parameters are optional:

ORA_SID_SHUTDOWNTYPE

This parameter controls database shutdown mode. Set it to a (abort), i (immediate), or n (normal). Default mode is i (immediate) if you do not set this parameter.

ORA_SID_SHUTDOWN_TIMEOUT

This parameter sets maximum time to wait before the service for a particular SID stops.

The registry location of these required and optional parameters is determined by the number of Oracle home directories on your computer. If you have only one Oracle home directory, then these parameters belong in:

HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0

If you have multiple Oracle home directories, then these parameters belong in:

HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOMEID

where ID is incremented for each additional Oracle home directory on your computer.

Note:

If you use ORADIM to create or edit instances, then it automatically sets the relevant registry parameters to their appropriate values.

This automatically starts ORADIM, which issues the -SHUTDOWN command in the mode indicated by ORA_SID_SHUTDOWNTYPE, and shuts down Oracle Database.

See Also:

Your operating system documentation for instructions on starting and stopping services.

5.4Starting Multiple Instances

Start the service for each instance using ORADIM or the Services dialog of the Control Panel.

At the command prompt set the ORACLE_SID configuration parameter to the SID for the first instance to run:

C:\> SET ORACLE_SID=SID

where SID is the name of the Oracle Database instance.

Start SQL*Plus:

C:\> sqlplus /NOLOG

Connect ASSYSDBA:

SQL> CONNECT / AS SYSDBA

Start up the first instance:

SQL> STARTUP PFILE=ORACLE_BASE\admin\db_name\pfile\init.ora

where ORACLE_BASE is c:\oracle\product\10.1.0 (unless you changed it during installation) and db_name is the name of the instance.

Repeat Steps 2-5 for the other instances to run.

5.5Creating and Populating Password Files

Use Password Utility to create password files. Password Utility is automatically installed with Oracle Database utilities. Password files are located in directory ORACLE_BASE\ORACLE_HOME\DATABASE and are named PWDsid.ORA, where SID identifies the Oracle Database instance. Password files can be used for local or remote connections to Oracle Database.

To create and populate a password file:

Create a password file with the Password Utility:

C:\> orapwd FILE=PWDsid.ora PASSWORD=password ENTRIES=max_users

where

FILE specifies the password filename.

SID identifies the database instance.

PASSWORD sets the password for account SYS.

ENTRIES sets maximum number of entries in password file. This corresponds to maximum number of distinct users allowed to connect to the database simultaneously with either the SYSDBA or the SYSOPER DBA privilege.

The value exclusive specifies that only one instance can use the password file and that the password file contains names other than SYS. In search of the password file, Oracle Database looks in the registry for the value of parameter ORA_SID_PWFILE. If no value is specified, then it looks in the registry for the value of parameter ORA_PWFILE, which points to a file containing usernames, passwords, and privileges. If that is not set, then it uses the default:

ORACLE_BASE\ORACLE_HOME\DATABASE\PWDsid.ORA.

The default value is shared. It specifies that multiple instances (for example, a Real Application Clusters environment) can use the password file. However, the only user recognized by the password file is SYS. Other users cannot log in with SYSOPER or SYSDBA privileges even if those privileges are granted in the password file. The shared value of this parameter affords backward compatibility with earlier Oracle releases. Oracle Database looks for the same files as it does when the value is exclusive.

none specifies that Oracle Database ignores the password file and that authentication of privileged users is handled by the Windows operating system. This is the default setting.

Start SQL*Plus:

C:\> sqlplus /NOLOG

Connect AS SYSDBA:

SQL> CONNECT / AS SYSDBA

Start Oracle Database:

SQL> STARTUP

Grant appropriate privileges to each user. Users who must perform database administration, for example, would be granted privilege SYSDBA:

SQL> GRANT SYSDBA TO scott;

If the grant is successful, then the following message displays:

Statement Processed.

This adds scott to the password file and enables scott to connect to the database with SYSDBA privileges. Use SQL*Plus to add or delete usernames, user passwords, and user privileges in password files.

Caution:

Copying or manually moving password files may result in ORADIM being unable to find a password to start an instance.

5.5.1Viewing and Hiding the Password File

The password file is not automatically hidden. It can be made invisible and visible again from two different locations:

5.7 Automatically Encrypted Database Passwords

With Oracle Database, the password used to verify a remote database connection is automatically encrypted. Whenever a user attempts a remote login, Oracle Database encrypts the password before sending it to the remote database. If the connection fails, then the failure is noted in the operating system audit log.

5.8Creating Control, Data, and Log Files on Remote Computers

Oracle Database can access database files on a remote computer using Universal Naming Convention (UNC), but it may degrade database performance and network reliability. UNC is a PC format for specifying locations of resources on a local area network. UNC uses the following format:

\\server-name\shared-resource-path-name

For example, UNC specification for file system01.dbf in directory C:\oracle\product\10.1.0\oradata\orcl on shared server argon would be:

\\argon\oracle\product\10.1.0\oradata\orcl\system01.dbf

Locations of archive log files cannot be specified using UNC. Always set initialization parameter LOG_ARCHIVE_DEST_n to a mapped drive. If you set it to a UNC specification, then Oracle Database does not start and you receive the following errors:

An ORA-00256 error also occurs if you enter \\\meldell\rmdrive or \\\meldell\\rmdrive. Control files required the additional backslashes for Oracle8 release 8.0.4, but redo log files and datafiles did not.

5.9Archiving Redo Log Files

If you installed Oracle Database through the Typical installation, then it is created in NOARCHIVELOG mode. If you created your database through the Custom option of Database Configuration Assistant, then you had the choice of either ARCHIVELOG or NOARCHIVELOG.

In NOARCHIVELOG mode, redo logs are not archived. Setting your archive mode to ARCHIVELOG and enabling automatic archiving causes redo log files to be archived. This protects Oracle Database from both instance and disk failure.

This section describes how to change archive mode to ARCHIVELOG and enable automatic archiving.

5.10 Backing Up an Oracle Database on Windows

As noted in Table 2-1, "Preferred Database Tools", Oracle recommends Oracle Enterprise Manager Backup Wizard for backup and recovery. Oracle Database 10g Release 1 (10.1) also bundles Legato Single Server Version (LSSV) software to provide tape backups of your Oracle Database. It is fully integrated with Recovery Manager (RMAN) to back up your database on a single host. Legato NetWorker updates and documentation can be obtained directly from Legato and can be found at the following Web site:

If you have previously installed and used Legato Storage Manager (LSM) on your Oracle Database server, then you can uninstall it and install this new version of Legato NetWorker. Any backups made by LSM can still be used by the new Legato NetWorker software.