Detailed steps for manual database creation in Oracle

Source: Internet
Author: User

Here we will introduce several steps to manually create a database in Oracle, including preparation and implementation.
AD:
Manual database creation in Oracle is the focus of this Article. We hope this article will help you better use Oracle.

In addition to the built-in DBCA, Oracle can create databases. Another method is to manually create databases in Oracle, which must be mastered by DBAs. The following describes how to manually create a database:
To manually create a database, follow these steps:
1. Confirm the new database name and Instance name;
2. Determine the authentication method of the database administrator;
3. Create an initialization parameter file;
4. Create an instance;
5. Connect and start the instance;
6. Use the create database statement to create a database;
7. Create additional tablespaces;
8. Run the script to create a data dictionary view;
The following describes how to create a database named "MYNEWDB ".
1. Determine the Database Name and Instance name;
DB_NAME = MYNEWDB
SID = MYNEWDB
2. Determine the authentication method of the database administrator;
The Administrator authentication methods include operating system authentication and password authentication. In this example, operating system authentication is used.
3. Create an initialization parameter file;
The initialization parameter sample file provided by Oracle is located in initsmpl. ora in the $ ORACLE_HOMEadminsamplepfile directory.
We use the sample modification method. The name of the created parameter is initMYNEWDB. ora, which is stored in D: oracleora92.
DatabaseinitMYNEWDB. ora. The main content is set as follows:
# Sharing server settings
Dispatchers = "(PROTOCOL = TCP) (SERVICE = MYNEWDBXDB)
# Database instance name settings
Instance = MYNEWDB
# Security and audit settings
Remote_login_passwordfile = EXCLUSIVE
# Sorting area size setting
Pga_aggregate_target = 25165824
Sort_area_size = 524288
# Global Database Name settings
Db_domain = ""
Db_name = MYNEWDB
# Control File Settings
Control_files = ("D: oracleoradataMYNEWDBCONTROL01.CTL ",
"D: oracleoradataMYNEWDBCONTROL02.CTL ",
"D: oracleoradataMYNEWDBCONTROL03.CTL ")
# SGA zone settings
Java _ pool_size = 33554432
Large_pool_size = 8388608
Shared_pool_size = 50331648
# Cursor and database cache settings
Open_cursors = 300
# Rollback segments and tablespace revocation settings
Undo_management = AUTO
Undo_retention = 10800
Undo_tablespace = UNDOTBS
# Diagnosis and tracking information settings
Background_dump_dest = D: oracleadminMYNEWDBdump
Core_dump_dest = D: oracleadminMYNEWDBcdump
Timed_statistics = TRUE
User_dump_dest = D: oracleadminMYNEWDBudump
# User process settings
Processes = 150
# Buffer and database size settings
DB _ block_size = 8192
DB _ cache_size = 25165824
Db_file_multiblock_read_count = 16
4. Create an instance
Select "program --> Run" and enter the "cmd" command to open the DOS interface.
(1) set the environment variable ORACLE_SID to "MYNEWDB"
C: SET ORACLE_SID = MYNEWDB
(2) Use the ORADIM command to create a MYNEWDB Database
C: ORADMIN-NEW-sid mynewdb-intpwd mynewdb-startmode manual-pfile d: oracleora92
Database
Note: ORADMIN is a tool provided by Oracle for instance management. You can create, modify, delete, start, and close an instance.
Instance, run the C: oradmin help command to view the usage of this command
5. Connect and start the instance
C: sqlplus/nolog
SQL> connect sys/mynewdb as sysdba;
SQL> startup nomount;
6. Use the create database statement to create a database
SQL> CREATE DATABASE MYNEWDB
MAXINSTANCES 1
MAXLOGHISTORY 1
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXDATAFILES 100
Datafile d: oracleoradatamynewdbsystem. dbf size 50 M
Undo tablespace undotbs datafile d: oracleoradatamynewdbundotbs. dbf size 50 M
Autoextend on next 5120 K MAXSIZE UNLIMITED
Default temporary tablespace tempts
Character set US7ASCII
National character set AL16UTF16
Logfile group 1 (D: oracleoradatamynewdbedo01.log) size 100 M,
GROUP 2 (D: oracleoradatamynewdbedo02.log) size 100 M,
GROUP 3 (D: oracleoradatamynewdbedo03.log) size 100 M;
When the create database statement is executed, the $ ORACLE_HOMEdbmsadminsql.bsq script is automatically executed, create SYSTEM tablespace and SYSTEM rollback segments, create SYS and SYSTEM accounts, create basic data dictionary tables, create data dictionary indexes, and create predefined roles.
7. Create additional tablespace
The database created using the create database statement contains only the SYSTEM, UNDOTBS, and TEMPTBS tablespaces.
Some extra tablespaces
SQL> create tablespace users
Datafile d: oracleoradatamynewdbusers01.dbf size 100 M
Reuse autoextend on next 1280 K maxsize unlitited
Extend management local;
SQL> create tablespace index
Datafile d: oracleoradatamynewdbindex01.dbf size 100 M
Reuse autoextend on next 1280 K maxsize unlimited
Extend management local;
8. Run the script to create a data dictionary view.
Execute two script statements:
---- Create a data dictionary view, including the V $ dynamic performance view and their synonyms, and assign the PUBLIC role to these Synonyms
Word access permission
SQL> @ D: oracleora92dbmsadmincatalog. SQL;
---- Used to establish support for PL/SQL Program Design
SQL> @ D: oracleora92dbmsadmincatproc. SQL;
9. Create a server initialization parameter file
SQL> create spfile from file = d: oracleora92databaseinitMYNEWDB. ora;
Run this statement to create a server initialization parameter file named spfileMYNEWDB. ora under the $ ORACLE_HOMEdatabase directory.
Need to restart Database
SQL> shutdown immediate;
SQL> connect sys/mynewdb as sysdba;
SQL> startup

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.