Showing posts with label Oracle Managed Files. Show all posts
Showing posts with label Oracle Managed Files. Show all posts

Oracle Database Configuration Assistant

The Database Configuration Assistant (DBCA) an Oracle supplied tool that enables you to create an Oracle database, configure database options for an existing Oracle database, delete an Oracle database, or manage database templates. DBCA is launched automatically by the Oracle Universal Installer, but it can be invoked standalone from the Windows operating system start menu (under Configuration Assistants) or by entering the following on the UNIX command line:

dbca

The Database Configuration Assistant (DBCA) is a graphical user interface that interacts with the Oracle Universal Installer when you choose to create a database automatically when you install the Oracle 9i Server. The DBCA is a Java-based interface that can be launched from any platform that has access to a Java engine.

During installation of the server software, DBCA is launched by the Universal Installer and can automatically create a starter database if you want it to. You can choose at this point whether to use the DBCA at this time, use it later to assist you with database creation, or create your database manually.
With the DBCA, you can not only create a database, you can also configure database options, delete existing databases, and manage templates.
To launch the DBCA on Unix, type dbca at the Unix prompt. In Windows, you can launch the assistant from the Windows operating system Start menu where it is found under Configuration Assistants.

On a Unix platform, you need to be running an XWindows session either on the terminal or on your PC to run the DBCA product.

When you start the DBCA, you are presented with a screen with four options:

  • Create a Database 
  • Configure Database Options in a Database 
  • Delete a Database 
  • Manage Templates    


Create a Database
This option allows you to create a new database or a database template. The default template allows you to choose to create a database either with or without data files.

Without datafiles contains only the structure of the database, but allows you to specify or change all the database parameters.

With datafiles contains both the structure and the physical datafiles of the database. All the log files and control files are automatically created for the database, but you can add or remove control files and/or log groups. You can also change the destination and name of any or all of the data files. You cannot add or remove datafiles, tablespaces, or rollback segments. You cannot change initialization parameters.

Whenever you create a database with the DBCA, you need to specify the global database name as well as the unique SID. What's more, you need to decide what added features you want in your resulting database. These added features that you can choose to add to your installation include the following:
  • Oracle Spatial 
  • Oracle Intermedia (or Oracle Text) 
  • Oracle OLAP Services 
  • Example Schemas 
  • Human Resources 
  • Order Entry 
  • Product Media 
  • Sales History 
  • Shipping 
  • When you are creating a database with the DBCA, you have the option of creating either a typical or a custom database.
A custom database allows you to customize the creation of your database. This option is only for experienced database administrators with advanced knowledge of the database creation process. This advanced knowledge includes experience with the data, control, and redo settings; tablespace and extent sizing; database memory parameters and other initialization parameters; archive log formats and destinations; trace file destinations; and character set values.
A typical database creation with minimal user input allows you to choose the following different types of databases to mimic.

The steps involved in creating a database with DBCA include the following:
  • Create Database Create the database immediately. 
  • Save as a Database Template Save creation parameters as a template and that template is added to the list of available templates. 
  • Generate Database Creation Scripts Save the database creation parameters as a script file for later use. 
  • Determine the type of database that you want to create: 
  1. Online Transaction Processing (OLTP) An OLTP database typically must be capable of processing many thousands of transactions (read, write, update, delete) from many concurrent users every day. Performance, in an OLTP, is in terms of throughput of transactions and availability of data. 
  2. Data Warehouse These databases must be capable of processing a wide variety of queries; however, they are typically read-only queries. These processes range from simple queries that fetch a few records, to queries that many long-running complex queries take hours to process. Data Warehouse database performance is measured in terms of response time. 
  3. Multipurpose Many environments require a combination of the two different kinds of processing. A mixed database supports both OLTP and Data Warehousing environments. This is the default database that will be installed using DBCA.
 
Database Configuration Options
The Configure Database option lets you add options to your database that had not previously been configured. These include (if they are available for your installation) JVM, InterMedia, Visual Information Retrieval, Spatial, Oracle OLAP services, advanced replication, and SQL*Plus help.
The Configure Database option is not available in the 9i Real Application Clusters installation.
Additional database configuration options, some shown earlier in Figure 3.2, include the following:
  • Delete a Database Allows you to delete a database. 
  • Manage Templates Allows you to create a template though one of three methods:

