日期:2011-06-04  浏览次数:20663 次


创建数据库虽说是一件很平常的工作,在ORACLE的参考文档中也有一定的描述,但现实中确有很多人都不会,一方面是因为平时很少有这样的机会让你去做,而真有了这样的机会让你做的时候,可能又手忙脚乱的不知道如何下手,本文将为你提供一个完整的参考。

详细步骤如下:

第一步:准备工作

1、 环境变量:
ox1> more .profile_oracyx
# 这部分建议提供
PATH=/data4/ora817/app/oracle/product/8.1.7/bin:/data4/ora817/bin::/usr/bin:.
ORACLE_BASE=/data4/ora817/app/oracle
ORACLE_SID=oracyx
ORA_NLS33=/data4/ora817/app/oracle/product/8.1.7/ocommon/nls/admin/data
ORACLE_HOME=/data4/ora817/app/oracle/product/8.1.7

# 这部分根据你的具体环境,不过有的参数在数据库建成后最好还是明确写出来,
# 如:LD_LIBRARY_PATH等,这样自己看起来会更清楚些。
LD_LIBRARY_PATH=/data4/ora817/app/oracle/product/8.1.7/lib:/usr/lib
TNS_ADMIN=/data4/ora817/app/oracle/product/8.1.7/network/admin
USER=ora817
NLS_LANG=american_america.zhs16cgb231280
LOGNAME=ora817
ORA_DB=/data4/ora817/app/oracle/product/8.1.7/dbs
TERM=vt100
HOME=/data4/ora817
ORACLE_TERM=vt100
SHELL=/bin/ksh
DISPLAY=ox1:0.0

2、参数文件
ox1> pwd
/data4/ora817/app/oracle/product/8.1.7/dbs
ox1> cp init.ora initoracyx.ora
ox1> vi initoracyx.ora
# --------------------------BEGIN---------------------------------------------------------
# db_name是唯一一个需要在建库时候提供的参数,
# 但通常以下参数都会做部分调整的
db_name = "oracyx"
instance_name = oracyx
service_names = oracyx
control_files = ('/data4/ora817/oradata/oracyx/control1.ctl', '/data2/oradata/or
acyx/control2.ctl','/data5/oradata/oracyx/control3.ctl')
open_cursors = 1000
max_enabled_roles = 40
db_block_buffers = 18800
shared_pool_size = 204800000
java_pool_size = 0
log_checkpoint_interval = 1000000000
log_checkpoint_timeout = 1800
processes = 2000
log_buffer = 2048000
timed_statistics = true
max_dump_file_size = 10000
log_archive_start = true
log_archive_dest_1 = "location=/data5/archive/oracyx"
log_archive_format = arch_%t_%s.arc
global_names = false
background_dump_dest = /data4/ora817/app/oracle/admin/oracyx/bdump
background_core_dump = partial
core_dump_dest = /data4/ora817/app/oracle/admin/oracyx/cdump
shadow_core_dump = none
user_dump_dest = /data4/ora817/app/oracle/admin/oracyx/udump
db_block_size = 8192
remote_login_passwordfile = exclusive
os_authent_prefix = ""
distributed_transactions = 1500
compatible = "8.1.7.0.0"
sort_area_size = 1024000
sort_area_retained_size = 1024000
db_files = 400
db_file_multiblock_read_count = 16
parallel_max_servers = 8
lm_ress=900000
lm_locks=1500000
session_cached_cursors = 20