Process for creating an oracle database: Process for creating an oracle database

Source: Internet
Author: User

Process for creating an oracle database: Process for creating an oracle database

Since there is already a database instance in the current environment, this does not affect the creation of a new instance sun

Current System instance

[Oracle @ DBA2 dbs] $ env | grep ORACLE
ORACLE_SID = orcl1
ORACLE_BASE =/u/oracle
ORACLE_HOME =/u/oracle/product/11.2
[Oracle @ DBA2 dbs] $

 

1. First, set the ORACLE_SID of the database to be created.

Export $ ORACLE_SID = sun

 

2. Create a password file for the new instance

Orapwd file = $ ORACLE_HOME/dbs/orapwsun password = oracle entries = 10

 

3. Create an initialization parameter file (pfile)

[Oracle @ DBA2 dbs] $ vi initsun. ora
Db_name = sun
Control_files = '/oradata/sun/control01.ctl'
Sga_target = 250 M
Undo_management = auto
Undo_tablespace = undotbs

The main parameters are db_name, control_files, and sga_target.

 

4. Create instance-related directories (data files, log files, control files, etc)

I put the data files, log files, and control files in a directory. I only use one control file here. Of course, it is recommended that two or three control files be stored in different paths to ensure data file redundancy.

[Oracle @ DBA2 ~] $ Mkdir/oradata/sun

[Oracle @ DBA2 admin] $ mkdir/u/oracle/admin/adump

[Oracle @ DBA2 admin] $ mkdir/u/oracle/admin/bdump

[Oracle @ DBA2 admin] $ mkdir/u/oracle/admin/pfile

 

5. Create a spfile file and start the database to nomount.

SQL> create spfile from pfile;

File created.

SQL> startup nomount
ORACLE instance started.

Total System Global Area 418484224 bytes
Fixed Size 1336932 bytes
Variable Size 281020828 bytes
Database Buffers 130023424 bytes
Redo Buffers 6103040 bytes
SQL>

6. Create a database (with scripts)

Create database sun
User sys identified by oracle
User system identified by oracle
Logfile group 1 ('/oradata/sun/redo01a. log') SIZE 20 M,
GROUP 2 ('/oradata/sun/redo02a. log') SIZE 20 M,
GROUP 3 ('/oradata/sun/redo03a. log') SIZE 20 M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
MAXINSTANCES 2
Character set AL32UTF8
DATAFILE '/oradata/sun/system01.dbf' SIZE 400 M REUSE
EXTENT MANAGEMENT LOCAL
Sysaux datafile '/oradata/sun/sysaux01.dbf' SIZE 400 M REUSE
Default tablespace users
DATAFILE '/oradata/sun/users01.dbf' SIZE 20 M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
Default temporary tablespace tempts01
TEMPFILE '/oradata/sun/tempts01.dbf' SIZE 20 M REUSE
Undo tablespace undotbs
DATAFILE '/oradata/sun/undotbs01.dbf' SIZE 200 M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
/

 

7. Execute relevant data dictionary attempts

@? /Rdbms/admin/catalog. SQL
@? /Rdbms/admin/catproc. SQL
@? /Sqlplus/admin/pupbld. SQL

 

OK. Now the manual creation of the Oracle database is complete. The experiment proves that manual database creation is easier and faster than DBCA database creation, and the basic process is divided into the above steps.

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.