ITPub博客

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

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

原创 Linux操作系统 作者:tolywang 时间:2007-03-19 00:00:00 0 删除 编辑
系统环境:
1、操作系统:Windows2003 Server
2、数据库: Oracle9i Database 9.2.0.1.0 for Windows 企业版
3、安装路径:C:ORACLE

比较简单,但还是整了一整天,原来ORACLE_SID不能有_下划线,郁闷,



步骤:
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:oracleadmin>md wbq
C:oracleadmin>cd wbq
C:oracleadminwbq>md bdump
C:oracleadminwbq>md udump
C:oracleadminwbq>md cdump
C:oracleadminwbq>md pfile
C:oracleadminwbq>md create
C:oracleadminwbq>cd ....
C:oracle>md oradata
C:oracle>cd oradata
C:oracleoradata>md wbq
C:oracleoradata>cd wbq
C:oracleoradatawbq>md archive

2. 手工创建初始化参数文件,并拷贝到默认的文件夹C:oracleora92database目录下
##############################################################################
# Copyright (c) 1991, 2001, 2002 by Oracle Corporation
##############################################################################

###########################################
# 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:oracleadminwbqbdump
core_dump_dest=C:oracleadminwbqcdump
timed_statistics=TRUE
user_dump_dest=C:oracleadminwbqudump

###########################################
# File Configuration
###########################################
control_files=("C:oracleoradatawbqCONTROL01.CTL","C:oracleoradatawbqCONTROL02.CTL","C:oracleoradatawbqCONTROL03.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:oracleora92databasepwdwbq.ora password=wbq entries=5

4. 创建Oracle服务
C:oracleoradatawbq>set ORACLE_SID=wbq
C:oracleoradatawbq>cd ....ora92bin
C:oracleora92bin>REM 只需要制定实例名称即可
C:oracleora92bin>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:Oracleoradatawbqsystem01.dbf' size 200M reuse autoextend on next 10240K maxsize 32767M extent management local default temporary tablespace
temp tempfile 'C:Oracleoradatawbqtemp01.dbf' size 40M reuse autoextend on next 640K maxsize 32767M undo tablespace "undotbs1"
datafile 'C:Oracleoradatawbqundotbs01.dbf' size 200M reuse autoextend on next 5129K maxsize 32767M
character set ZHS16GBK
logfile group 1 ('C:Oracleoradatawbqredo01.log') size 10240K,
group 2 ('C:Oracleoradatawbqredo02.log') size 10240K,
group 3 ('C:Oracleoradatawbqredo03.log') size 10240K;

6. 创建数据字典
SQL>@C:Oracleora92Rdbmsadmincatalog.sql;
SQL>@C:Oracleora92Rdbmsadmincatexp7.sql
SQL>@C:Oracleora92Rdbmsadmincatproc.sql
SQL>@C:Oracleora92Rdbmsadmincaths.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

http://www.itpub.net/showthread.php?threadid=738720&pagenumber=

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

请登录后发表评论 登录
全部评论
Oracle , MySQL, SAP IQ, SAP HANA, PostgreSQL, Tableau 技术讨论,希望在这里一起分享知识,讨论技术,畅谈人生 。

注册时间:2007-12-10

  • 博文量
    5595
  • 访问量
    13132515