Oracle8 Enterprise Edition Getting Started 
Release 8.0.5 for Windows NT 
A64416-01
 
Library
 
Product
 
Contents
 
Index
 

Prev Next

9
Creating a Database

This chapter describes how to create a database.

Specific topics discussed are:

Before You Create a Database

Before you create a database, consider the following requirements:

Naming Conventions for Oracle8 Databases

Before creating a database, it is important to understand that starting with Oracle8 Enterprise Edition, all mounted Oracle databases in a network must have unique database names. A database name is associated with a database at "CREATE DATABASE" time and stored in the control file(s) of the database. If the database keyword is provided in the CREATE DATABASE statement, then that value becomes the database name for that database. If not, then the value of the DB_NAME parameter in the INITSID.ORA file is used. If the DB_NAME parameter is not specified, then the default DB_NAME value is ORCx.

If you attempt to mount two Oracle8 databases with the same database name, you receive the following error during the second mount:

ORA-01102: cannot mount database in EXCLUSIVE mode

If there are two or more Oracle8 databases on the same computer located in different Oracle homes:

To change the name of an existing database, you must use the CREATE CONTROLFILE statement to recreate your control file(s) and specify a new database name. This restriction is imposed only on Oracle8 instances. Any Oracle7 instances running simultaneously with an Oracle8 instance are not subject to this restriction.

Installing Oracle8 Server (the Database Component)

Note that the Oracle8 Server RDBMS component (the database software) must be installed from either the Oracle8 Enterprise Edition or Custom Installation options on Windows NT. It is not available with the Client option. See Oracle8 Enterprise Edition Installation for Windows NT for more information.

Creating a Database Overview

This section describes how to create a new database. You can choose either of the following tools to create a database:

Use Oracle Database Assistant to create a database because it is the easiest method. If you want to create a database using command line tools, you can use the BUILD_DB.SQL script located in ORACLE_HOME\RDBMS80\ADMIN.

Using Oracle Database Assistant

During installation of Oracle8 Enterprise Edition, you can select either of the following options to install Oracle Database Assistant. If you select:

To create a database using Oracle Database Assistant:

  1. Choose Start > Programs > Oracle for Windows NT - [HOME_NAME] > Oracle Database Assistant.
  2. The Oracle Database Assistant welcome window appears:

  3. Select Create a database, then click Next.
  4. The following window appears:

  5. Choose the Typical or Custom option to create a database:

  6. Option  Description 

    Typical 

    Creates a standard database with default INITSID.ORA parameter settings. 

    Custom 

    Customizes the creation of your database. This option is only for Oracle database administrators experienced with advanced database creation procedures, such as customizing: 

    • Data, control, and redo log file settings 
    • Tablespace sizes 
    • Extent sizes 
    • Database memory parameters 
    • Archiving formats and destinations 
    • Trace file destinations 
    • Character set values 
     
     
  7. Respond to instructions in each Oracle Database Assistant window, then click Next when you are ready to continue to the next screen. When you get to the last screen, click Finish to start the creation of the Oracle8 database.

Configure Oracle8 Cartridges Using Oracle Database Assistant

You can modify an Oracle8 database to support the following cartridges that you installed from your CD-ROM, but have not yet configured:

These cartridges (if installed during a separate installation from Oracle8 Enterprise Edition) are not automatically configured during installation. The Oracle ConText Cartridge is never automatically configured. The Modify option of Oracle Database Assistant automatically configures your cartridges. If you installed Oracle cartridges through the Oracle8 Enterprise Edition option on the CD-ROM, your cartridges were automatically configured for the starter database ORCL.


Note:  

If you installed the Oracle8 Visual Information Retrieval Cartridge and its check box is shaded, you must select the Oracle8 Image Cartridge check box first. This action clears the Oracle8 Visual Information Retrieval Cartridge check box. 


 
 

Delete a Database Using Oracle Database Assistant

The Delete a Database option of Oracle Database Assistant lets you quickly and easily delete databases.

Enable and Disable Multi-Threaded Support Using Oracle Database Assistant

