oracle靜默建庫刪庫

arthurtangel發表於2012-12-04
init.conf

GLOBE_DBNAME=ccttos
SID=ccttos
SYSPASSWORD=SYS
SYSTEMPASSWORD=SYSTEM
MEMORY_TARGET_M=3072


install.sh

#!/bin/bash
###############################################
#
#silent install
#
###############################################

while read line
do
keys="`echo $line |awk -F= '{print $1}'`"
val="`echo $line |awk -F= '{print $2}'`"
case "${keys}" in
SID)
ORACLE_SID=${val}
;;
GLOBE_DBNAME)
ORACLE_GNAME=${val}
;;
SYSPASSWORD)
ORACLE_SYS_PWD=${val}
;;
SYSTEMPASSWORD)
ORACLE_SYSTEM_PWD=${val}
;;
MEMORY_TARGET_M)
MEMORY_TARGET_M=${val}
;;
esac
done < init.conf

dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName $ORACLE_GNAME -sid $ORACLE_SID -SYSPASSWORD $ORACLE_SYS_PWD -SYSTEMPASSWORD $ORACLE_SYSTEM_PWD -characterSet ZHS16GBK -nationalCharacterSet AL16UTF16 -totalMemory $MEMORY_TARGET_M -INITPARAMS open_cursors=1000,db_keep_cache_size=300M,result_cache_max_size=300M -redoLogFileSize 512 -automaticMemoryManagement true


unistanll.sh

#!/bin/bash
###############################################
#
#silent uninstall
#
###############################################

while read line
do
keys="`echo $line |awk -F= '{print $1}'`"
val="`echo $line |awk -F= '{print $2}'`"
case "${keys}" in
SID)
ORACLE_SID=${val}
;;
GLOBE_DBNAME)
ORACLE_GNAME=${val}
;;
SYSPASSWORD)
ORACLE_SYS_PWD=${val}
;;
SYSTEMPASSWORD)
ORACLE_SYSTEM_PWD=${val}
;;
MEMORY_TARGET_M)
MEMORY_TARGET_M=${val}
;;
esac
done < init.conf

dbca -silent -deleteDatabase -sourceDB $ORACLE_GNAME -sid $ORACLE_SID -sysDBAUserName SYS -sysDBAPassword $ORACLE_SYS_PWD

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

相關文章