手工创建数据库的全部脚本及说明 (转)[@more@]
系统环境:
1、 操作系统: windows 2000 Server,机器 内存128M
2、数据库: ORACLE 8i R2 (8.1.6) for NT 企业版
3、 安装路径:D:ORACLE
建库步骤:
1、手工创建相关目录
D:Oracleadmintest
D:Oracleadmintestadhoc
D:Oracleadmintestbdump
D:Oracleadmintestcdump
D:Oracleadmintestcreate
D:Oracleadminteste xp
D:Oracleadmintestpfile
D:Oracleadmintestudump
D:Oracleoradatatest
D:Oracleoradatatestarchive
2、手工创建初始化启动参数 文件:D:Oracleadmintestpfileinittest.ora,内容:
3、手工创建D:OracleOra81DATABASEinittest.ora文件,
内容:IFILE='D:Oracleadmintestpfileinittest.ora'
4、使用orapwd.exe命令,创建D:OracleOra81DATABASEPWDtest. ora
命令:D:OracleOra81binorapwd file=D:OracleOra81DATABASEPWDtest.ora pass word=ORACLE entries=5
5、通过oradim.exe命令,在服务里生成一个新的实例管理服务,启动方式为手工
set ORACLE_SID=test
D:OracleOra81binoradim -new -sid test -startmode manual -pfile "D:Oracleadmintestpfileinittest.ora"
6、生成各种数据库 对象
D:>svrmgrl
--创建数据库
connect INTERNAL/oracle
startup nomount pfile="D:Oracleadmintestpfileinittest.ora"
CREATE DATABASE test
LOGFILE 'D:Oracleoradatatestredo01.log' SIZE 2048K,
'D:Oracleoradatatestredo02.log' SIZE 2048K,
'D:Oracleoradatatestredo03.log' SIZE 2048K
MAXLOGFILES 32
MAXLOGMEMBERS 2
MAXLOGHISTORY 1
DATAFILE 'D:Oracleoradatatestsystem01. dbf' SIZE 58M REUSE AUTOEXTEND ON NEXT 640K
MAXDATAFILES 254
MAXINSTANCES 1
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET ZHS16GBK;
控制文件、日志文件在上面语句 执行时生成
connect INTERNAL/oracle
--修改系统表空间
ALTER TABLESPACE SYSTEM DEFAULT STORAGE ( INITIAL 64K NEXT 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 50);
ALTER TABLESPACE SYSTEM MINIMUM EXTENT 64K;
--创建回滚表空间
CREATE TABLESPACE RBS DATAFILE 'D:Oracleoradatatestrbs01.dbf' SIZE 256M REUSE
AUTOEXTEND ON NEXT 5120K
MINIMUM EXTENT 512K
DEFAULT STORAGE ( INITIAL 512K NEXT 512K MINEXTENTS 8 MAXEXTENTS 4096);
--创建 用户表空间
CREATE TABLESPACE USERS DATAFILE 'D:Oracleoradatatestusers01.dbf' SIZE 128M REUSE
AUTOEXTEND ON NEXT 1280K
MINIMUM EXTENT 128K
DEFAULT STORAGE ( INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0);
--创建临时表空间
CREATE TABLESPACE TEMP DATAFILE 'D:Oracleoradatatesttemp01.dbf' SIZE 32M REUSE
AUTOEXTEND ON NEXT 640K
MINIMUM EXTENT 64K
DEFAULT STORAGE ( INITIAL 64K NEXT 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0) TEMPORARY;
--创建工具表空间
CREATE TABLESPACE TOOLS DATAFILE 'D:Oracleoradatatesttools01.dbf' SIZE 64M REUSE
AUTOEXTEND ON NEXT 320K
MINIMUM EXTENT 32K
DEFAULT STORAGE ( INITIAL 32K NEXT 32K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0);
--创建 索引表空间
CREATE TABLESPACE INDX DATAFILE 'D:Oracleoradatatestindx01.dbf' SIZE 32M REUSE
AUTOEXTEND ON NEXT 1280K
MINIMUM EXTENT 128K
DEFAULT STORAGE ( INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0);
--创建回滚段
CREATE PUBLIC ROLLBACK SEGMENT RBS0 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS1 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS2 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS3 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS4 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS5 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS6 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS7 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS8 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS9 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS10 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS11 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS12 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS13 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS14 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS15 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS16 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS17 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS18 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS19 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS20 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS21 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS22 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS23 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS24 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
--使回滚段在线
ALTER ROLLBACK SEGMENT "RBS0" ONLINE;
ALTER ROLLBACK SEGMENT "RBS1" ONLINE;
ALTER ROLLBACK SEGMENT "RBS2" ONLINE;
ALTER ROLLBACK SEGMENT "RBS3" ONLINE;
ALTER ROLLBACK SEGMENT "RBS4" ONLINE;
ALTER ROLLBACK SEGMENT "RBS5" ONLINE;
ALTER ROLLBACK SEGMENT "RBS6" ONLINE;
ALTER ROLLBACK SEGMENT "RBS7" ONLINE;
ALTER ROLLBACK SEGMENT "RBS8" ONLINE;
ALTER ROLLBACK SEGMENT "RBS9" ONLINE;
ALTER ROLLBACK SEGMENT "RBS10" ONLINE;
ALTER ROLLBACK SEGMENT "RBS11" ONLINE;
ALTER ROLLBACK SEGMENT "RBS12" ONLINE;
ALTER ROLLBACK SEGMENT "RBS13" ONLINE;
ALTER ROLLBACK SEGMENT "RBS14" ONLINE;
ALTER ROLLBACK SEGMENT "RBS15" ONLINE;
ALTER ROLLBACK SEGMENT "RBS16" ONLINE;
ALTER ROLLBACK SEGMENT "RBS17" ONLINE;
ALTER ROLLBACK SEGMENT "RBS18" ONLINE;
ALTER ROLLBACK SEGMENT "RBS19" ONLINE;
ALTER ROLLBACK SEGMENT "RBS20" ONLINE;
ALTER ROLLBACK SEGMENT "RBS21" ONLINE;
ALTER ROLLBACK SEGMENT "RBS22" ONLINE;
ALTER ROLLBACK SEGMENT "RBS23" ONLINE;
ALTER ROLLBACK SEGMENT "RBS24" ONLINE;
--修改sys用户的临时表空间为TEMP
alter user sys temporary tablespace TEMP;
--创建数据字典表
@D:OracleOra81 rdbmsadmincatalog. sql;
@D:OracleOra81Rdbmsadmincatexp7.sql
@D:OracleOra81Rdbmsadmincatproc.sql
@D:OracleOra81Rdbmsadmincaths.sql
connect system/manager
@D:OracleOra81sqlplusadminpupbld.sql
connect internal/oracle
@D:OracleOra81Rdbmsadmincatrep.sql
exit
--生成SQL*Plus帮助系统
sqlplus SYSTEM/manager
@D:OracleOra81sqlplusadminhelphelpbld.sql helpus.sql
exit
--修改system用户默认表空间和临时表空间
svrmgrl
connect internal/oracle
alter user system default tablespace TOOLS;
alter user system temporary tablespace TEMP;
exit
7、将test实例启动服务设置成自动启动方式
D:OracleOra81binoradim -edit -sid test -startmode auto
----------------init.ora 内容--------------------------
db_name = "test"
instance_name = test
service_names = test
db_files = 1024
control_files = ("D:Oracleoradatatestcontrol01.ctl", "D:Oracleoradatatestcontrol02.ctl", "D:Oracleoradatatestcontrol03.ctl")
open_cursors = 200
max_enabled_roles = 30
db_file_multiblock_read_count = 8
db_block_buffers = 4096
shared_pool_size = 52428800
large_pool_size = 78643200
Java_pool_size = 20971520
log_checkpoint_interval = 10000
log_checkpoint_timeout = 1800
processes = 115
parallel_max_servers = 5
log_buffer = 32768
max_dump_file_size = 10240
global_names = true
oracle_trace_collection_name = ""
background_dump_dest = D:Oracleadmintestbdump
user_dump_dest = D:Oracleadmintestudump
db_block_size = 16384
remote_login_passwordfile = exclusive
os_authent_prefix = ""
job_queue_processes = 4
job_queue_interval = 60
open_links = 4
distributed_transactions = 10
mts_dispatchers = "(PROTOCOL=TCP)(PRE=oracle.aurora.server.SGiopServer)"
mts_dispatchers = "(protocol=TCP)"
compatible = 8.1.0
sort_area_size = 65536
sort_area_retained_size = 65536
手工创建数据库的全部脚本及说明
系统环境:
1、 操作系统: windows 2000 Server,机器 内存128M
2、数据库: ORACLE 8i R2 (8.1.6) for NT 企业版
3、 安装路径:D:ORACLE
建库步骤:
1、手工创建相关目录
D:Oracleadmintest
D:Oracleadmintestadhoc
D:Oracleadmintestbdump
D:Oracleadmintestcdump
D:Oracleadmintestcreate
D:Oracleadminteste xp
D:Oracleadmintestpfile
D:Oracleadmintestudump
D:Oracleoradatatest
D:Oracleoradatatestarchive
2、手工创建初始化启动参数 文件:D:Oracleadmintestpfileinittest.ora,内容:
3、手工创建D:OracleOra81DATABASEinittest.ora文件,
内容:IFILE='D:Oracleadmintestpfileinittest.ora'
4、使用orapwd.exe命令,创建D:OracleOra81DATABASEPWDtest. ora
命令:D:OracleOra81binorapwd file=D:OracleOra81DATABASEPWDtest.ora pass word=ORACLE entries=5
5、通过oradim.exe命令,在服务里生成一个新的实例管理服务,启动方式为手工
set ORACLE_SID=test
D:OracleOra81binoradim -new -sid test -startmode manual -pfile "D:Oracleadmintestpfileinittest.ora"
6、生成各种数据库 对象
D:>svrmgrl
--创建数据库
connect INTERNAL/oracle
startup nomount pfile="D:Oracleadmintestpfileinittest.ora"
CREATE DATABASE test
LOGFILE 'D:Oracleoradatatestredo01.log' SIZE 2048K,
'D:Oracleoradatatestredo02.log' SIZE 2048K,
'D:Oracleoradatatestredo03.log' SIZE 2048K
MAXLOGFILES 32
MAXLOGMEMBERS 2
MAXLOGHISTORY 1
DATAFILE 'D:Oracleoradatatestsystem01. dbf' SIZE 58M REUSE AUTOEXTEND ON NEXT 640K
MAXDATAFILES 254
MAXINSTANCES 1
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET ZHS16GBK;
控制文件、日志文件在上面语句 执行时生成
connect INTERNAL/oracle
--修改系统表空间
ALTER TABLESPACE SYSTEM DEFAULT STORAGE ( INITIAL 64K NEXT 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 50);
ALTER TABLESPACE SYSTEM MINIMUM EXTENT 64K;
--创建回滚表空间
CREATE TABLESPACE RBS DATAFILE 'D:Oracleoradatatestrbs01.dbf' SIZE 256M REUSE
AUTOEXTEND ON NEXT 5120K
MINIMUM EXTENT 512K
DEFAULT STORAGE ( INITIAL 512K NEXT 512K MINEXTENTS 8 MAXEXTENTS 4096);
--创建 用户表空间
CREATE TABLESPACE USERS DATAFILE 'D:Oracleoradatatestusers01.dbf' SIZE 128M REUSE
AUTOEXTEND ON NEXT 1280K
MINIMUM EXTENT 128K
DEFAULT STORAGE ( INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0);
--创建临时表空间
CREATE TABLESPACE TEMP DATAFILE 'D:Oracleoradatatesttemp01.dbf' SIZE 32M REUSE
AUTOEXTEND ON NEXT 640K
MINIMUM EXTENT 64K
DEFAULT STORAGE ( INITIAL 64K NEXT 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0) TEMPORARY;
--创建工具表空间
CREATE TABLESPACE TOOLS DATAFILE 'D:Oracleoradatatesttools01.dbf' SIZE 64M REUSE
AUTOEXTEND ON NEXT 320K
MINIMUM EXTENT 32K
DEFAULT STORAGE ( INITIAL 32K NEXT 32K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0);
--创建 索引表空间
CREATE TABLESPACE INDX DATAFILE 'D:Oracleoradatatestindx01.dbf' SIZE 32M REUSE
AUTOEXTEND ON NEXT 1280K
MINIMUM EXTENT 128K
DEFAULT STORAGE ( INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0);
--创建回滚段
CREATE PUBLIC ROLLBACK SEGMENT RBS0 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS1 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS2 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS3 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS4 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS5 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS6 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS7 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS8 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS9 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS10 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS11 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS12 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS13 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS14 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS15 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS16 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS17 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS18 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS19 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS20 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS21 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS22 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS23 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS24 TABLESPACE RBS STORAGE ( OPTIMAL 4096K );
--使回滚段在线
ALTER ROLLBACK SEGMENT "RBS0" ONLINE;
ALTER ROLLBACK SEGMENT "RBS1" ONLINE;
ALTER ROLLBACK SEGMENT "RBS2" ONLINE;
ALTER ROLLBACK SEGMENT "RBS3" ONLINE;
ALTER ROLLBACK SEGMENT "RBS4" ONLINE;
ALTER ROLLBACK SEGMENT "RBS5" ONLINE;
ALTER ROLLBACK SEGMENT "RBS6" ONLINE;
ALTER ROLLBACK SEGMENT "RBS7" ONLINE;
ALTER ROLLBACK SEGMENT "RBS8" ONLINE;
ALTER ROLLBACK SEGMENT "RBS9" ONLINE;
ALTER ROLLBACK SEGMENT "RBS10" ONLINE;
ALTER ROLLBACK SEGMENT "RBS11" ONLINE;
ALTER ROLLBACK SEGMENT "RBS12" ONLINE;
ALTER ROLLBACK SEGMENT "RBS13" ONLINE;
ALTER ROLLBACK SEGMENT "RBS14" ONLINE;
ALTER ROLLBACK SEGMENT "RBS15" ONLINE;
ALTER ROLLBACK SEGMENT "RBS16" ONLINE;
ALTER ROLLBACK SEGMENT "RBS17" ONLINE;
ALTER ROLLBACK SEGMENT "RBS18" ONLINE;
ALTER ROLLBACK SEGMENT "RBS19" ONLINE;
ALTER ROLLBACK SEGMENT "RBS20" ONLINE;
ALTER ROLLBACK SEGMENT "RBS21" ONLINE;
ALTER ROLLBACK SEGMENT "RBS22" ONLINE;
ALTER ROLLBACK SEGMENT "RBS23" ONLINE;
ALTER ROLLBACK SEGMENT "RBS24" ONLINE;
--修改sys用户的临时表空间为TEMP
alter user sys temporary tablespace TEMP;
--创建数据字典表
@D:OracleOra81 rdbmsadmincatalog. sql;
@D:OracleOra81Rdbmsadmincatexp7.sql
@D:OracleOra81Rdbmsadmincatproc.sql
@D:OracleOra81Rdbmsadmincaths.sql
connect system/manager
@D:OracleOra81sqlplusadminpupbld.sql
connect internal/oracle
@D:OracleOra81Rdbmsadmincatrep.sql
exit
--生成SQL*Plus帮助系统
sqlplus SYSTEM/manager
@D:OracleOra81sqlplusadminhelphelpbld.sql helpus.sql
exit
--修改system用户默认表空间和临时表空间
svrmgrl
connect internal/oracle
alter user system default tablespace TOOLS;
alter user system temporary tablespace TEMP;
exit
7、将test实例启动服务设置成自动启动方式
D:OracleOra81binoradim -edit -sid test -startmode auto
----------------init.ora 内容--------------------------
db_name = "test"
instance_name = test
service_names = test
db_files = 1024
control_files = ("D:Oracleoradatatestcontrol01.ctl", "D:Oracleoradatatestcontrol02.ctl", "D:Oracleoradatatestcontrol03.ctl")
open_cursors = 200
max_enabled_roles = 30
db_file_multiblock_read_count = 8
db_block_buffers = 4096
shared_pool_size = 52428800
large_pool_size = 78643200
Java_pool_size = 20971520
log_checkpoint_interval = 10000
log_checkpoint_timeout = 1800
processes = 115
parallel_max_servers = 5
log_buffer = 32768
max_dump_file_size = 10240
global_names = true
oracle_trace_collection_name = ""
background_dump_dest = D:Oracleadmintestbdump
user_dump_dest = D:Oracleadmintestudump
db_block_size = 16384
remote_login_passwordfile = exclusive
os_authent_prefix = ""
job_queue_processes = 4
job_queue_interval = 60
open_links = 4
distributed_transactions = 10
mts_dispatchers = "(PROTOCOL=TCP)(PRE=oracle.aurora.server.SGiopServer)"
mts_dispatchers = "(protocol=TCP)"
compatible = 8.1.0
sort_area_size = 65536
sort_area_retained_size = 65536
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10752019/viewspace-985371/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10752019/viewspace-985371/