You can choose options in Oracle Database Assistant to enable or disable multi-threaded server support in your Oracle8 database. Multi-threaded server (MTS) support enables many client user processes to share a small number of server processes. Many client users can connect to a dispatcher process. The dispatcher process then routes client requests to the next available shared server process. There is no dedicated server process for each user process that remains associated with the client user process for the duration of the connection. Instead, inactive server processes are "recycled" and used as needed. This reduces system overhead and enables you to increase the number of supported users. See Net8 Administrator's Guide, Oracle8 Concepts, and Oracle8 Reference for more information.

Using BUILD_DB.SQL

This section describes the steps to create a database manually using a SQL script. There are a number of ways to create a database depending on if you want to:

The table below summarizes the steps to create a new database for each of the above database creation scenarios. Each step is explained in detail in the following sub-sections.


Perform These Tasks...  If You Want To... 
Copy an existing database and remove the old database  Copy an existing database and keep the old database  Create a new database when no other database exists that you can copy 

Export an Existing Database 

Yes 

Yes. Only if you want to copy data from an existing database to the additional database 

Not applicable 

Delete Database Files 

Yes 

No 

Not applicable 

Modify the INITSID.ORA File 

Yes 

Yes 

Yes 

Create and Start an Oracle8 Service 

No 

Yes 

Yes 

Put CREATE DATABASE Statement in a Script 

Yes 

Yes 

Yes 

Create a Database 

Yes 

Yes 

Yes 

Import a Database 

Yes 

Yes. Only if you want to import tables and other objects exported from an existing database 

Not applicable 

Update ORACLE_SID in the Registry 

No 

Only if you want to change the default SID 

Yes 

Back Up the New Database 

Yes 

Yes 

Yes 

 

Create Database Example

An example is used in the following sections to demonstrate the commands to create a database. In this example, you will copy an existing database (the starter database with a SID of ORCL located in the C:\ ORANT directory) to a new database with a SID of PROD located in the C:\MYDIR directory. You will delete the ORCL database after you have created the PROD database.

Create \MYDIR Directory

Create a directory, for example, C:\MYDIR in which to put the new database PROD.

Export an Existing Database

It is only necessary to export if you want to copy the contents of an existing database to a new database. You must perform this task if you are going to remove the old database and put its data in the new database. If you are going to create an additional database, you only need to do this if you want a copy of the data from the old database in the new database.

You can invoke the Export Utility using parameter mode or interactive mode. Parameter mode is the recommended mode. Interactive mode provides less functionality than parameter mode. It exists for backward compatibility.

Example 9-1 Parameter Mode

C:\ORANT> EXP80 SYSTEM/PASSWORD FILE=MYEXP.DMP FULL=Y LOG=MYEXP.LOG

Example 9-2 Interactive Mode

C:\ORANT> EXP80 SYSTEM/PASSWORD

Enter only the command EXP80 USERNAME/PASSWORD to begin an interactive session and let the Export Utility prompt you for the information it needs.

See Oracle8 Utilities for more information on using the Export Utility in parameter or interactive mode.


Note:  

If you use Parameter mode, the Export Utility considers file names and directory names to be invalid if a blank space is present. Enclose the full path in the FILE= parameter in triple quotes. For example:  

FILE="""C:\PROGRAM FILES\EXPORT.DMP"""  

or  

FILE="""C:\PROGRAM FILES\EXPORT FILE.DMP"""  

If the Export Utility is used in Interactive mode, the file name or directory name can contain a space without quotes. 


 
 

To export all data from an existing database to a new database:

  1. Set ORACLE_SID to the database service of the database whose contents you want to export. For example, if the database you want to export is the starter database ORCL, enter the following at the MS-DOS command prompt. Note there are no spaces around the equal sign (=) character.
  2. C:\ORANT> SET ORACLE_SID=ORCL
  3. Start the Export utility from the MS-DOS command prompt:
  4. C:\ORANT> EXP80 SYSTEM/PASSWORD FILE=MYEXP.DMP FULL=Y LOG=MYEXP.LOG

    You now have a full database export of the starter database ORCL in the file MYEXP.DMP, with all messages from the Export utility logged in the MYEXP.LOG file.

Delete Database Files

It is only necessary to delete database files if you want to copy an existing database to a new database and then remove the old database. In the following example, we delete the database files of the starter database ORCL.

