cfg_pdmora

来自「proe5.0野火版下载(中文版免费下载)」· 代码 · 共 695 行 · 第 1/2 页

TXT
695
字号
#!/bin/csh -fset fullscrname="$0"set scrname="$fullscrname:t"set scrdir="$fullscrname:h"if ($scrname == $scrdir) then    set scrdir = `pwd`endif#########################################################################                                                                      ## PTC installation/configuration script                                ##                                                                      ## Title - cfg_pdmora                                                   ##                                                                      ## Function - Configure an ORACLE datebase to run with Pro/PDM          ##                                                                      ## Inputs - DF_CMD                                                      ##          DF_CMD                                                      ##          DF_FCOL                                                     ##          PS_CMD                                                      ##          PRO_LOAD_DIR                                                ##                                                                      ## Modifications                                                        ##                                                                      ## 03-15-94  $$1  James Created                                         ## 03-21-94  $$2  James Set ORACLE_{HOME,SID}                           ## 03-29-94  $$3  James Fixed RE# 04-10-94  $$4  James non-dba pdmserver changes.# 05-01-94  $$5  James Ask for initial tb size.# 07-19-94  $$6  James ORAPWDCHK# 09-28-94  $$7  sfc   Identify Oracle version number# 09-30-94  $$8  sfc   Added ORAPWDCHK for Oracle V7# 10-06-94  $$9  James Fixed syntax error and commented echo of ORAPWDCHK# 10-14-94  $$10 sfc   Fixed syntax error# 10-21-94  $$11 James/RB    Ask if installer has auto log priv.# 11-03-94  $$12 James Standalone mode.# 01-04-95  $$13 sfc   Allowed users to define tablespace file location## 01-13-95  $$14 James Look for ../../pdm/pdmtools/sql directory.# 04-05-95  $$14 sfc   Oracle user's password will not display on the screen# 04-19-95  $$15 sfc   Added default password option, removed unnecessary msg.# 01-18-96  $$16 sfc   Changed some misleading messages. #                      Find sql scripts in the $PRO_LOAD_DIR/pdm/pdmtools/sql.########################################################################if ( ! ($?PRO_LOAD_DIR && $?DF_CMD && $?DF_FCOL && $?PS_CMD && $?PDMUSER && $?CNFG_STATFILE && $?ORAPWDCHK && $?ORAUSER)) then   echo ""   echo "Pro/PDM script to configure an ORACLE database."   echo "-----------------------------------------------"   echo ""endif########################################################################if (! $?PRO_LOAD_DIR) then   setenv PRO_LOAD_DIR "__unset__"endifif (! $?DF_CMD) then   setenv DF_CMD "__unset__"endifif (! $?DF_FCOL) then   setenv DF_FCOL "__unset__"endifif (! $?PS_CMD) then   setenv PS_CMD "__unset__"endifif (! $?PDMUSER) then   unset valid_ans   while (! $?valid_ans)      echo ""      echo "What is the UNIX username of the Pro/PDM Server owner."      echo -n "?: "      set ans="$<"      if ("$ans" == "") continue      set valid_ans   end   setenv PDMUSER "$ans"endifif (! $?CNFG_STATFILE) then   setenv CNFG_STATFILE "/dev/null"endifif (! $?ORAPWDCHK) then   unset valid_ans   while (! $?valid_ans)      echo ""      echo "DO you want the Pro/PDM server process owner '$PDMUSER'"      echo "to use an automatic login account to connect Oracle?"      echo "(i.e. should user '$PDMUSER' be able to login to Oracle"      echo "without a password)"       echo -n "(y/n) ?: "      set ans="$<"      if ("$ans" == "") continue      if ("$ans" =~ [Yy]* || "$ans" =~ [Nn]* ) set valid_ans   end   if ("$ans" =~ [Yy]*) then      setenv ORAPWDCHK 0   else      setenv ORAPWDCHK 1   endifendifif (! $?ORAUSER) then   setenv ORAUSER "__unset__"endif########################################################################echo "started" > $CNFG_STATFILEif ("$ORAPWDCHK" != "0") setenv ORAPWDCHK 1#echo $ORAPWDCHKunset info_onlyif ("$1" != "") then   if ("$1" != "info") then      echo "Usage:  $scrname [info]"      goto EXIT_ERROR   endif   set info_onlyendif# local initsset gen_tmpfile="/tmp/$scrname.$$"# Ask for ORACLE info# 1. is effectively: grant DBA to OPS$user identified by userpasswordif ($?info_only) then   while(1)      echo ""      echo "Prerequsite ORACLE preparations are as follows:"      echo ""      echo "1 - Do you know:"      echo ""      echo "EITHER:"      echo "    A UNIX username/password which has automatic login"      echo "    privilege and database administrator (DBA) access to Oracle."      echo "    ex:  oracle/<password>"      echo ""      echo "OR:"      echo "    A UNIX username/password which has write-access to ORACLE_HOME"      echo "    AND any ORACLE DBA oracle_username/oracle_password."      echo ""      echo "2 - Do you know the ORACLE_HOME directory, ORACLE_SID and db initialization"      echo "    filename."      echo "    ex:  /usr/oracle, oracle  and /usr/oracle/dbs/initoracle.ora"      echo ""      echo "3 - Do you know initially how large the index and data tablespace files"      echo "    should be created (the default is 10 Mb)."      echo ""if ($ORAPWDCHK) then      echo "4 - Have you granted all the necessary privileges to user '$PDMUSER'."      echo ""endif      echo -n "Have the above preparations been made (y/n) ?: "      set ans="$<"      if ("$ans" =~ [Nn]* || "$ans" =~ [Yy]*) break   end   if ("$ans" =~ [Nn]*) then      goto EXIT_ERROR   else      goto EXIT_SUCCESS   endifendifif ("$ORAUSER" == "__unset__") then   set ask_prompt="Do you have automatic login privilege."else   set ask_prompt="Does $ORAUSER have automatic login privilege."endifecho ""unset valid_answhile (! $?valid_ans)   echo ""   echo "$ask_prompt"   echo -n "(y/n) ? "   set ans="$<"   if ("$ans" =~ [Yy]* || "$ans" =~ [Nn]* ) set valid_ansendset oracle_username=""  set oracle_passwd=""  if ("$ans" =~ [Nn]*) then    echo ""   while ("$oracle_username" == "")       echo -n "Enter the ORACLE username ?: "      set oracle_username="$<"    end   while ("$oracle_passwd" == "")       echo -n "Enter ${oracle_username}'s password ?: "      stty -echo              # turn echo off      set oracle_passwd="$<"       stty echo               # turn echo on   end   echo ""endifset conline="connect $oracle_username/$oracle_passwd;"# Check the environment variables : ORACLE_HOME if ($?ORACLE_HOME) then   set def="$ORACLE_HOME"else   set def=`echo ~oracle`   if ("$def" != "") then      if (! -d "$def") set def=""   endifendifset orahome=""echo ""while ("$orahome" == "")    echo "Enter the Oracle Home directory (ORACLE_HOME)"   echo -n "[$def] ?: "   set orahome="$<"   if ("$orahome" == "") set orahome="$def"   if (! -d "$orahome") then      echo "ERROR:  $orahome - no such directory."      echo ""      set orahome=""   endifend# Check the environment variables :  ORACLE_SIDif ($?ORACLE_SID) then   set def="$ORACLE_SID"else if (-e $orahome/.cshrc) then   set def=`grep ORACLE_SID $orahome/.cshrc | awk '{print $3}'`else   set def=""endifecho ""set orasid=""while ("$orasid" == "")    echo "Enter the Oracle system identifier (ORACLE_SID)"   echo -n "[$def] ?: "   set orasid="$<"   if ("$orasid" == "") set orasid="$def"end# Check the initialization file if (-e $orahome/dbs/init$orasid.ora) then   set def="$orahome/dbs/init$orasid.ora"else   set def=""endifecho ""set orainitfile=""while ("$orainitfile" == "")    echo "Enter the Oracle Database Initialization filename"   echo -n "[$def] ?: "   set orainitfile="$<"   if ("$orainitfile" == "") set orainitfile="$def"   if (-e "$orainitfile") then      set dbfile_sid=`grep db_name $orainitfile | awk -F\= '{print $2}'`      if ("$dbfile_sid" != "" && "$dbfile_sid" != "$orasid") then         echo ""         echo "WARNING:  db_name entry in $orainitfile ($dbfile_sid)"         echo "          is different than your ORACLE_SID ($orasid)"         echo ""      endif   else      echo "ERROR:  $orainitfile - no such file."      echo ""      set orainitfile=""   endifend# allowed users to define the tablespace files location echo ""set oracle_tbsp = ""set def="$ORACLE_HOME/PTC_PDM"echo "Please enter the full path of the tablespace files directory : "echo -n "[$def] ?: "set oracle_tbsp = "$<"if ("$oracle_tbsp" == "") set oracle_tbsp = $def# check PTC_PDM dir(default tablespace files directory) exists / try to create it.if ("$oracle_tbsp" == "$def") then if (! -d $oracle_tbsp) then    mkdir $oracle_tbsp >& /dev/null    if ($status != 0) then       echo " "       echo "ERROR:  $oracle_tbsp - no such directory."       echo "        As the owner of $orahome type:"       echo "        mkdir $oracle_tbsp"       echo "        then retry."       goto EXIT_ERROR    endif endifendif# Check the tablespace files directory exists/try to create it. if (! -d $oracle_tbsp) then   unset valid_ans   while (! $?valid_ans)      echo ""      echo "Warning : The directory $oracle_tbsp does not exist."      echo "          Would you like to create the tablespace files directory:"      echo -n "          $oracle_tbsp  (y/n)? "      set ans="$<"      if ("$ans" =~ [Yy]* || "$ans" =~ [Nn]* ) set valid_ans   end   if ("$ans" =~ [Nn]*) then      echo ""      echo "ERROR : You have to define the full path of tablespace files directory."      echo ""      goto EXIT_ERROR   endif   if ("$ans" =~ [Yy]*) then       mkdir $oracle_tbsp >& /dev/null       if ($status != 0) then           echo ""           echo "ERROR:  Cannot create $oracle_tbsp "           echo "        Please check the read/write priviledges,"           echo "        then retry."           goto EXIT_ERROR       endif   endifendifif (! $?ORACLE_TBSP) then   setenv ORACLE_TBSP  $oracle_tbspendifif (-e $orahome/.cshrc) then  if (`grep 'ORACLE_TBSP' $orahome/.cshrc | wc -l` == 0) then

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?