Exploring Oracle Database Administration

Oracle Architectural Components and Database Creation

Oracle Architectural Components and Database Creation
This chapter provides an overview of the Oracle architecture and talks about the various components that make an Oracle Instance. It also talks about the creation of database and various modes of starting and shutting down a database.

SCOPE
1.1Oracle Architecture and its main components 1.1.1System Global Area Overview 1.1.2Program Global Area (PGA) Overview 1.1.3Oracle Processes Overview 1.2Oracle Instance 1.3Managing an Oracle Instance 1.4Start up and shut down 1.4.1Starting up the database 1.4.2Starting up an instance

1.4.3Shutting down a database 1.5Alert Log File 1.6Setup Password File Authentication 1.7Oracle9i Installation Procedure 1.8Configure OMF 1.9 Prerequisites for database creation 1.9.1Planning for database creation 1.9.2Meeting Prerequisites 1.10 Create and manage Initialization parameter files 1.10.1Determine the global database name 1.10.2Specify Control Files 1.10.3Specify database block size 1.10.4Setting Initialization parameters that affect the size of SGA 1.10.5Specifying the Maximum Number of Processes 1.10.6Specifying a method of Undo Space Management 1.10.7Managing Initialization parameter files using a server parameter file 1.11 Creating a database manually 1.12 Create a database using Oracle Database Configuration Assistant 1.12.1Advantages of using Oracle Database Configuration Assistant: 1.12.2Creating a database 1.12.3Global Database name and Parameters 1.12.4Completing Database Creation 1.12.5Deleting a database 1.13Monitor the use of Diagnostic Files
© Copyright 2006, Tata Consultancy Services Limited (TCS). 1

Exploring Oracle Database Administration

Oracle Architectural Components and Database Creation

1.1Oracle Architecture and its main components
An Oracle Database is comprised of physical files, memory areas and processes. The distribution of these components varies depending on the database architecture chosen. The data in the database is stored in physical files (called data files) on a disk. As it is used that data is stored in the memory. Oracle uses memory areas to improve performance and to manage the sharing of data between users. The main memory area in the database is called the System Global Area (SGA). To read and write data between SGA and data files, Oracle uses a set of background processes that are shared by all users. The basic memory structures of Oracle include: System Global Area (SGA), which is shared by all server and background processes and holds the following: • • • • Database buffer cache Redo log buffer Shared pool Large pool (if configured)

Program Global Areas (PGA), which is private to each server and background process; there is one PGA for each process. The PGA holds the following: • • Stack areas Data areas

Fig. 1.1 – Oracle Memory Structure

1.1.1

System Global Area Overview
© Copyright 2006, Tata Consultancy Services Limited (TCS). 2

Exploring Oracle Database Administration

Oracle Architectural Components and Database Creation

A system global area (SGA) is a group of shared memory structures that contain data and control information for one Oracle database instance. If multiple users are concurrently connected to the same instance, then the data in the instance’s SGA is shared among the users. Consequently, the SGA is sometimes called the shared global area. An SGA and Oracle processes constitute an Oracle instance. Oracle automatically allocates memory for an SGA when you start an instance, and the operating system reclaims the memory when you shut down the instance. Each instance has its own SGA. The SGA is read/write. All users connected to a multiple-process database instance can read information contained within the instance’s SGA, and several processes write to the SGA during execution of Oracle. The SGA contains the following data structures: • Database buffer cache • Redo log buffer • Shared pool • Java pool • Large pool (optional) • Data dictionary cache • Other miscellaneous information Dynamic SGA Beginning with Oracle9i, Release 1 (9.0.1), Oracle can change its SGA configuration while the instance is running. With the dynamic SGA infrastructure, the sizes of the buffer cache, the shared pool, and the large pool can be changed without shutting down the instance. Dynamic SGA also allows Oracle to set, at run time, limits on how much virtual memory Oracle will use for the SGA. Oracle can start instances under configured and allow the instance to use more memory by growing the SGA components, up to a maximum of SGA_MAX_SIZE. If SGA_MAX_SIZE specified in INIT.ORA is less than the sum of all components specified or defaulted at initialisation time, then the setting of SGA_MAX_SIZE in INIT.ORA is ignored. The size of the SGA is determined by several initialisation parameters. The parameters that most affect SGA size are: DB_CACHE_SIZE: LOG_BUFFER: SHARED_POOL_SIZE: The size of the cache of standard blocks. The number of bytes allocated for the redo log buffer. The size in bytes of the area devoted to shared SQL and PL/SQL statements.
© Copyright 2006, Tata Consultancy Services Limited (TCS). 3

Exploring Oracle Database Administration

Oracle Architectural Components and Database Creation

LARGE_POOL_SIZE:

The size of the large pool; the default is 0.

1.1.1.1 Data Base Buffer Cache The database buffer cache is the portion of the SGA that holds copies of data blocks read from data files. All user processes concurrently connected to the instance share access to the database buffer cache. The database buffer cache and the shared SQL cache are logically segmented into multiple sets. This organization into multiple sets reduces contention on multiprocessor systems. Size of the Database Buffer Cache Oracle9i, Release 1 (9.0.1), supports multiple block size in a database. This is the default block size—the block size used for the system table space. You specify the standard block size by setting the initialisation parameter DB_BLOCK_SIZE. Legitimate values are from 2K to 32K. To specify the size of the standard block size cache, you set the initialisation parameter DB_CACHE_SIZE. Optionally, you can also set the size for two additional buffer pools, KEEP and RECYCLE, by setting DB_KEEP_CACHE_SIZE and DB_RECYCLE_CACHE_SIZE. These three parameters are independent of one another in Oracle9i, Release 1 (9.0.1). The sizes and numbers of non-standard block size buffers are specified by the following parameters: DB_2K_CACHE_SIZE DB_4K_CACHE_SIZE DB_8K_CACHE_SIZE DB_16K_CACHE_SIZE DB_32K_CACHE_SIZE Each parameter specifies the size of the cache for the corresponding block size. 1.1.1.2 Redo Log Buffer The redo log buffer is a circular buffer in the SGA that holds information about changes made to the database. This information is stored in redo entries. Redo entries contain the information necessary to reconstruct, or redo, changes made to the database by INSERT, UPDATE, DELETE, CREATE, ALTER, or DROP operations. Redo entries are used for database recovery, if necessary.

© Copyright 2006, Tata Consultancy Services Limited (TCS).

4

