How To Install Oracle 10g On Solaris 10

BACKGROUND & OVERVIEW

The following documentation provides instructions for building an Oracle database residing on a Sun Solaris 10 (Version 5.10) operating system. It also describes the steps required to plug the database into Netbackup and perform a database bare metal recovery (BMR).

Solaris 10 introduces many new features to the Unix environment. Of particular use to the DBA is the dynamic memory management feature which means that pre-configuration of the kernel - /etc/system - is no longer necessary.

Another new feature which will require a change to DBA process and procedure is the use of the Service Management Facility (SMF) which will require all services - the database and listener included - to be stopped and started using SMF commands. As of January 2007, this feature is not supported by Oracle and therefore will not be incorporated into this initial documentation. Instead, the use of shutdown and startup scripts as utilised on earlier versions of Solaris will be maintained.

Further reference documentation about Oracle and Solaris 10 is detailed in the other references section below.

ASSUMPTIONS & PRE-REQUISITES

This document expects and assumes the following:

  • The instructions are carried out by a qualified DBA, fully conversant with Oracle.
  • Access to the internet is available.
  • All necessary client software, e.g. Telnet and X-Server is available.
  • The resultant database will be standalone, i.e. not part of a cluster or failover configuration.
  • All references to SID should be replaced with correct database name as derived using the database naming standard.
  • All $variable references assume the .profile as described in the File Listings section has been implemented and run.
  • There is only ONE database installed on the server.

USEFUL INFORMATION

This section outlines changes or additions to existing site standards that will be implemented as part of the migration to Solaris 10 and Oracle 10g. Some have been made for cosmetic reasons, others for more practical considerations.

  • The following file systems are added to the standard:
    • /u03/oradata/SID/sysaux/d1
    • /u09/oradata/SID/exp/d1
    • /u10/oradata/SID/flash/d1
  • Unless dictated by the application vendor, all databases will have a character set of AL32UTF8
  • Archive log names must now include the mandatory %r tag, this is because starting with Oracle 10g, archived log file names must contain each of the elements %s (sequence), %t (thread), and %r (resetlogs id) to ensure that all archived log file names are unique. This facilitates the ability to roll-forward past a resetlogs command.
  • A new file hc_SID.dat will appear in the $ORACLE_HOME/dbs directory. This is used for health check monitoring by Grid Contol. It contains information used to monitor the instance's health, and to determine why it went down if the instance isn't up. The file will be recreated at every instance startup, therefore there is no need to specifically back it up.

