windows下手动创建oracle数据库

 
系统环境:
1、操作系统:Windows 2003 Server
2、数据库: Oracle9I Release 9.0.1.1.1
3、安装路径:D:/ORACLE
建库步骤:
1、 手工创建相关目录
D:/Oracle/admin/orarman
D:/Oracle/admin/orarman/arch
D:/Oracle/admin/orarman/bdump
D:/Oracle/admin/orarman/create
D:/Oracle/admin/orarman/pfile
D:/Oracle/admin/orarman/udump

D:/Oracle/oradata/orarman
D:/Oracle/oradata/orarman/archive
如果嫌麻烦,可以从%oracle_home%/ora90/admin/sample目录拷到%oracle_home%/admin下进行相应修改即可。
 
2、 手工创建初始化启动参数文件:D:/Oracle/admin/orarman/pfile/init.ora
 
可以拷贝一个现有的参数文件作下修改:
db_name=orarman
instance_name=orarman
db_domain=""
service_names=orarman
control_files=("d:/oracle/oradata/orarman/CONTROL01.CTL",
"d:/oracle/oradata/orarman /CONTROL02.CTL",
"d:/oracle/oradata/orarman/CONTROL03.CTL")
db_block_size=4096
background_dump_dest=d:/oracle/admin/orarman/bdump
core_dump_dest=d:/oracle/admin/orarman/cdump
user_dump_dest=d:/oracle/admin/orarman/udump
 
3、手工创建D:/Oracle/Orarman/DATABASE/initorarman.ora文件,
内容:IFILE='D:/Oracle/admin/orarman/pfile/init.ora'
4、使用orapwd.exe命令,创建D:/Oracle/Ora90/DATABASE/PWDorarman.ora

命令:D:/Oracle/Ora90/bin/orapwd file=D:/Oracle/Ora90/DATABASE/PWDorarman.ora         password=admin entries=5
5、通过oradim.exe命令,在服务里生成一个新的实例管理服务,启动方式为手工 .
在注册表中添加HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/HOME0 添加字串值ORACLE_SID=orarman(这个很重要,否则出现ORA-12560错误)
也可以set ORACLE_SID=oraorarman
D:/Oracle/Ora90/bin/oradim -new -sid orarman -startmode manual -pfile "D:/Oracle/admin/orarman/pfile/init.ora"
6、生成各种数据库对象
D:/>Oracle/Ora90/bin/sqlplus /nolog
Conn SYS/change_on_install as SYSDBA
--创建数据库
startup nomount pfile="D:/Oracle/admin/orarman/pfile/init.ora"

--创建spfile
create spfile from pfile
CREATE DATABASE orarman
logfile
      group 1 ('d:/oracle/oradata/orarman/redo01a.log',
               'd:/oracle/oradata/orarman/redo01b.log')  size 5M,
      group 2 ('d:/oracle/oradata/orarman/redo02a.log',
               'd:/oracle/oradata/orarman/redo02b.log')  size 5M,
      group 3 ('d:/oracle/oradata/orarman/redo03a.log',
               'd:/oracle/oradata/orarman/redo03b.log')  size 5M
MAXLOGFILES 32
MAXLOGMEMBERS 2
MAXLOGHISTORY 1
MAXDATAFILES 254
MAXINSTANCES 1
DATAFILE 'D:/Oracle/oradata/orarman/system01.dbf' SIZE 100M REUSE AUTOEXTEND ON NEXT     10M maxsize unlimited
UNDO TABLESPACE UNDOTBS DATAFILE ‘D:/oracle/oradata/orarman/undotbs01.dbf’size 200M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED
DEFAULT temporary tablespace temp
           tempfile ‘d:/oracle/oradata/orarman/temp01.dbf’ size 40M reuse
                autoextend on next 1280K maxsize unlimited
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16;
7、创建其它表空间
 (1)、创建用户表空间
       create tablespace users
           datafile ‘d:/oracle/oradata/orarman/users01.dbf’ size 25M reuse
                autoextend on next 1280K maxsize unlimited
(2)、创建工具表空间
       create tablespace tools
           datafile ‘d:/oracle/oradata/orarman/tools01.dbf’ size 10M reuse
                autoextend on next 1280K maxsize unlimited
(3)、创建索引表空间
       create tablespace indx
           datafile ‘d:/oracle/oradata/orarman/indx01.dbf’ size 25M reuse
                autoextend on next 1280K maxsize unlimited
8、建立数据字典的文件是:
@$ORACLE_HOME/rdbms/admin/catalog.sql
@$ORACLE_HOME/rdbms/admin/catproc.sql
@$ORACLE_HOME/rdbms/admin/catexp.sql
9、将实例启动服务设置成自动自动方式
   d:/oracle/ora90/bin/oradim –edit –sid orarman –startmode auto
 
阅读更多
换一批

没有更多推荐了,返回首页