Note:Creating a Java enabled database is not part of this chapter. For more information about creating a Java enabled database, refer to Chapter 12, "Java in the Database."
You can create a database either automatically or manually. Oracle recommends that you use the automatic creation procedure outlined in "Creating a Database Automatically". Instructions on how to create a database manually are given in "Creating a Database Manually".
This section describes the following:
Before creating a database, you first need to carry out the following pre-creation activities:
Install Oracle Database 11g Release 2 under the installation user ID. For details on how to do this, refer to Chapter 3, " Oracle Database Installation and Deinstallation."
The BS2000 System Administrator must create a DBA user ID with the attributes as described in Section 2.8.2, "DBA User ID."
The account number used for running the Oracle instance must have the following attributes:
NO_CPU-LIMIT=YES START-IMMEDIATE=YES MAX-ALLOWED-CATEGORY=TP
Note:The Address Space Limit must be at least 512 MB.
Oracle recommends that the BS2000 System Administrator should define a separate job class for the background and server tasks. This job class should have the following characteristics:
TP-ALLOWED=YES NO-CPU-LIMIT=YES JOB-TYPE=BATCH
Complete the following steps to create a database automatically:
Log in using the DBA user ID.
To start the automatic creation procedure,
INSTALL.P.SUPER, enter the following command:
INSTALL.P.SUPER procedure, you can specify the value of the following keyword parameters (the default values are used if you choose not to modify the values):
|BATCH||Enter YES to run the procedure in batch mode. The default is set to
|CPULIMIT||Sets the time limit for batch jobs. The default is NO.|
|PLSQL||Enter NO to suppress automatic installation of the basic PL/SQL package. The default is
|VIEWS||Enter NO to suppress automatic installation of the basic views (catalog, import/export, and so on). The default is
Answer the prompts for the following information (if you enter nothing, the default shown on the screen are used):
|DBASID||Enter the 1 - 4 character system ID of the database you are installing. This is a mandatory parameter.|
|JOBCLASS||Enter the jobclass to be used for Oracle Database 11g Release 2 background jobs. This is mandatory.|
|UPDATE||Enter YES if you have existing files for this
|SYSPW||Enter the desired password for the Oracle Database user
Note: By default the
|SYSTEMPW||Enter the desired password for the Oracle Database user
Note: By default the
|JAVA||Enter NO if you do not need a Java enabled database (thus saving memory, CPU and disk space resources). For more information refer to Chapter 12, "Java in the Database."|
|DBSIZE||Enter the size of the system tablespace files in bytes, kilobytes or megabytes. The value you enter can have one of the following forms:
The default is 250M.
|AUXSIZE||Enter the size of the sysaux tablespace file(s) in bytes, kilobytes, or megabytes. The value you enter can have one of the following forms:
The default is 200M.
|LOGSIZE||Enter the size of the log files in bytes, kilobytes, or megabytes. The value you enter can have one of the following forms:
The default is 20000K.
|UNDOSIZE||Enter the size of the undo tablespace file in bytes, kilobytes, or megabytes. The value you enter can have one of the following forms:
The default is 100M.
|LOCAL||Enter NO if you do not require a locally managed system tablespace. The default is
|DEFTS||Enter NO if you do not want to create a default permanent tablespace. The default is
|TEMPTS||This prompt only appears if you do not want a locally managed system tablespace. Enter NO if you do not want a default temporary tablespace. The default is
|CHARSET||Enter the character set with which you want the database to be created (the default is
For more information refer to the chapter about Globalization Support in Oracle Database User's Guide for Fujitsu BS2000/OSD.
|NCHARSET||Enter the national character set used to store data in columns specifically defined as
Unless specified otherwise
, $ORAC1120.INSTALL.P.SUPER generates and enter a batch job which:
Creates the system and sysaux tablespace
Creates the default permanent tablespace, temporary tablespace, and undo tablespace
Creates the log files
Initializes the database
Installs the SQL Help tables
Installs the DEMO tables
Changes the system passwords if necessary
Calls the verification procedure
$ORAC1120.INSTALL.P.SUPER has completed, you should have an initialized, ready-to-use database, and a running Oracle Database system. The results of the job are listed in the file,
SID is the system ID of the database you have just installed.
Oracle recommends that you use the automatic creation procedure outlined in "Creating a Database Automatically". The following manual creation procedure performs the same steps as the automatic creation procedure. However, because you enter the individual steps manually, you can perform the installation at your own pace, and determine which of the optional of the following steps you want to perform and which you want to expand, omit, or save for another time.
Copy the DBA files from
$ORAC1120 as shown below:
Log in using the DBA user ID.
Call Oracle Database install procedure. This procedure copies the DBA files from
$ORAC1120 to the DBA user ID. When the procedure begins you are prompted to supply a 1 to 4 character Oracle system ID for the database you are installing.
To install the DBA files, enter the following command:
This procedure prompts you for the following information:
|DBASID||Enter the 1 - 4 character system ID of the database you are installing.|
|JOBCLASS||Enter the BS2000 jobclass to be used for background and server tasks.|
You can also modify the following keyword parameters when invoking this procedure:
|LOG||Enter WRITE-TEXT (the BS2000 command name) if you want to have install actions listed.|
|UPDATE||Enter YES/NO to indicate whether existing files are to be updated. The default is NO.|
$ORAC1120.INSTALL.P.DBA procedure copies the following files into the DBA user ID account:
.P.ORAENV: Oracle Database environment definition file
.DBS.INIT.ORA: Oracle Database initialization file
sid is the system ID for the database being installed.
After installing the DBA procedures, you must create the database. This section describes the procedure for creating the database, and for allocating the database file and the log files.
You can place the database file and the log files on the default volume set for the
DBA account, another Public Volume Set (PVS), or a specific private volume.
To create a database file or a log file on a private disk, you must first allocate the file using the BS2000
/FILE command as shown:
/FILE sid.DBS.DATABASE1.DBF,SPACE=filesize - /[,DEVICE=device,VOLUME=volser] /FILE sid.DBS.SYSAUX.DBF,SPACE=filesize - //[,DEVICE=device,VOLUME=volser] /FILE sid.DBS.LOG1.DBF,SPACE=filesize - /[,DEVICE=device, VOLUME=volser] /FILE sid.DBS.LOG2.DBF,SPACE=filesize - /[,DEVICE=device, VOLUME=volser]
sid identifies the database that you are installing.
filesize is the size of the file in PAM blocks. The file size specified in the
/FILE command must match the size specified to SQL*Plus in the
CREATE DATABASE statement when creating the database, plus 1 extra Oracle Database block used as an extra header. The size of this block is 1 to 16 PAM pages depending on the Oracle Database block size given in the
DB_BLOCK_SIZE, refer to Appendix C, "Initialization Parameters and the Parameter File."
For example, if you want to create a 2 MB database file, then you must specify 1024 plus 1 PAM pages extra Oracle Database block as the value of file size in the
device specifies the device to be used to store the file.
volser specifies the volume to be used to store the file.
The names used in the preceding examples are the default database and log file names. If you want to use other names, then remember to use these names in the SQL
CREATE DATABASE statement, when creating the database.
Determine what changes, if any, you want to make to parameters in the distributed initialization file,
sid is the system ID for the database). The SGA parameters may need to be adjusted to reflect memory limitations and the maximum number of users who can access the Oracle Database system at one time. Make the modifications using a BS2000 editor.
See Also:Refer to Oracle Database Reference for an explanation of initialization parameters
Modify the environment definition file,
.P.ORAENV, according to the specific requirements. Remember that a number of variables are evaluated during startup only. If you modify the
ORAENV file later on, then you may have to wait for the next startup for the changes to become effective.
The character set in the
NLS_LANG, however, must not be changed when you run some delivered SQL scripts.
Remember that you must call the applicable
.P.ORAENV procedure before calling SQL*Plus. To execute SQL*Plus, enter the following command:
/START-PROGRAM $ORAC1120.SQLPLUS * /NOLOG SQL> CONNECT / AS SYSDBA SQL> STARTUP NOMOUNT [PFILE=filename]
/NOLOG omits being prompted for user name/password.
CONNECT gives you a connection to an idle instance. The last statement starts the Oracle Database instance. If you want to use your own copy of the initialization file (
.DBS.INIT.ORA), then use the
filename option, as illustrated in the previous command.
SQL> CREATE DATABASE...;
This statement creates database and log files.
Note:If you get an error before the first
SQL>prompt, then it may be caused by either a missing
ORASIDnot set in the
ORAENV), or sometimes by an address space conflict. For example, the address range you assigned to the kernel memory pool (
KNL_BASE) could be occupied by a subsystem.
Run the scripts necessary to build data dictionary views, synonyms, and PL/SQL packages. Run the following commands:
SQL> SPOOL filename SQL> SET TERMOUT OFF SQL> @$ORAC1120.RDBMS.ADMIN.CATALOG.SQL SQL> @$ORAC1120.RDBMS.ADMIN.CATPROC.SQL
To install the online Help facility, enter the following command:
/CALL-PROCEDURE $ORAC1120.INSTALL.P.HELP,(sid [,SYSTEMPW=systempw])
To install demo tables, enter the following:
/CALL-PROCEDURE $ORAC1120.INSTALL.P.DEMO,(sid [,SYSTEMPW=systempw])
To install Sample Schemas, enter the following:
/CALL-PROCEDURE $ORAC1120.INSTALL.P.SAMPLES,(sid - /[,SYSTEMPW=systempw] [,SYSPW=syspw])
INSTALL.P.SAMPLES installs the sample schemas human resources (HR), order entry (OE), info exchange (IX), and sales history (SH) with the default passwords. Product media (PM) is not supported.
Note:By default, the password for the
MANAGERand the password for the
CHANGE_ON_INSTALL. For security reasons, Oracle recommends that you change these passwords and the sample schema passwords immediately after installation.
To verify if the demonstration database was correctly created, enter the following:
/CALL-PROCEDURE $ORAC1120.INSTALL.P.VERIFY,(sid [,SYSTEMPW=systempw])
If the demonstration database was correctly created, then you see messages like the following displayed on the screen:
*SCOTT'S TABLE EMP IS INSTALLED
Installing Oracle Text is summarized in the "Oracle Text" chapter of this book.
Installing Java is summarized in the "Java in the Database" chapter of this book.
This section contains information about upgrading your Oracle database from previous releases:
For upgrading from Oracle Database Release 9i, refer to "Upgrading to the New Release of Oracle Database" in Oracle Database Upgrade Guide.
This section explains the BS2000 specific steps of the upgrade path. We assume the reader to be familiar with Oracle Database 11g Release 2 upgrade documentation about upgrade preparation, space and backup requirements, release differences, and so on. Refer to Oracle Database Upgrade Guide for further information regarding database upgrades. Oracle recommends reading the appropriate section in the generic documentation, especially when you are using
TIMESTAMP WITH TIME ZONE data type.
We further assume your Oracle Database 10g is set up and the Oracle Database 11g Release 2 software is properly installed as explained in Chapter 3, " Oracle Database Installation and Deinstallation." Thereafter, complete the following steps:
Run the Pre-Upgrade Information Tool
utlu112i.sql from Oracle Database 11g installation id with SQL*Plus in your Oracle Database 10g environment to analyze required parameters as follows (assuming the database is running):
/START-PROGRAM $ORACL1020.sqlplus * /nolog SQL> connect / as sysdba SQL> SPOOL info.log SQL> @$ORAC1120.rdbms.admin.utlu112i.sql; SQL> SPOOL off
Check the sections in the spool file for Logfiles, Tablespaces, and Rollback Segments, and if necessary, change the attributes of your database accordingly.
Shutdown the database and exit SQL*Plus
SQL> SHUTDOWN IMMEDIATE SQL> exit
Enter the following command to create an Oracle Database 11g Release 2
init.ora and an Oracle Database 11g Release 2
ORAENV file and save the original files under the suffix
/CALL-PROCEDURE $ORAC1120.INSTALL.P.DBA, (sid, jobclass, UPDATE=YES)
Modify the newly created files according to your special requirements (for instance
DB_CACHE_SIZE, and so on) and set the parameters in the
INIT.ORA file as recommended in the spool file. Ensure that the
COMPATIBLE initialization parameter is properly set for Oracle Database 10g Release 2 (10.2 or higher).
Set the Oracle environment variables using the
To avoid being prompted for many overflow acknowledgements on your screen, enter the following BS2000 command:
Start the instance in upgrade mode:
/START-PROGRAM $ORAC1120.sqlplus * /nolog SQL> connect / as sysdba SQL> STARTUP UPGRADE
Start the upgrade script:
SQL> SPOOL upgrade.log; SQL> @$ORAC1120.rdbms.admin.catupgrd.sql; SQL> SPOOL off
Shut down and restart the instance to re-initialize the system parameters for normal operation:
SQL> SHUTDOWN IMMEDIATE SQL> STARTUP
Run the postupgrade script
utlu112s.sql to display the results of the upgrade and run
catuppst.sql to finish the upgrade. Finally run
utlrp.sql to recompile any remaining stored PL/SQL and Java code and verify that all expected packages and classes are valid:
SQL> SPOOL postupgrade.log; SQL> @$ORAC1120.rdbms.admin.UTLU112S.SQL; SQL> SPOOL off SQL> @$ORA1120.RDBMS.ADMIN.CATUPPST.SQL SQL> @$ORAC1120.rdbms.admin.utlrp.sql; SQL> SELECT count(*) FROM dba_objects WHERE status='INVALID'; SQL> SELECT distinct object_name FROM dba_objects WHERE status='INVALID';
Now you should have an upgraded Oracle Database 11g Release 2 database. For troubleshooting, refer to "Upgrading to the New Release of Oracle Database" in Oracle Database Upgrade Guide.
This section describes the tasks you must complete after upgrading your database to Oracle Database 11g Release 2.
All C and COBOL programs developed before release 11.2 must be precompiled using the new version of the precompilers and recompiled.
All user-written precompiler or Oracle Call Interface applications must be re-linked using the new Oracle Database libraries.
openUTM applications must be rebuilt. Refer to the chapters on openUTM in this manual and in Oracle Database User's Guide for Fujitsu BS2000/OSD for more information.
ORAUID environment variable must reference the correct Oracle Database installation user ID. Check your
ORAENV file and adjust the variables if required.