随笔-42  评论-12  文章-0  trackbacks-0

第一步:创建密码文件
C:Documents and Settingsshiyihai>orapwd file="H:ora10gdbsorapwdora10g.pwd" entries=10 password=sys

第二步:编辑初始化参数文件,部分参数跟9i不一样,并nomount启动数据库
初始化参数文件init_10g.ora内容如下:
ora10g.__db_cache_size=100000000
ora10g.__java_pool_size=16777216
ora10g.__large_pool_size=16777216
ora10g.__shared_pool_size=50000000
ora10g.__streams_pool_size=0
*.audit_file_dest='H:adminora10gadump'
*.background_dump_dest='H:adminora10gbdump'
*.compatible='10.2.0.1.0'
*.control_files='H:oradataora10gCONTROL01.CTL','H:oradataora10gCONTROL02.CTL','H:oradataora10gCONTROL03.CTL'
*.core_dump_dest='H:adminora10gcdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=32
*.db_name='ora10g'
*.db_recovery_file_dest='h:flash_recovery_area'
*.db_recovery_file_dest_size=500000000
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ora10gXDB)'
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=200000000
*.processes=550
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=610
*.sga_target=300000000
*.star_transformation_enabled='TRUE'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='H:adminora10gudump'

SQL> startup pfile='h:init_10g.ora' nomount
ORACLE 例程已经启动。

Total System Global Area 301989888 bytes
Fixed Size 1248672 bytes
Variable Size 96469600 bytes
Database Buffers 201326592 bytes
Redo Buffers 2945024 bytes

注意:是启动到nomount状态下。

第三步:创建数据库
create database ora10g
MAXINSTANCES 8
MAXLOGHISTORY 32
MAXLOGFILES 32
MAXLOGMEMBERS 3
MAXDATAFILES 2048
character set ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
DATAFILE 'H:oradataora10gsystem01.dbf' size 300M autoextend on next 64K maxsize unlimited
sysaux DATAFILE 'H:oradataora10gsysaux01.dbf' size 100M autoextend on next 64K maxsize unlimited
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE 'H:oradataora10gtemp01.dbf' size 50M autoextend on MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1024K
UNDO TABLESPACE UNDOTBS1 datafile 'H:oradataora10gundotbs01.dbf' SIZE 50M autoextend on next 64K maxsize unlimited
LOGFILE
GROUP 1 ('H:oradataora10gredo0101.dbf') SIZE 50M REUSE,
GROUP 2 ('H:oradataora10gredo0201.dbf') SIZE 50M REUSE,
GROUP 3 ('H:oradataora10gredo0301.dbf') SIZE 50M REUSE;

数据库已创建。

SQL>

第四步:创建数据字典
SQL>@ ?/rdbms/admin/catalog.sql;
SQL>@ ?/rdbms/admin/catproc.sql;
SQL>@ ?/rdbms/admin/catblock.sql;
SQL>@ ?/rdbms/admin/catoctk.sql;
SQL> conn system/manager
已连接。
SQL> @ ?/sqlplus/admin/pupbld.sql;

第五步:创建spfile并重启db
SQL> conn / as sysdba
已连接。
SQL> create spfile from pfile='h:init_10g.ora';

文件已创建。

SQL> startup force;
ORACLE 例程已经启动。

Total System Global Area 301989888 bytes
Fixed Size 1248672 bytes
Variable Size 96469600 bytes
Database Buffers 201326592 bytes
Redo Buffers 2945024 bytes
数据库装载完毕。
数据库已经打开。
SQL>


附:
1、windows平台手工创建数据库需要首先创建例程

set ORACLE_SID=test
oradim.exe -new -sid TEST -startmode m
2、失败后重新创建时,需要删除生成的文件(数据文件,联机日志文件等)
如果遇到如下错误:

Errors in file d:\oracle\product\10.1.0\admin\mydb\udump\mydb_ora_1344.trc:
ORA-01501: CREATE DATABASE failed
ORA-01991: invalid password file 'D:\oracle\product\10.1.0\Db_1\DATABASE\PWDmydb.ORA'

需要重新创建密码文件

posted on 2008-04-01 16:52 tianjuchuan 阅读(796) 评论(0)  编辑 收藏 引用 所属分类: 数据库创建
只有注册用户登录后才能发表评论。