STEP-BY-STEP GUIDE

  1. Ensure oracle account and dba group exists.
  2. Create and run .profile - see File Listings section below.
  3. Ensure the database file systems have been created with correct permissions and have been sized appropriately for the application. - see File Systems section below.
  4. Create a symbollic link from /u01/app/oracle/admin/SID/exp to /u09/oradata/SID/exp/d1
  5. Ensure /var/opt/oracle directory exists and is owned by oracle:dba.
  6. Download the latest oracle binaries from OTN. For example:
    • Enterprise Edition for Solaris Operating System (SPARC) (64-bit)
    • 10gr2_db_sol.cpio.gz : 873,334,160 bytes; cksum - 1491417549
    • p6810189_10204_Solaris-64.zip : 1,276,477,084 bytes; cksum - 2774168749
  7. Unzip the downloaded files using the following commands:
    • cd /u01/app/oracle
    • mkdir -p SOFTWARE/DATABASE/BASE
    • mkdir -p SOFTWARE/DATABASE/UPGRADE
    • cd /u01/app/oracle/SOFTWARE/DATABASE/BASE
    • gunzip 10gr2_db_sol.cpio.gz
    • cpio -idmv < 10gr2_db_sol.cpio
    • cd /u01/app/oracle/SOFTWARE/DATABASE/UPGRADE
    • unzip p6810189_10204_Solaris-64.zip
  8. Configure the DISPLAY variable.
  9. Start x-server.
  10. Run runInstaller and follow the instructions as demonstrated in the Example Install section below.
    • cd /u01/app/oracle/SOFTWARE/DATABSE/BASE
    • ./runInstaller
  11. Some applications may require the companion disk to be installed. This should be done before applying the following patchset.
  12. Run runInstaller for the database patch upgrade.
    • Ensure the DISPLAY variable is still configured.
    • Ensure x-server is still running.
    • cd /u01/app/oracle/SOFTWARE/DATABASE/UPGRADE/Disk1
    • ./runInstaller>
  13. Follow the instructions as demonstrated in the Example Patch Install section below.
  14. Apply any additional patches and/or patchsets (e.g. Critical Patch Updates) as recommended by Oracle and/or the application vendor.
  15. Configure /var/opt/oracle/oratab file and test using . oraenv command - see File Listings section below.
  16. Configure $ORACLE_BASE/admin/SID/create/createdb.sql file, adjusting parameters accordingly - see File Listings section below.
  17. Configure $ORACLE_BASE/admin/SID/pfile/initSID.ora file, adjusting parameters accordingly and create symbollic link to it from $ORACLE_HOME/dbs - see File Listings section below.
  18. Adjust the oracle file permissions by running:
    • $ORACLE_HOME/install/changePerm.sh
    • y
  19. Remove template init.ora and initdw.ora files from $ORACLE_HOME/dbs.
  20. Configure Oracle environment variables using the following commands:
    • . oraenv
    • SID
  21. Start the listener using the command lsnrctl start.
  22. Build the embryo database using the following commands:
    • cd $ORACLE_BASE/admin/SID/create
    • sqlplus '/ as sysdba'
    • @createdb.sql
    • Enter SYS password.
    • Enter SYSTEM password.
    • Enter SID name.
  23. Wait for database to build - this may take up to 30 mins…
    • Confirm there are no unexpected errors in $ORACLE_BASE/admin/SID/create/createdb.log
  24. Set-up the spfile.
    • connect / as sysdba
    • CREATE SPFILE='/u01/app/oracle/admin/SID/pfile/spfileSID.ora' FROM PFILE='/u01/app/oracle/admin/SID/pfile/initSID.ora';
    • shutdown immediate
    • exit
    • cd $ORACLE_HOME/dbs
    • orapwd file=orapwSID password=<password>
    • rm initSID.ora
    • ln -s /u01/app/oracle/admin/SID/pfile/spfileSID.ora spfileSID.ora
    • sqlplus '/ as sysdba'
    • startup
    • exit
  25. Confirm database has been recognised by the listener using the command
    • lsnrctl status
  26. Configure $TNS_ADMIN/tnsnames.ora file, adjusting parameters accordingly - see File Listings section below.
  27. Confirm connections via SQL*net are working using the following commands:
    • sqlplus system/<password>@SID
    • exit
  28. Shutdown the database and listener then request that the storage team install the appropriate Netbackup software.
  29. Link the Netbackup software to oracle using the following commands:
    • cd $ORACLE_HOME/lib
    • ln -s /opt/openv/netbackup/bin/libobk.so64.1 libobk.so
  30. Install and configure the RMAN catalog using the following commands:
    • cd $NBU/install
    • ./install.ksh
      • /
      • y
      • rman SID
      • rman_SID
      • <rman password>
      • y
      • <system password>
      • Wait for RMAN catalog to build…
      • y
  31. Set up control data in order to perform a test backup and recovery.
  32. Switch the log file using the following commands:
    • sqlplus '/ as sysdba'
    • alter system switch logfile;
    • exit
  33. Perform RMAN database and archive log backup using the following commands:
    • cd $NBU/bin
    • ./rman_backup full=y controlfile=y archivelogs=y
    • Wait for the backup to run…
  34. Add further control data for the backup and recovery test.
  35. Switch the log file using the following commands:
    • sqlplus '/ as sysdba'
    • alter system switch logfile;
    • exit
  36. Perform RMAN archive log backup using the following commands:
    • cd $NBU/bin
    • ./rman_backup archivelogs=y
    • Wait for the backup to run…
  37. Confirm with Storage team that backup has worked successfully.
  38. Shutdown database and listener.
  39. Check for any further archive logs and preserve if generated.
  40. Remove all dbf files, log files and control files.
  41. Restore database and archive logs via RMAN using the following commands:
    • cd $NBU/bin
    • ./rman_restore full=y controlfile=y
      • Wait for the restore to run…
        • When all datafiles and archive logs have been restored, the process will error with a media recovery requesting unknown log message - this is normal behaviour.
        • If the tape is in use by other backups, this process may abort with a channel not available message and will require restarting.
    • sqlplus '/ as sysdba'
    • recover database using backup controlfile until cancel;
    • cancel
    • alter database open resetlogs;
  42. Confirm database has restored successfully by checking the control data created earlier.
  43. Ensure the /etc/init.d/oracle file has been created by the Unix administrator and given 755 permissions. See /etc/init.d/oracle for file listing.
  44. Ensure the value for OPATH in /etc/init.d/oracle is set to the correct ORACLE_HOME value.
  45. Ensure the Unix administrator has created the following symbollic links:
    • ln -s /etc/init.d/oracle /etc/rc0.d/K09oracle
    • ln -s /etc/init.d/oracle /etc/rc2.d/K09oracle
    • ln -s /etc/init.d/oracle /etc/rc3.d/S10oracle
  46. Configure the $ORACLE_HOME/bin/dbshut and $ORACLE_HOME/bin/dbstart, listener and oratab parameters accordingly.
  47. Arrange for the Unix administrator to bounce the server in order to confirm that the startup and shutdown scripts behave as expected.
  48. Create a symbolic link to the DBA directory.
    • cd $HOME
    • ln -s /u01/app/oracle/dba dba
  49. Place any shell or SQL scripts into the relevant dba directory
    • SQL to /u01/app/oracle/dba/sql
    • Shell scripts to /u01/app/oracle/dba/scripts

