top of page
exrunifilbulink

Create Database In Sqlplus: Tips And Tricks To Master The Oracle Tool



Using an Initial DatabaseMigrating an Older Version of the DatabaseDatabase creation prepares several operating system files so they can work together as an Oracle database. You need only create a database once, regardless of how many datafiles it has or how many instances access it. Creating a database can also erase information in an existing database and create a new database with the same name and physical structure.




Create Database In Sqlplus




creating information structures that Oracle requires to access and use the database (the data dictionary)creating and initializing the control files and redo log files for the databaseConsider the following issues before you create a database:


Plan how to protect your new database, including the configuration of its online and archived redo log (and how much space it will require), and a backup strategy.Select the database character set. You must specify the database character set when you create the database. After the database is created, you cannot change the character set choices without re-creating the database. Hence, it is important that you carefully consider which character set(s) to use. All character data, including data in the data dictionary, is stored in the database character set. If users access the database using a different character set, the database character set should be the same as, or a superset of, all character sets they use.Also become familiar with the principles and options of starting up and shutting down an instance, mounting and opening a database, and using parameter files.


sufficient memory to start the Oracle instancesufficient disk storage space for the planned database on the computer that executes Oracle Using an Initial DatabaseDepending on your operating system, a database might have been created automatically as part of the installation procedure for Oracle. You can use this initial database and customize it to meet your information management requirements, or discard it and create one or more new databases to replace it.


Creating a Database: ExampleTroubleshooting Database CreationDropping a Database Steps for Creating an Oracle DatabaseThese steps, which describe how to create an Oracle database, should be followed in the order presented.


Create parameter files.Edit new parameter files.Check the instance identifier for your system.Start SQL*Plus and connect to Oracle as SYSDBA.Start an instance.Create the database.Back up the database.See Also: These steps provide general information about database creation on all operating systems. See your operating system-specific Oracle documentation for information about creating databases on your platform.


Note:In distributed processing environments, Enterprise Manager is often executed from a client machine of the network. If a client machine is being used to execute Enterprise Manager and create a new database, you need to copy the new parameter file (currently located on the computer executing Oracle) to your client workstation. This procedure is operating system dependent. For more information about copying files among the computers of your network, see your operating system-specific Oracle documentation.


creates the control files for the databasecreates the redo log files for the databasecreates the SYSTEM tablespace and the SYSTEM rollback segmentcreates the data dictionarycreates the users SYS and SYSTEMspecifies the character set that stores data in the databasemounts and opens the database for useWARNING:Make sure that the datafile and redo log file names that you specify do not conflict with files of another database. See Also: You can also create a database with a locally managed SYSTEM tablespace; for more information, see "Creating a Database with a Locally Managed SYSTEM Tablespace" .


The SYSTEM tablespace of the new database is comprised of one 10 MB datafile named TEST_SYSTEM.The new database has two online redo log groups, each containing two 500 KB members.The new database does not overwrite any existing control files specified in the parameter file.Note:You can set several limits during database creation. Some of these limits are also subject to superseding limits of the operating system and can affect each other. For example, if you set MAXDATAFILES, Oracle allocates enough space in the control file to store MAXDATAFILES filenames, even if the database has only one datafile initially; because the maximum control file size is limited and operating system-dependent, you might not be able to set all CREATE DATABASE parameters at their theoretical maximums. See Also: For more information about setting limits during database creation, see the Oracle8i SQL Reference.


CONTROL_FILESDB_BLOCK_SIZEPROCESSESROLLBACK_SEGMENTSLicense ParametersDB_BLOCK_BUFFERSLICENSE_MAX_SESSIONS and LICENSE_SESSIONS _WARNINGLICENSE_MAX_USERS DB_NAME and DB_DOMAINA database's global database name (name and location within a network structure) is created by setting both the DB_NAME and DB_DOMAIN parameters before database creation. After creation, the database's name cannot be easily changed. The DB_NAME parameter determines the local name component of the database's name, while the DB_DOMAIN parameter indicates the domain (logical location) within a network structure. The combination of the settings for these two parameters should form a database name that is unique within a network. For example, to create a database with a global database name of TEST.US.ACME.COM, edit the parameters of the new parameter file as follows:


Place each control file on a separate physical disk drives by fully specifying filenames that refer to different disk drives for each filename.Note:The file specification for control files is operating system-dependent. Regardless of your operating system, always fully specify filenames for your control files. When you execute the CREATE DATABASE statement (in Step 7), the control files listed in the CONTROL_FILES parameter of the parameter file will be created.


The operating system that runs Oracle uses a small operating system block size. For example, if the operating system block size is 1K and the data block size matches this, Oracle may be performing an excessive amount of disk I/O during normal operation. For best performance in this case, a database block should consist of multiple operating system blocks.Each database's block size is set during database creation by the initialization parameter DB_BLOCK_SIZE. The block size cannot be changed after database creation except by re-creating the database. If a database's block size is different from the operating system block size, make the database block size a multiple of the operating system's block size.


Note:This mechanism assumes that each person accessing the database has a unique user name and that no people share a user name. Therefore, so that named user licensing can help you ensure compliance with your Oracle license agreement, do not allow multiple users to log in using the same user name.


Choosing the Number of DB_BLOCK_LRU_LATCHESDistributing I/O Allocating Rollback SegmentsProper allocation of rollback segments makes for optimal database performance. The size and number of rollback segments required for optimal performance depends on your application. Oracle8i Tuning contains some general guidelines for choosing how many rollback segments to allocate based on the number of concurrent transactions on your Oracle server. These guidelines are appropriate for most application mixes.


If you use the CREATE DATABASE statement, you must complete additional actions before you have an operational database. These actions include building views on the data dictionary tables and installing standard PL/SQL packages. You perform these actions by running the supplied scripts.


The instructions in this section apply to single-instance installations only. Refer to the Oracle Real Application Clusters (Oracle RAC) installation guide for your platform for instructions for creating an Oracle RAC database.


ORACLE_SID is used to distinguish this instance from other Oracle Database instances that you may create later and run concurrently on the same host computer. The maximum number of characters for ORACLE_SID is 12, and only letters and numeric digits are permitted. On some platforms, the SID is case-sensitive.


For example, on most platforms, ORACLE_SID and ORACLE_HOME must be set. In addition, it is advisable to set the PATH variable to include the ORACLE_HOME/bin directory. On the UNIX and Linux platforms, you must set these environment variables manually. On the Windows platform, OUI automatically assigns values to ORACLE_HOME and ORACLE_SID in the Windows registry. If you did not create a database upon installation, OUI does not set ORACLE_SID in the registry, and you will have to set the ORACLE_SID environment variable when you create your database later.


To be authenticated with a password file, create the password file as described in "Creating and Maintaining a Password File". To be authenticated with operating system authentication, ensure that you log in to the host computer with a user account that is a member of the appropriate operating system user group. On the UNIX and Linux platforms, for example, this is typically the dba user group. On the Windows platform, the user installing the Oracle software is automatically placed in the required user group.


When an Oracle instance starts, it reads an initialization parameter file. This file can be a text file, which can be created and modified with a text editor, or a binary file, which is created and dynamically modified by the database. The binary file, which is preferred, is called a server parameter file. In this step, you create a text initialization parameter file. In a later step, you create a server parameter file from the text file.


Strongly recommended. If not provided, the database instance creates one control file in the same location as the initialization parameter file. Providing this parameter enables you to multiplex control files. See "Creating Initial Control Files" for more information. 2ff7e9595c


1 view0 comments

Recent Posts

See All

Comments


Catering Service

bottom of page