ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle10g linux 手工建库

oracle10g linux 手工建库

原创 Linux操作系统 作者:YallonKing 时间:2011-08-16 12:17:06 0 删除 编辑

闲来无事,贴我以前的一篇,算是复习了....

知识获得不易,转载请注明出处!

1、  设置环境变量
[root@xlong ~]# su - oracle
[oracle@xlong ~]$ export ORACLE_SID=xlong01
[oracle@xlong ~]$ env | grep ORA
ORACLE_NLS33=/u01/app/oracle/product/10.2.0/db_1/ocommon/nls/admin/data
ORACLE_SID=xlong01
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
2、  创建口令文件
[oracle@xlong dbs]$ orapwd file=orapwtest password=oracle entries=10
3、  创建静态初始化参数文件(pfile)
[oracle@xlong dbs]$ vi initxlong01.ora
db_cache_size=176160768
java_pool_size=4194304
large_pool_size=4194304
shared_pool_size=96468992
streams_pool_size=0
audit_file_dest='/u01/app/oracle/admin/xlong01/adump'
background_dump_dest='/u01/app/oracle/admin/xlong01/bdump'
compatible='10.2.0.1.0'
control_files=('/u01/app/oracle/oradata/xlong01/control01.ctl','/u01/app/oracle/oradata/xlong01/control02.ctl','/u01/app/oracle/oradata/xlong01/control03.ctl')
core_dump_dest='/u01/app/oracle/admin/xlong01/cdump'
db_block_size=8192
db_create_file_dest='/u01/app/oracle/oradata'
db_domain=''
db_file_multiblock_read_count=16
db_name='xlong01'
db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
db_recovery_file_dest_size=2147483648
dispatchers='(PROTOCOL=TCP) (SERVICE=xlong01XDB)'
job_queue_processes=10
open_cursors=300
pga_aggregate_target=94371840
processes=150
remote_login_passwordfile='EXCLUSIVE'
sga_target=285212672
undo_management='AUTO'
undo_tablespace='UNDOTBS1'
user_dump_dest='/u01/app/oracle/admin/xlong01/udump'
4、  创建所需目录
(此处根据initxlong01.ora参数中的相关设置创建)
[oracle@xlong admin]$ mkdir xlong01
[oracle@xlong xlong01]$ mkdir adump
[oracle@xlong xlong01]$ mkdir bdump
[oracle@xlong xlong01]$ mkdir cdump
[oracle@xlong xlong01]$ mkdir dpdump
[oracle@xlong xlong01]$ mkdir pfile
[oracle@xlong xlong01]$ mkdir scripts
[oracle@xlong xlong01]$ mkdir udump
[oracle@xlong oradata]$ mkdir xlong01
5、  连接到实例
[oracle@xlong dbs]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jan 29 04:40:27 2011
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
SQL> conn /as sysdba
Connected to an idle instance.
6、  创建动态初始化参数文件(spfile)(optional)
SQL> create spfile from pfile;
File created.
 7、  启动实例
startup nomount pfile='/u01/app/oracle/product/10.2.0/db_1/dbs/initxlong01.ora'  (optional)
SQL> startup nomount;
8、  执行CREATE DATABASE 语句
(此处通过文件createdb.sql进行)
创建createdb.sql文件
[oracle@xlong dbs]$ vi createdb.sql
spool dbcreate.log;
create database xlong01
user sys identified by oracle
user system identified by oracle
logfile group 1 ('/u01/app/oracle/oradata/xlong01/redo01.log') size 10m reuse,
        group 2 ('/u01/app/oracle/oradata/xlong01/redo02.log') size 10m reuse,
        group 3 ('/u01/app/oracle/oradata/xlong01/redo03.log') size 10m reuse
datafile '/u01/app/oracle/oradata/xlong01/xlong0101.dbf' size 500m reuse extent management local
maxdatafiles 100
maxlogmembers 5
maxloghistory 1
maxinstances 1
archivelog
character set US7ASCII
national character set AL16UTF16
sysaux datafile '/u01/app/oracle/oradata/xlong01/sys01.dbf' size 230m autoextend on next 10m maxsize unlimited
default tablespace tbs01 datafile '/u01/app/oracle/oradata/xlong01/tbs01.dbf' size 100m
undo tablespace undotbs1 datafile '/u01/app/oracle/oradata/xlong01/undo.dbf' size 100m
default temporary tablespace temp tempfile '/u01/app/oracle/oradata/xlong01/temp01.dbf'
size 100m autoextend on next 10m maxsize unlimited;
spool off;
执行文件crdb01.sql
[oracle@xlong dbs]$ exit
exit
SQL> @$ORACLE_HOME/dbs/createdb.sql;
9、  创建额外的表空间
10、              执行相关脚本
/u01/app/oracle/product/10.2.0/db_1/rdbms/admin
SQL>spool log01.log
SQL> @$ORACLE_HOME/rdbms/admin/catalog.sql;
SQL>spool log02.log
SQL> @$ORACLE_HOME/rdbms/admin/catproc.sql;
11、备份数据库

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26143577/viewspace-704973/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-08-07

  • 博文量
    72
  • 访问量
    260401