To delete database files:

  1. Shut down the starter database ORCL at the MS-DOS command prompt:
  2. C:\ORANT> ORADIM80 -SHUTDOWN -SID ORCL -USRPWD PASSWORD -SHUTTYPE INST 
    -SHUTMODE I
  3. Delete the following database files located in the ORANT\DATABASE directory:

LOG3ORCL.ORA AND LOG4ORCL.ORA database files are only available with release 7.3.4 and 8.0.4 databases. Do not delete the INITORCL.ORA file, as it will be the basis for the new initialization parameter file INITPROD.ORA in "Modify the INITSID.ORA File".

Modify the INITSID.ORA File

If you are using the starter database ORCL as the basis for your new database, copy C:\ORANT\DATABASE\INITORCL.ORA to C:\MYDIR\DATABASE\ INITPROD.ORA and modify the file.

If you do not have an existing database on your system, you cannot copy an initialization parameter file to use as the basis for your INITPROD.ORA file. You can use the sample initialization parameter file INITORCL.80 provided in the C:\ORANT\DATABASE directory as the basis for INITPROD.ORA.

You must modify the CONTROL_FILES and DB_NAME initialization parameters in the INITPROD.ORA file or you will not be able to start the PROD database. Modifying the initialization parameters GLOBAL_NAMES and DB_FILES is highly recommended to optimize performance.

Initialization Parameter  How to Modify... 

CONTROL_FILES 

This parameter lists the control files of the database. You do not have the control files on your file system at this point, because the control files are created when you execute the CREATE DATABASE statement.  

Ensure you specify the complete path and file name, including drive letter. For example,  

CONTROL_FILES = (C:\MYDIR\DATABASE\CTL1PROD.ORA,  

ORACLE_HOME\DATABASE\CTL2PROD.ORA)  

DB_NAME 

This parameter indicates the name of the database, and must match the name used in the CREATE DATABASE statement in "Using BUILD_DB.SQL" in this chapter. This name does not need to match the SID of the database service. You give a unique database name to each database. For example,  

DB_NAME=PROD  

You can use up to eight characters for the database name. 

GLOBAL_NAMES 

The default value of this parameter is FALSE; however, it is recommended to set this parameter to TRUE. See the Oracle8 Administrator's Guide to find out more about global names and how they relate to database links. 

DB_FILES 

Set this initialization parameter to the same number as the value of the MAXDATAFILES option of the CREATE DATABASE statement. The value of 100 is used for this example.  

DB_FILES=100 

 

Additional Information:  

See Appendix B, "Oracle8 Database Specifications for Windows NT" for information on other initialization parameters you may want to add to the INITPROD.ORA file. 

 
 

Create and Start an Oracle8 Service

It is only necessary to create and start an Oracle8 service if you want to:

Before you create the database, first create a Windows NT service to run the database. This service is the Oracle8 database process, ORACLE80.EXE, installed in the form of a Windows NT service. Use ORADIM80 to create the service. Upon creation, the service starts automatically. See section, "Using ORADIM80 to Administer the Oracle Instance" for information on how to use ORADIM80.

To create a Windows NT service:

  1. Go to the \MYDIR directory.
  2. C:\> CD MYDIR
  3. Run ORADIM80 from the MS-DOS command prompt:
  4. C:\MYDIR> ORADIM80 -NEW -SID PROD -INTPWD PASSWORD -STARTMODE AUTO 
    -PFILE C:\MYDIR\DATABASE\INITPROD.ORA

    Note that the previously created INITPROD.ORA file is specified, with complete path, including drive name. You do not receive a message indicating the success or failure of this command. You can check if the service is started in the services window of the Windows NT Control Panel.

  5. Set ORACLE_SID to equal PROD. Note there are no spaces around the equal sign (=) character:
  6. C:\MYDIR> SET ORACLE_SID=PROD

Put CREATE DATABASE Statement in a Script

The CREATE DATABASE statement is a sequence of SQL statements that creates the database. Create a script containing this statement that you can reuse anytime you want to create a database. Use the BUILD_DB.SQL script located in C:\ORANT\RDBMS80\ADMIN as a basis for your script.

