Download presentation
Presentation is loading. Please wait.
Published byJasmine Edwards Modified over 9 years ago
1
Week 2 Lecture 1 Creating an Oracle Instance
2
Learning Objectives Learn the steps for creating a database Understand the prerequisites for creating a database Configure initial settings for database creation Create, start, and stop a database instance
3
Steps for Creating a Database Steps in a nutshell: 1. Install Oracle software 2. Create appropriate users (Unix only) 3. Confirm memory and disk storage availability 4. Choose file management, DBA authentication, and initialization parameters 5. Create the database (manual or automated) 6. Test the database (start up and shut down)
4
Overview of Prerequisites for Creating a Database See your Installation Guide for exact details. Example of Windows 2000 requirements: RAM: 128 Megabytes Virtual Memory: 200 Megabytes Temp space: 400 Megabytes Storage: ORACLE_HOME: 4.5 Gigabytes System drive: 140 Megabytes
5
Configuring Initial Settings Three configuration decisions that must be done prior to creating the database: Choose DBA authentication method Choose file management method Set initialization parameters
6
DBA Authentication Method Primarily used to authenticate users who log in with the SYSDBA or SYSOPER roles Important due to the capabilities of users with these roles Operating system authentication method can be used for other Oracle users Password file authentication method can only be used for users with SYSDBA or SYSOPER role assigned
7
Operating System Authentication Type of DBA Authentication (first of two methods) Pros: Users log on without specifying additional password or user name Best when only local access or secured line access are allowed Cons: Can be a security risk if used with non- secure internet or network lines Requires knowledge of operating system security
8
Operating System Authentication How to implement: Create operating system user for DBA use Create OSDBA group (UNIX only because Windows automatically creates the group) Assign operating system user to OSDBA group Set REMOTE_LOGIN_PASSWORDFILE = NONE Set OS_AUTHENT_PREFIX as desired Create Oracle user with same name or name with prefix
9
Password File Authentication Type of DBA Authentication (second of two methods) Pros: Users must know their Oracle username and password to log onto the database Best for non-secured line access, such as Internet, is allowed Cons: Users required to remember multiple usernames and passwords Possible security risk due to storage of passwords in an encrypted operating system file
10
Password File Authentication How to implement: Set REMOTE_LOGIN_PASSWORDFILE = EXCLUSIVE (or SHARE if database is part of distributed system) Create password file using the orapwd utility SYSTEM user is ready at this point Add more SYSDBA or SYSOPER users by: Creating new Oracle user Assigning SYSDBA or SYSOPER role to the user Password file is automatically updated when new users are assigned these roles and when any of these users change their passwords Set OS_AUTHENT_PREFIX as desired Create Oracle user with same name or name with prefix
11
File Management Methods Files controlled by the file management method are control files, data files, and redo log files Determines how files are located to help with: Multiplexing of control and redo log files I/O load balancing Determines how files are added, extended, or deleted
12
User-Managed File Management Type of File Management (first of two methods) Pros: DBA has complete control of names, locations, and sizes of all files Compatible with older versions Cons: DBA must manually delete files after their associated tablespace is dropped DBA must monitor and adjust file sizes over time
13
User-Managed File Management How to implement: For user-managed control files, set CONTROL_FILES to a list of files. For example: For user-managed redo log files, use the LOGFILE clause in the CREATE DATABASE command. For user-managed data files, use the DATAFILE clause in the CREATE DATABSE command or the CREATE TABLESPACE command
14
User-Managed File Management Example Initialization parameter: CONTROL_FILES = (/d1/oracle/control01.ctl, /d2/oracle/control02.ctl) CREATE DATABASE command: CREATE DATABASE TECHNO92 MAXDATAFILES 100 DATAFILE ‘C:\ora\oradata\system01.dbf' SIZE 325M AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED LOGFILE GROUP 1 (‘C:\ora\oralogs\redo01.log') SIZE 50M, GROUP 2 (‘D:\ora\oralogs\redo02.log') SIZE 50M;
15
Oracle Managed File Management Type of File Management (second of two methods) Pros: Automated control of control of names and sizes of all files DBA only has to determine the locations Less monitoring required due to automated size adjustment and deleting of appropriate files Cons: File names can be somewhat cryptic No control over exact sizes and names of files
16
Oracle Managed File Management How to implement: For Oracle-managed data files, set the DB_CREATE_FILE_DEST to a valid directory For Oracle-managed control files and redo log files, set DB_CREATE_ONLINE_LOG_DEST_ n to a valid directory
17
Oracle Managed File Management Example Initialization parameters: DB_CREATE_FILE_DEST = ‘C:\ora\oradata' DB_CREATE_ONLINE_LOG_DEST_1= ‘C:\ora\oralogs’ DB_CREATE_ONLINE_LOG_DEST_2= ‘D:\ora\oralogs’ CREATE DATABASE command: CREATE DATABASE TECHNO92 MAXDATAFILES 100;
18
Set the Initialization Parameters Stored in a file named init.ora prior to creating the database ( = database name) The init.ora is used for many purposes: Tune memory Limit the number of users Set the location of files Determine how to handle of SQL parsing Much more
19
Set the Initialization Parameters Initial setting Alternate settings (comments)
20
Set the Initialization Parameters Important initialization parameters to set prior to creating a database DB_BLOCK_SIZE DB_NAME DB_DOMAIN COMPATIBLE Parameters mentioned in previous slides
21
Creating a Database Two distinct methods: Automated: Database Configuration Assistant Better for novice DBA Easier to use due to the many pre-defined settings Manual: CREATE DATABASE command More flexible Useful when using script for creating multiple identical (or similar) databases on several sites
22
Create a New Database Using the Database Configuration Assistant
23
The SYS and SYSTEM users must have secure passwords to prevent unauthorized access
24
Starting and Stopping the Database with Instance Manager Before going to the console, create an Oracle Net connection for the new database using Net Manager
25
Starting and Stopping the Database with Instance Manager When logging into the database in the console, select “SYSDBA” in the Connect as box so you have authority to start or stop the database
26
Starting and Stopping the Database with Instance Manager Click this button to begin the shutdown process
27
Creating a Database Manually Highlights include these steps: Create three directories in which files are to be stored: newlog – for redo log files and control files newdata – for data files newadmin – for the init.ora file and scripts used to create the database
28
Creating a Database Manually Create a password file using the orapwd utility from a command line: orapwd file=“ \database\pwdtrial02.ora” password=change_on_install entries=5 Replace with the actual directory path of ORACLE_HOME before typing the command
29
Creating a Database Manually Create a Windows service for the database instance from a command line: oradim –new –sid trial02 –startmode a –pfile \newadmin\inittrial02.ora Replace with the actual directory path of root directory for the three new directories This is only needed in Windows, not in UNIX
30
Creating a Database Manually Prepare a CREATE DATABASE statement: CREATE DATABASE MAXDATAFILES MAXINSTANCES MAXLOGFILES MAXLOGMEMBERS DATAFILE ' / ' UNDO TABLESPACE DATAFILE ' / ‘ CHARACTER SET NATIONAL CHARACTER SET LOGFILE GROUP (' / ',' / ',...) GROUP (' / ',' / ',...);
31
Creating a Database Manually After running the CREATE DATABSE command, follow up with these steps: Create TEMP and USERS tablespaces Create the data dictionary views Create the PL/SQL packages Register the database in Windows
32
Starting and Stopping the Database Manually Use SQL*Plus from a command line Start SQL*Plus and log on as SYS: sqlplus /nolog CONNECT SYS/change_on_install AS SYSDBA Shut down the database: SHUTDOWN IMMEDIATE Start up the database: STARTUP PFILE= \newadmin\inittrial02.ora
33
Lecture Summary Installing the Oracle software (if needed) is the first step in creating a new database Databases can be created manually or by using the Database Configuration Assistant The DBA authentication method can be either Operating System authentication or password file authentication File management involves determining the location, name and size of files
34
Lecture Summary User-managed file management gives the DBA complete control but requires more monitoring and manual changes Oracle-managed file (OMF) management automates names, sizes, and tuning of files Some initialization parameters never change after the database is created Other initialization parameters can be changed later
35
Lecture Summary Database Configuration Assistant provides selections among many default settings for the new database The new database must have an Oracle Net connection defined prior to accessing it in the console The Instance Manager can be used to shut down or start up the database You must be logged on with SYSDBA authority to start or stop the database Creating a database manually means using the CREATE DATABASE command A new database service starts up a new database instance in Windows
36
Lecture Summary After creating the database manually: Add tablespaces for users and temporary storage Add the data dictionary and PL/SQL packages Add the database to the Windows registry Use SQL*Plus to shut down or start up a database
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.