.com Solutions Inc. - logo  
Products - Header Buttons
.
Repgen bullet item 7b Installgen bullet item 7b FmPro Migratorbullet item 7b CGIScripter
.
.
.

.
.

Installgen - win901 - Title Graphic

Installgen Features and Benefits

Installgen Demo Available for download...

Bookmark This Page

email a friend

.

#!/bin/bash
# script: 9_macosx_920_ora_post_install_1.sh
# Features: This shell script creates the spfile, new Oracle DBA accounts
# changes default passwords, installs database backup,
# export and performance tuning scripts.
#
# Limitations: Local use of the OEM Console Java application is not supported
# with Developer Release 1 of Oracle 9.2.0 for Mac OS X.
# Script Sequence#: 9
# Used By: run manually as oracle UNIX user
# Copyright 2002 by .com Solutions Inc.
#
# ---------------------- Revision History ---------------
# Date By Changes
# 10-14-2002 dsimpson Initial Release for Mac OS X.

# This output file was created by Installgen version 1.38 on Sat Nov 23 07:13:32 2002. By .com Solutions Inc. www.dotcomsolutionsinc.net

PATH=/bin:/sbin:/usr/bin:/usr/sbin:.
ORACLE_BASE=/Users/oracle/v920
ORACLE_HOME=/Users/oracle/v920
ORACLE_OWNER=oracle
ORACLE_OWNER_PATH=/Users/oracle
ORACLE_GROUP=dba
PATH=$PATH:$ORACLE_HOME/bin
SRCHOME=$ORACLE_HOME
ORACLE_SID=prod1
CLASSPATH=$ORACLE_HOME/DBCreate/oradev/classes/orapts.jar:$ORACLE_HOME/jdbc/lib/classes12.zip:$CLASSPATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
DYLD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib:$DYLD_LIBRARY_PATH
ORAENV_ASK=NO
TNS_ADMIN=$ORACLE_HOME/network/admin
TERM=vt100
NLS_LANG=AMERICAN_AMERICA.US7ASCII

export PATH ORACLE_BASE ORACLE_HOME SRCHOME ORACLE_SID CLASSPATH LD_LIBRARY_PATH DYLD_LIBRARY_PATH ORACLE_OWNER TNS_ADMIN TERM NLS_LANG

# the following ulimit parameters are required by the Oracle database on Mac OS X
ulimit -c unlimited
ulimit -d unlimited
ulimit -s 65536
ulimit -u 500
ulimit -n 10000

# the rman_oem_backup variable will be =1 if rman backups are scheduled via OEM/OMS jobs
rman_oem_backup=0

# make sure the oracle user is running this script
if [ ! $LOGNAME = "$ORACLE_OWNER" ]
then
# the user running this script is not $ORACLE_OWNER - exit
echo "You must be logged in as the $ORACLE_OWNER user to run this script, exiting...."
# exit immediately!
exit
fi

echo ""
echo "Adding DBA accounts..."
echo ""
echo "Changing default Oracle database passwords:"
echo "username: SYS=s9_21sv"
echo "username: SYSTEM=Wt_47i"
echo "username: OUTLN=Wt_47i"
echo "username: DBSNMP=Wt_47i"
echo "username: ORDSYS=intermedia"
echo "username: CTXSYS=intermedia"
echo "username: MDSYS=intermedia"
echo "username: WKSYS=intermedia"


$ORACLE_HOME/bin/sqlplus /nolog << EOF
connect / as SYSDBA
set echo on
spool /Users/oracle/v920/assistants/dbca/logs/postDBCreation.log

-- enable archivelog mode
shutdown immediate;
startup mount pfile="/Users/oracle/v920/dbs/initprod1.ora";
alter database archivelog;
alter database open;
alter system archive log start;
-- change default passwords
ALTER USER SYS IDENTIFIED BY s9_21sv;
ALTER USER SYSTEM IDENTIFIED BY Wt_47i;
ALTER USER OUTLN IDENTIFIED BY Wt_47i;
ALTER USER DBSNMP IDENTIFIED BY Wt_47i;
ALTER USER ORDSYS IDENTIFIED BY "intermedia";
ALTER USER CTXSYS IDENTIFIED BY "intermedia";
ALTER USER MDSYS IDENTIFIED BY "intermedia";
ALTER USER WKSYS IDENTIFIED BY "intermedia";
ALTER USER ctxsys IDENTIFIED BY intermedia ACCOUNT UNLOCK;
ALTER USER wksys IDENTIFIED BY intermedia ACCOUNT UNLOCK;