SECURITY COMPLIANCE

The following steps should be performed once the database has been built to ensure that the environment conforms to Oracle's Best Practices and also ensures that it doesn't fall foul of Internal Audit.

  1. Remove the GRANT EXECUTE TO PUBLIC privilege from potentially harmful packages.
    • sqlplus '/ as sysdba'
    • revoke execute on utl_file from public;
    • revoke execute on dbms_random from public;
    • revoke execute on utl_http from public;
    • revoke execute on utl_smtp from public;
    • revoke execute on utl_tcp from public;
    • exit
  2. Ensure the following user-ids' passwords, where applicable, have been changed:
    • SYS
    • SYSTEM
    • DBSNMP
    • OUTLN
    • CTXSYS
    • PERFSTAT
  3. Adjust the database DEFAULT TABLESPACE settings so that the SYSTEM is not used inappropriately.
    • sqlplus '/ as sysdba'
    • alter database default tablespace users;
    • alter user sys default tablespace system;
    • alter user system default tablespace system;
    • Correct any users that already have SYSTEM as their DEFAULT TABLESPACE:
      • select username, default_tablespace from dba_users where default_tablespace = 'SYSTEM';
      • alter user <user name> default tablespace <non-SYSTEM tablespace>;
    • exit
  4. Lock and expire potentially harmful built-in user-ids.
    • sqlplus '/ as sysdba'
    • alter user outln password expire account lock;
    • alter user dbsnmp password expire account lock;
    • exit

REGRESSION

To restore the environment back to its initial state, perform one of the following methods:

TO REMOVE DATABASE ONLY

  1. Shutdown the database and listener.
  2. Remove the RMAN catalog using the following commands:
    • sqlplus system/<password>@<rman_database>
    • drop user rman_SID cascade;
    • exit;
  3. Remove all database files, trace files and administration logs using the clear up script - see Miscellaneous section below.
  4. Remove all lock files and password files using the following commands:
    • cd $ORACLE_HOME/dbs
    • rm hc_SID.dat lkSID orapwSID snapcf_SID.f

