ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Oracle学习系列—Window操作系统下Oracle数据库的手工创建

Oracle学习系列—Window操作系统下Oracle数据库的手工创建

原创 Linux操作系统 作者:bq_wang 时间:2008-02-13 17:24:36 0 删除 编辑

系统环境:
1、操作系统:Windows2003 Server
2、数据库: 
Oracle9i Database 9.2.0.1.0 for Windows 企业版
3、安装路径:C/:ORACLE

步骤:
1、手工创建相关目录
2、手工创建初始化参数文件
3、通过oradim创建一个ORACLE服务
4、创建数据库
5、创建数据库数据文件,执行脚本
6、创建数据字典,运行

安装中的注意事项

ORACLE_SID最好采用标准英文字母,_下划线名称将会导致Ora-12560错误!



安装前的准备工作

1. 确定Oracle实例的名称为wbq

2. 参照相关文档命名Oracle数据库的文件夹名称,最好以实例名称命名

3. 根据应用情况,对初始化参数中的各个参数值进行明确,例如datablocksize,归档模式等等

4. 按照相关文档和实际情况,对数据库的系统表空间、回滚段表空间、临时表空间进行设置。

安装详细步骤

1. 手工创建Oracle数据库相关目录

Microsoft Windows [Version 5.2.3790]

(C) Copyright 1985-2003 Microsoft Corp.

C:/>cd Oracle

C:/oracle>md admin

C:/oracle>cd admin

C:/oracle/admin>md wbq

C:/oracle/admin>cd wbq

C:/oracle/admin/wbq>md bdump

C:/oracle/admin/wbq>md udump

C:/oracle/admin/wbq>md cdump

C:/oracle/admin/wbq>md pfile

C:/oracle/admin/wbq>md create

C:/oracle/admin/wbq>cd ../..

C:/oracle>md oradata

C:/oracle>cd oradata

C:/oracle/oradata>md wbq

C:/oracle/oradata>cd wbq

C:/oracle/oradata/wbq>md archive

2. 手工创建初始化参数文件,并拷贝到默认的文件夹C:/oracle/ora92/database目录下

###################################################

# Copyright (c) 1991, 2001, 2002 by Oracle Corp

###################################################

###########################################

# Cache and I/O

###########################################

db_block_size=8192

db_cache_size=25165824

db_file_multiblock_read_count=16

###########################################

# Cursors and Library Cache

###########################################

open_cursors=300

###########################################

# Database Identification

###########################################

db_domain=""

db_name=wbq

###########################################

# Diagnostics and Statistics

###########################################

background_dump_dest=C:/oracle/admin/wbq/bdump

core_dump_dest=C:/oracle/admin/wbq/cdump

timed_statistics=TRUE

user_dump_dest=C:/oracle/admin/wbq/udump

###########################################

# File Configuration

###########################################

control_files=(
"C:/oracle/oradata/wbq/CONTROL01.CTL", "C:/oracle/oradata/wbq/CONTROL02.CTL",
"C:/oracle/oradata/wbq/CONTROL03.CTL")

###########################################

# Instance Identification

###########################################

instance_name=wbq

###########################################

# Job Queues

###########################################

job_queue_processes=10

###########################################

# MTS

###########################################

# dispatchers="(PROTOCOL=TCP) (SERVICE=wbqXDB)"

###########################################

# Miscellaneous

###########################################

aq_tm_processes=1

compatible=9.2.0.0.0

###########################################

# Optimizer

###########################################

hash_join_enabled=TRUE

query_rewrite_enabled=FALSE

star_transformation_enabled=FALSE

###########################################

# Pools

###########################################

java_pool_size=3355443

large_pool_size=8388608

shared_pool_size=50331648

###########################################

# Processes and Sessions

###########################################

processes=150

###########################################

# Redo Log and Recovery

###########################################

fast_start_mttr_target=300

###########################################

# Security and Auditing

###########################################

remote_login_passwordfile=EXCLUSIVE

###########################################

# Sort, Hash Joins, Bitmap Indexes

###########################################

pga_aggregate_target=25165824

sort_area_size=524288

###########################################