1.  From predefined template settings Create a new template from the predefined template settings; add or change any settings, parameters, storage characteristics; or use custom scripts.
2.  From an existing database, structure only Contains the structural information similar to an existing database. The structure, in this case, means all the database options as well (the tablespaces, datafiles, and initialization parameters) specified in the source database. No schemas or data will be a part of the created database.
3.  From an existing database, structure and data Create a database that copies the structure as well as the data of the existing database. User-defined schemas and their data will be a part of the template. You are not allowed to add or remove any data files, tablespaces, or rollback segments.
  • Required Parameters Besides the information already covered, the creation of an Oracle Database and Oracle instance requires some further decisions to be made, particularly if you are choosing the custom database creation option. Figure 3.4 shows you a tabbed page on which you can choose various SGA settings, character sets to define for your database, data block sizing decisions, file locations, and archive log locations for the database.


Choosing database parameters.

  • Archive Parameters Archive redo logs are used for database recovery and often for implementation of a standby database. Running your database in archive log mode enables the archiving of redo log files before those redo files are reused. This is done for the purpose of recovery facilitation.
 It is often not necessary, or wise, to put a Data Warehouse database into archive log mode. Because Data Warehouses are updated infrequently, and typically by means of a bulk SQL*Ldr job, creating logs for restoration purposes in this case is often simply a waste of resources.

  • Data Block Sizing DB_BLOCK_SIZE helps to define the default database block size and determine the SORT_AREA_SIZE. DB_BLOCK_SIZE, the parameter that gets set during the use of this parameter, can be specified only at database creation time. SORT_AREA_SIZE is the amount of memory used for sorting operations. 
Remember that the only time you can set the DB_BLOCK_SIZE of the database, regardless of the method used to create the database, is at database creation time. If for any reason you determine later that you have chosen an incorrect value for this parameter, the database has to be rebuilt.
  •  File Locations By using the UDUMP, BDUMP, and CDUMP parameters, you can specify the particular locations for trace files.
 More information about the Initialization Parameter file can be found in Chapter 4, "Managing an Instance."

  • Database Storage This helps you to specify the storage parameters for the various files in your database creation. You can make custom alterations to the control files (do you want to multiplex?), tablespaces (do you want to have dictionary managed or locally managed?), datafiles, undo segments (do you want the new, and Oracle suggested, Automatic Undo Management, or do you want to manage rollback segments manually?), and redo log groups (how many log groups do you want, where do you want them, and do you want to multiplex them?).
Related Post:-  

Default Temporary Tablespace Creation

The DEFAULT TEMPORARY TABLESPACE clause of the CREATE DATABASE statement specifies that a temporary tablespace is to be created at database creation time. This tablespace is used as the default temporary tablespace for users who are not otherwise assigned a temporary tablespace.

Users can be explicitly assigned a default temporary tablespace in the CREATE USER statement. But, if no temporary tablespace is specified, they default to using the SYSTEM tablespace. It is not good practice to store temporary data in the SYSTEM tablespace. To avoid this problem, and to avoid the need to assign every user a default temporary tablespace at CREATE USER time, you can use the DEFAULT TEMPORARY TABLESPACE clause of CREATE DATABASE.

If you decide later to change the default temporary tablespace, or to create an initial one after database creation, you can do so. You do this by creating a new temporary tablespace (CREATE TEMPORARY TABLESPACE), then assign it as the temporary tablespace using the ALTER DATABASE DEFAULT TEMPORARY TABLESPACE statement. Users will automatically be switched (or assigned) to the new temporary default tablespace.

The following statement assigns a new default temporary tablespace:

ALTER DATABASE DEFAULT TEMPORARY TABLESPACE tempts2;

The new default temporary tablespace must be an existing temporary tablespace. When using a locally managed SYSTEM tablespace, the new default temporary tablespace must also be locally managed.

You cannot drop a default temporary tablespace, but you can assign a new default temporary tablespace, then drop the former one. You are not allowed to change a default temporary tablespace to a permanent tablespace, nor can you take a default temporary tablespace offline.

Users can obtain the name of the current default temporary tablespace using the DATABASE_PROPERTIES view. The PROPERTY_NAME column contains the value "DEFAULT_TEMP_TABLESPACE" and the PROPERTY_VALUE column contains the default temporary tablespace name.

Related Post:-

Creation Of Undo Tablespace By Using Automatic Undo Management

