oracle9i 手工創庫

wangzhensheng發表於2007-04-26

.bash_profile

#export LD_ASSUME_KERNEL=2.4.20
export ORACLE_BASE=/export/home/oracle
export ORACLE_HOME=$ORACLE_BASE/9i
export ORACLE_SID=ECOM
export ORACLE_TERM=xterm
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/openwin/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/td/lib:/usr/ucblib:/usr/local/lib
export LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_HOME/bin
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export LANG=zh_CN
export NLS_LANG="AMERICAN_AMERICA.ZHS16GBK" ; export NLS_LANG
#export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK" ; export NLS_LANG
export PATH=$PATH:$ORACLE_BASE/9i/bin

-- 生成資料庫初始化引數檔案 /export/home/oracle/9i/dbs/initECOM.ora
db_name=ECOM
db_block_size=8192
db_cache_size=25165824
db_files = 80
db_file_multiblock_read_count = 8
# db_block_buffers = 100 #ora9i已經廢除
shared_pool_size = 150000000 # 設定太小可能造成oracle例項突然中斷
log_checkpoint_interval = 10000
processes = 150
compatible='9.2.0.0.0'
parallel_max_servers = 5
log_buffer = 32768
max_dump_file_size = 10240 # limit trace file size to 5 Meg each
global_names = TRUE
control_files='/export/home/oracle/oradata/ECOM/control01.ctl','/export/home/oracle/oradata/ECOM/control02.ctl','/export/home/oracle/oradata/ECOM/control03.ctl'
background_dump_dest='/export/home/oracle/admin/ECOM/bdump'
core_dump_dest='/export/home/oracle/admin/ECOM/cdump'
user_dump_dest='/export/home/oracle/admin/ECOM/udump'
undo_tablespace='UNDOTBS1'
undo_management='AUTO'
-- /export/home/oracle/9i/dbs/init.ora end

-- 建立資料庫
sqlplus '/as sysdba'
spool /export/home/oracle/admin/ECOM/create/CreateDB.log
startup nomount pfile='/export/home/oracle/9i/dbs/initECOM.ora'
CREATE DATABASE ECOM
CONTROLFILE REUSE
USER SYS IDENTIFIED BY change_on_install
USER SYSTEM IDENTIFIED BY manager
LOGFILE GROUP 1 ('/export/home/oracle/oradata/ECOM/redo01.log') SIZE 16M,
GROUP 2 ('/export/home/oracle/oradata/ECOM/redo02.log') SIZE 16M,
GROUP 3 ('/export/home/oracle/oradata/ECOM/redo03.log') SIZE 16M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
MAXINSTANCES 1
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
DATAFILE '/export/home/oracle/oradata/ECOM/system01.dbf' SIZE 325M REUSE EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE temp TEMPFILE '/export/home/oracle/oradata/ECOM/temp01.dbf' SIZE 20M extent management local uniform
UNDO TABLESPACE UNDOTBS1 DATAFILE '/export/home/oracle/oradata/ECOM/undotbs01.dbf' SIZE 200M ;
spool off;
exit;

-- 建立資料庫檔案
spool /export/home/oracle/admin/ECOM/create/CreateDBFiles.log
CREATE TABLESPACE "INDX" LOGGING
DATAFILE '/export/home/oracle/oradata/ECOM/indx01.dbf'
SIZE 25M REUSE
AUTOEXTEND ON
NEXT 1280K
MAXSIZE
UNLIMITED
EXTENT MANAGEMENT LOCAL;
CREATE TABLESPACE "TOOLS" LOGGING
DATAFILE '/export/home/oracle/oradata/ECOM/tools01.dbf'
SIZE 10M REUSE
AUTOEXTEND ON
NEXT 320K
MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL;
CREATE TABLESPACE "USERS" LOGGING
DATAFILE '/export/home/oracle/oradata/ECOM/users01.dbf'
SIZE 25M REUSE
AUTOEXTEND ON
NEXT 1280K
MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL;
spool off
exit;

-- 建立資料庫字典
connect /as sysdba;
create spfile='/export/home/oracle/9i/dbs/spfileECOM.ora' from pfile='/export/home/oracle/9i/dbs/initECOM.ora';
shutdown immediate;

connect /as sysdba
startup
sqlplus '/as sysdba' -- sys
spool /export/home/oracle/admin/ECOM/create/CreateDBCatalog.log
@/export/home/oracle/9i/rdbms/admin/catalog.sql;
@/export/home/oracle/9i/rdbms/admin/catexp7.sql;
@/export/home/oracle/9i/rdbms/admin/catblock.sql;
@/export/home/oracle/9i/rdbms/admin/catproc.sql;
@/export/home/oracle/9i/rdbms/admin/catoctk.sql;
@/export/home/oracle/9i/rdbms/admin/catobtk.sql;
@/export/home/oracle/9i/rdbms/admin/caths.sql;
@/export/home/oracle/9i/rdbms/admin/owminst.plb;
connect SYSTEM/manager
@/export/home/oracle/9i/sqlplus/admin/pupbld.sql;
@/export/home/oracle/9i/sqlplus/admin/help/hlpbld.sql helpus.sql;

set lines 160
col name for a70
col name for a90
select name,value from v$parameter order by name;

[@more@]