holding values specific to his or her session. particularly if transactions are long or numerous. global. The redo entries take up continuous. sequential space in the buffer. Tata Consultancy Services Limited (TCS). compiled form of a program unit. its structures. Oracle accesses the data © Copyright 2006. functions. and database triggers) much the same way it processes individual SQL statements. and control structures. buffers for parallel execution messages. while each user maintains a separate copy of his or her private SQL area. larger values reduce log file I/O. The initialisation parameter LOG_BUFFER determines the size (in bytes) of the redo log buffer.3 The Shared Pool The shared pool portion of the SGA contains three major areas: library cache.1. Oracle allocates a private area to hold values specific to the session that executes the program unit. Shared SQL Areas A shared SQL area contains the parse tree and execution plan for a given SQL statement. anonymous blocks. 5 . Dictionary Cache The data dictionary is a collection of database tables and views containing reference information about the database. The default setting is four times the maximum data block size for the host operating system. PL/SQL procedures and packages. The total size of the shared pool is determined by the initialisation parameter SHARED_POOL_SIZE. and control structures such as locks and library cache handles. including local. Oracle saves memory by using one shared SQL area for SQL statements executed multiple times. which often happens when many users execute the same application. Library Cache The library cache includes the shared SQL areas. PL/SQL Program Units and the Shared Pool Oracle processes PL/SQL program units (procedures. and package variables (also known as package instantiation) and buffers for executing SQL. In general. The default value of this parameter is 8M on 32-bit platforms and 64M on 64-bit platforms. packages. Increasing the value of this parameter increases the amount of memory reserved for the shared pool. The background process LGWR writes the redo log buffer to the active online redo log file (or group of files) on disk. Oracle allocates a shared area to hold the parsed. 1.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation Redo entries are copied by Oracle server processes from the user’s memory space to the redo log buffer in the SGA. shared area is used by all users. dictionary cache. and its users. private SQL areas (in the case of a multiple transaction server). then a single. If more than one user executes the same program unit.1.

The other area in memory to hold dictionary data is the library cache.2 Program Global Area (PGA) Overview A program global area (PGA) is a memory region. All Oracle user processes share these two caches for access to data dictionary information.4 Large Pool The database administrator can configure an optional memory area called the large pool to provide large memory allocations for: • Session memory for the shared server and the Oracle XA interface (used where transactions interact with more than one database) • I/O server processes • Oracle backup and restore operations • Parallel execution message buffers. and for parallel buffers is allocated in buffers of a few hundred kilobytes. This access is essential to the continuing operation of Oracle. Tata Consultancy Services Limited (TCS). 1. The large pool is better able to satisfy such large memory requests than the shared pool.1. It is different from reserved space in the shared pool. Access to it is exclusive to that server process and is read and written only by Oracle code acting on behalf of it. The data dictionary is accessed so often by Oracle that two special locations in memory are designated to hold dictionary data. Oracle can use the shared pool primarily for caching shared SQL and avoid the performance overhead caused by shrinking the shared SQL cache.1. One area is called the data dictionary cache. 6 . The large pool does not have an LRU list. Oracle XA. The total PGA memory allocated by each server process attached to an Oracle instance is also referred to as the aggregated PGA memory allocated by the instance.1. these buffers are allocated to the shared pool) By allocating session memory from the large pool for shared server. It is a nonshared memory created by Oracle when a server process is started. which contains data and control information for a server process.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation dictionary frequently during SQL statement parsing. 1. if the initialisation parameter PARALLEL_ AUTOMATIC_TUNING is set to TRUE (otherwise. which uses the same LRU list as other memory allocated from the shared pool. or parallel query buffers. Contents of PGA: Private SQL Area © Copyright 2006. the memory for Oracle backup and restore operations. In addition. for I/O server processes. also known as the row cache because it holds data as rows instead of buffers (which hold entire blocks of data).

a user process always communicates with Oracle through a separate server process. 1. It also describes the trace files and alert file. although the number of private SQL areas that a user process can allocate is always limited by the initialisation parameter OPEN_CURSORS. and use them as a named resource throughout the execution of the program. or handles to specific private SQL areas. In some situations when the application and Oracle operate on the same machine. Server Processes Oracle creates server processes to handle the requests of user processes connected to the instance. Tata Consultancy Services Limited (TCS). many private SQL areas can be associated with the same-shared SQL area. if the blocks are not already present in the SGA Return results in such a way that the application can process the information Background Processes To maximize performance and accommodate many users. it is possible to combine the user process and corresponding server process into a single process to reduce system overhead. 7 . Cursors and SQL Areas The application developer of an Oracle precompiler program or OCI program can explicitly open cursors. Thus. Each user that submits the same SQL statement has his/ her own private SQL area that uses a single shared SQL area. Each session that issues a SQL statement has a private SQL area. The allocation and deallocation of private SQL areas depends largely on which application tool you are using. which record database events for the Oracle processes.3 Oracle Processes Overview This section describes the two types of processes that execute the Oracle server code (server processes and background processes). Server processes (or the server portion of combined user/server processes) created on behalf of each user’s application can perform one or more of the following: • • • Parse and execute SQL statements issued through the application Read necessary data blocks from data files on disk into the shared database buffers of the SGA. The default value of this parameter is 50. © Copyright 2006.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation A private SQL area contains data such as bind information and runtime memory structures. However. a multiprocess Oracle system uses some additional Oracle processes called background processes.1. when the application and Oracle operate on different machines. Recursive cursors that Oracle issues implicitly for some SQL statements also use shared SQL areas. The management of private SQL areas is the responsibility of the user process.

Tata Consultancy Services Limited (TCS). and the rest of this section describes each process. The background processes in an Oracle instance include the following: • Database Writer (DBW0 or DBWn) • Log Writer (LGWR) • Checkpoint (CKPT) • System Monitor (SMON) • Process Monitor (PMON) • Archiver (ARCn) • Recoverer (RECO) • Lock Manager Server (LMS) . background processes are created automatically when an instance is started. 8 .Exploring Oracle Database Administration Oracle Architectural Components and Database Creation An Oracle instance can have many background processes. © Copyright 2006.Real Application Clusters only • Queue Monitor (QMNn) • Dispatcher (Dnnn) • Server (Snnn) On many operating systems. Figure 1.2 show how each background process interacts with the different parts of an Oracle database. not all are always present.

1. These additional DBWn processes are not useful on uniprocessor systems. 1.1 Database Writer Process (DBWn) The database writer process (DBWn) writes the contents of buffers to data files. 9 . Although one database writer process (DBW0) is adequate for most systems.3. you can configure additional processes (DBW1 through DBW9) to improve write performance if your system modifies data heavily.2 Log Writer Process (LGWR) © Copyright 2006.1. Tata Consultancy Services Limited (TCS).3.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation Fig 1.2 Showing background process interacting with different parts of oracle database 1. The DBWn processes are responsible for writing modified (dirty) buffers in the database buffer cache to disk.

3.1. LGWR writes all redo entries that have been copied into the buffer since the last time it wrote. LGWR writes one contiguous portion of the buffer to disk.4 System Monitor Process (SMON) The system monitor process (SMON) performs crash recovery. This is done by the CKPT process. LGWR normally writes fast enough to ensure that space is always available in the buffer for new entries. releases locks. When LGWR writes redo entries from the redo log buffer to a redo log file. at instance startup. and removes the process ID from the list of active processes. When the redo log buffer is one-third full 3. if necessary 1. Other processes can call SMON if they detect a need for SMON to wake up. SMON recovers them when the table space or file is brought back online. © Copyright 2006. server processes can then copy new entries over the entries in the redo log buffer that have been written to disk.3. The CKPT process does not write blocks to disk. PMON is responsible for cleaning up the database buffer cache and freeing resources that the user process was using. 10 . Tata Consultancy Services Limited (TCS). DBWn always performs that work.3 Checkpoint Process (CKPT) When a checkpoint occurs. The statistic DBWR checkpoints displayed by the System_Statistics monitor in Oracle Enterprise Manager indicates the number of checkpoint requests completed.1. PMON periodically checks the status of dispatcher and server processes. When a DBWn process writes modified buffers to disk. For example.5 Process Monitor Process (PMON) The process monitor (PMON) performs process recovery when a user process fails. 1. even when access to the redo log is heavy. and restarts any that have died (but not any that Oracle has terminated intentionally).Exploring Oracle Database Administration Oracle Architectural Components and Database Creation The log writer process (LGWR) is responsible for redo log buffer management— writing the redo log buffer to a redo log file on disk. With Oracle9i Real Application Clusters. it resets the status of the active transaction table. 1.3. if necessary. Every three seconds 2. SMON wakes up regularly to check whether it is needed. SMON is also responsible for cleaning up temporary segments that are no longer in use and for coalescing contiguous free extents within dictionary-managed table spaces. Oracle must update the headers of all data files to record the details of the checkpoint. LGWR writes: • A commit record when a user process commits a transaction • Redo log buffers 1. The redo log buffer is a circular buffer. If any dead transactions were skipped during crash and instance recovery because of fileread or offline errors.1. the SMON process of one instance can perform instance recovery for a failed CPU or instance.

Like SMON. Here’s what happens: 1. RECO waits an increasing amount of time (growing exponentially) before it attempts another connection.7 Job Queue Processes Job queue processes are used for batch processing.6 Recoverer Process (RECO) The recoverer process (RECO) is a background process used with the distributed database configuration that automatically resolves failures involving distributed transactions. New jobs selected are ordered by time. The RECO process of a node automatically connects to other databases involved in an in-doubt distributed transaction. Release 1 (9. © Copyright 2006. If the RECO process fails to connect with a remote server. They execute user jobs. The coordinator process. it automatically resolves all in-doubt transactions.0. 2.1). removing from each database’s pending transaction table any rows that correspond to the resolved in-doubt transactions. 1. Given a start date and an interval. They can be viewed as a scheduler service that can be used to schedule jobs as PLSQL statements or procedures on an Oracle instance.3.1. The job queue process executes one of the jobs that were selected by the CJ process for execution. Dynamic job queue processes can execute a large number of jobs concurrently at a given interval. The CJQ0 process dynamically spawns job queue slave processes (J000… J999) to execute the jobs. named CJQ0. periodically selects jobs that need to be run from the system JOB$ table. The RECO process is present only if the instance permits distributed transactions and if the DISTRIBUTED_TRANSACTIONS parameter is greater than zero. Beginning with Oracle9i. 1. The resources used by the new processes are released when they are idle. The processes execute one job at a time. The job queue processes execute user jobs as they are assigned by the CJQ process.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation PMON also registers information about the instance and dispatcher processes with the network listener. 11 . 3. job queue processes are managed dynamically. This allows job queue clients to use more job queue processes when required. the job queue processes try to execute the job at the next occurrence of the interval. However. PMON wakes up regularly to check whether it is needed and can be called if another process detects the need for it. If this initialisation parameter is zero. RECO is not created during instance startup. RECO automatically tries to connect again after a timed interval.1.3. When the RECO process re-establishes a connection between involved database servers. Tata Consultancy Services Limited (TCS).

1. from which it wakes up at periodic intervals and polls for more jobs. clients should not assume that all job queue processes are available for job execution.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation 4. The ALERT file keeps a record of when LGWR starts a new ARCn process.9 Lock Manager Server Process (LMS) In Oracle9i Real Application Clusters. 1. a Lock Manager Server process (LMS) provides inter-instance resource management. it polls for more jobs.8 Archiver Processes (ARCn) The archiver process (ARCn) copies online redo log files to a designated storage device after a log switch has occurred. ARCn processes are present only when the database is in ARCHIVELOG mode.ora parameter JOB_QUEUE_PROCESSES represents the maximum number of job queue processes that can concurrently run on an instance.3. After the process finishes execution of a single job. If the process does not find any new jobs. If there are no scheduled jobs for execution. it aborts after a preset interval. 1. it enters a sleep state.1.3. The init. and automatic archiving is enabled. 12 . However. Tata Consultancy Services Limited (TCS). The LGWR process starts a new ARCn process whenever the current number of ARCn processes is insufficient to handle the workload. An Oracle instance can have up to 10 ARCn processes (ARC0 to ARC9). © Copyright 2006.

which monitors the message queues. This combination of the SGA and the Oracle processes is called an Oracle instance. Oracle9i Real Application Clusters enables multiple instances to mount a single database. which makes it accessible to authorized users.2Oracle Instance Introduction to an Oracle Instance Every running Oracle database is associated with an Oracle instance. each accessing its own physical database. This is called mounting the database. In clustered and massively parallel systems (MPP). 13 . © Copyright 2006. The memory and processes of an instance manage the associated database’s data efficiently and serve the one or multiple users of the database. 1.3. Oracle allocates a memory area called the System Global Area (SGA) and starts one or more Oracle processes. Multiple instances can execute concurrently on the same computer.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation 1. These processes are different from other Oracle background processes in that process failure does not cause the instance to fail. The database is then ready to be opened.1. Tata Consultancy Services Limited (TCS). Oracle associates the instance with the specified database.3 shows an Oracle Instance The Instance and the Database After starting an instance. Fig 1. When a database is started on a database server (regardless of the type of computer). You can configure up to 10 queue monitor processes.10 Queue Monitor Processes (QMNn) The queue monitor process is an optional background process for Oracle Advanced Queuing.

Tata Consultancy Services Limited (TCS). Security for database startup and shutdown is controlled through connections to Oracle with administrator privileges. When a database is closed.COM # LICENSE_MAX_USERS = 64 # CONTROL_FILES = filename1. the database administrator can shut down the database so that it is closed. If a database is open. which are called variable parameters Among other things. Oracle must read an initialisation parameter file—a file containing a list of configuration parameters for that instance and database. Most initialisation parameters belong to one of the following groups: • Parameters that name things (such as files) • Parameters that set limits (such as maximums) • Parameters that affect capacity (such as the size of the SGA). users cannot access the information that it contains. 1.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation Only the database administrator can start up an instance and open the database. filename2 # LOG_ARCHIVE_DEST = C:\DEST LOG_ARCHIVE_START = TRUE LOG_BUFFER = 64512 UNDO_MANAGEMENT = TRUE © Copyright 2006. Set these parameters to particular values to initialise many of the memory and process settings of an Oracle instance. 14 . the initialisation parameters tell Oracle: • • • • • The name of the database for which to start up an instance How much memory to use for memory structures in the SGA What to do with filled online redo log files The names and locations of the database’s control files The names of private rollback segments or undo table spaces in the database The following is an example of a parameter file DB_BLOCK_BUFFERS = 550 DB_NAME = ORAESD DB_DOMAIN = US.ACME. Normal users do not have control over the current status of an Oracle database.3Managing an Oracle Instance Initialization Parameter Files To start an instance.

© Copyright 2006. the platform-specific default location (directory) for the server parameter file (or text initialisation parameter file) is: $ORACLE_HOME/dbs For Windows NT and Windows 2000 the location is: $ORACLE_HOME\database In the platform-specific default location. To start an instance. Connect to Oracle as SYSDBA: CONNECT username/password AS SYSDBA Now you are connected to Oracle and ready to start up an instance of your database. Start SQL*Plus without connecting to the database: SQLPLUS /NOLOG 2. Oracle reads the initialisation parameters from a server parameter file (SPFILE) in a platform-specific default location. 15 .4.4Start up and shut down 1. 3. 1. 2. Using SQL*Plus to Start Up a Database You use the STARTUP command to start up a database instance. When you issue the STARTUP command with no PFILE clause.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation 1. Tata Consultancy Services Limited (TCS). Oracle must read instance configuration parameters (the initialisation parameters) from either a server parameter file or a traditional text initialisation parameter file.1 Starting up the database These are the preliminary steps to be performed before attempting to start an instance of database using SQL*Plus. spfile$ORACLE_SID. by using the PFILE clause of the STARTUP command.ora init$ORACLE_SID.ora You can direct Oracle to read initialisation parameters from a traditional text initialisation parameter file. Oracle locates your initialisation parameter file by examining filenames in the following order: 1.ora spfile. Note: For UNIX.

16 . Database opened. This does not allow access to the database and usually would be done only for database creation or the re-creation of control files Start the instance and mount the database. SQL> 235693104 bytes 279600 bytes 167772160 bytes 67108864 bytes 532480 bytes © Copyright 2006.0. This mode allows any valid user to connect to the database and perform typical data access operations. SQL> STARTUP ORACLE instance started. Total System Global Area Fixed Size Variable Size Database Buffers Redo Buffers Database mounted. Start an instance.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation For example: STARTUP PFILE = /home/oracle/product/9. read the initialisation parameters from the default server parameter file location.2 Starting up an instance You can start up an instance in these modes: • • • Start the instance without mounting a database. This state allows for certain activities. and Mounting and Opening a Database Normal database operation means that an instance is started and the database is mounted and open.1 Starting an Instance. 1. or in restricted mode. but does not allow general access to the database. allowing access for database administrators only.1/dbs/inittest1.4. This can be done in unrestricted mode. and mount and open the database. but leave it closed. Start the instance.2.ora 1.4. allowing access to all users. and then mount and open the database by using the STARTUP command by itself. Tata Consultancy Services Limited (TCS).

you must first connect as SYSOPER or SYSDBA. you do so only during database creation.2.2 Starting an Instance Without Mounting a Database You can start an instance without mounting a database.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation 1.2. Typically. Total System Global Area 235693104 bytes Fixed Size 279600 bytes Variable Size 167772160 bytes Database Buffers 67108864 bytes Redo Buffers 532480 bytes SQL> 1.4. but leave it closed by using the STARTUP command with the MOUNT option: SQL> startup mount ORACLE instance started.4. 17 .4. Total System Global Area Fixed Size Variable Size Database Buffers Redo Buffers Database mounted. 235693104 bytes 279600 bytes 167772160 bytes 67108864 bytes 532480 bytes 1.3 Starting an Instance and Mounting a Database Start an instance and mount the database.3 Shutting down a database To shut down a database and instance. There are various modes of shutting down a database. • • • • Shutting down with Normal option Shutting down with Immediate option Shutting down with transactional option Shutting down with abort option © Copyright 2006. Tata Consultancy Services Limited (TCS). Use the STARTUP command with the NOMOUNT option: SQL> startup nomount ORACLE instance started.

Oracle waits for all currently connected users to disconnect from the database. use the SHUTDOWN command with the IMMEDIATE option: SHUTDOWN IMMEDIATE Immediate database shutdown proceeds with the following conditions: • • • No new connections are allowed Any uncommitted transactions are rolled back.4. 1. SQL> Normal database shutdown proceeds with the following conditions: No new connections are allowed after the statement is issued.1 Shutting Down with the NORMAL Option To shut down a database in normal situations. Before the database is shut down. 18 .3 Shutting down with Transactional option To perform a planned shutdown of an instance while allowing active transactions to complete first. use the SHUTDOWN command with the TRANSACTIONAL option: SHUTDOWN TRANSACTIONAL © Copyright 2006. • • 1.3. Database dismounted.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation 1.3. ORACLE instance shut down. The next startup of the database will not require any instance recovery procedures.3.4. use the SHUTDOWN command with the NORMAL option: SQL> shutdown normal. Oracle implicitly rolls back active transactions and disconnects all connected users.2 Shutting Down with the IMMEDIATE Option The immediate database shutdown can be used in the following situations: • • • To initiate an automated and unattended backup When a power shutdown is going to occur soon When the database or one of its applications is functioning irregularly and you cannot contact users to ask them to log off or they are unable to log off To shut down a database immediately. Tata Consultancy Services Limited (TCS). The next startup of the database will not require any instance recovery procedures.4. Database closed.

any client still connected to the instance is disconnected. When a process detects an internal error. • Current client SQL statements being processed by Oracle are immediately terminated. while other information is for Oracle Support Services. At this point. ALTER. • Uncommitted transactions are not rolled back. block corruption errors (ORA-1578).3. Trace file information is also used to tune applications and instances.4 Shutting down with ABORT Option When you must do a database shutdown by aborting transactions and user connections.5Alert Log File Each server and background process can write to an associated trace file. The next startup of the database will require instance recovery procedures.4. The alert file. or alert log. is a special trace file. and deadlock errors (ORA-60) that occur • Administrative operations. Tata Consultancy Services Limited (TCS). • Oracle does not wait for users currently connected to the database to disconnect. nor are new transactions allowed to be started. The alert file of a database is a chronological log of messages and errors. SHUTDOWN. and DROP statements and STARTUP. • 1. issue the SHUTDOWN command with the ABORT option: SHUTDOWN ABORT An aborted database shutdown proceeds with the following conditions: No new connections are allowed. 1. 19 . the instance shuts down just as it would when a SHUTDOWN IMMEDIATE statement is submitted. which includes the following: All internal errors (ORA-600).Exploring Oracle Database Administration Oracle Architectural Components and Database Creation Transactional database shutdown proceeds with the following conditions: • • • No new connections are allowed After all transactions have completed. Some of the information written to a trace file is intended for the database administrator. such as CREATE. it dumps information about the error to its trace file. and ARCHIVELOG statements • Several messages and errors relating to the functions of shared server and dispatcher processes • Errors occurring during the automatic refresh of a materialized view • The values of all initialisation parameters at the time the database and instance Start Initialization parameters controlling the location and size of trace files are: • © Copyright 2006. Oracle implicitly disconnects all connected users. after the statement is issued.

Tata Consultancy Services Limited (TCS). There are no spaces around the equal-to (=) character.pwd that allows up to 30 privileged users with different passwords: ORAPWD FILE=acct. 20 .name of password file (mand).pwd PASSWORD=secret ENTRIES=30 file named © Copyright 2006. • • • • Using ORAPWD Setting REMOTE_LOGIN_PASSWORDFILE Adding users to Password file Maintaining a password file 1. but each file usually includes the name of the process writing the file (such as LGWR and RECO). entries . This section covers these topics. 1.5.1 Using ORAPWD: Syntax for ORAPWD orapwd Usage: orapwd file=<fname> password=<password> entries=<users> where file .maximum number of distinct DBAs and OPERs (opt). The names of trace files are operating system specific. All trace files for server processes are written to the destination directory specified by the initialisation parameter USER_DUMP_DEST.6Setup Password File Authentication Password file can be created by a utility called ORAPWD. For example. password .Exploring Oracle Database Administration Oracle Architectural Components and Database Creation • • • BACKGROUND_DUMP_DEST USER_DUMP_DEST MAX_DUMP_FILE_SIZE 1. the following command creates a password acct.1 Specifying the location of Trace and Alert Files All trace files for background processes and the alert file are written to the destination directory specified by the initialisation parameter BACKGROUND_DUMP_DEST.6.password for SYS (mand).

both the password stored in the data dictionary and the password stored in the password file are updated. Password: This parameter sets the password for user SYS. Only an EXCLUSIVE file can contain the names of users other than SYS. This parameter is mandatory. Tata Consultancy Services Limited (TCS). However. You must specify the full path name for the file. The contents of this file are encrypted. SYS. All users needing SYSDBA or SYSOPER system privileges must connect using the same name. • Exclusive: An EXCLUSIVE password file can be used with only one database. 1. This option is useful if you have a single DBA administering multiple databases. • Shared: A SHARED password file can be used by multiple databases. you must also set the initialisation parameter Remote_Login_Passwordfile to an appropriate value.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation Following are the description of parameters in ORAPWD utility: File: This parameter sets the name of the password file being created. You cannot add users to a SHARED password file. The values are the following: None: Setting this parameter to NONE causes Oracle to behave as if the password file does not exist. and password. This number corresponds to the number of distinct users allowed to connect to the database as SYSDBA or SYSOPER. the only user recognized by a SHARED password file is SYS. 21 . Entries: This parameter specifies the number of entries that you require the password file to accept. If you issue the ALTER USER statement to change the password for SYS after connecting to the database.2 Setting Remote_Login_PasswordFile Apart from creating the Password file .6. NONE is the default value for this parameter. Using an EXCLUSIVE password file allows you to grant SYSDBA and SYSOPER system privileges to individual users and have them connect as themselves. and the file cannot be read directly. • © Copyright 2006. This parameter is mandatory.

only those users who can be authenticated by the operating system can perform database administration operations. You can change the state of the password file by setting the initialisation parameter REMOTE_LOGIN_PASSWORDFILE. Set the Remote_Login_Passwordfile parameter to EXCLUSIVE 3. you can delete the password file and reset the REMOTE_LOGIN_PASSWORDFILE initialisation parameter to NONE. Grant SYSDBA or SYSOPER privileges. Create users as necessary.6.4. its default state is SHARED. Start up the instance and create the database if necessary.2 Remove the password file If you determine that you no longer require a password file to authenticate users. or mount and open an existing database. Create a password file using ORAPWD utility following the syntax 2.6. 5. 1.4 Maintaining a Password file: This section describes how to: • • • Expand the number of password file users if the password file becomes full Remove the password file Avoid changing the state of the password file 1.6. 22 .6. Connect with SYSDBA privilege as shown in example Connect sys/password as sysdba 4. 1.4.3 Changing the state of password file: The password file state is stored in the password file.4. To replace a password file: Shutdown the database Delete the existing password file Create a new password file using ORAPWD utility with sufficient ENTRIES parameter which u think might be used. • • • 1.6. When you mount the database.1 Expanding the number of Password file users: If you receive the file full error (ORA-1996) when you try to grant SYSDBA or SYSOPER system privileges to a user.3 Adding Users to Password File: 1. When you start up an instance. Oracle compares the value of this © Copyright 2006. When you first create a password file.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation 1. Oracle retrieves the value of this parameter from the parameter file stored on your client machine. you must create a larger password file and regrant the privileges to the users. After you remove this file. Tata Consultancy Services Limited (TCS).

1. Oracle utilities.1 Oracle9i has these components. It also installs those products most commonly used in data warehousing and transaction processing environments. including Console. Standard Edition. Personal Edition. There are four installation types: Enterprise Edition. which consists of an Oracle database and an Oracle instance. database environment tools. and online documentation. Oracle Universal Installer provides the following capabilities: • • • • • • • Component and suite installations Web-based installations National language and globalisation support Distributed installation support Unattended "silent" installations using response files Uninstallation of installed components Multiple Oracle homes support Oracle9i products for Installation: 1. 1. If the values do not match. Oracle overwrites the value stored in the file. Oracle Universal Installer installs a preconfigured seed database. and Intelligent Agent.1 Oracle9i database: The Oracle9i Database is an object-oriented relational database management system.7Oracle9i Installation Procedure Oracle Universal Installer Overview Oracle Universal Installer is a Java-based graphical user interface (GUI) tool that enables you to install Oracle components from your CD-ROM. licensable Oracle Options. networking services.7. the Oracle Enterprise Manager framework of management tools. Tata Consultancy Services Limited (TCS). Enterprise Edition: If you select this type. © Copyright 2006.7. • • • Oracle9i Database Oracle9i Client Oracle9i Management and Integration 1. 23 . Management Server.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation parameter to the value stored in the password file. or Custom.

Oracle Integration Server is a suite of software that provides Internet and intranet tools to integrate applications within and across organizations. Tata Consultancy Services Limited (TCS). 1. networking services. Personal Edition: If you select this type. Oracle Universal Installer installs the Oracle Enterprise Manager Console. There are three Client installation types: Administrator. © Copyright 2006. Administrator: If you select this type.7. Note that Oracle Management Server and Intelligent Agent are not supported on Windows 98.1. Runtime. Oracle Universal Installer installs networking services and support files. Custom: If you select this type. Oracle Enterprise Manager framework of management tools.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation Standard Edition: If you select this type. and basic client software. Management Server. Oracle Internet Directory is an database-based LDAP v3 directory server. and Custom. Oracle Integration Server. Custom: If you select this type. and Oracle utilities. Oracle Internet Directory. Runtime: If you select this type. and Intelligent Agent.7. including Console. There are four Management and Integration installation types: Oracle Management Server. and Personal Edition installations. Oracle Universal Installer prompts you to select individual components to install from the components available with Administrator and Runtime. and Custom. It enables distributed control between clients and managed nodes. Oracle Universal Installer installs the same software as the Enterprise Edition installation type. 1. Standard Edition. including enterprise management tools. 24 . Oracle Universal Installer installs a preconfigured seed database.1. but supports only a single user development and deployment environment that requires full compatibility with Enterprise Edition and Standard Edition. utilities. Personal Edition is the only Oracle9i Database installation type that is supported on Windows 98.3 Oracle9i Management and Integration Oracle Management Server is a central processing and distribution system for management tasks.2 Oracle9i Client The Oracle9i Client is a front-end database application that connects to the database through one or more application servers. Oracle Universal Installer prompts you to select individual components to install from the components available with Enterprise Edition. networking services.

and the Oracle Internet Directory database schema. LDAP-enabled client tools. 25 . and advanced queuing. Components include Oracle9i JVM. In addition. • Custom: If you select this type. a workflow engine. © Copyright 2006. Oracle Universal Installer prompts you to select individual components to install from the components available with Oracle Management Server. Oracle Internet Directory. The following initialisation parameters allow the database server to use the Oracle managed files feature: DB_CREATE_FILE_DEST: Defines the location of the default file system directory where Oracle creates data files or tempfiles when no file specification is given in the creation operation. Tata Consultancy Services Limited (TCS). Also used as the default file system directory for online redo log and control files if DB_ CREATE_ONLINE_LOG_DEST_ n is not specified. where n specifies a multiplexed copy of the online redo log or control file. • Oracle Internet Directory: If you select this type.8Configure OMF Oracle managed files simplifies the administration of an Oracle Database. Oracle Universal Installer installs XML-enabled components that integrate enterprise applications. Oracle Universal Installer installs basic client software. • Oracle Integration Server: If you select this type. Oracle Universal Installer installs the Oracle Management Server. • 1. which processes all system management tasks from the Enterprise Manager console and administers the distribution of these tasks to Intelligent Agents on managed nodes across the enterprise.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation Oracle Management Server: If you select this type. and Oracle Integration Server. You can use this initialisation parameter multiple times. DB_CREATE_ONLINE_LOG_DEST_n: Defines the location of the default file system directory for online redo log files and control file creation when no file specification is given in the creation operation. Include the DB_CREATE_FILE_DEST initialisation parameter in your initialisation parameter file to identify the default location for the database server to create: • • • • Data files Tempfiles Online redo log files Control files as the default The following example sets /u01/oradata/payroll directory to use when creating Oracle-managed files. You can specify up to five multiplexed copies. Oracle Universal Installer installs a Lightweight Directory Access Protocol (LDAP)-enabled Oracle Internet Directory Server.

Select the global database name. Use an undo table space to manage your undo records. Create the global database name by setting both the DB_ NAME and DB_DOMAIN initialisation parameters. Develop a backup and recovery strategy to protect the database from failure. Tata Consultancy Services Limited (TCS). Plan the layout of the underlying operating system files.1 • Plan the database tables and indexes and estimate the amount of space they will require. Select the data base character set Select the standard database block size. This is specified at database creation by the DB_BLOCK_SIZE initialisation parameter and cannot be changed after the database is created. which is the name and location of the database within the network structure. Proper distribution of files can improve database performance dramatically by distributing the I/O for accessing the files. to choose the appropriate backup mode. Consider using Oracle Managed Files feature to create and manage operating systems files.9 Prerequisites for database creation The following topics are to be looked into for database creation • • Planning for data base creation Meeting certain prerequisites Planning for database creation 1.9. It is important to protect the control. file by multiplexing. 26 .Exploring Oracle Database Administration Oracle Architectural Components and Database Creation DB_CREATE_FILE_DEST = '/u01/oradata/payroll' Setting the DB_CREATE_ONLINE_LOG_DEST_n initialisation parameter in the initialisation parameter file to identify the default location for the database server to create: • • Online Redo log files Control Files DB_CREATE_ONLINE_LOG_DEST_1 = ‘/u02/oradata/payroll’ DB_CREATE_ONLINE_LOG_DEST_2 = ‘/u02/oradata/payroll’ 1. and to manage the online and archived redo logs. • • • • • • • © Copyright 2006.

During database creation. For example. 27 .2 • • • The desired Oracle Software has to be installed.9. and control file of the database.acme. redo log files. If during database instance startup the value of the DB_NAME parameter (in the parameter file) and the database name in the control file are not the same.com. to create a database with a global database name of test.acme.1 Determine the global database name DB_DOMAIN parameter indicates the domain (logical location) within a network structure.10. edit the parameters of the new parameter file as follows: DB_NAME = test DB_DOMAIN = us. This is typically the name of the organization that owns the database. There should be sufficient memory available to start up the Oracle Instance There should be sufficient disk storage space available on the computer that executes Oracle.10 Create and manage Initialization parameter files The following are the initialisation parameters one has to look into before creating a database: • • • • • • • Determine the global database name Specify control files Specify database block sizes Setting Initialization Parameters that affect the size of SGA Specify the maximum number of processes Specify the method of undo space management Setting License Parameters 1.10. The combination of the settings for these two parameters must form a database name that is unique within a network.us. the name provided for DB_NAME is recorded in the data files. Meeting Prerequisites 1. Tata Consultancy Services Limited (TCS). the database does not start. 1. DB_DOMAIN is a text string that specifies the network domain where the database is created.com DB_NAME must be set to a text string of no more than eight characters.2 Specify Control Files © Copyright 2006.Exploring Oracle Database Administration • Oracle Architectural Components and Database Creation Get Familiar with the options of starting and shutting down an instance and mounting and opening a database. 1.

When you execute the CREATE DATABASE statement.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation CONTROL_FILES initialisation parameter has to be included in your new parameter file and set its value to a list of control filenames to use for the new database. © Copyright 2006. Tata Consultancy Services Limited (TCS). 28 . the control files listed in the CONTROL_ FILES parameter will be created.

3 Specify database block size The DB_BLOCK_SIZE initialisation parameter specifies the standard block size for the database. 29 . Oracle selects an appropriate default value. Limiting the size of the SGA: © Copyright 2006. where DB_ BLOCK_SIZE specifies the standard block size. except by re-creating the database. For example. If a database’s block size is different from the operating system block size. Oracle selects an appropriate default value. This block size is used in creation of SYSTEM table space and by default in other table spaces. DB_ nK_CACHE_SIZE Initialization Parameters The sizes and numbers of non-standard block size buffers are specified by the following initialisation parameters: • • • • DB_2K_CACHE_SIZE DB_4K_CACHE_SIZE DB_8K_CACHE_SIZE DB_16K_CACHE_SIZE Adjusting the Size of the Shared Pool The SHARED_POOL_SIZE initialisation parameter is a dynamic parameter (in previous releases it was not dynamic) that allows you to specify or adjust the size of the shared pool component of the SGA. Adjusting the Size of the Large Pool The LARGE_POOL_SIZE initialisation parameter is a dynamic parameter (in previous releases it was not dynamic) that allows you to specify or adjust the size of the large pool component of the SGA. the following setting for the DB_BLOCK_SIZE initialisation parameter is valid: DB_BLOCK_SIZE=4096 1.10. if your operating system’s block size is 2K (2048 bytes). The DB_CACHE_SIZE parameter specifies the size of the cache of standard block size buffers.4 Setting Initialization parameters that affect the size of SGA DB_CACHE_SIZE Initialization Parameter The DB_CACHE_SIZE initialisation parameter replaces the DB_BLOCK_BUFFERS initialisation parameter that was used in previous releases. Tata Consultancy Services Limited (TCS).10.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation 1. make the database block size a multiple of the operating system’s block size. Typically DB_BLOCK_SIZE is set to either 4K or 8K The block size cannot be changed after database creation.

MANUAL enables rollback segment undo mode. it selects the first available undo table space in the instance for storing undo. For example. You can dynamically alter the initialisation parameters affecting the size of the buffer caches. The value of this parameter must be 6 or greater (5 for the background processes plus 1 for each user process).10. Setting License parameters: To set the maximum number of concurrent sessions for an instance set the initialisation parameter LICENSE_MAX_SESSIONS in the initialisation parameter file that starts the instance: © Copyright 2006. but only to the extent that the sum of these sizes and the sizes of the other components of the SGA (fixed SGA. This is the undo table space that Oracle will normally select whenever you start up the database.10. if you plan to have 50 concurrent users. SGA_MAX_SIZE >= DB_CACHE_SIZE + SHARED_POOL_SIZE + LARGE_POOL_SIZE + FIXED SGA + VARIABLE SGA + SIZE OF REDO LOG BUFFERS 1. and large pool.5 Specifying the Maximum Number of Processes The PROCESSES initialisation parameter determines the maximum number of operating system processes that can be connected to Oracle concurrently.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation The SGA_MAX_SIZE initialisation parameter specifies the maximum size of the System Global Area for the lifetime of the instance. 30 . where undo is stored in rollback segments. shared pool. 1. and redo log buffers) does not exceed the value specified by SGA_MAX_SIZE. variable SGA. or rollback segment undo mode. A value of AUTO enables automatic undo management mode. A default undo table space named SYS_UNDOTBS is automatically created when you execute a CREATE DATABASE statement and the UNDO_MANAGEMENT initialisation parameter is set to AUTO. set this parameter to at least 55.6 Specifying a method of Undo Space Management Undo Management Initialization parameter determines whether an instance will start up in automatic undo management mode where undo is stored in an undo table space. Tata Consultancy Services Limited (TCS). UNDO_TABLESPACE Initialization Parameter When the instance starts up in automatic undo management mode.

Step 2: Establish the database administrator authentication method To create a database one should have appropriate system privileges Step 3: Create the initialisation parameter file Have a look at the sample initialisation parameter file and edit it accordingly. % export ORACLE_SID=mynewdb environment The value of DB_NAME initialisation parameter should match the SID setting.ora'.ora' FROM PFILE='/u01/oracle/dbs/test_init. Exporting the server parameter file: The following example creates a text initialisation parameter file from a server parameter file where the names of the files are specified: CREATE PFILE='/u01/oracle/dbs/test_init. set the LICENSE_MAX_USERS initialisation parameter in the database’s initialisation parameter file. Store the initialisation parameter file in the Oracle’s default location. If a server parameter file of the same name already exists on the server.11 Creating a database manually Step 1: Decide on the instance identifier Decide on a unique Oracle System Identifier and set the ORACLE_SID variable accordingly. 1. as shown in the following example: LICENSE_MAX_USERS = 200 1.10.ora' FROM SPFILE='/u01/oracle/dbs/test_spfile. it is Overwritten with the new information.7 Managing Initialization parameter files using a server parameter file Creating a server parameter file: CREATE SPFILE='/u01/oracle/dbs/test_spfile. 31 .Exploring Oracle Database Administration Oracle Architectural Components and Database Creation LICENSE_MAX_SESSIONS = 80 To limit the number of users created in a database.ora'. Tata Consultancy Services Limited (TCS). © Copyright 2006.

SGiopServer)" DISPATCHERS="(PROTOCOL=TCP)(SER=MODOSE)".ora is stored in the following location: /home/oracle/product/9. "/home1/oracle9i/mynewdb/control/control03.ctl".ora and sqlnet.1 Default parameter file locations Oracle Architectural Components and Database Creation Platform Unix NT Default Name Init$ORACLE_SID. Tata Consultancy Services Limited (TCS). 32 .ctl") # Archive LOG_ARCHIVE_DEST_1='LOCATION=/home1/oracle9i/mynewdb/archive' LOG_ARCHIVE_FORMAT=%t_%s.aurora.aurora.ora) # DISPATCHERS = "(PROTOCOL=TCPS)(SER=MODOSE)".ora Step3.dbf LOG_ARCHIVE_START=TRUE # Shared Server # Uncomment and use first DISPATCHES parameter below when your listener is # configured for SSL # (listener.0.Exploring Oracle Database Administration Table 1.ctl". # "(PROTOCOL=TCPS)(PRE=oracle.server. "(PROTOCOL=TCP)(PRE=oracle.server. (PROTOCOL=TCP) © Copyright 2006.ora Init$ORACLE_SID.SGiopServer)". "/home1/oracle9i/mynewdb/control/control02.ora Default Location $ORACLE_HOME/dbs $ORACLE_HOME/database The initialisation parameter file initmynewdb.1/dbs/initmynewdb.1: Sample Initialization parameter file #Cache and I/O DB_BLOCK_SIZE =4096 DB_CACHE_SIZE=20971520 # Cursors and Library Cache CURSOR_SHARING=SIMILAR OPEN_CURSORS=300 # Diagnostics and Statistics BACKGROUND_DUMP_DEST=/home1/oracle9i/mynewdb/ bdump CORE_DUMP_DEST=/home1/oracle9i /mynewdb/cdump TIMED_STATISTICS=TRUE USER_DUMP_DEST=/home1/oracle9i/mynewdb/udump # Control File configuration CONTROL_FILES=("/home1/oracle9i/mynewdb/control/control01.