Oracle recommends that instead of using rollback segments in your database, you use an undo tablespace. This requires the use of a different set of initialization parameters, and optionally, the inclusion of the UNDO TABLESPACE clause in your CREATE DATABASE statement.

You must include the following initialization parameter if you want to operate your database in automatic undo management mode:

UNDO_MANAGEMENT=AUTO

In this mode, rollback information, referred to as undo, is stored in an undo tablespace rather than rollback segments and is managed by Oracle. If you want to create and name a specific tablespace for the undo tablespace, you can include the UNDO TABLESPACE clause at database creation time. If you omit this clause, and automatic undo management is specified, Oracle creates a default undo tablespace named SYS_UNDOTBS



Related Post:-

DBCA's Advantage


These are a few of the advantages of using DBCA:
  • You can use its wizards to guide you through a selection of options providing an easy means of creating and tailoring your database. It allows you to provide varying levels of detail. You can provide a minimum of input and allow Oracle to make decisions for you, eliminating the need to spend time deciding how best to set parameters or structure the database. Optionally, it allows you to be very specific about parameter settings and file allocations. 
  • It builds efficient and effective databases that take advantage of Oracle's new features 
  • It uses Optimal Flexible Architecture (OFA), whereby database files and administrative files, including initialization files, follow standard naming and placement practices.

Step To Create Oracle Database Using DBCA

If you choose to install software only and later create a database, or if you want to create additional databases using the release software that you just installed, you can do so by using the Database Configuration Assistant (DBCA).

Follow the steps below to create a database:

- Log onto your computer as a member of the administrative group that is authorized to install Oracle software and create and manage the database.
- Launch the DBCA on a Windows operating system as follows :                           Start > Programs > Oracle - home_name > Configuration and Migration Tools >DatabaseConfigurationAssistant
- The Welcome page appears. 
- Select Create a Database on the Operations window to begin an interview that enables you to configure and create a database.
- On the Database Templates page, select the type of database template to be used in creating the database. You can click Show Details to see the configuration for each type of database. Choose the template suited to the type of workload your database will support. If you are not sure, select the default General Purpose template.
- On the Database Identification page, enter the Global Database Name and SID. 
- The Management Options page appears. To use Enterprise Manager, select Configure the Database with Enterprise Manager. Select Use Database Control for Database Management to manage your database locally or select Use Grid Control for Database Management as appropriate to your configuration.
- Enter passwords for the administrative users.
- Select File System, Automatic Storage Management, or Raw Devices as appropriate to your environment.
- Specify the location for the creation of the datafiles. Choose one of the following:Use Database File Locations from Template, Use Common Location for All Database Files, or Use Oracle-Managed Files.
- Select Flash Recovery Area and specify a directory location and size. Select Enable Archiving to place your database in ARCHIVELOG mode.
- Click the Sample Schemas tab. Select Sample Schemas if you want to include the Sample Schemas (EXAMPLE) tablespace in your database. Click the Custom Scripts tab.
- Specify one or more SQL scripts to be run after your database is created if required in your environment. Otherwise, accept the default No scripts to run.
- The Memory page appears. Select Typical and enter a percentage value. Click the Sizing tab. - The Sizing page appears. Specify the smallest block size and the maximum number of operating system user processes that can simultaneously connect to the database. 
- The Character Set page appears. Select the character set for your database. Click the Connection Mode tab.
- The Connection Mode page appears. Select Dedicated Server or Shared Server as appropriate for your environment.
 - The Database Storage page appears. Accept the configuration or make changes as needed.
 - Select Create Database to create your database. You can also select Save as a Database Template to save your configuration. Click Finish.
 -  At the Confirmation window, confirm the options that will be installed and click OK.
 - Your database is now being created.

How to create an Oracle Database

Creating a database includes the following operations:
  • Creating information structures, including the data dictionary, that Oracle requires to access and use the database 
  • Creating and initializing the control files and redo log files for the database 
  • Creating new datafiles or erasing data that existed in previous datafiles
You use the CREATE DATABASE statement to perform these operations, but other actions are necessary before you have an operational database. A few of these actions are creating users and temporary tablespaces, building views of the data dictionary tables, and installing Oracle built-in packages.