TO REMOVE DATABASE & BINARIES

  1. Shutdown the database and listener.
  2. Remove the RMAN catalog using the following commands:
    • sqlplus system/<password>@<rman_database>
    • drop user rman_SID cascade;
    • exit;
  3. Remove all database files, trace files and administration logs using the clear up script - see Miscellaneous section below.
  4. Remove all binaries and inventory files using the following commands:
    • Adjust the following steps accordingly if multiple SID installations exist.
    • cd /u01/app/oracle
    • rm -rf *
    • cd /var/opt/oracle
    • rm -f *

FILE LISTINGS

oracle .profile

         #----------------------------------------------------------------------
         # Configure Terminal Settings.
         #----------------------------------------------------------------------
         stty susp ^Z
         stty quit ^C
         stty erase ^H
         export TERM=vt100-w
         export ORACLE_TERM=vt100
         #----------------------------------------------------------------------
         # Configure Shell Settings.
         #----------------------------------------------------------------------
         set -o vi
         export PATH=/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/ccs/bin:$PATH
         export EDITOR=vi
         export HOSTNAME=`hostname`
         export PS1='$LOGNAME@$HOSTNAME:$ORACLE_SID> '
         export TMPDIR=/tmp
         export TEMP=/tmp
         umask 022
         #----------------------------------------------------------------------
         # Configure Aliases.
         #----------------------------------------------------------------------
         alias ll="ls -la"
         alias bdf="df -k"
         #----------------------------------------------------------------------
         # Configure Oracle Settings.
         #----------------------------------------------------------------------
         export ORACLE_BASE=/u01/app/oracle
         export SQLPATH=$ORACLE_BASE/DBA/SQL
         export ORACLE_HOME=$ORACLE_BASE/product/10.2.0
         export TNS_ADMIN=$ORACLE_HOME/network/admin
         export PATH=$ORACLE_HOME/bin:$PATH
         export ORACLE_HOME_LISTNER=/u01/app/oracle/product/10.2.0
         export ORATAB=/var/opt/oracle/oratab
         #----------------------------------------------------------------------
         # Configure Netbackup Settings.
         #----------------------------------------------------------------------
         export NBU=/opt/openv/netbackup/ext/db_ext/oracle

oratab

         SID:/u01/app/oracle/product/10.2.0:Y

initSID.ora

         ###########################################
         # Cache and I/O
         ###########################################
         db_block_size=8192
         db_cache_size=524288000
         db_block_checking=MEDIUM
         db_block_checksum='FULL'
         db_cache_advice='ON'
         db_file_multiblock_read_count=16
         #filesystemio_options=setall #Unhash this parameter if using SVM
         sga_max_size=6G
         sga_target=3G

         ###########################################
         # Cursors and Library Cache
         ###########################################
         open_cursors=500

         ###########################################
         # Database Identification
         ###########################################
         compatible='10.2.0.4.0'
         db_name=SID

         ###########################################
         # Diagnostics and Statistics
         ###########################################
         audit_file_dest=/u01/app/oracle/admin/SID/adump
         background_dump_dest=/u01/app/oracle/admin/SID/bdump
         core_dump_dest=/u01/app/oracle/admin/SID/cdump
         user_dump_dest=/u01/app/oracle/admin/SID/udump

         ###########################################
         # File Configuration
         ###########################################
         control_files=("/u03/oradata/SID/users/d1/control01.ctl",
         "/u03/oradata/SID/tools/d1/control02.ctl",
         "/u03/oradata/SID/indx/d1/control03.ctl")
         db_files=1000

         ###########################################
         # Job Queues
         ###########################################
         job_queue_processes=1

         ###########################################
         # Miscellaneous
         ###########################################
         optimizer_mode=choose
         timed_statistics=TRUE

         ###########################################
         # Pools
         ###########################################
         java_pool_size=125829120
         large_pool_size=20971520
         shared_pool_size=419430400

         ###########################################
         # Processes
         ###########################################
         processes=1000

         ###########################################
         # Security and Auditing
         ###########################################
         remote_login_passwordfile=exclusive

         ###########################################
         # Sort, Hash Joins, Bitmap Indexes
         ###########################################
         pga_aggregate_target=1048576000

         ###########################################
         # System Managed Undo and Rollback Segments
         ###########################################
         undo_management=AUTO
         undo_tablespace=UNDO

         ###########################################
         # Enabling Archivelog mode
         ###########################################
         log_archive_dest='/u06/oradata/SID/arch/d1'
         log_archive_format=arch_%r_%t_%s.log

