Manually create a database on RedHat5

Source: Internet
Author: User
In Linux, we can create a database through dbca, but we can also create a database in command line mode. Let's talk about its method 1, first, check the name of the database we want to create [Oracle @ oracle ~]. $ Echo $ ORACLE_SIDorcl if not set, you can set exportORACLE_SID = orcl2 as follows. First, create an instance parameter file (pfile) named pfileorcl. ora # vim $

In Linux, we can use dbca to create a database, but we can also create a database in command line mode. The following describes how to create a database.

1. First, check the following database name.

[Oracle @ oracle ~] $ Echo $ ORACLE_SID
Orcl
If not set, you can make the following settings:
Export ORACLE_SID = orcl

2. Create an instance parameter file (pfile) named pfileorcl. ora.
# Vim $ ORACLE_HOME/dbs/pfileorcl. ora enter the following content in it:
Db_name = orcl
Db_domain = example.com
Db_files = 1000
Processes = 600
Statistics_level = typical
DB _ block_size = 8192
Audit_trail = none
Background_dump_dest = '/u01/app/admin/orcl/bdump'
Core_dump_dest = '/u01/app/admin/orcl/adump'
Control_files = ('/u02/oradata/orcl/control01.ctl ',
'/U02/oradata/orcl/control02.ctl', '/u02/oradata/orcl/control03.ctl ')
Sga_target = 400 M
Pga_aggregate_target = 400 M
Db_file_multiblock_read_count = 16
Log_archive_format = 'Log % t _ % s _ % r. arc'
Optimizer_mode = all_rows
Remote_login_passwordfile = none
Undo_management = auto
Undo_retention = 7200

3. create necessary Directories
# Mkdir-pv/u01/app/admin/orcl/{adump, bdump, dbump}
Mkdir: created directory '/u01/app/admin'
Mkdir: created directory '/u01/app/admin/orcl'
Mkdir: created directory '/u01/app/admin/orcl/adump'
Mkdir: created directory '/u01/app/admin/orcl/bdump'
Mkdir: created directory '/u01/app/admin/orcl/dbump'
Change their Permissions
# Chmod 775-Rv/u01/app/admin/
Mode of '/u01/app/admin/' changed to 0775 (rwxrwxr-x)
Mode of '/u01/app/admin/orcl' changed to 0775 (rwxrwxr-x)
Mode of '/u01/app/admin/orcl/adump' changed to 0775 (rwxrwxr-x)
Mode of '/u01/app/admin/orcl/bdump' changed to 0775 (rwxrwxr-x)
Mode of '/u01/app/admin/orcl/dbump' changed to 0775 (rwxrwxr-x)
Change their master Group
# Chown oracle: oinstall-Rv/u01/app/admin/
Changed ownership of '/u01/app/admin/orcl/adump' to oracle: oinstall
Changed ownership of '/u01/app/admin/orcl/bdump' to oracle: oinstall
Changed ownership of '/u01/app/admin/orcl/dbump' to oracle: oinstall
Changed ownership of '/u01/app/admin/orcl' to oracle: oinstall
Changed ownership of '/u01/app/admin/' to oracle: oinstall
# Mkdir/u02/oradata/orcl
# Mkdir/u02/oradata/orcl/arch-pv
Mkdir: created directory '/u02/oradata/orcl'
# Chmod 775-Rv/u02/oradata/orcl/
Mode of '/u02/oradata/orcl/' changed to 0775 (rwxrwxr-x)
Mode of '/u02/oradata/orcl/arch' changed to 0775 (rwxrwxr-x)
# Chown oracle: oinstall-Rv/u02/oradata/orcl/
Changed ownership of '/u02/oradata/orcl/' to oracle: oinstall

3. Create a spfile file.
$ Sqlplus/as sysdba
SQL * Plus: Release 10.2.0.1.0-Production on Thu Mar 25 20:46:42 2010
Copyright (c) 1982,200 5, Oracle. All rights reserved.
Connected to an idle instance.
SQL> create SPFILE = '/u01/app/oracle/product/10.2.0/db_1/dbs/spfileorcl. ora 'from PFILE = '/u01/app/oracle/product/10.2.0/db_1/dbs/pfileorcl. ora ';
File created.

4. Enable the instance and do not mount the database
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 419430400 bytes
Fixed Size 1219736 bytes
Variable Size 121635688 bytes
Database Buffers 289406976 bytes
Redo Buffers 7168000 bytes

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.