Chinaunix首页 | 论坛 | 博客
  • 博客访问: 744866
  • 博文数量: 95
  • 博客积分: 1754
  • 博客等级: 上尉
  • 技术积分: 1607
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-12 10:06
文章分类

全部博文(95)

文章存档

2015年(3)

2013年(15)

2012年(77)

分类: Oracle

2012-05-20 10:07:24

oracle 手工建库
一,创建init.ora文件

#first,specify the name of the databases
db_name=ayou
#for an asm instance,use instance_type=ASM.following is the default
instance_type=RDBMS
#you can set the db_name to your organizaion name as well
db_domain=oracle.mtsoso.com
#following two parameters set the max number of open files and processes
db_files=1000
processes=600
#following is the default block size
db_block_size=8192
#following is the default value for the statistics_level parameter
statistics_level=typical
#following is the default audit trail value
audit_trail=none
#followin three lines set the dump directory destinations
audit_file_dest='/u01/app/oracle/admin/ayou/adump/'
background_dump_dest='/u01/app/oracle/admin/ayou/bdump/'
user_dump_dest='/u01/app/oracle/admin/ayou/udump/'
core_dump_dest='/u01/app/oracle/admin/ayou/cdump'
#following parameter sets the database compatibility level
compattible=10.2.0.1
#three control files are specified below
control_files=('/u01/app/oracle/oradata/control1.ctl','/u01/app/oracle/oradata/control2.ctl','/u01/app/oracle/oradata/control3.ctl')
#cursor sharing is set to force,to make the database use bind variables
cursor_sharing=force
#open_cursors=300
#folllowing two parameters set the SGA and PGA targets
sga_target=800M
pga_aggregate_target=200M
#the multiblock read count is 16
db_file_multiblock_read_count=16
#the following will ensure that flashback logs
#are retained for 2 hours
db_flashback_retention_target=7200
#following two parameters configure the optional flash recovery area
db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
db_recovery_file_dest_size=10G
dispatchers='(PROTOCOL=TCP) (SERVICE=robotXDB)'

#following two parameters control the archiviing of the redo
#log files.for now,i am not archiving the logs,but these two parameters
#enable me to turn it on later.
log_archive_dest_1='LOCATION=/u01/app/oracle/arch/'
log_archive_format='%t_%s_%r.dbf'
#folllwing is the default optimizer mode
optimizer_mode=all_rows
#the following line makes it necessary to use a password file to connect as SYSDBA
remote_login_passwordfile=none
#remote_login_passwordfile='EXCLUSIVE'
#following parameter allows certain operations to resume after a suspension
resumbable_timeout=1800
#the following two parameters pertain to automatic undo management
undo_management=auto
undo_retention=7200
#the following is optional,since i'm using only a single undo tablespace
undo_tablespace=undotbs_01

--

SQL> sql /nolog
SQL>connect sys as sysdba
SQL>startup nomount
init.ora默认位置($ORACLE_HOME/dbs),否则必须指定文件的完整路径和名字
SQL>startup nomount pfile=’/u01/inityou.ora’

二,创建数据库
SQL>create database ayou
user sys indentified by sys_password
user system identified by system_password
maxinstances 1
maxloghistory 1
maxlogfiles 5
maxlogmembers 5
character set  AL16UTF8
national character set AL16UTF16
datafile ‘/u01/app/oracle/oradata/ayou/system01.dbf’ size 500M extent management LOCAL
sysaux datafile ‘/u01/app/oracle/oradata/ayou/sysaux01.dbf’ size 500M
default temporary tablespace temp01
temfile ‘/u01/app/oracle/oradata/ayou/temp01.dbf’ size 200M
UNDO tablespace undotbs_01
datafile ‘/u01/app/oracle/oradata/ayou/undotbs01.dbf’ size 500M
default tablespace users
datafile ‘/u01/app/oracle/oradata/ayou/users01.dbf’ size 200M
logfile group 1 (‘/u01/app/oracle/oradata/ayou/redo01.dbf’) size 200M,
group 2 (‘/u01/app/oracle/oradata/ayou/redo02.dbf’) size 200M,
group 3 (‘/u01/app/oracle/oradata/ayou/redo03.dbf’) size 200M,
group 4 (‘/u01/app/oracle/oradata/ayou/redo04.dbf’) size 200M,


三,执行oracle脚本创建数据字典对象
oracle提供两个脚本catalog.sql和catproc.sql,它们是创建新数据库后需要执行的脚本。
catalog.sql用数据字典视图,公用同义词和其他对象填充数据库。数据字典基表,v$视图的双亲是oracle数据库中创建的最开始的对象。
catproc.sql创建oracle提供的程序包以及其他支持在数据库中使用PL/SQL代码的对象

阅读(1236) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

weilua2012-05-22 08:55:26

看看