Oracle8i Personal Edition Administrator's Guide
Release 2 (8.1.6) for Windows 98

A85313-01

Library

Product

Contents

Index

Prev Next

7
Administering a Database

This chapter describes how to administer Oracle8i Personal Edition for Windows 98.

Specific topics discussed are:

Starting and Shutting Down a Database with SQL*Plus

These instructions assume that a database instance is created.


Note::

The directory path examples in this chapter follow Optimal Flexible Architecture (OFA) guidelines (for example, ORACLE_BASE\ORACLE_HOME\RDBMS\ADMIN). If you specified non-OFA compliant directories during installation, your directory paths will differ. See section "OFA and Multiple Oracle Home Configurations" for information. 


To start or shut down an Oracle8i database:

  1. Go to your Oracle8i database server.

  2. Start SQL*Plus at the MS-DOS command prompt:

    C:\> SQLPLUS
    

  1. Connect to the Oracle8i database with the INTERNAL user name:

    SQL> CONNECT INTERNAL
    

  1. Follow the instructions below:

If You Want to...  Then Enter... 

Start a database with the default parameter file 

SQL> STARTUP

This command uses the default INIT.ORA file located in the ORACLE_BASE\ ADMIN\DB_NAME\PFILE directory. 

Start a database with a file other than the default parameter file 

SQL> STARTUP PFILE=PATH\FILENAME

This command uses the INIT.ORA file specified in PATH\FILENAME. This example starts the database using a file named INIT2.ORA in C:\ORA81\ADMIN\ORCL\ PFILE

 

SQL> STARTUP PFILE=C:\ORA81\ADMIN\ORCL\PFILE\INIT2.ORA 

Stop the database 

SQL> SHUTDOWN [MODE] 

 

where MODE is one of the following: 

 

  • Normal

 

 

The database waits for all currently-connected users to disconnect and disallows any new connections before shutting down. This is the default mode. 

 

  • Immediate

 

 

The database terminates and rolls back active transactions, disconnects clients, and shuts down. 

 

  • Abort

 

 

The 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. 


Note:

See "Choosing a Database Tool" for a list of other tools that can start the database and the Oracle8i Administrator's Guide for information on options you can specify when starting your database. 


Starting and Shutting Down a Database Using OSTART and OSTOP

Using OSTART:

Choose Start>Programs>Oracle_Home_Name>Database Administration>Start Database.

OR

At the MS-DOS Prompt execute :

c:\>OSTART SCREEN

Select the instance you want to start by choosing the SID from the combo box, then press OK.

If you are executing OSTART from command prompt, the SID list displayed will be of the Oracle Home which comes frist in the PATH. To get the SID list of another Oracle Home, go to the BIN directory of that Home and execute OSTART SCREEN.

Using OSTOP:

Choose Start>Programs>Oracle_Home_Name>Database Administration>Stop Database.

OR

At the MS-DOS Prompt execute :

c:\> OSTOP SCREEN

OSTOP will stop the instance whose SID is found in HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME_NAME\ORACLE_SID if ORACLE_SID is not set in the environment.

To stop any other instance started from the same Home, User, can do:

  1. Set the SID of that instance to ORACLE_SID either in the registry or in the environment and then run OSTOP or right click on the database icon on the systray and select "shutdown".

  2. Run KNLSTOP from the same Home with the SID of the instance to be stopped;

    c:\> KNLSTOP <SID Name>
    

Running Multiple Instances

To run multiple instances, ensure that you have already created each instance. You then run multiple instances by starting each of the instances using SQL*Plus.

To run multiple instances:

  1. Ensure that you have already created each instance.

  2. Set the ORACLE_SID configuration parameter at the MS-DOS command prompt to the SID for each instance you want to run:

    C:\> SET ORACLE_SID=SID
    

  1. Start SQL*Plus:

    C:\> SQLPLUS
    

  1. Connect as INTERNAL:

    SQL> CONNECT INTERNAL
    

  1. Start up the database with the new instance:

    SQL> STARTUP PFILE=ORACLE_BASE\ADMIN\DB_NAME\PFILE\INIT.ORA
    

Creating Password Files

Use the Password Utility ORAPWD to create password files. ORAPWD is automatically installed with the Oracle8i Utilities. Password files are located in the ORACLE_BASE\ORACLE_HOME\DATABASE directory and are named PWDSID.ORA, where SID identifies the Oracle8i database instance. Password files can be used for local or remote connections to an Oracle8i database. The example below describes how to perform a local connection.

To create a password file:

  1. Create a password file with ORAPWD:

    C:\> ORAPWD FILE=PWDSID.ORA PASSWORD=PASSWORD ENTRIES=MAX_USERS
    

Element  Description 

SID 

Identifies the database instance. 

FILE 

Specifies the password file name. 

PASSWORD 

Sets the password for the INTERNAL and SYS accounts. 

ENTRIES 