To prepare the CREATE DATABASE script:

  1. Copy C:\ORANT\RDBMS80\ADMIN\BUILD_DB.SQL to C:\MYDIR\RDBMS80\ADMIN\BUILD_PROD.SQL and make the following changes to the BUILD_PROD.SQL script:
    1. Set PFILE so it points to the C:\MYDIR\DATABASE\INITPROD.ORA initialization file.
    2. Modify CREATE DATABASE ORCL to CREATE DATABASE PROD.
    3. Modify all the log file and data file names. Change all occurrences of ORCL to PROD. For example, change LOG1ORCL.ORA to LOG1PROD.ORA.
    4. Modify the location of the Oracle home directory including drive name, if necessary. Change all occurrences of ORANT to MYDIR. For example, change C:\ORANT\DATABASE to C:\MYDIR\DATABASE.

    A sample script follows:

    -- This file must be run out of the directory containing the 
    -- initialization file. 
    startup nomount pfile=C:\mydir\DATABASE\initprod.ora 
    --  Create database 
    create database prod 
    controlfile reuse 
    logfile 'C:\mydir\DATABASE\log1prod.ora' size 1M reuse, 
            'C:\mydir\DATABASE\log2prod.ora' size 1M reuse, 
            'C:\mydir\DATABASE\log3prod.ora' size 1M reuse, 
            'C:\mydir\DATABASE\log4prod.ora' size 1M reuse 
    datafile 'C:\mydir\DATABASE\sys1prod.ora' size 10M reuse autoextend on 
    next 10M maxsize 200M 
    character set WE8ISO8859P1;  
    create rollback segment rb_temp;  
    -- Create additioanal tablespaces ...  
    -- USER_DATA: Create user sets this as the default tablespace 
    -- TEMPORARY_DATA: Create user sets this as the temporary tablespace 
    -- ROLLBACK_DATA: For rollback segments 
    create tablespace user_data 
            datafile 'C:\mydir\DATABASE\usr1prod.ora' size 3M reuse autoextend on 
            next 5M maxsize 150M; 
    create tablespace rollback_data 
            datafile 'C:\mydir\DATABASE\rbs1prod.ora' size 5M reuse autoextend on 
            next 5M maxsize 150M; 
    create tablespace temporary_data 
            datafile 'C:\mydir\DATABASE\tmp1prod.ora' size 2M reuse autoextend on 
            next 5M maxsize 150M; 
    alter rollback segment rb_temp online;\x7f  
    -- Change the SYSTEM users' password, default tablespace and 
    -- temporary tablespace. 
    alter user system temporary tablespace temporary_data; 
    alter user system default tablespace user_data; 
    -- Create 16 rollback segments.  Allows 16 concurrent users with open 
    -- transactions updating the database. This should be enough. 
    create public rollback segment rb1 storage(initial 50K next 50K) 
    tablespace rollback_data; 
    create public rollback segment rb2 storage(initial 50K next 50K) 
    tablespace rollback_data; 
    create public rollback segment rb3 storage(initial 50K next 50K) 
    tablespace rollback_data; 
    create public rollback segment rb4 storage(initial 50K next 50K) 
    tablespace rollback_data; 
    create public rollback segment rb5 storage(initial 50K next 50K) 
    tablespace rollback_data; 
    create public rollback segment rb6 storage(initial 50K next 50K) 
    tablespace rollback_data; 
    create public rollback segment rb7 storage(initial 50K next 50K) 
    tablespace rollback_data; 
    create public rollback segment rb8 storage(initial 50K next 50K) 
    tablespace rollback_data; 
    create public rollback segment rb9 storage(initial 50K next 50K) 
    tablespace rollback_data; 
    create public rollback segment rb10 storage(initial 50K next 50K) 
    tablespace rollback_data; 
    create public rollback segment rb11 storage(initial 50K next 50K) 
    tablespace rollback_data; 
    create public rollback segment rb12 storage(initial 50K next 50K) 
    tablespace rollback_data; 
    create public rollback segment rb13 storage(initial 50K next 50K) 
    tablespace rollback_data; 
    create public rollback segment rb14 storage(initial 50K next 50K) 
    tablespace rollback_data; 
    create public rollback segment rb15 storage(initial 50K next 50K) 
    tablespace rollback_data; 
    create public rollback segment rb16 storage(initial 50K next 50K) 
    tablespace rollback_data;

