Steps for creating a database manually in Oracle

Source: Internet
Author: User

In addition to the built-in DBCA, Oracle can create databases. Another method is to manually create databases, 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_HOME/admin/sample/pfile directory.
We use the sample modification method. The name of the created parameter is initMYNEWDB. ora, which is stored in D:/oracle/ora92.

/Database/initMYNEWDB. 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:/oracle/oradata/MYNEWDB/CONTROL01.CTL ",
"D:/oracle/oradata/MYNEWDB/CONTROL02.CTL ",
"D:/oracle/oradata/MYNEWDB/CONTROL03.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:/oracle/admin/MYNEWDB/bdump
Core_dump_dest = D:/oracle/admin/MYNEWDB/cdump
Timed_statistics = TRUE
User_dump_dest = D:/oracle/admin/MYNEWDB/udump

# 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:/oracle/ora92


/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:/oracle/oradata/mynewdb/system. dbf' size 50 M
Undo tablespace undotbs DATAFILE 'd:/oracle/oradata/mynewdb/undotbs. 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:/oracle/oradata/mynewdb/redo01.log ') size 100 M,
GROUP 2 ('d:/oracle/oradata/mynewdb/redo02.log ') size 100 M,
GROUP 3 ('d:/oracle/oradata/mynewdb/redo03.log ') size 100 M;


When the create database statement is executed, the $ ORACLE_HOME/rdbms/admin/SQL. bsq script is automatically executed to create the SYSTEM


Tablespace and SYSTEM rollback segments, SYS and SYSTEM accounts, basic data dictionary tables, data dictionary indexes, and predefined roles.

  • 1
  • 2
  • Next Page

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.