--
EXEC DBMS_STATS.CREATE_STAT_TABLE(OWNNAME=>'SYS',STATTAB=>'SYSSTATS');
-- make sure that stats can be collected
ALTER SYSTEM SET JOB_QUEUE_PROCESSES = 1;
-- create invalid rows table in SYS for partitioned tables
-- to avoid ORA-14508 error
@/Users/oracle/v920/rdbms/admin/utlvalid.sql
--
connect / as SYSDBA
-- create Oracle dba accounts
create user admin identified by zx-vnm
default tablespace users
temporary tablespace temp
quota unlimited on users;
grant connect to admin;
grant resource to admin;
grant exp_full_database to admin;
grant imp_full_database to admin;
grant sysdba to admin;
grant OEM_MONITOR to admin;
-- grant execute on LT_EXPORT_PKG to fix Bug# 1828996 referenced in
-- Oracle Support Note#159695 on 12-27-2001
grant execute on SYS.LT_EXPORT_PKG to EXP_FULL_DATABASE;
create user thedba identified by e2-76
default tablespace users
temporary tablespace temp
quota unlimited on users;
grant connect to thedba;
grant resource to thedba;
grant exp_full_database to thedba;
grant imp_full_database to thedba;
grant sysdba to thedba;
grant OEM_MONITOR to thedba;
-- grant execute on LT_EXPORT_PKG to fix Bug# 1828996 referenced in
-- Oracle Support Note#159695 on 12-27-2001
grant execute on SYS.LT_EXPORT_PKG to EXP_FULL_DATABASE;
exit;
EOF

# apply latest major database patch
echo ""
/Users/oracle/52_macosx_920_patch_db_1.sh

echo ""
echo "Copying new database oratab file - to allow automatic startup of instance."
echo ""
cp /Users/oracle/46_macosx_oratab_1.txt /etc/oratab

if [ $rman_oem_backup -eq 0 ]
then
# ask whether to install scripts for non-OEM based scheduling
echo "Install controlfile backup to trace script?y/n"
read answer
if [ "$answer" = "y" ]
then
# copy script to /Volumes/u01/server_scripts directory
cp 36_macosx_prod1_controlfile_backup_to_trace_1.sh /Volumes/u01/server_scripts/prod1_controlfile_backup_to_trace_1.sh

echo "This job needs to be executed via an oracle UNIX account CRON job as follows:"
echo "# ******** Nightly backup of controlfile to trace at 11:51PM ********"
echo "51 23 * * 0-6 /Volumes/u01/server_scripts/prod1_controlfile_backup_to_trace_1.sh"
echo "Press the Return key once this CRON job has been entered."
read answer

fi

echo "Install RMAN backup script which doesn't use OEM server? y/n"
read answer
if [ "$answer" = "y" ]
then

# copy backup script to /Volumes/u01/server_scripts directory
cp 29_macosx_920_rman_backup_job_1.sh /Volumes/u01/server_scripts/prod1_rman_backup_job_1.sh

# copy the restore script to /Volumes/u01/server_scripts directory
cp 30_macosx_920_prod1_rman_restore_db_1.sh /Volumes/u01/server_scripts/prod1_rman_restore_db_1.sh

echo "This job needs to be executed via an oracle UNIX account CRON job as follows:"
echo "# ******** RMAN Full Oracle Database nightly backup at 4:03 ********"
echo "03 4 * * 0-6 /Volumes/u01/server_scripts/prod1_rman_backup_job_1.sh"
echo "Press the Return key once this CRON job has been entered."
read answer

fi

echo "Install Nightly Full Database Export script - scheduled via CRON? y/n"
read answer
if [ "$answer" = "y" ]
then

# copy export script to /Volumes/u01/server_scripts directory
cp 35_macosx_prod1_export_full_db_1.sh /Volumes/u01/server_scripts/prod1_export_full_db_1.sh

echo "This job needs to be executed via an oracle UNIX account CRON job as follows:"
echo "# ******** Full Oracle Database Export nightly at 11:50PM ********"
echo "50 23 * * 0-6 /Volumes/u01/server_scripts/prod1_export_full_db_1.sh"
echo "Press the Return key once this CRON job has been entered."
read answer

fi

echo "Install Nightly Closed Database backup job - scheduled via CRON? y/n"
read answer
if [ "$answer" = "y" ]
then

# copy export script to /Volumes/u01/server_scripts directory
cp 31_macosx_prod1_closed_db_backup_job_1.sh /Volumes/u01/server_scripts/prod1_closed_db_backup_job_1.sh

echo "This job needs to be executed via an oracle UNIX account CRON job as follows:"
echo "# ******** Closed Oracle Database backup nightly at 4:03 ********"
echo "03 4 * * 0-6 /Volumes/u01/server_scripts/prod1_closed_db_backup_job_1.sh"
echo "Press the Return key once this CRON job has been entered."
read answer