You will run this script at the Server Manager prompt in the section, "Create a Database".

Create a Database

Before you run the BUILD_PROD.SQL script to create a database, you must perform the following tasks:

  1. Check if the service is started in the Windows NT Control Panel. In this example, the service name is OracleServicePROD, and its status column should display Started. If not, single-click the service name and choose the Start button to start the service. Alternatively, check the status of the service by entering the following at the MS-DOS command prompt:
  2. C:\MYDIR> NET START

    A list of all Windows NT services currently running on the system appears. If OracleServicePROD is missing from the list, enter:

    C:\MYDIR> NET START ORACLESERVICEPROD
  3. Make PROD the current SID:
  4. C:\MYDIR> SET ORACLE_SID=PROD
  5. Start Server Manager from the MS-DOS command prompt, and connect to the database as INTERNAL:
  6. C:\MYDIR> SVRMGR30
    SVRMGR> CONNECT INTERNAL/PASSWORD

    The password is the one you previously used to create the service, with the ORADIM80 -NEW command in section, "To create a Windows NT service:". You should see the message Connected.

  7. Start the database in NOMOUNT mode:
  8. SVRMGR> STARTUP NOMOUNT PFILE=C:\MYDIR\DATABASE\INITPROD.ORA

    When the initialization parameter file INITPROD.ORA is located in the DATABASE subdirectory of your Oracle home directory, the PFILE specification is optional. Otherwise, you must specify the PFILE option with the complete path and file name of the initialization parameter file. Note that there is an equal sign (=) between the keyword PFILE and the path/filename. There are no space characters around the equal sign (=).

  9. Turn on spooling to save the messages and run the BUILD_PROD.SQL script you created in section, "Put CREATE DATABASE Statement in a Script":
  10. SVRMGR> SPOOL BUILD_PROD.LOG 
    
    SVRMGR> @BUILD_PROD.SQL

    This command assumes the script file is located in the directory from which Server Manager was invoked. If this is not the case, specify the complete path in front of the file name. If the database is created successfully, the message Statement processed appears. If you receive any errors, there are three possible causes:
    Cause of Error  Solution 

    The BUILD_PROD.SQL script contained syntax errors. 

    Correct them. 

    Some of the files to be created by the BUILD_PROD.SQL script already exist in the file system. 

    Make sure you are not using any file names already used by another database on the system. 

    There was an error at the operating system level, such as a file or directory permission problem. 

    You should have received a series of errors in Server Manager, the last one of which should have the OSD- prefix. At the end of the OSD error you typically see an operating system error number in parentheses. To see what the error means:  

    From the MS-DOS command prompt, enter:  

    C:\> NET HELPMSG n  

    or  

    From the Server Manager prompt, enter:  

    SVRMGR> HOST NET HELPMSG n  

    where n is the operating system error number. See "Operating System Permission Issues" in Appendix F, "Troubleshooting" for more information. 

     

    You must correct these problems before attempting to recreate a database.

  11. Run the following script to generate the data dictionary:
  12. SVRMGR> @%RDBMS80%\ADMIN\CATALOG.SQL
  13. Run the following script to install the objects used by the Oracle8 database's PL/SQL functionality:
  14. SVRMGR> @%RDBMS80%\ADMIN\CATPROC.SQL

    Run the following script if you want Advanced Replication functionality with the new database. Ensure that the rollback segments are large enough and are online before you run CATREP8M.SQL.

    SVRMGR> @%RDBMS80%\ADMIN\CATREP8M.SQL

    Note that CATREP8M.SQL requires at least an hour to run, depending on your system.

  15. Turn off spooling after all scripts have finished running:
  16. SVRMGR> SPOOL OFF
  17. Examine the BUILD_PROD.SQL.LOG file for any errors.

  18. Note:  

    You may see many messages such as object to be dropped does not exist and name already used by another object while the scripts are running. These are information messages and are intended to occur while creating a new database. If you see any unusual errors in the BUILD_PROD.SQL.LOG log file, see Oracle8 Error Messages for suggested actions. 
     


     
     

    IMPORTANT:  

    The new database contains two users, SYS and SYSTEM, with passwords CHANGE_ON_INSTALL and MANAGER, respectively. For security reasons, change the passwords now. Use the ALTER USER statement to change the passwords: 

    SVRMGR> ALTER USER SYS IDENTIFIED BY NEW_SYS_PASSWORDSVRMGR> ALTER USER SYSTEM IDENTIFIED BY NEW_SYSTEM_PASSWORD
     
     
     