Sets the maximum number of entries in the password file. This corresponds to the maximum number of distinct users allowed to connect to the database with the SYSDBA and SYSOPER DBA privileges simultaneously. 

  1. Set the INIT.ORA file parameter REMOTE_LOGIN_PASSWORDFILE to EXCLUSIVE or SHARED. Definitions for all possible values are described below:

Element  Description 

EXCLUSIVE 

Specifies that only one instance can use the password file and that the password file contains names other than SYS and INTERNAL. Oracle8i looks in the registry for the value of the ORA_SID_PWFILE parameter. If a value is unspecified, it looks in the registry for the value of the ORA_PWFILE parameter, which points to a file containing the INTERNAL password as well as user names, passwords, and privileges. If that is not set, it uses the default of ORACLE_BASE\ORACLE_HOME\DATABASE\PWDSID.ORA. 

SHARED 

Specifies that multiple instances can use the password file (for example, a parallel server environment). However, the only users recognized by the password file are SYS and INTERNAL. You 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 releases. The Oracle8i database looks for the same files as it does when the value is EXCLUSIVE, but only the INTERNAL account is available for privileged access. This is the default value.  

NONE 

Specifies that the Oracle8i database ignores the password file and that privileged users are authenticated by the Windows NT operating system. NONE is the default setting. 

  1. Start SQL*Plus:

    C:\> SQLPLUS
    

  1. Connect as INTERNAL:

    SQL> CONNECT INTERNAL
    

  1. Start the Oracle8i database:

    SQL> STARTUP
    

  1. Grant appropriate privileges to each user who needs to perform database administration. For example:

    SQL> GRANT SYSDBA TO SCOTT;
    

  1. Connect to the Oracle8i database with DBA privileges for SCOTT:

    SQL> CONNECT SCOTT/TIGER AS SYSDBA
    

Viewing Password Files

The password file is automatically hidden. This section describes two ways of viewing the password file:

To see the password file from the MS-DOS command prompt:

To...  Enter... 

See the password file 

C:\ORACLE\ORA81\DATABASE> ATTRIB

The password file displays:

A H C:\ORACLE\ORA81\DATABASE\PWDSID.ORA 

Make the password file visible 

C:\ORACLE\ORA81\DATABASE> ATTRIB -H PWDSID.ORA

Note: The password file must be visible before you can move or copy it.  

Hide the password file again 

C:\ORACLE\ORA81\DATABASE> ATTRIB +H PWDSID.ORA 

To see the password file from Windows 98 Explorer:

  1. Open Windows 98 Explorer.

  2. Open the folder to view.

  3. Click Folder Options from the View main menu.

  4. Click the View tab.

  5. Follow the instructions below:

    To...  Click... 

    See the password file 

    Show all files. 

    Hide the password file 

    Do not show hidden files. 

Deleting Password Files

This section describes how to delete a password file.

To delete a password file:

  1. Make the password file visible at the MS-DOS command prompt or in Windows 98 Explorer by following the instructions in section "Viewing Password Files".

  2. Delete the password file based on whether you made it visible at the MS-DOS command prompt or in Windows 98 Explorer.

Connecting as INTERNAL with a Password File

You can connect as INTERNAL with a password file. The password for INTERNAL is ORACLE if you installed your database through the Typical or Minimal installation types.

To connect as INTERNAL with a password file:

  1. Follow the procedures in "Creating Password Files" to create a password file with ORAPWD.

  2. Set the INIT.ORA file parameter REMOTE_LOGIN_PASSWORDFILE to EXCLUSIVE or SHARED.


Note:

When REMOTE_LOGIN_PASSWORDFILE is set to NONE, connecting remotely to a database as INTERNAL is prohibited even if the correct password is supplied. 


  1. Connect to your Oracle8i database as follows:

    SQL> CONNECT INTERNAL/PASSWORD
    

Changing the INTERNAL Password

Change the INTERNAL user account password with either ORAPWD or SQL*Plus.

To change the password with ORAPWD:

  1. See section "Deleting Password Files" for instructions on deleting the password file.

  2. See section "Creating Password Files" for instructions on creating a password file.

To change the password with SQL*Plus:

The section assumes the password file is already created and the INIT.ORA file parameter REMOTE_LOGIN_PASSWORDFILE is set to SHARED or EXCLUSIVE.

  1. Start SQL*Plus:

    C:\> SQLPLUS
    

  1. Connect with the INTERNAL user name:

    SQL> CONNECT SYS/password
    

  1. Change the password for the SYS user name, for which INTERNAL is an alias:

    SQL> ALTER USER SYS IDENTIFIED BY NEW_PASSWORD;
    

Encrypting Database Passwords

With the Oracle8i database, you can encrypt the password used to verify a remote database connection.