fi

echo "Install Nightly Open Database backup job - scheduled via CRON? y/n"
read answer
if [ "$answer" = "y" ]
then

# copy export script to /Volumes/u01/server_scripts directory
cp 33_macosx_prod1_open_db_backup_job_1.sh /Volumes/u01/server_scripts/prod1_open_db_backup_job_1.sh

echo "This job needs to be executed via an oracle UNIX account CRON job as follows:"
echo "# ******** Open Oracle Database backup nightly at 4:03 ********"
echo "03 4 * * 0-6 /Volumes/u01/server_scripts/prod1_open_db_backup_job_1.sh"
echo "Press the Return key once this CRON job has been entered."
read answer

fi

# ask whether to install performance monitoring scripts via CRON based scheduling
echo "Install performance monitoring script scheduled via CRON? y/n"
read answer
if [ "$answer" = "y" ]
then
# copy script to /Volumes/u01/server_scripts directory
# cp 59_macosx_920_prod1_gather_stats_day_job_1.sh /Volumes/u01/server_scripts/prod1_gather_stats_day_job_1.sh
# cp 60_macosx_920_prod1_gather_stats_night_job_1.sh /Volumes/u01/server_scripts/prod1_gather_stats_night_job_1.sh
# cp 57_macosx_920_prod1_import_stats_day_job_1.sh /Volumes/u01/server_scripts/prod1_import_stats_day_job_1.sh
# cp 58_macosx_920_prod1_import_stats_night_job_1.sh /Volumes/u01/server_scripts/prod1_import_stats_night_job_1.sh
cp 56_macosx_920_prod1_schema_stats_job_1.sh /Volumes/u01/server_scripts/prod1_schema_stats_job_1.sh

echo "This job needs to be executed via oracle UNIX account CRON job as follows:"
# echo "# ******* Gather daytime Oracle CBO stats Mondays at 9:00AM ********"
# echo "00 09 * * 1 /Volumes/u01/server_scripts/prod1_gather_stats_day_job_1.sh"

# echo "# ******** Gather nightly batch Oracle CBO stats Mondays at 9:00PM ********"
# echo "00 21 * * 1 /Volumes/u01/server_scripts/prod1_gather_stats_night_job_1.sh"

# echo "# ******** Import daytime Oracle CBO stats weekdays daily at 5:00AM ********"
# echo "00 05 * * 1-5 /Volumes/u01/server_scripts/prod1_import_stats_day_job_1.sh"

# echo "# ******** Import nightly Oracle CBO stats weekdays daily at 6:00PM ********"
# echo "00 18 * * 1-5 /Volumes/u01/server_scripts/prod1_import_stats_night_job_1.sh"

echo "# ******** Gather Oracle CBO schema stats Fridays at 9:00PM ********"
echo "00 21 * * 5 /Volumes/u01/server_scripts/prod1_schema_stats_job_1.sh"

# create the overall database stats table in the SYS schema
$ORACLE_HOME/bin/sqlplus /nolog<< EOF
connect / as SYSDBA
EXEC DBMS_STATS.CREATE_STAT_TABLE(OWNNAME=>'SYS',STATTAB=>'SYSSTATS');
exit;
EOF

echo "Press the Return key once this CRON job has been entered."
read answer

fi
fi

# install new version of dbshut script to insure that database can
# be shut down when the operating system goes down
mv $ORACLE_HOME/bin/dbshut $ORACLE_HOME/bin/orig-dbshut
cp 55_macosx_920_dbshut_1.sh $ORACLE_HOME/bin/dbshut
chmod +x $ORACLE_HOME/bin/dbshut

# rename tasklist spreadsheet
mv 40_macosx_prod1_tasklist_sheet_1.slk prod1_tasklist_sheet_1.sh

# rename timeline spreadsheet
echo ""
echo "Re-naming script 43_macosx_prod1_backup_timeline_1.slk to prod1_backup_timeline_1.slk ."
echo ""
mv 43_macosx_prod1_backup_timeline_1.slk prod1_backup_timeline_1.slk

echo ""
echo "Removing script 41_macosx_remove_oracle_1.sh for safety..."
echo ""
rm 41_macosx_remove_oracle_1.sh

echo ""
echo "Making all perl and shell scripts in /Volumes/u01/server_scripts executable."
echo ""
chmod +x /Volumes/u01/server_scripts/*.sh
chmod +x /Volumes/u01/server_scripts/*.pl



.

hline

. .

.

. .
 

Home | Products | Services | Downloads | Order | Support | Contact

Legal Notices

.
.   .
.
Home Products Services Downloads Order Support Contact