Chinaunix首页 | 论坛 | 博客
  • 博客访问: 788224
  • 博文数量: 185
  • 博客积分: 7434
  • 博客等级: 少将
  • 技术积分: 2325
  • 用 户 组: 普通用户
  • 注册时间: 2005-12-29 14:01
文章分类

全部博文(185)

文章存档

2013年(1)

2012年(2)

2011年(17)

2010年(25)

2009年(36)

2008年(104)

分类: Oracle

2009-01-16 16:36:23

10GR2手工创建数据库步聚
这里以10.2.0.4在linux平台创建一个testdb1实例作为案例:
1.准备参数文件
cd $ORACLE_HOME/dbs
cat >>inittestdb1.ora<*.audit_file_dest='/home/oracle/admin/testdb1/adump'
*.background_dump_dest='/home/oracle/admin/testdb1/bdump'
*.compatible='10.2.0.3.0'
*.control_files='/oradata/testdb1/control01.ctl','/oradata/testdb1/control02.ctl','/oradata/testdb1/control03.ctl'
*.core_dump_dest='/home/oracle/admin/testdb1/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='testdb1'
*.fast_start_mttr_target=300
*.job_queue_processes=10
*.log_archive_dest_1='LOCATION=/oradata/testdb1/arc'
*.log_archive_format='%t_%s_%r.dbf'
*.nls_language='AMERICAN'
*.nls_territory='AMERICA'
*.open_cursors=300
*.pga_aggregate_target=500M
*.processes=500
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=2G
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/home/oracle/admin/testdb1/udump'
EOF
2.创建有关目录:
mkdir -p /home/oracle/admin/testdb1/adump
mkdir -p /home/oracle/admin/testdb1/bdump
mkdir -p /home/oracle/admin/testdb1/cdump
mkdir -p /home/oracle/admin/testdb1/dpdump
mkdir -p /home/oracle/admin/testdb1/udump
3.创建密码文件
cd $ORACLE_HOME/dbs
orapwd file=orapwtestdb1 password=abc123 entries=5
4.创建数据库
export ORACLE_SID=test
sqlplus "/as sysdba"
create spfile from pfile;
startup nomount;
CREATE DATABASE "testdb1"
MAXINSTANCES 8
MAXLOGHISTORY 1
MAXLOGFILES 16
MAXLOGMEMBERS 5
MAXDATAFILES 2048
DATAFILE '/oradata/testdb1/system01.dbf' SIZE 300M REUSE AUTOEXTEND ON NEXT  10240K MAXSIZE 1G EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE '/oradata/testdb1/sysaux01.dbf' SIZE 120M REUSE AUTOEXTEND ON NEXT  10240K MAXSIZE 1G
SMALLFILE DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/oradata/testdb1/temp01.dbf' SIZE 20M REUSE AUTOEXTEND ON NEXT  640K MAXSIZE 4G
SMALLFILE UNDO TABLESPACE "UNDOTBS1" DATAFILE '/oradata/testdb1/undotbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT  5120K MAXSIZE 4G
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
LOGFILE GROUP 1 ('/oradata/testdb1/redo01.log') SIZE 200M,
GROUP 2 ('/oradata/testdb1/redo02.log') SIZE 200M,
GROUP 3 ('/oradata/testdb1/redo03.log') SIZE 200M
5.创建字典
spool /tmp/testdb1_createcat.log
set echo on
@?/rdbms/admin/catalog.sql;
@?/rdbms/admin/catblock.sql;
@?/rdbms/admin/catproc.sql;
@?/rdbms/admin/catoctk.sql;
@?/rdbms/admin/owminst.plb;
spool off
6.修改system用户的口令
alter user system identified by manager;
 
7.创建帮助
connect system/manager;
@?/sqlplus/admin/pupbld.sql;
@?/sqlplus/admin/help/hlpbld.sql helpus.sql;
8.创建应用表空间
--创建tools表空间
create tablespace tools datafile '/oradata/testdb1/ts_tools01.dbf' size 100M reuse extent management local uniform size 1M SEGMENT SPACE MANAGEMENT  AUTO;
9.修改为归档模式并重启(可选)
SQL> connect /as sysdba
SQL> shutdown immediate;
SQL> startup mount
SQL> alter database archivelog;
SQL> alter database open;
重新编译所有失效过程:
select 'utl_recomp_begin: ' || to_char(sysdate, 'HH:MI:SS') from dual;
execute utl_recomp.recomp_serial();
select 'utl_recomp_end: ' || to_char(sysdate, 'HH:MI:SS') from dual;
10.建立和配置EM(可选):
SQL> @?/sysman/admin/emdrep/sql/emreposcre /u01/app/oracle/product/10.2.0/db_1 SYSMAN iamwangnc TEMP ON;
SQL> alter user SYSMAN identified by "test" account unlock;
SQL> alter user DBSNMP identified by "test" account unlock;
SQL> host emca -config dbcontrol db -silent -DB_UNIQUE_NAME testdb1 -PORT 1521 -EM_HOME /home/oracle/product/10.2.0/db_1 -LISTENER LISTENER -SERVICE_NAME testdb1 -SYS_PWD "abc123" -SID testdb1 -ORACLE_HOME /home/oracle/product/10.2.0/db_1 -DBSNMP_PWD "test" -HOST "xxx" -LISTENER_OH /home/oracle/product/10.2.0/db_1 -LOG_FILE /orahome/emConfig.log -SYSMAN_PWD "test";
阅读(674) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~