Oracle7 Getting Started for Windows NT | ![]() Library |
![]() Product |
![]() Contents |
![]() Index |
Steps to Create a Database
This section describes the steps to follow when creating your own database. In order to help you understand the database creation process, an example is used to demonstrate the various commands involved. In this example:
Each database creation step is described in detail in the following sections.
|
|
|
C:\MYDIR> SET ORACLE_SID=ORCL
C:\MYDIR> EXP73 SYSTEM/password FILE=MYEXP.DMP FULL=Y LOG=MYEXP.LOGYou 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.
|
C:\MYDIR> ORADIM73 -SHUTDOWN -SID ORCL -USRPWD password -SHUTTYPE INST -SHUTMODE I
|
|
|
Create and Start an Oracle7 Database Service
C:\MYDIR> ORADIM73 -NEW -SID PROD -INTPWD password -STARTMODE AUTO
-PFILE C:\ORANT\DATABASE\INITPROD.ORANote that the previously created INITPROD.ORA file is specified, with complete path.
C:\MYDIR> SET ORACLE_SID=PROD
|
|
The text of the CREATE_PROD_DB.SQL script is given below.
CREATE DATABASE PROD_DB
LOGFILE 'C:\ORANT\DATABASE\LOG1PROD.ORA' SIZE 500K,
'C:\ORANT\DATABASE\LOG2PROD.ORA' SIZE 500K
MAXDATAFILES 100
DATAFILE 'C:\ORANT\DATABASE\SYS1PROD.ORA' SIZE 20M
NOARCHIVELOG
CHARACTER SET WE8ISO8859P1;This statement creates a database where:
|
NET STARTYou will see the list of all Windows NT services currently running on the system. If OracleServicePROD is missing from the list, enter:
NET START OracleServicePROD
C:\MYDIR> SET ORACLE_SID=PROD
C:\MYDIR> SET LOCAL=2:PRODThe second command overrides the setting of the LOCAL environment variable, if it is set in the Windows NT Registry or the AUTOEXEC.BAT file. Without overriding LOCAL, it is possible you will receive an ORA-3121, ORA-9352, ORA-12154, or ORA-12203 error in the next step. See Oracle7 Server Messages for information on the meaning of each error.
C:\MYDIR> SVRMGR23
SVRMGR> CONNECT INTERNAL/passwordThe password is the one you previously used to create the service, with the ORADIM73 -NEW command. You should see the message Connected to an idle instance.
SVRMGR> STARTUP NOMOUNT
PFILE=C:\ORANT\DATABASE\INITPROD.ORAWhen 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 should be no space characters around the equal sign (=).
SVRMGR> SPOOL CREATE_PROD_DB.LOG
SVRMGR> @CREATE_PROD_DB.SQLThis command assumes the script file is located in the directory from which Server Manager was invoked. If this is not the case, you must specify the complete path in front of the file name.
If the database is created successfully, you will see the message Statement processed. If you receive any errors, there are three possible causes:
NET HELPMSG nor
From the Server Manager prompt, enter:
HOST NET HELPMSG nwhere n is the operating system error number. See the section "Operating System Permission Problems" in the chapter "Contacting Oracle Worldwide Customer Support" for more information.
|
SVRMGR> @C:\ORANT\RDBMS73\ADMIN\CATALOG.SQL
SVRMGR> @C:\ORANT\RDBMS73\ADMIN\CATPROC.SQLThe first script generates the data dictionary, the second script installs the objects used by Oracle7 database's PL/SQL functionality.
SVRMGR> @C:\ORANT\RDBMS73\ADMIN\CATREP.SQLNote that CATREP.SQL requires an hour to run.
SVRMGR> SPOOL OFF
SVRMGR> ALTER USER SYS IDENTIFIED BY new_sys_password; SVRMGR> ALTER USER SYSTEM IDENTIFIED BY new_system_password; |
SVRMGR> EXIT
C:\MYDIR> IMP73 SYSTEM/password FILE=MYEXP.DMP FULL=Y LOG=MYIMP.LOG
C:\MYDIR> REGEDT32
If you have Windows NT 3.51:
|
C:\MYDIR> ORADIM73 -SHUTDOWN -SID PROD -USRPWD password
-SHUTTYPE SRVC,INST -SHUTMODE ISince the Instance Manager returns the prompt immediately, you must wait for the database and the service to stop completely. Wait until the Control Panel indicates the OracleServicePROD service has stopped.
|
While some users may find the graphical interface easier to use than Instance Manager command line, keep in mind that command line gives greater control over the customizing of the new database, as well as providing you with a script file that documents the exact CREATE DATABASE statement used to create the database.
When you click on the New button in Instance Manager GUI, you will see a dialog box with many fields. This dialog box, and another one which pops up when you click on the Advanced button provide a graphical interface to write the CREATE DATABASE statement. Consult the online help and the syntax description of the CREATE DATABASE statement in Oracle7 Server SQL Reference to find out what each field of the dialog boxes is used for.
When you have entered the correct entries in all fields and have clicked the OK button, Instance Manager GUI:
![]() ![]() Prev Next |
![]() Copyright © 1996 Oracle Corporation. All Rights Reserved. |
![]() Library |
![]() Product |
![]() Contents |
![]() Index |