createdb.sql

         --
         -- Title :       createdb.sql
         -- Description : Build an empty database.
         --
         -- Usage/Notes : For use with 10g databases.
         --               Required answers for SYS,
         --               SYSTEM and SID.
         --
         -- Copyright :   ABCdba.com 2004
         --

         ACCEPT syspw PROMPT 'Enter SYS password : '
         ACCEPT systpw PROMPT 'Enter SYSTEM password : '
         ACCEPT sid PROMPT 'Enter SID name : '

         SET VERIFY OFF
         SET ECHO ON

         SPOOL createdb.log

         STARTUP NOMOUNT

         CREATE DATABASE &sid
         USER SYS IDENTIFIED BY &syspw
         USER SYSTEM IDENTIFIED BY &systpw
         MAXDATAFILES 1024
         MAXINSTANCES 1
         MAXLOGFILES 32
         MAXLOGMEMBERS 4
         MAXLOGHISTORY 100
         CHARACTER SET AL32UTF8
         ARCHIVELOG
         DATAFILE '/u03/oradata/&sid/system/d1/system_01.dbf'
         SIZE 400m
         EXTENT MANAGEMENT LOCAL
         SYSAUX DATAFILE '/u03/oradata/&sid/sysaux/d1/sysaux_01.dbf'
         SIZE 400m
         LOGFILE
         GROUP 1 ('/u02/oradata/&sid/redo/d1/redo001a.dbf')
         SIZE 50m,
         GROUP 2 ('/u02/oradata/&sid/redo/d1/redo002a.dbf')
         SIZE 50m,
         GROUP 3 ('/u02/oradata/&sid/redo/d1/redo003a.dbf')
         SIZE 50m,
         GROUP 4 ('/u02/oradata/&sid/redo/d1/redo004a.dbf')
         SIZE 50m
         UNDO TABLESPACE undo
         DATAFILE '/u04/oradata/&sid/undo/d1/undo_01.dbf'
         SIZE 400m
         DEFAULT TEMPORARY TABLESPACE temp
         TEMPFILE '/u05/oradata/&sid/temp/d1/temp_01.dbf'
         SIZE 400m
         EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1m
         /

         SET ECHO OFF

         PROMPT
         PROMPT
         PROMPT Now running CATALOG. Please wait....
         PROMPT
         PROMPT

         SET TERMOUT OFF

         @${ORACLE_HOME}/rdbms/admin/catalog

         SET TERMOUT ON

         PROMPT
         PROMPT
         PROMPT Now running CATPROC. Please wait....
         PROMPT
         PROMPT

         SET TERMOUT OFF

         @${ORACLE_HOME}/rdbms/admin/catproc

         SET TERMOUT ON

         SET ECHO ON

         CREATE TABLESPACE tools
         DATAFILE '/u03/oradata/&sid/tools/d1/tools_01.dbf' SIZE 400m
         EXTENT MANAGEMENT LOCAL AUTOALLOCATE
         SEGMENT SPACE MANAGEMENT AUTO
         /

         CREATE TABLESPACE users
         DATAFILE '/u03/oradata/&sid/users/d1/users_01.dbf' SIZE 400m
         EXTENT MANAGEMENT LOCAL AUTOALLOCATE
         SEGMENT SPACE MANAGEMENT AUTO
         /

         CREATE TABLESPACE indx
         DATAFILE '/u03/oradata/&sid/indx/d1/indx_01.dbf' SIZE 400m
         EXTENT MANAGEMENT LOCAL AUTOALLOCATE
         SEGMENT SPACE MANAGEMENT AUTO
         /

         CREATE USER ops$oracle IDENTIFIED EXTERNALLY
         DEFAULT TABLESPACE users
         /

         GRANT DBA TO ops$oracle
         /

         CONN system/&systpw

         SET ECHO OFF

         PROMPT
         PROMPT
         PROMPT Now running PUPBLD. Please wait....
         PROMPT
         PROMPT

         SET TERMOUT OFF

         @?/sqlplus/admin/pupbld.sql

         SET TERMOUT ON

         SPOOL OFF