# System Managed Undo and Rollback Segments

###########################################

undo_management=AUTO

undo_retention=10800

undo_tablespace=UNDOTBS1

3. 创建密码文件

C:/>orapwd help

Usage: orapwd file= password= entries=

where

file - name of password file (mand),

password - password for SYS (mand),

entries - maximum number of distinct DBA and OPERs (opt),

There are no spaces around the equal-to (=) character.

C:/>orapwd file=C:/oracle/ora92/database/pwdwbq.ora password=wbq entries=5

4. 创建Oracle服务

C:/oracle/oradata/wbq>set ORACLE_SID=wbq

C:/oracle/oradata/wbq>cd ../../ora92/bin

C:/oracle/ora92/bin>REM 只需要制定实例名称即可

C:/oracle/ora92/bin>oradim -new -sid wbq

5. 创建数据库数据文件、控制文件、日志文件,并根据需要产生undo表空间和临时表空间。

SQL>sqlplus /nolog
SQL>connect SYS/change_on_install as sysdba

SQL>startup nomount

SQL>create database wbq

maxinstances 1

maxloghistory 1

maxlogfiles 5

maxlogmembers 5

maxdatafiles 100

datafile 'C:/Oracle/oradata/wbq/system01.dbf' size 200M reuse autoextend on next 10240K maxsize 32767M extent management local default temporary tablespace

temp tempfile 'C:/Oracle/oradata/wbq/temp01.dbf' size 40M reuse autoextend on next 640K maxsize 32767M undo tablespace "undotbs1"

datafile 'C:/Oracle/oradata/wbq/undotbs01.dbf' size 200M reuse autoextend on next 5129K maxsize 32767M

character set ZHS16GBK

logfile group 1 ('C:/Oracle/oradata/wbq/redo01.log') size 10240K,

group 2 ('C:/Oracle/oradata/wbq/redo02.log') size 10240K,

group 3 ('C:/Oracle/oradata/wbq/redo03.log') size 10240K;

6. 创建数据字典

SQL>@C:/Oracle/ora92/Rdbms/admin/catalog.sql;

SQL>@C:/Oracle/ora92/Rdbms/admin/catexp7.sql

SQL>@C:/Oracle/ora92/Rdbms/admin/catproc.sql

SQL>@C:/Oracle/ora92/Rdbms/admin/caths.sql

7. 更改注册表

[HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/HOME0]

"ORACLE_SID"="wbq"

8. 更改Oracle服务启动方式,并启动数据库

Microsoft Windows [Version 5.2.3790]

(C) Copyright 1985-2003 Microsoft Corp.

C:/>oradim -edit -sid wbq -startmode a

C:/ >net start oracleservicewbq

The OracleServicewbq service is starting.

The OracleServicewbq service was started successfully.

C:/ >lsnrctl start

LSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 18-MAR-2007 07:43:

22

Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.

Starting tnslsnr: please wait...

TNSLSNR for 32-bit Windows: Version 9.2.0.1.0 - Production

Log messages written to C:/oracle/ora92/network/log/listener.log

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bq_wang)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(PORT=1521))

STATUS of the LISTENER

------------------------

Alias LISTENER

Version TNSLSNR for 32-bit Windows: Version 9.2.0.1.0 - Produc

tion

Start Date 18-MAR-2007 07:43:24

Uptime 0 days 0 hr. 0 min. 2 sec

Trace Level off

Security OFF

SNMP OFF

Listener Log File C:/oracle/ora92/network/log/listener.log

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bq_wang)(PORT=1521)))

The listener supports no services

The command completed successfully

C:/ >sqlplus /nolog

SQL*Plus: Release 9.2.0.1.0 - Production on Sun Mar 18 07:44:06 2007

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> connect sys/change_on_install as sysdba

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area 105978600 bytes

Fixed Size 453352 bytes

Variable Size 79691776 bytes

Database Buffers 25165824 bytes

Redo Buffers 667648 bytes

Database mounted.

Database opened.

SQL> quit

Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.1.0 - Production


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/6517/viewspace-145508/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2007-12-07

  • 博文量
    412
  • 访问量
    1106855