Manually create an Oracle database in Linux

Source: Internet
Author: User
On the Linux platform, there are several steps to manually create a database: 1. Confirm the unique instance and database name; 2. Select the character set of the database; 3. Set the OS environment variables; 4. Create the initialization parameter file; 5. Start the instance to the nomount state;
6. Execute the create database Command. 7. run at least two script files. test condition description: a database orcl has been created at the beginning of Oracle creation ), here we will create a Kwen database manually. 1. First open putty and switch to Oracle user: Login as: Root
Root@192.168.1.60's password:
Last login: Thu Jan 21 23:27:52 2010 from 192.168.1.2
[Root @ localhost root] # view the current environment variable configuration in Su-Oracle:
[Oracle @ localhost Oracle] $ ENV | grep Oracle
Oracle_sid = orcl
Oracle_base =/opt/Oracle
ORACLE_HOME =/opt/Oracle/10gr2
[Oracle @ localhost Oracle] $ sqlplus/nolog SQL * Plus: Release 10.1.0.3.0-production on Thu Jan 21 23:28:07 2010
Copyright (c) 1982,200 4, Oracle. All rights reserved.
SQL <exit
[Oracle @ localhost Oracle] $ VI env. New racle_base =/opt/Oracle
ORACLE_HOME = $ oracle_base/10gr2
Oracle_sid = Kwen
LD_LIBRARY_PATH = $ ORACLE_HOME/lib
Path = $ path: $ ORACLE_HOME/bin export oracle_base ORACLE_HOME oracle_sid LD_LIBRARY_PATH path
[Oracle @ localhost Oracle] $ chmod 755 env. New