tnsnames.ora

         <SID> =
           (DESCRIPTION =
             (ADDRESS = (PROTOCOL = tcp)(HOST = <hostname>)(PORT = 1521))
             (CONNECT_DATA =
               (SID = <SID>)
             )
           )

         <NETBACKUP> =
           (DESCRIPTION =
             (ADDRESS = (PROTOCOL = tcp)(HOST = <netbackup hostname>)(PORT = 1521))
             (CONNECT_DATA =
               (SID = <netbackup SID>)
             )
           )

/etc/init.d/oracle

        OUSER="oracle"
        OPATH="/u01/app/oracle/product/10.2.0"
        case "$1" in
           start)
              echo  "*** Starting Oracle *** "
              su - $OUSER -c "$OPATH/bin/dbstart $OPATH"
              ;;
           stop)
              echo  "*** Stopping Oracle *** "
              su - $OUSER -c "$OPATH/bin/dbshut $OPATH"
              ;;
           *)
              echo $"Usage: $0 {start|stop}"
              exit 1
        esac
        exit 0

FILE SYSTEMS

      / --- /var --- /opt     --- /oracle
        |
        --- /u01 --- /app     --- /oracle   --- /local   --- /bin
        |                                   |
        |                                   --- /software
        |                                   |
        |                                   --- /DBA --- /CRONTAB
        |                                            |
        |                                            --- /DBCHECKS
        |                                            |
        |                                            --- /FILES
        |                                            |
        |                                            --- /HOUSEKEEPING
        |                                            |
        |                                            --- /SCRIPTS
        |                                            |
        |                                            --- /SQL
        |                                   |
        |                                   --- /product --- /10.2.0
        |                                   |
        |                                   --- /admin   --- /SID        --- /adump
        |                                                                |
        |                                                                --- /bdump
        |                                                                |
        |                                                                --- /cdump
        |                                                                |
        |                                                                --- /create
        |                                                                |
        |                                                                --- /exp 
        |                                                                |  (link to /u09)
        |                                                                |
        |                                                                --- /parfile
        |                                                                |
        |                                                                --- /pfile
        |                                                                |
        |                                                                --- /scripts
        |                                                                |
        |                                                                --- /udump
        |                                  
        |    
        --- /u02 --- /oradata --- /SID      --- /redo    --- /d1
        |    
        --- /u03 --- /oradata --- /SID      --- /indx    --- /d1
        |                                   !
        |                                   --- /sysaux  --- /d1
        |                                   !
        |                                   --- /system  --- /d1
        |                                   !
        |                                   --- /tools   --- /d1
        |                                   !
        |                                   --- /users   --- /d1
        |
        --- /u04 --- /oradata --- /SID      --- /undo    --- /d1
        |    
        --- /u05 --- /oradata --- /SID      --- /temp    --- /d1
        |
        --- /u06 --- /oradata --- /SID      --- /arch    --- /d1
        |    
        --- /u07 --- /oradata --- /SID      --- /data    --- /d1
        |    
        --- /u08 --- /oradata --- /SID      --- /index   --- /d1
        |    
        --- /u09 --- /oradata --- /SID      --- /exp   --- /d1

