ORACLE 11G manual database creation, oracle11g manual database creation

Source: Internet
Author: User

ORACLE 11G manual database creation, oracle11g manual database creation

 Original Works are from the blog of "Deep Blue blog". You are welcome to reprint them. Please note the following source when reprinting them. Otherwise, you will be held legally liable for copyright.

Deep Blue blog: http://blog.csdn.net/huangyanlong/article/details/43926437

 

Step 1: Directory

-- Database file directory

$ Cd $ ORACLE_BASE/oradata

$ Ls

-- View the SID of an existing database

PROD

$ Pwd

-- Check the absolute path.

/U01/app/oracle/oradata

$ Mkdir HYL

$ Ls-l

-- Production: Check the Directory and permissions

-- Plan different disk directories for storing data files. The plan here depends on the actual situation.

$ Cd HYL

$ Mkdir dump disk1 disk2 disk3 disk4 disk5

-- Disk indicates different disks, which are used to prepare for file diversification.

$ Cd dump

$ Mkdir bdump cdump udump

-- Three directories are created for different dump files.

 

Step 2: Permission

$ Chown-R oracle: oinstall/u01/app/oracle/oradata/HYL

-- Grant the HYL directory created in the previous step to the oracle user

-- The above file path and dump file path should all be in this directory, and the database creation can be completed only when the permission is correct

$ Chmod-R 755 HYL

-- Grant the access permission to the HYL directory. The permission level is 755.

 

Step 3: Initialize Parameters

-- In this step, the initialization parameter file must be created.

$ Cd $ ORACLE_HOME/dbs

-- Store the initialization parameter file of the database in this directory. We need to create a pfile file in this directory.

$ Vi initHYL. ora

-- The initialization parameter is named init and SID.

In memory_target = 900M--11G, the memory management uses the parameter memory_target to represent pga and sga. The following is the data name. The initial plan is the SID Name db_name = HYL. The following is the control file path, it is recommended that the control files in different paths be named control_files = '/u01/app/oracle/oradata/HYL/disk1/control01.ctl' with the same name ', '/u01/app/oracle/oradata/HYL/disk2/control01.ctl ', '/u01/app/oracle/oradata/HYL/disk3/control01.ctl' -- below is the undo tablespace information undo_management = autoundo_tablespace = undotbs -- below is the dump file diagnostic_dest =/u01/app/oracle /oradata/PROD/dump -- compared to 10 Gb, the udump, bdump, and cdump paths are unified to one
Step 4: Start the database to nomount

$ Export ORACLE_SID = HYL

$ Sqlplus '/as sysdba'

SQL> startup nomount;

Step 5: Compile database creation statements using official documents

For more information, see:Http://blog.csdn.net/huangyanlong/article/details/43925909

-- Delete unnecessary settings based on the actual modification script

-- Diversity of log group members

-- Modify path information

CREATE DATABASE HYL

Logfile group 1 ('/u01/app/oracle/oradata/HYL/disk1/redo01a. log ',

'/U01/app/oracle/oradata/HYL/disk2/redo01b. log ')

SIZE 100 m blocksize 512,

GROUP 2 ('/u01/app/oracle/oradata/HYL/disk1/redo02a. log ',

'/U01/app/oracle/oradata/HYL/disk2/redo02b. log ')

SIZE 100 m blocksize 512,

GROUP 3 ('/u01/app/oracle/oradata/HYL/disk1/redo03a. log ',

'/U01/app/oracle/oradata/HYL/disk2/redo03b. log ')

SIZE 100 m blocksize 512

Character set zhs16gbk

National character set AL16UTF16

EXTENT MANAGEMENT LOCAL

DATAFILE '/u01/app/oracle/oradata/HYL/disk3/system01.dbf' SIZE 325 M REUSE

Sysaux datafile '/u01/app/oracle/oradata/HYL/sysaux01.dbf' SIZE 325 M REUSE

Default tablespace users

DATAFILE '/u01/app/oracle/oradata/HYL/disk3/users01.dbf'

SIZE 500 M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED

 

Default temporary tablespace tempts1

TEMPFILE '/u01/app/oracle/oradata/HYL/disk4/temp01.dbf'

SIZE 20 M REUSE

Undo tablespace undotbs

DATAFILE '/u01/app/oracle/oradata/HYL/disk5/undotbs01.dbf'

SIZE 200 m reuse autoextend on maxsize unlimited;

-- Place the preceding script in the oracle directory and execute

$ Cd/u01/app/oracle/

$ Vi createDB. sh

SQL> @/u01/app/oracle/createDB. sh

 

Step 6: run the script

SQL> @? /Rdbms/admin/catalog. SQL

-- About 2 minutes. function: create a data dictionary

SQL> @? /Rdbms/admin/catproc. SQL

-- In about 5 minutes, the database has been created after the two scripts are run. Role: Create a stored procedure and Package

SQL> conn system/manager

SQL> @? /Sqlplus/admin/pupbld. SQL

-- Run this script with conn system/manager in about 1 minute: set some packages of sqlplus so that other users can log on to sqlplus.

SQL> conn/as sysdba

SQL> select instance_name, status from v $ instance;--Check the status. The database should be open.

 

 Original Works are from the blog of "Deep Blue blog". You are welcome to reprint them. Please note the following source when reprinting them. Otherwise, you will be held legally liable for copyright.

Deep Blue blog: http://blog.csdn.net/huangyanlong/article/details/43926437

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.