An Oracle database can be created using:
Creating a database can be done either using the Oracle DatabaseConfiguration Assistant (DBCA) or by creating a SQL script using the CREATE DATABASE command. The DBCA is a graphical user interface that interacts with the Oracle Universal Installer, or can be used stand-alone, to simplify the creation of a database. The DBCA is Java-based and can be launched from any platform with a Java engine. During the installation of the Oracle Server, DBCA is launched by the Oracle Universal Installer and can automatically create a starter database for you. You have the option of using DBCA or not, and you also have the option to create a starter database. You also have the option to launch DBCA later as a standalone application to create a database. You can also migrate or upgrade an existing database if you are using a previous version of Oracle.

Related Post:

Creation Prerequisites

To create a new database, the following prerequisites must be met:
  • There is sufficient memory available to start the Oracle instance. 
  • There is sufficient disk storage space for the planned database on the computer that executes Oracle. 
  • The desired Oracle software is installed. 
  • You have the operating system privileges associated with a fully operational database administrator. You must be specially authenticated by your operating system or through a password file, allowing you to start up and shut down an instance before the database is created or opened.
 All of these are discussed in the Oracle installation guide specific to your operating system. Additionally, the Oracle Universal Installer will guide you through your installation and provide help in setting up environment variables, directory structure, and authorizations.

Related Post:-

Planning Database File Locations

Plan how to protect the database, including the online redo log files, control files, data files, archived redo log files, and provide a backup strategy.

Control Files

For the sake of safety, you should create at least two control files on two different disks.

Online Redo Log Files

The online redo log files of a database should consist of multiplexed groups of online redo log files. A group of log files consists of identical copies, which should be located on different disks. To distinguish between groups and their members, use a name such as log0101.log or log01a.log.

Data Files

Name data files by relating to the contents as the root of the name—for example, data files such as system01.dbf, temp01.dbf, and users01.dbf on Unix. Consider the characteristics of the data to be stored before determining the structure appropriate for your database, in order to:

    Minimize fragmentation
    Minimize disk contention
    Separate objects

To minimize fragmentation of the database, you should separate database objects with different life spans, such as application data and temporary data, into different tablespaces. To ensure well-balanced I/O loads, you should separate objects with competing I/O requirements, such as tables and indexes, into different tablespaces.

What is Oracle Managed Files (OMF)

Oracle Managed Files (OMF) directly manages file creation and deletion at the operating system level. Operations are specified in terms of database objects rather than filenames. Oracle internally uses standard file system interfaces to create and delete files as needed for the database structures such as tablespaces, online redo log files, and control files.

Administrators need to specify the file system directory to be used for a particular type of file. Thereafter, Oracle manages to create unique files when needed and also deletes files that are not needed. The advantages include: 
  • Automatic cleanup of the filesystem when database objects are dropped. 
  • Standardized naming of database files.
  • Increased portability since file specifications are not needed. 
  • Simplified creation of test systems on differing operating systems. 
  • No unused files wasting disk space.

 The location of database files is defined using the DB_CREATE_FILE_DEST parameter. It is default file system directory location where Oracle creates data files or temp files when no file specification is given in the object creation statement.
For online redo log files and control files the default location of the file system directory is defined by db_create_online_log_dest_n. This initialization parameter can be used multiple times where n specifies a multiplexed copy of the online redo log or control file.

Note that the file system directory specified by either of these parameters must already exist. Oracle does not create it. The directory must also have permissions to allow Oracle to create the files in it. The default location is used whenever a location is not explicitly specified for the operation of creating a file. Oracle creates the filename, and a file thus created is an Oracle-managed file. The following example sets default directory to use when creating Oracle-managed files:

DB_CREATE_FILE_DEST = '/p1/oracle/oradata/LSH'

By default, this location would be applicable for data files, temp files, Online redo log files, and control files. However, the db_create_online_log_dest_n initialization parameter can be included in the initialization parameter file to identify the default location for the database server to create online redoes log files and control files. For example:

DB_CREATE_ONLINE_LOG_DEST_1 = '/p2/oracle/redo1/lsh1'
DB_CREATE_ONLINE_LOG_DEST_2 = '/u04/oracle/redo2/lsh2'

After the initialization parameters are set, the database can be created using the CREATE DATABASE command. If the command fails, any OMF files created are removed. The internally generated file names can be seen when the user selects from DBA_DATAFILES and V$LOGFILE.
Both DB_CREATE_FILE_DEST and DB_CREATE_ONLINE_LOG_DEST_N can be modified dynamically with the ALTER SYSTEM SET command.

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More