ORACLE 10G hand-built library

Source: Internet
Author: User
Tags sqlplus

Original works, from the "Blue Blog" blog, Welcome to reprint, please be sure to indicate the following sources, otherwise, the legal responsibility to pursue copyright.

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

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

sga_target=400m   -The total memory allocation size is 80% of physical memory, with the SGA accounting for 80% (representing sga:pga=4:1 relationship)-The following is the data name, initially planned as the SID name Db_name= hyl--The following is the control file path, it is recommended that the control files under different paths 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 '--the following is the undo Tablespace information Undo_ management=autoundo_tablespace=undotbs--Below is a three dump file user_dump_dest=/u01/app/oracle/oradata/hyl/dump/ udumpbackground_dump_dest=/u01/app/oracle/oradata/hyl/dump/bdumpcore_dump_dest=/u01/app/oracle/oradata/hyl/ Dump/cdump

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

--Modify the path information according to the actual situation

CREATE DATABASE HYL

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

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

SIZE 100M,

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

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

SIZE 100M,

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

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

SIZE 100M

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 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

Seventh step: Optimization after building the library

To avoid the creation of additional users and objects, for the expropriation of system tablespace, a new user table space is created by default for other new users. Because the data dictionary is stored in the system table space, it is placed in the system table space by default when a new user or object is created, which has a certain effect on the performance of the database.

This problem can actually be solved at the beginning of the library script, but due to the reference statement given in the official documentation, this is wrong, so we will create the default tablespace after the library is built. In 11G , this issue is addressed in the references provided in the official documentation.

(You can see the article:???????????????????????????????????? )

Sql> Create tablespace users datafile '/u01/app/oracle/oradata/hyl/disk3/user01.dbf ' size 100m autoextend on next 50m m Axsize Unlimited;

-- Create a new table space as the default tablespace using

sql> ALTER DATABASE default tablespace users;

-- Change the default table space for the database to Users Table Space


This is done by hand-built libraries.

Original works, from the "Blue Blog" blog, Welcome to reprint, please be sure to indicate the following sources, otherwise, the legal responsibility to pursue copyright.

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

ORACLE 10G hand-built library

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.