EXAMPLE INSTALL


OracleInstall_01.jpg
  • Select Basic Installation.
  • Enter Oracle Home Location.
  • Enter Unix DBA Group - should be dba.
  • De-select Create Starter Database.
  • Click Next.

OracleInstall_02.jpg
  • Enter full path of the orainventroy directory.
  • Enter operating system group name - should be dba.
  • Click Next.

OracleInstall_03.jpg
  • Ensure there are 0 requirements to be verified.
  • Click Next.

OracleInstall_04.jpg
  • Select Install database Software only.
  • Click Next.

OracleInstall_05.jpg
  • Review Summary.
  • Click Install.

OracleInstall_06.jpg
  • Ask Unix Administrator to run root.sh. - use default answers.
  • Click OK.

OracleInstall_07.jpg
  • Note iSQL*Plus URL's.
  • Click Exit.

OracleInstall_08.jpg
  • Click Yes.

EXAMPLE PATCH INSTALL


OraclePatchInstall_01.jpg
  • Click Next.

OraclePatchInstall_02.jpg
  • Enter Name of the ORACLE_HOME.
    • If unsure, check the value by clicking Installed Products.
  • Enter full Path of the ORACLE_HOME directory.
  • Click Next.

OraclePatchInstall_02a.jpg
  • If you want to use OCM, tick Enable Oracle Configuration Manager
  • Enter a valid CSI
  • Enter A Valid Metalink Account.
  • Click Next.

NOTE You will need to configure the connection settings. These will be site dependant.


OraclePatchInstall_03.jpg
  • Review Summary.
  • Click Install.

OraclePatchInstall_04.jpg
  • Ask Unix Administrator to run root.sh. - use default locations and overwrite where necessary.
  • Click OK.

OraclePatchInstall_05.jpg
  • Click Exit.

OraclePatchInstall_06.jpg
  • Click Yes.

OTHER REFERENCES

MISCELLANEOUS

CLEAR UP SCRIPT

If a database build has failed part way through, removing the database files can be messy and time consuming, therefore use the following shell script to aid the process. Note, this script will prompt for the SID name and then remove any file that may have been created by the createdb.sql script.

Ensure all Oracle processes have been stopped, before using this script.

This script assumes the file naming standards as detailed in the see File Systems section have been used.

echo
echo
echo " WARNING!"
echo "=========="
echo "This script will remove all datafiles related to the requested SID."
echo
echo
echo "Enter SID name to be cleared up: \c"
read sidname
echo
echo

rm /u03/oradata/$sidname/users/d1/control01.ctl
rm /u03/oradata/$sidname/tools/d1/control02.ctl
rm /u03/oradata/$sidname/indx/d1/control03.ctl

rm /u01/app/oracle/admin/$sidname/adump/*
rm /u01/app/oracle/admin/$sidname/bdump/*
rm /u01/app/oracle/admin/$sidname/cdump/*
rm /u01/app/oracle/admin/$sidname/udump/*

rm /u02/oradata/$sidname/redo/d1/redo001a.dbf
 rm /u02/oradata/$sidname/redo/d1/redo002a.dbf
rm /u02/oradata/$sidname/redo/d1/redo003a.dbf
rm /u02/oradata/$sidname/redo/d1/redo004a.dbf

rm /u03/oradata/$sidname/indx/d1/indx_01.dbf
rm /u03/oradata/$sidname/sysaux/d1/sysaux_01.dbf
rm /u03/oradata/$sidname/system/d1/system_01.dbf
rm /u03/oradata/$sidname/tools/d1/tools_01.dbf
rm /u03/oradata/$sidname/users/d1/users_01.dbf

rm /u04/oradata/$sidname/undo/d1/undo_01.dbf

rm /u05/oradata/$sidname/temp/d1/temp_01.dbf

rm /u06/oradata/$sidname/arch/d1/*
© copyright 2001-2014 ABCdba.com | all rights reserved