Manually create an Oracle database in linux

Source: Internet
Author: User
On the linux platform, manually create a database (Oracle10g). After installing the Oracle software, you can use manual database creation to train your abilities and understand the whole process of database creation. The steps are as follows: 1. Create an Oracle SID. If you log on to linux as a user in the dba group to view the data in the main directory. this variable is already set in the bash_profile file.

On the linux platform, manually create a database (Oracle 10 Gb). After installing the Oracle software, you can use manual database creation to train your capabilities and understand the whole process of database creation. The steps are as follows: 1. Create an Oracle SID. If you log on to linux as a user in the dba group to view the data in the main directory. this variable is already set in the bash_profile file.

On the linux platform, manually create a database (Oracle 10 Gb). After installing the Oracle software, you can use manual database creation to train your capabilities and understand the whole process of database creation. The steps are as follows:

1. Create an Oracle SID. If you log on to linux as a user in the dba group to view the data in the main directory. this variable is already set in the bash_profile file. If multiple Oracle instances are running on one server, you also need to set export ORACLE_SID = myoral

You can also set it in a single file and execute this file to make all environment variables related to Oracle take effect.

Create a directory named param_myorcl.env

ORACLE_HOME = $ ORACLE_HOME (if you have created an Oracle database before, you can directly use the previously set. Otherwise, you can set it to the upper-level directory of the bin to the directory where Oracle is installed)

OACLE_SID = myorcl

PATH = $ ORACLE_HOME/bin: $ PATH

LD_LIBRARY_PATH = $ ORACLE_HOME/bin: $ LD_LIBRARY_PATH

TNS_ADMIN = $ ORACLE_HOME/network/admin

Export ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH TNS_ADMIN

You can execute "../param_myorcl.env" to make the setting take effect, but this method is temporary. Otherwise, you can directly change. bash_profile to make it take effect permanently.

2. Create pfile, create spfile Based on pfile, and use spfile to generate database instances (recommended by Oracle, although pfile can also be used to create database instances)

Method 1: If a database already exists on the server, you can create a pfile file through create pfile from spfile and then cp initorcl in the $ ORACLE_HOME/dbs/directory. ora initmyorcl. ora, copy one and then modify initmyorcl.

Method 2: strings spfileorcl. ora> initmyorcl. ora (replace the command % s/orcl/myorcl/g on linux to be modified)

Method 3: Make a change online.

After creating a pfile, check whether the environment variable "env | grep ORA" takes effect"

If it takes effect, you can start the Oracle instance. After it is started, you can create a spfile Based on pfile.

Create spfile from pfile;

3. Write the database creation script myorcl. SQL.

Spool on
Create database myorcl
MAXINSTANCES 1
MAXLOGHISTORY 1
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXDATAFILES 100
National character set AL16UTF16
DATAFILE
'/U01/oracle/oradata/myorcl/system01.dbf' size 100 m reuse autoextend on next 1 m maxsize unlimited extent management

Local
Sysaux datafile
'/U01/oracle/oradata/myorcl/sysaux01.dbf' size 100 m reuse autoextend on next 1 m maxsize unlimited
Default temporary tablespace TEMP tempfile
'/U01/oracle/oradata/myorcl/temp01.dbf' size 20 m reuse autoextend on next 640 k maxsize unlimited
Undo tablespace UNDOTBS1 datafile
'/U01/oracle/oradata/myorcl/undo01.dbf' size 20 m reuse autoextend on next 5 M maxsize unlimited
Logfile
GROUP 1 ('/u01/oracle/oradata/myorcl/redo1.dbf') size 10 m,
GROUP 2 ('/u01/oracle/oradata/myorcl/redo2.dbf') size 10 m,
GROUP 3 ('/u01/oracle/oradata/myorcl/redo3.d

;

Spool off

4. Create a database

@ $ ORACLE_HOME/dbs/myorcl. SQL

5. Create a database data dictionary

Spool log1.log

@? /Rdbms/admin/catalog. SQL

@? /Rdbms/admin/catproc. SQL

@? /Sqlplus/admin/pupbld. SQL

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.