© Copyright 2006. Hash Joins. Bitmap Indexes SORT_AREA_SIZE=524288 # System Managed Undo and Rollback Segments UNDO_MANAGEMENT=AUTO UNDO_TABLESPACE=undotbs Step4: Connect to the instance Start SQL*Plus and connect to your Oracle instance AS SYSDBA.Production on Tue Oct 16 16:13:26 2001 (c) Copyright 2001 Oracle Corporation.com REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE # Network Registration INSTANCE_NAME=mynewdb # Pools JAVA_POOL_SIZE=31457280 LARGE_POOL_SIZE=1048576 SHARED_POOL_SIZE=52428800 # Processes and Sessions PROCESSES=150 # Redo Log and Recovery FAST_START_MTTR_TARGET=300 # Resource Manager RESOURCE_MANAGER_PLAN=SYSTEM_PLAN # Sort. $ SQLPLUS /nolog CONNECT SYS /MANAGER AS SYSDBA [oracle9i@esdlnx dbs]$ sqlplus /nolog SQL*Plus: Release 9. 33 . All rights reserved.1.0 DB_NAME=mynewdb # Distributed. Tata Consultancy Services Limited (TCS).0.0. Replication and Snapshot DB_DOMAIN=til.0.0 .Exploring Oracle Database Administration Oracle Architectural Components and Database Creation # Miscellaneous COMPATIBLE=9.

dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED DEFAULT TEMPORARY TABLESPACE tempts1 TEMPFILE '/home1/oracle9i/mynewdb/temps1. 34 . A database is created with the following characteristics: • The database is named mynewdb © Copyright 2006. SQL> Step5: Start the Instance Start the instance without mounting the database.dbf' SIZE 50M REUSE AUTOEXTEND ON NEXT 100K MAXSIZE UNLIMITED CHARACTER SET US7ASCII NATIONAL CHARACTER SET AL16UTF16 LOGFILE GROUP 1 ('/home1/oracle9i/mynewdb/redo01. GROUP 2 ('/home1/oracle9i/mynewdb/redo02.log') SIZE 100M. • Creates the SYSTEM table space and the SYSTEM rollback segment • Creates the data dictionary • Sets the character set that stores data in the database • Sets the database time zone • Mounts and opens the database for use The following statement creates database mynewdb: CREATE DATABASE mynewdb MAXINSTANCES 1 MAXLOGHISTORY 1 MAXLOGFILES 5 MAXLOGMEMBERS 5 MAXDATAFILES 100 DATAFILE '/home1/oracle9i/mynewdb/system01. Use the Startup command without NOMOUNT option STARTUP NOMOUNT At this point. GROUP 3 ('/home1/oracle9i/mynewdb/redo03. only instance is created and there is no database.log') SIZE 100M.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation SQL> connect sys/manage as sysdba Connected. Step6: Issue the Create database statement To create new database use CREATE DATABASE statement.dbf' SIZE 325M REUSE UNDO TABLESPACE undotbs DATAFILE '/home1/oracle9i/mynewdb/undotbs01. Only SGA is created and background processes are started in preparation for the creation of new database. This is done only during database creation or while performing maintenance operations.log') SIZE 100M. This statement does the following: • Creates the data files for the database • Creates the control files for the database • Creates the redo log files for the database and establishes the ARCHIVELOG mode. Tata Consultancy Services Limited (TCS).

create a user table space to be assigned as the default table space for users CREATE TABLESPACE users LOGGING DATAFILE '/home1/oracle9i/mynewdb/users01. 35 . MAXDATAFILES specifies the maximum number of data files that can be open in the database. separate from user table space CREATE TABLESPACE indx LOGGING DATAFILE '/home1/oracle9i/mynewdb/indx01. The SYSTEM table space. or NVARCHAR2. -. The UNDO TABLE SPACE clause creates and names an undo table space to be used for undo records for this database. NCLOB. it is overwritten.dbf is created as specified by the DATAFILE clause. As ARCHIVELOG clause is not specified in this CREATE DATABASE statement.Exploring Oracle Database Administration • • • • Oracle Architectural Components and Database Creation • • • • • • • • Three control files are created as specified by CONTROL_FILES initialisation parameter MAXINSTANCES specified that only one instance can have this database mounted and open. the default database time zone is the operating system time zone. The DEFAULT_TEMPORARY_TABLESPACE clause creates a temporary table space. If omitted (as it is in this case). Tata Consultancy Services Limited (TCS). The new database has three online redo log files as specified in the LOGFILE clause. The AL16UTF16 character set is specified as the NATIONAL CHARACRTER SET used to store data in columns of specifically defined as NCHAR.Create a table space for indexes. The US7ASCII character set is used to store data in this database. The following sample script creates some additional table spaces: CONNECT SYS/ password AS SYSDBA -. MAXLOGHISTORY. and MAXLOGMEMBERS define limits for the redo log. MAXLOGFILES. If the file already exists. you need to create additional files and table spaces for users. Step7: Create Additional table spaces To make the database functional. You set the database’s default time zone by specifying the SET TIME_ZONE clause of the CREATE DATABASE statement. © Copyright 2006. The default database time zone is the same as the operating system’s time zone.dbf' SIZE 25M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL. redo log files will not initially be archived. consisting of the operating system file /home1/oracle9i/mynewdb/system01.dbf' SIZE 25M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL.

1/initmynewdb.0.0.1/spfilemynewdb.0. CATPROC. Tata Consultancy Services Limited (TCS).ora' FROM PFILE='/home/oracle/product/9.SQL Creates the views of the data dictionary tables.sql. @/home/oracle/product/9. and public synonyms for many of the views. © Copyright 2006. SHUTDOWN This time you will start up using the server parameter file CONNECT SYS/ password AS SYSDBA STARTUP Step10: Back up the database Take the back up of the database.Create the server parameter file CREATE SPFILE=' /home/oracle/product/9.sql.1/rdbms/admin/catalog. the dynamic Performance views.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation Step8: Run scripts to create Data Dictionary Views: Run the scripts necessary to build views.ora'. Step9: Create Server parameter file: CONNECT SYS/ password AS SYSDBA -.1/rdbms/admin/catproc. Grants PUBLIC access to the synonyms.SQL Runs all scripts required for or used with PL/SQL. EXIT CATALOG. synonyms.0. and PL/SQL packages: CONNECT SYS/ password AS SYSDBA @/home/oracle/product/9. 36 .

• It uses Optimal Flexible Architecture (OFA). or it can be used to create or add instances in an Oracle Real Application Clusters environment. concurrence. Availability. you will be able to save the database creation information as a template or script. whereby database files and administrative files. Using Oracle Database Configuration Assistant you can add or delete a database. follow standard naming and placement practices. Tata Consultancy Services Limited (TCS). • It builds efficient and effective databases that take advantage of Oracle’s new features. and recoverability are key issues.1 Advantages of using Oracle Database Configuration Assistant: Its wizards guide you through a selection of options providing an easy means of creating and tailoring your database. accuracy.12 Create a database using Oracle Database Configuration Assistant The Oracle Database Configuration Assistant (DBCA) is a graphical user interface (GUI) tool that interacts with the Oracle Universal Installer. © Copyright 2006. OLTP: Many concurrent users performing numerous transactions requiring rapid access to data.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation 1. • 1.12. You can run the script later to create a new database. 1. to simplify the creation of a database. Response time. you can choose either to include data files or not. or can be used Standalone. The Oracle Database Configuration Assistant can be used to create single instance databases. Oracle provides templates for the following options: DSS: Users perform numerous. When you select a template. speed.2 Creating a database A database can be created from predefined templates provided by Oracle or from templates that you or others have created. including initialisation files. complex queries that process large volumes of data.12. 37 . If you select a template with data files. New Database: This template allows you maximum flexibility in defining a database. and availability are key issues.

13 Monitor the use of Diagnostic Files Trace Files: Background processes always write to a trace file when appropriate. You do not specify specific initialisation parameter values. Typical: This creates a database with minimal user input. and ultimately you can specify initialisation parameter. 1. setting the initialisation parameter SQL_TRACE = TRUE causes the SQL trace facility to generate performance statistics for the processing of all SQL statements for an instance and write them to the USER_DUMP_DEST directory. and data files.12.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation 1. specify database options to include. 1. Custom: Custom allows you to specify initialisation parameter values that affect the size of the System Global Area (SGA). you delete the database instance and its control file(s). Additionally. Multipurpose or Data Warehousing). it is possible. determine mode (dedicated server of shared server).3 Global Database name and Parameters You are guided thorough a series of pages that allow you to further define your database or to accept default parameter values and file locations as recommended by Oracle. When you do so. Optionally.12.4 Completing Database Creation After you have completed the specification of the parameters that define your database you can: • • • Create the database Save the description as database template Generate database creation scripts. Regardless of the current value of the SQL_TRACE initialisation parameter. the percentage of physical memory reserved for Oracle. each session can enable or © Copyright 2006. The initialisation parameter file is not deleted. and a database type (OLTP.12.5 Deleting a database The Oracle Database Configuration Assistant enables you to delete a database. instead. through an initialisation parameter. trace files can be generated for server processes at user request. Trace files are written on behalf of server processes whenever internal errors occur. to control the amount and type of trace information that is produced. you specify the maximum number of concurrent users. Tata Consultancy Services Limited (TCS). Very experienced database administrators who have specific tuning needs can use it 1. You provide a global database name. In the case of the ARCn background process. 38 . redo log files.

This example enables the SQL trace facility for a specific session: ALTER SESSION SET SQL_TRACE TRUE. The DBMS_SESSION and DBMS_SYSTEM packages can also be used to control SQL tracing for a session. © Copyright 2006. 39 .Exploring Oracle Database Administration Oracle Architectural Components and Database Creation disable trace logging on behalf of the associated server process by using the SQL statement ALTER SESSION SET SQL_TRACE. Tata Consultancy Services Limited (TCS).

which contains data and control information for a server process.  A shared SQL area contains the parse tree and execution plan for a given SQL statement. ARCn processes are present only when the database is in ARCHIVELOG mode.  The total size of the shared pool is determined by the initialisation parameter SHARED_POOL_SIZE. if necessary.  The command for starting an instance and mounting the database is STARTUP MOUNT.  The process monitor (PMON) performs process recovery when a user process fails.  Oracle allocates a memory area called the System Global Area (SGA) and starts one or more Oracle processes. at instance startup.  The database writer process (DBWn) writes the contents of buffers to data files.  The archiver process (ARCn) copies online redo log files to a designated storage device after a log switch has occurred.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation SUMMARY  An Oracle Data base is comprised of physical files. and automatic archiving is enabled.  To shutdown the database immediately use SHUTDOWN IMMEDIATE command.  The redo log buffer is a circular buffer in the SGA that holds information about changes made to the database. which monitors the message queues.  The recoverer process (RECO) is a background process used with the distributed database configuration that automatically resolves failures involving distributed transactions.  The system monitor process (SMON) performs crash recovery. The DBWn processes are responsible for writing modified (dirty) buffers in the database buffer cache to disk  The log writer process (LGWR) is responsible for redo log buffer management—writing the redo log buffer to a redo log file on disk. 40 .  The database buffer cache is the portion of the SGA that holds copies of data blocks read from data files. Tata Consultancy Services Limited (TCS).  A system global area (SGA) is a group of shared memory structures that contain data and control information for one Oracle database instance.  The parameters which control the location and size of trace files are: © Copyright 2006.  The command for starting an instance without mounting the database is STARTUP NOMOUNT.  A program global area (PGA) is a memory region.  To shut down the database in normal conditions the command used is SHUTDOWN NORMAL.  The queue monitor process is an optional background process for Oracle Advanced Queuing. This combination of the SGA and the Oracle processes is called an Oracle instance. memory and processes.

Exploring Oracle Database Administration ♦ ♦ ♦ Oracle Architectural Components and Database Creation BACKGROUND_DUMP_DEST USER_DUMP_DEST MAX_DUMP_FILE_SIZE  Password file can be created by a utility called ORAPWD. This block size is used in creation of SYSTEM table space and by default in other table spaces.  The PROCESSES initialisation parameter determines the maximum number of operating system processes that can be connected to Oracle concurrently. 41 .  The DB_BLOCK_SIZE initialisation parameter specifies the standard block size for the database. Tata Consultancy Services Limited (TCS).  Oracle Universal Installer is a Java-based graphical user interface (GUI) tool that enables you to install Oracle components from your CD-ROM. © Copyright 2006.

and –ORACLE PROCESS-. The init. –DATA DICTIONARY---.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation SELF-ASSESSMENT Fill in the blanks: 1.is a collection of database tables and views. PMON process performs Crash Recovery (T/F). 6. –REDO LOG BUFFER -. 2.ora parameter JOB_QUEUE_PROCESSES represents the maximum number of job queue processes that can concurrently run on an instance (T/F). 3. 3. 4. The recoverer process (RECO) is a background process used with the distributed database configuration that automatically resolves failures involving distributed transactions (T/F). 42 . State whether the following are True/False 1. 2. --SGA------.contains data and control information of an Oracle Instance.constitute an Oracle Instance. Answer the following Questions: 1. 5. Log Writer Process writes contents of buffers to data files (T/F). 2. 4. SMON performs process recovery (T/F). What is SGA and what does it comprise of? What does background process RECO do? What is an Oracle Instance? What are various options of starting and shutting down a database ? What is the role of alert file? Write short notes on ORAPWD? When are Oracle Managed files used? What are the prerequisites for data base creation? © Copyright 2006. 6. 3. Database writer process writes data in redo log buffer to redo log file (T/F).holds information about changes made to the database. Tata Consultancy Services Limited (TCS). 5. 7. --SGA-----. 5. 8. The size of the cache of the data blocks is determined by ---DB_BLOCK_SIZEparameter 4.

The Trace file location should be in the BDUMP and CDUMP directory. Maximum of 30 data files that can be created for the database vi. 43 .rdo located in the directory '/home1/oracle9i/testdb/redo01. 5. 4.rdo and log2a.log' The maximum number of five logs files groups and five log file Members for each group iv. A 20M data file named system01.ctl" iii. The Character set WE8ISO8859P1 viii. Create additional table spaces called users and indx Create the data dictionary views. 2. A maximum number of 100 archived redo logs for automatic media recovery vii. Tata Consultancy Services Limited (TCS).con located in the directory "/home1/oracle9i/testdb/control/control01. 3. What happens? © Copyright 2006.dbf and located in /home1/oracle9i/testdb/system01. Database name and Instance name: TESTDB ii.Exploring Oracle Database Administration Oracle Architectural Components and Database Creation LAB EXERCISES 1. Where is the existing control file and what is its name Try to start the database without the control file.dbf' directory v. Two redo log file groups each one 150K member named log1a. Write a script for creation of database with the following configuration: i. One control file named control01.

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.