歡迎您光臨本站 註冊首頁

ORACLE手工建庫(LINUX平台)

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0

ORACLE: 11.2.0.1.0

OS:RED HAT ENTERPRISE 5


1.設置ORACLE_SID

2.建立PFILE

3.生成SPFILE

4.CREATE DATABASE

1.設置ORACLE_SID

export ORACLE_SID=SID-NAME

2.建立

PFILE

$ORACLE_HOME/dbs/initSID-NAME.ora

---------------------------------------------------------------------------------------------------------------------------------

test.__db_cache_size=671088640

test.__java_pool_size=16777216

test.__large_pool_size=16777216

test.__oracle_base='/oracle/oracle'#ORACLE_BASE set from environment

test.__pga_aggregate_target=671088640

test.__sga_target=989855744

test.__shared_io_pool_size=0

test.__shared_pool_size=268435456

test.__streams_pool_size=0

*.audit_file_dest='/oracle/oracle/admin/test/adump'

*.audit_trail='db'

*.compatible='11.2.0.0.0'

*.control_files='/oracle/oracledata/test/control01.ctl','/oracle/oracledata/test/control03.ctl'

*.db_block_size=8192

*.db_domain=''

*.db_name='test'

*.db_recovery_file_dest='/oracle/oracle/test/flash_recovery_area'

*.db_recovery_file_dest_size=5218762752

*.diagnostic_dest='/oracle/oracle/test'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=testXDB)'

*.log_archive_dest_1='location=/oracle/oracledata/test/archive'

*.memory_target=1655701504

*.open_cursors=300

*.processes=150

*.remote_login_passwordfile='EXCLUSIVE'

*.undo_tablespace=' undotbs01.dbf '

DB_CREATE_FILE_DEST='/oracle/oracledata/test'

---------------------------------------------------------------------------------------------------------------------------------

PFILE中指定目錄必須存在.CREATE

命令不負責建立目錄

若不指定文件目錄和DB_CREATE_FILE_DEST參數.則採取默認路徑

3.啟動實例生成SPFILE

shell>sqlplus user/password

SQL>startup nomount

SQL>create spfile from pfile

4.CREATE DATABASE

自定義方式:

---------------------------------------------------------------------------------------------------------------------------------

SQL>create database test

user sys identified by password

user system identified by password

logfile group 1 ('/oracle/oracledata/test/redo01.log') size 100m,

group 2 ('/oracle/oracledata/test/redo02.log') size 100m,

group 3 ('/oracle/oracledata/test/redo03.log') size 100m

maxlogfiles 5

maxloghistory 1

maxdatafiles 100

character set us7ascii

national character set al16utf16

extent management local

datafile '/oracle/oracledata/test/system01.dbf' size 320m reuse

sysaux datafile '/oracle/oracledata/test/sysaux01.dbf' size 320m reuse

default tablespace users

datafile '/oracle/oracledata/test/users01.dbf' size 500m reuse autoextend on maxsize unlimited

default temporary tablespace tempts1

tempfile '/oracle/oracledata/test/temp01.dbf' size 50m reuse

undo tablespace undotbs1

datafile '/oracle/oracledata/test/undotbs01.dbf'

size 200m autoextend on maxsize unlimited;

---------------------------------------------------------------------------------------------------------------------------------

注意與PFILE中設定的參數一致

OMF方式:(如有報錯查看警報文件

.避免PFILE與默認參數不符)

SQL>create database db-name;

也可以指定點什麼:

SQL> create database test

user sys identified by password

user system identified by password

extent management local

default temporary tablespace temp1

undo tablespace undotbs1

default tablespace users;

THE END;

本文出自 「Xin23的歷程」 博客,請務必保留此出處http://xin23.blog.51cto.com/1827266/494217


[火星人 ] ORACLE手工建庫(LINUX平台)已經有99次圍觀

http://coctec.com/docs/linux/show-post-49396.html