.bash_profile

#export LD_ASSUME_KERNEL=2.4.20
export ORACLE_BASE=/export/home/oracle
export ORACLE_HOME=$ORACLE_BASE/9i
export ORACLE_SID=ECOM
export ORACLE_TERM=xterm
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/openwin/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/td/lib:/usr/ucblib:/usr/local/lib
export LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_HOME/bin
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export LANG=zh_CN
export NLS_LANG="AMERICAN_AMERICA.ZHS16GBK" ; export NLS_LANG
#export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK" ; export NLS_LANG
export PATH=$PATH:$ORACLE_BASE/9i/bin

-- 生成資料庫初始化引數檔案 /export/home/oracle/9i/dbs/initECOM.ora
db_name=ECOM
db_block_size=8192
db_cache_size=25165824
db_files = 80
db_file_multiblock_read_count = 8
# db_block_buffers = 100 #ora9i已經廢除
shared_pool_size = 150000000 # 設定太小可能造成oracle例項突然中斷
log_checkpoint_interval = 10000
processes = 150
compatible='9.2.0.0.0'
parallel_max_servers = 5
log_buffer = 32768
max_dump_file_size = 10240 # limit trace file size to 5 Meg each
global_names = TRUE
control_files='/export/home/oracle/oradata/ECOM/control01.ctl','/export/home/oracle/oradata/ECOM/control02.ctl','/export/home/oracle/oradata/ECOM/control03.ctl'
background_dump_dest='/export/home/oracle/admin/ECOM/bdump'
core_dump_dest='/export/home/oracle/admin/ECOM/cdump'
user_dump_dest='/export/home/oracle/admin/ECOM/udump'
undo_tablespace='UNDOTBS1'
undo_management='AUTO'
-- /export/home/oracle/9i/dbs/init.ora end

-- 建立資料庫
sqlplus '/as sysdba'
spool /export/home/oracle/admin/ECOM/create/CreateDB.log
startup nomount pfile='/export/home/oracle/9i/dbs/initECOM.ora'
CREATE DATABASE ECOM
CONTROLFILE REUSE
USER SYS IDENTIFIED BY change_on_install
USER SYSTEM IDENTIFIED BY manager
LOGFILE GROUP 1 ('/export/home/oracle/oradata/ECOM/redo01.log') SIZE 16M,
GROUP 2 ('/export/home/oracle/oradata/ECOM/redo02.log') SIZE 16M,
GROUP 3 ('/export/home/oracle/oradata/ECOM/redo03.log') SIZE 16M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
MAXINSTANCES 1
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
DATAFILE '/export/home/oracle/oradata/ECOM/system01.dbf' SIZE 325M REUSE EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE temp TEMPFILE '/export/home/oracle/oradata/ECOM/temp01.dbf' SIZE 20M extent management local uniform
UNDO TABLESPACE UNDOTBS1 DATAFILE '/export/home/oracle/oradata/ECOM/undotbs01.dbf' SIZE 200M ;
spool off;
exit;

-- 建立資料庫檔案
spool /export/home/oracle/admin/ECOM/create/CreateDBFiles.log
CREATE TABLESPACE "INDX" LOGGING
DATAFILE '/export/home/oracle/oradata/ECOM/indx01.dbf'
SIZE 25M REUSE
AUTOEXTEND ON
NEXT 1280K
MAXSIZE
UNLIMITED
EXTENT MANAGEMENT LOCAL;
CREATE TABLESPACE "TOOLS" LOGGING
DATAFILE '/export/home/oracle/oradata/ECOM/tools01.dbf'
SIZE 10M REUSE
AUTOEXTEND ON
NEXT 320K
MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL;
CREATE TABLESPACE "USERS" LOGGING
DATAFILE '/export/home/oracle/oradata/ECOM/users01.dbf'
SIZE 25M REUSE
AUTOEXTEND ON
NEXT 1280K
MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL;
spool off
exit;

-- 建立資料庫字典
connect /as sysdba;
create spfile='/export/home/oracle/9i/dbs/spfileECOM.ora' from pfile='/export/home/oracle/9i/dbs/initECOM.ora';
shutdown immediate;

connect /as sysdba
startup
sqlplus '/as sysdba' -- sys
spool /export/home/oracle/admin/ECOM/create/CreateDBCatalog.log
@/export/home/oracle/9i/rdbms/admin/catalog.sql;
@/export/home/oracle/9i/rdbms/admin/catexp7.sql;
@/export/home/oracle/9i/rdbms/admin/catblock.sql;
@/export/home/oracle/9i/rdbms/admin/catproc.sql;
@/export/home/oracle/9i/rdbms/admin/catoctk.sql;
@/export/home/oracle/9i/rdbms/admin/catobtk.sql;
@/export/home/oracle/9i/rdbms/admin/caths.sql;
@/export/home/oracle/9i/rdbms/admin/owminst.plb;
connect SYSTEM/manager
@/export/home/oracle/9i/sqlplus/admin/pupbld.sql;
@/export/home/oracle/9i/sqlplus/admin/help/hlpbld.sql helpus.sql;

set lines 160
col name for a70
col name for a90
select name,value from v$parameter order by name;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8806316/viewspace-912412/,如需轉載,請註明出處,否則將追究法律責任。

相關文章