Import a Database

You can choose to import the full export created in the section, "Export an Existing Database" into the new database.

You can invoke the Import Utility using Parameter mode or Interactive mode. Parameter mode is the recommended mode. Interactive mode provides less functionality than parameter mode. It exists for backward compatibility.

Example 9-3 Parameter Mode

C:\ORANT> IMP80 SYSTEM/PASSWORD FILE=MYEXP.DMP FULL=Y LOG=MYEXP.LOG

Example 9-4 Interactive Mode

C:\ORANT> IMP80 SYSTEM/PASSWORD

Enter only the command IMP80 USERNAME/PASSWORD to begin an interactive session and let the Export Utility prompt you for the information it needs.

See Oracle8 Utilities for more information on using the Import Utility in parameter or interactive mode.


Note:  

If you use Parameter mode, the Import Utility considers file names and directory names to be invalid if a blank space is present. Enclose the full path in the FILE= parameter in triple quotes. For example:  

FILE="""C:\PROGRAM FILES\EXPORT.DMP"""  

or  

FILE="""C:\PROGRAM FILES\EXPORT FILE.DMP"""  

If the Import Utility is used in Interactive mode, the file name or directory name can contain a space without quotes. 


 
 

To import data:

  1. Exit Server Manager:
  2. SVRMGR> EXIT
  3. Run the Import utility:
  4. C:\MYDIR> IMP80 SYSTEM/PASSWORD FILE=MYEXP.DMP FULL=Y LOG=MYIMP.LOG

    IMPORTANT:  

    If the original database from which the export file was generated contains tablespaces that are not in the new database, then the Import utility attempts to create those tablespaces with associated data files. The easy solution is to ensure both databases contain the same tablespaces. The data files do not have to be identical. Only the tablespace names are important. 
     


     
     

Update ORACLE_SID in the Registry

If this is the first database on the system or if you want to make the new database the default database, you must make a change in the registry.

  1. Invoke the registry editor at the MS-DOS command prompt by entering REGEDT32. For example:
  2. C:\MYDIR> REGEDT32

    The registry editor window appears.

  3. Choose the \HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE subkey for the first Oracle home on your computer. For subsequent installations to different Oracle homes on the same computer, the path is \HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOMEID, where ID is the unique number identifying the Oracle home. See Appendix C, "Configuration Parameters and the Registry" for more information on the subkey locations for multiple Oracle homes.
  4. Locate the ORACLE_SID parameter on the right side of the registry editor window.
  5. Double-click the parameter name, and change the data to the new SID, which is PROD in this example.

If you do not have ORACLE_SID because this is the first database on your system, you must create the ORACLE_SID parameter.

To create ORACLE_SID parameter:

  1. Start the registry in either of two ways:
  2. The registry editor window appears.

  3. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE if this is the first Oracle home on your computer. For additional Oracle homes on the same computer, the path is \HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ HOMEID, where ID is the unique number identifying the Oracle home.
  4. Choose Add Value... from the Edit menu.
  5. The Add Value dialog box appears:

  6. Enter ORACLE_SID in the Value Name field.
  7. Enter REG_EXPAND_SZ (for an expandable string) in the Data Type box
  8. Click OK.
  9. A string editor dialog box appropriate for the data type appears:

  10. Enter PROD in the string editor dialog box.
  11. The registry editor adds the ORACLE_SID parameter.

  12. Choose Exit from the registry menu.
  13. The registry exits.

Back Up the New Database


WARNING:  

If anything goes wrong while operating the new database without a backup, you must repeat the database creation procedure. Back up your database now to prevent such damage.  


 
 