To enable password encryption:

  1. Add DBLINK_ENCRYPT_LOGIN to the initialization parameter INIT.ORA file on the server computer.

  2. Set DBLINK_ENCRYPT_LOGIN equal to TRUE.

  3. Set the ORA_ENCRYPT_LOGIN configuration variable on the client computer to TRUE. See Appendix C, "Oracle8i Configuration Parameters and the Registry" for instructions on adding and setting configuration parameters in the registry.

Once these parameters are set to TRUE, whenever a user attempts a remote login, the Oracle8i database encrypts the password before sending it to the remote database. If the connection fails, the failure is noted in the audit log. The Oracle8i database then checks if either of these parameters is set to FALSE. If so, the Oracle8i database attempts the connection again using an unencrypted version of the password. If the connection is successful, the success is noted in the audit log, and the connection proceeds.


Note:

Releases prior to Release 7.1 do not support encrypted passwords. If you are connecting to an earlier version of the Oracle database, you must set the initialization parameter
DBLINK_ENCRYPT_LOGIN to FALSE for the connection to succeed. 


Archiving Redo Log Files

Your Oracle8i database is created in NOARCHIVELOG mode if you installed your database through the Typical or Minimal installation. If you created your databas through the Custom option of Database Configuration Assistant, you had the choice of either ARCHIVELOG or NOARCHIVELOG.

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

This section describes how to change the archive mode to ARCHIVELOG and enable automatic archiving. See the chapter "Archiving Redo Information" of the Oracle8i Administrator's Guide for complete descriptions of the ARCHIVELOG and NOARCHIVELOG modes.

Step 1: Change the Archive Mode to ARCHIVELOG

To change the archive mode to ARCHIVELOG:

  1. Start SQL*Plus at the MS-DOS command prompt:

    C:\> SQLPLUS
    

  1. Connect to the Oracle8i database with the INTERNAL user name:

    SQL> CONNECT INTERNAL
    

  1. If the database is open, shut it down:

    SQL> SHUTDOWN
    

  1. Mount the database:

    SQL> STARTUP MOUNT
    

  1. Enter the following command:

    SQL> ARCHIVE LOG LIST
    

  • Change the archive mode to ARCHIVELOG:

    SQL> ALTER DATABASE ARCHIVELOG;
    

    1. Enter the following command:

      SQL> ARCHIVE LOG LIST
      

    1. Open the database:

      SQL> ALTER DATABASE OPEN;
      

    1. Continue to "Step 2: Enable Automatic Archiving".

    Step 2: Enable Automatic Archiving

    To enable automatic archiving:

    1. Open the ORACLE_BASE\ADMIN\DB_NAME\INIT.ORA file.

    2. Find the following three parameters:

      # LOG_ARCHIVE_START = TRUE
      # LOG_ARCHIVE_DEST_1 = %ORACLE_HOME%\DATABASE\ARCHIVE
      # LOG_ARCHIVE_FORMAT = "%%ORACLE_SID%%T%TS%S.ARC"
      

    1. Remove the # sign from in front of each.


    Note:

    The double quotes around LOG_ARCHIVE_FORMAT do not need to be removed. 


    1. Edit the LOG_ARCHIVE_DEST_n value to identify an existing drive and directory in which to archive your filled redo logs.

    2. Edit the LOG_ARCHIVE_FORMAT value to indicate the appropriate archiving format.

    Format  Description  Example 

    %%ORACLE_SID%%%T.ARC 

    Specifies the thread number. This number is padded to the left by zeroes. The default value is one with a range of up to three characters. 

    SID0001.ARC 

    %%ORACLE_SID%%%S.ARC 

    Specifies the log sequence number. This number is padded to the left by zeroes. The default value is one with a range of up to five characters. 

    SID0001.ARC 

    %%ORACLE_SID%%%t.ARC 

    Specifies the thread number. The number is not padded. The default value is one with no range limit on characters. 

    SID1.ARC 

    %%ORACLE_SID%%%sARC 

    Specifies the log sequence number. The number is not padded. The default value is one with no range limit on characters. 

    SID1.ARC 

    1. Save your changes.

    2. Exit the file.

    3. Shut down the database:

      SQL> SHUTDOWN
      

    1. Restart the database

      SQL> STARTUP
      

    1. Enter the following command:

      SQL> ARCHIVE LOG LIST
      

    Using the ORADEBUG Utility

    The ORADEBUG utility is a debugging tool that sends debug commands through SQL*Plus to Oracle processes. It is primarily for use by developers and Oracle Support Services personnel. Only use this utility when instructed to do so by Oracle Support Services. Note that you must have database administrator privileges to use ORADEBUG.

    To start ORADEBUG:

    1. Start SQL*Plus from the MS-DOS command prompt and connect to the database as INTERNAL. For example:

      C:\> SQLPLUS
      SQL> CONNECT INTERNAL

    1. Enter the following at the SQL*Plus prompt:

      SQL> ORADEBUG
      


  • Prev Next
    Oracle
    Copyright © 2000 Oracle Corporation.

    All Rights Reserved.

    Library

    Product

    Contents

    Index