ORACLE 11G hand-built library

Source: Internet
Author: User
Tags sqlplus

First step: Catalog

-- Database Files directory

$ cd $ORACLE _base/oradata

$ ls

-- When you see a library that already exists SID

PROD

$ pwd

-- Take a look at the absolute path

/u01/app/oracle/oradata

$ mkdir HYL

$ ls-l

-- production look at the directory and permissions

-- plan the different disk directories where the data files are stored, depending on the situation

$ CD HYL

$ mkdir Dump Disk1 disk2 disk3 disk4 disk5

--disk represents a different disk, which is for file diversification preparation

$ CD Dump

$ mkdir bdump cdump udump

-- three directories were created for different Dump file

Step Two: Permissions

$ chown-r Oracle:oinstall/u01/app/oracle/oradata/hyl

-- The previous step was created HYL Catalog assigned to Oracle User

-- the file path in the above, Dump The file path should be in this directory, in the case of the correct permissions to complete the building of the library

$ chmod–r 755 HYL

-- Give HYL access permissions, permission levels for the directory 755

Step Three: Initialize parameters

-- This step is to complete the initialization of the parameter file creation

$ cd $ORACLE _home/dbs

-- in this directory to hold the database initialization parameter file, we need to create in this directory a Pfile file

$ VI Inithyl.ora

-- Initialize parameter name is Init Plus SID

memory_target=900m

--11g , memory management will PGA and the SGA with Memory_target This one parameter is represented

-- here is the data name, initially planned as SID name

Db_name=hyl

-- The following is the control file path, it is recommended that the control files under different paths are named with the same name

Control_files= '/u01/app/oracle/oradata/hyl/disk1/control01.ctl ',

'/u01/app/oracle/oradata/hyl/disk2/control01.ctl ',

'/u01/app/oracle/oradata/hyl/disk3/control01.ctl '

-- Below is undo Table Space Information

Undo_management=auto

Undo_tablespace=undotbs

-- Below is Dump file

Diagnostic_dest=/u01/app/oracle/oradata/prod/dump

-- compared to 10G , for Udump , Bdump , Cdump Path in 11G in Unity for a

Fourth Step: Start the library to the nomount State

$export oracle_sid=hyl

$sqlplus '/as sysdba '

sql> startup Nomount;

Fifth Step: Writing database statements with official documentation

-- Delete some unnecessary settings based on the actual modification script.

-- diversity of log Group members

CREATE DATABASE HYL

LOGFILE GROUP 1 ('/u01/app/oracle/oradata/hyl/disk1/redo01a.log ',

'/u01/app/oracle/oradata/hyl/disk2/redo01b.log ')

SIZE 100M BLOCKSIZE 512,

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

'/u01/app/oracle/oradata/hyl/disk2/redo02b.log ')

SIZE 100M BLOCKSIZE 512,

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

'/u01/app/oracle/oradata/hyl/disk2/redo03b.log ')

SIZE 100M BLOCKSIZE 512

CHARACTER SET ZHS16GBK

National CHARACTER SET AL16UTF16

EXTENT MANAGEMENT LOCAL

DataFile '/u01/app/oracle/oradata/hyl/disk3/system01.dbf ' SIZE 325M reuse

Sysaux datafile '/u01/app/oracle/oradata/hyl/sysaux01.dbf ' SIZE 325M reuse

DEFAULT tablespace Users

DataFile '/u01/app/oracle/oradata/hyl/disk3/users01.dbf '

SIZE 500M Reuse autoextend on MAXSIZE UNLIMITED

DEFAULT Temporary tablespace tempts1

Tempfile '/u01/app/oracle/oradata/hyl/disk4/temp01.dbf '

SIZE 20M Reuse

UNDO tablespace Undotbs

DataFile '/u01/app/oracle/oradata/hyl/disk5/undotbs01.dbf '

SIZE 200M Reuse autoextend on MAXSIZE UNLIMITED;

-- Place the above script in the Oracle directory, and then execute the

$CD/u01/app/oracle/

$vi createdb.sh

Sql> @/u01/app/oracle/createdb.sh

Sixth step: Run the corresponding script

Sql> @?/rdbms/admin/catalog.sql

-- about 2 minutes, Function: Create a data dictionary

Sql> @?/rdbms/admin/catproc.sql

-- about 5 minutes, after running through these two scripts, the library has been built, the role: creating Stored procedures and packages

Sql> Conn System/manager

Sql> @?/sqlplus/admin/pupbld.sql

-- about 1 minutes, to Conn System/manager Run this script function: Set Some packages of sqlplus so that other users can log in sqlplus

Sql> Conn/as SYSDBA

sql> Select Instance_name,status from V$instance; -- Check the status, the database should be open State at this time

ORACLE 11G hand-built library

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.