To back up the new database:

  1. Shut down the database instance and stop the service:
  2. C:\MYDIR> ORADIM80 -SHUTDOWN -SID PROD -USRPWD PASSWORD 
    -SHUTTYPE SRVC,INST -SHUTMODE I

    WARNING:  

    Although ORADIM80 returns the prompt immediately, you must wait for the database and the service to stop completely before continuing to Step 2. Wait until the Control Panel indicates the OracleServicePROD service has stopped. If you do not do this, the backup may be useless as it was taken while data was being written to the data files. 


     
     
  3. Using the tool of your choice, back up the database files. Data files consist of the initialization parameter file, control files, online redo log files, and data files.
  4. You can now start the database again, create users and objects if necessary, make any other changes, and use the database. Ensure you make a database backup, if possible, after making any significant change to the database, such as switching the ARCHIVELOG mode or adding a tablespace or data file.

    Additional Information:  

    See Chapter 13, "Backing Up and Recovering Database Files", Oracle8 Concepts, Oracle8 Backup and Recovery, and Oracle8 Administrator's Guide for more information on archiving and backup/recovery. 
     

     
     

Using ORADIM80 to Administer the Oracle Instance

ORADIM80 is a command line tool that is only available on Oracle8 Enterprise Edition for Windows NT. This is the only manual in the documentation set where you will find information on this tool. ORADIM80 and Oracle Database Assistant perform similar tasks. The following table compares what you can do with these two tools:


ORADIM80  Oracle Database Assistant 
  • Use ORADIM80 to create, start, stop, modify, and delete instances (and not any associated database files) at the MS-DOS command prompt.
  • Use the assistant to create and delete databases (and their associated instances and services). Note that the assistant cannot start or stop existing databases.
  • Can be used to modify an instance. You can modify an existing instance to change such values as the instance name, the password, the startup mode, and the number of users.
  • Cannot be used to modify an instance. 
 
  • Only creates the password file and the related service. The database (that is, the database files) is not created.
  • Creates the database, the associated instance, the service, and the password file.
 

When you use ORADIM80, a log file called ORADIM80.LOG is opened in ORACLE_HOME\RDBMS80. All operations (both successful and failed) are logged in this file. You must check this file to verify the success of an operation. The following sections describe the ORADIM80 commands and parameters. Note that each command is preceded by a dash (-).

To Get a List of ORADIM80 Parameters And Descriptions: 

Use this syntax: 

ORADIM80 -? | -H | -HELP 

Example: 

C:\MYDIR> ORADIM80 -? 

 

Creating an Instance

To Create an Instance: 

Use this syntax: 

ORADIM80 -NEW -SID SID -INTPWD INTERNAL_PWD  

[-USERS NUMBER][-STARTMODE AUTO, MANUAL][-PFILE FILENAME] 

Example to create an instance called PROD: 

C:\MYDIR> ORADIM80 -NEW -SID PROD -INTPWD MYPASSWORD1 -STARTMODE AUTO -PFILE C:\MYDIR\DATABASE\INITPROD.ORA  

Syntax description: 

  • -NEW 
 

indicates that you want to create a new instance. This is a mandatory parameter. 

 

  • -SID SID 
 

is the name of the instance you want to create. This is a mandatory parameter. 

 

  • -INTPWD INTERNAL_PWD 
 

is the password for the INTERNAL account. This is a mandatory parameter unless DBA_AUTHORIZATION or DBA_SID_AUTHORIZATION is set to BYPASS in the registry. 

 

  • -MAXUSERS NUMBER 
 

is the number of users defined in the password file. The default is 5. 

 

  • -STARTMODE AUTO, MANUAL 
 

indicates whether to start the instance automatically or manually at startup. The default setting is MANUAL. 

 

  • -PFILE FILENAME 
 

is the INITSID.ORA file to be used with this instance. Ensure you specify the complete pathname of this file, including drive letter. 

 

Starting an Instance

To Start an Instance: 

Use this syntax: 

ORADIM80 -STARTUP -SID SID [-USRPWD USER_PWD] -STARTTYPE SRVC, INST [-PFILE FILENAME] 

Example to start an instance called PUMA: 

C:\MYDIR> ORADIM80 -STARTUP -SID PUMA -STARTTYPE SRVC -PFILE C:\MYDIR\DATABASE\INITPUMA.ORA  

Syntax description: 

  • -STARTUP 
 