[Oracle @ localhost Oracle] $ ../env. New
[Oracle @ localhost Oracle] $ ENV | grep Oracle
Oracle_sid = Kwen
Oracle_base =/opt/Oracle
ORACLE_HOME =/opt/Oracle/10gr2
[Oracle @ localhost Oracle] $ mkdir-P/opt/Oracle/admin/Kwen/bdump [Oracle @ localhost Oracle] $ mkdir-P/opt/Oracle/admin/Kwen/udump
[Oracle @ localhost Oracle] $ mkdir-P/opt/Oracle/admin/Kwen/cdump
[Oracle @ localhost Oracle] $ mkdir-P/opt/Oracle/oradata/Kwen
Create a database password file [Oracle @ localhost Oracle] $ CD/opt/Oracle/10gr2/dbs
[Oracle @ localhost DBS] $ ls
Initdw. ora initorcl. ora spfileorcl. ora
Orapworcl hc_orcl.dat init. ora lkorcl [Oracle @ localhost DBS] $ orapwd file =/opt/Oracle/10gr2/dbs/orapwkwen Password = admin entries = 10; [Oracle @ localhost DBS] $ ls
Hc_kwen.dat hc_orcl.dat initdw. ora init. ora initorcl. ora lkorcl orapwkwen orapworcl spfileorcl. ora
[Oracle @ localhost DBS] $ CP initorcl. ora initkwen. ora
[Oracle @ localhost DBS] $ cat initorcl. ora
Orcl. _ db_cache_size = 46137344
Orcl. _ Java _pool_size = 8388608
Orcl. _ large_pool_size = 4194304
Orcl. _ shared_pool_size = 41943040
*. Background_dump_dest = '/opt/Oracle/admin/orcl/bdump'
*. Compatible = '10. 1.0.2.0'
*. Control_files = '/opt/Oracle/oradata/orcl/control01.ctl', '/opt/Oracle/oradata/orcl/control02.ctl', '/opt/Oracle/oradata/orcl/control03.ctl'
*. Core_dump_dest = '/opt/Oracle/admin/orcl/cdump'
*. Db_block_size = 8192
*. Db_cache_advice = 'on'
*. Db_cache_size = 37748736
*. Db_domain =''
*. Db_file_multiblock_read_count = 16
*. Db_name = 'orcl'
*. Db_recovery_file_dest = '/opt/Oracle/flash_recovery_area'
*. Db_recovery_file_dest_size = 2147483648
*. Dispatchers = '(Protocol = TCP) (Service = orclxdb )'
*. Job_queue_processes = 10
*. Open_cursors = 300
*. Pga_aggregate_target = 94371840
*. Processses = 150
*. Remote_login_passwordfile = 'clusive'
*. Sga_max_size = 104857600
*. Sga_target = 104857600
*. Shared_pool_size = 37748736
*. Undo_management = 'auto'
*. Undo_tablespace = 'undotbs1'
*. User_dump_dest = '/opt/Oracle/admin/orcl/udump'
[Oracle @ localhost DBS] $ cat initkwen. ora
Kwen. _ db_cache_size = 46137344
Kwen. _ java_pool_size = 8388608
Kwen. _ large_pool_size = 4194304
Kwen. _ shared_pool_size = 41943040
*. Background_dump_dest = '/opt/Oracle/admin/Kwen/bdump'
*. Compatible = '10. 1.0.2.0'
##*. Control_files = '/opt/Oracle/oradata/Kwen/control01.ctl', '/opt/Oracle/oradata/Kwen/control02.ctl', '/opt/Oracle/oradata/Kwen/control03.ctl'
*. Core_dump_dest = '/opt/Oracle/admin/Kwen/cdump'
*. Db_block_size = 8192
*. Db_cache_advice = 'on'
*. Db_cache_size = 37748736
*. Db_domain =''
*. Db_file_multiblock_read_count = 16
*. Db_name = 'kwen'
*. Db_recovery_file_dest = '/opt/Oracle/flash_recovery_area'
*. Db_recovery_file_dest_size = 2147483648
*. Dispatchers = '(Protocol = TCP) (Service = orclxdb )'
*. Job_queue_processes = 10
*. Open_cursors = 300
*. Pga_aggregate_target = 94371840
*. Processses = 150
*. Remote_login_passwordfile = 'clusive'
*. Sga_max_size = 104857600
*. Sga_target = 104857600
*. Shared_pool_size = 37748736
*. Undo_management = 'auto'
*. Undo_tablespace = 'undotbs1'
*. User_dump_dest = '/opt/Oracle/admin/Kwen/udump' replace all orcl with the new Sid: Kwen and comment out a row of the control file. Here you need to create all the specified directories.
[Oracle @ localhost DBS] $ sqlplus/nolog SQL * Plus: Release 10.1.0.3.0-production on Fri Jan 22 00:05:07 2010
Copyright (c) 1982,200 4, Oracle. All rights reserved.
SQL <Conn/As sysdba;
Connected.
SQL <create spfile from pfile; SQL <startup nomount;
Oracle instance started. Total system global area 104857600 bytes
Fixed size 777932 bytes
Variable Size 57680180 bytes
Database buffers 46137344 bytes
Redo buffers 262144 bytes SQL <!
[Oracle @ localhost DBS] $ ls
Hc_kwen.dat hc_orcl.dat initdw. ora initkwen. ora init. ora initorcl. ora lkkwen lkorcl orapwkwen orapworcl spfilekwen. ora spfileorcl. ora
[Oracle @ localhost Kwen] $ VI create. SQL
Create Database Kwen
Controlfile Reuse
Datafile '/opt/Oracle/oradata/Kwen/system1.dbf' size 100 m autoextend on next 100 m maxsize Unlimited
Sysaux datafile '/opt/Oracle/oradata/Kwen/sysaux. dbf' size 100 m reuse autoextend on next 100 m maxsize Unlimited
Default temporary tablespace temp1
Tempfile '/opt/Oracle/oradata/Kwen/temp1.dbf' size 100 m reuse autoextend on next 100 m maxsize Unlimited
Undo tablespace undotbs1
Datafile '/opt/Oracle/oradata/Kwen/undo1.dbf' size 100 m reuse autoextend on next 100 m maxsize Unlimited
Default tablespace Kwen
Datafile '/opt/Oracle/oradata/Kwen. dbf' size 100 m reuse autoextend on next 100 m maxsize Unlimited
Extent management local autoallocate
Logfile
Group 1'/opt/Oracle/oradata/Kwen/redo1.log' size 100 m reuse,
Group 2'/opt/Oracle/oradata/Kwen/redo2.log 'size 100 m reuse,
Group 3 '/opt/Oracle/oradata/Kwen/redo3.log' size 100 m Reuse
Character Set al32utf8
;
[Oracle @ localhost Oracle] $ exit
Exit SQL <Conn/As sysdba;
Connected. SQL <@/opt/Oracle/10gr2/dbs/create. after the SQL statement is executed, run catalog. SQL and cataproc. after the two SQL script files are executed, the database Kwen has been created successfully. SQL <@/opt/Oracle/10gr2/rdbms/admin/CATALOG. sqlsql <@/opt/Oracle/10gr2/rdbms/admin/catproc. SQL has been created successfully. You may encounter many problems during creation. Check the syntax of your script file or the data file already exists (the size is not specified here, you can use the reuse option). Another possibility is that you have insufficient permissions and cannot write data. The main steps are as follows: 1. Write and set a new environment variable script file 2. Create a password file and a parameter file 3. Create an empty directory conforming to ofa 4. Create a script file for the create database 5. Run catalog. SQL and catproc. the SQL script files are good, so it is easy ....

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.