indicates that you want to start an instance that already exists. This is a mandatory parameter. 

 

  • -SID SID 
 

is the name of the instance you want to start. This is a mandatory parameter. 

 

  • -USERPWD USER_PWD 
 

is the password. 

 

  • -STARTTYPE SRVC, INST 
 

indicates whether to start the service or the instance. Both can be specified. This is a mandatory parameter. 

 

Stopping an Instance

To Stop an Instance: 

Use this syntax: 

ORADIM80 -SHUTDOWN -SID SID [-USRPWD USER_PWD] -SHUTTYPE SRVC, INST -SHUTMODE [A, I, N] 

Example to stop an instance called PUMA: 

C:\MYDIR> ORADIM80 -SHUTDOWN -SID PUMA -SHUTTYPE SRVC INST 

Syntax description: 

  • -SHUTDOWN 
 

indicates that you want to stop an instance. This is a mandatory parameter. 

 

  • -SID SID 
 

is the name of the instance you want to stop. This is a mandatory parameter. 

 

  • -USERPWD USER_PWD 
 

is the password. 

 

  • -SHUTTYPE SRVC, INST 
 

indicates whether to stop the service or the instance. Both can be specified. This is a mandatory parameter. 

 

  • -SHUTMODE A, I, N 
 

specifications on how to stop an instance; A indicates abort mode, I indicates immediate mode, and N indicates normal mode. This is an optional parameter. If you do not specify how to stop an instance, normal is the default mode. 

 

Modifying an Instance

To Modify an Instance: 

Use this syntax: 

ORADIM80 -EDIT -SID SID [-NEWSID NEWSID] -INTPWD INTERNAL_PWD 
[-STARTMODE AUTO, MANUAL][-PFILE FILENAME] 

Example to modify an instance called PROD: 

C:\MYDIR> ORADIM80 -EDIT -SID PROD -NEWSID LYNX -INTPWD MYCAT123 -STARTMODE AUTO -PFILE C:\MYDIR\DATABASE\INITLYNX.ORA  

Note: 

You can modify an existing instance, in this example PROD, to change such values as the instance name, the password, the startup mode, and the number of users. 

Syntax description: 

  • -EDIT 
 

indicates that you want to modify an instance. This is a mandatory parameter. 

 

  • -SID SID 
 

is the name of the instance you want to modify. This is a mandatory parameter. 

 

  • -NEWSID NEWSID 
 

is the new instance name. This is an optional parameter. 

 

  • -INTPWD INTERNAL_PWD 
 

is the password for the INTERNAL account. This is a mandatory parameter unless DBA_AUTHORIZATION or DBA_SID_AUTHORIZATION is set to BYPASS in the registry.  

Note: This parameter cannot be used to change the password, as it does not overwrite the existing password file. It can only create a new password file when none already exists. To create a new password file, use ORAPWD80, or delete the Oracle8 services (this action implicitly deletes the associated password file) and then recreate the Oracle8 services (this action implicitly creates the associated password file). See the section, "Password Utility (ORAPWD80)" in Chapter 3, "Database Tools Overview"

 

  • -STARTMODE AUTO, MANUAL 
 

indicates whether to start the instance automatically or manually at startup. The default setting is MANUAL. 

 

  • -PFILE FILENAME 
 

is the INITSID.ORA file to be used with this instance. Ensure you specify the complete pathname of this file, including drive letter. 

 

Deleting an Instance

To Delete an Instance: 

Use this syntax: 

ORADIM80 -DELETE -SID SIDA SIDB SIDC -SVRC SVRCA SVRCB SVRCC  

Example to delete the instances PUMA and LYNX: 

C:\MYDIR> ORADIM80 -DELETE -SID PUMA LYNX -SRVC ORACLESERVICEPUMA ORACLESERVICELYNX 

Syntax description: 

  • -DELETE
indicates that you want to delete an instance or instances. 

 

  • -SID SIDA, SIDB, SIDC 
are the names of the SIDs to delete. 

 

  • -SVRC SRVCA, SRVCB, SRVCC 
are the services to delete. 
 



 
Prev
 
Next
 
Oracle 
Copyright © 1998 Oracle Corporation. 
All Rights Reserved. 
 
Library
 
Product
 
Contents
 
Index