Thursday, March 26, 2009

Installation of Oracle

Oracle XE

How to ignore Prerequisites, while installing oracle: -

./runInstaller -ignoreSysPrereqs

If we get the below error, while Installing Oracle no RHEL m/c: -

[oracle@localhost database]$ ./runInstaller
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from tmp/OraInstall2009-09-01_06 -48-58PM. Please wait ...[oracle@localhost database]$ Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/OraInstall2009-09-01_06-48-58PM/jre/1.4.2/ /i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at sun.security.action.LoadLibraryAction.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.NativeLibLoader.loadLibraries(Unknown Source)
at sun.awt.DebugHelper.(Unknown Source)
at java.awt.Component.(Unknown Source)

We have to install "libXp-1.0.0-8.i386.rpm" rpm to resolve this issue.

Friday, March 20, 2009

Oracle10g OUI Silent Installations

By default, the Oracle Universal Installer (OUI) is a GUI tool, requiring user input to define the type of installation required. The OUI allows you to record the selections made in the GUI screens, writing them to a response file. This response file, modified or not, can then be used to perform silent installations. The process is similar to using Kickstart for Linux installations.

To create a response file, start the OUI with the following command and perform an installation as normal.

./runInstaller -record -destinationFile /tmp/10gR2.rsp

The "-record" parameter tells the installer to write to the response file and the "-destinationFile" parameter defines the name and location of the response file.

The response files are quite large, containing a large number of parameters and comments. The 10gR2.rsp file is an example of a response file from an Oracle Database 10g installation generated by the previous command.

Create a responsefile with bellow contents: -

####################################################################
## Copyright (c) 1999, 2004 Oracle. All rights reserved. ##
## ##
## Specify values for the variables listed below to customize ##
## your installation. ##
## ##
## Each variable is associated with a comment. The comment ##
## identifies the variable type. ##
## ##
## Please specify the values in the following format: ##
## ##
## Type Example ##
## String "Sample Value" ##
## Boolean True or False ##
## Number 1000 ##
## StringList {"String value 1","String Value 2"} ##
## ##
## The values that are given as need to be ##
## specified for a silent installation to be successful. ##
## ##
## ##
## This response file is generated by Oracle Software ##
## Packager. ##
####################################################################


RESPONSEFILE_VERSION=2.2.1.0.0

#-------------------------------------------------------------------------------
#Name : UNIX_GROUP_NAME
#Datatype : String
#Description: Unix group to be set for the inventory directory. Valid only in Unix platforms.
#Example: UNIX_GROUP_NAME = "install"
#-------------------------------------------------------------------------------
UNIX_GROUP_NAME="oinstall"

#-------------------------------------------------------------------------------
#Name : FROM_LOCATION
#Datatype : String
#Description: Complete path to the products.xml.
#Example: FROM_LOCATION = "../stage/products.xml"
#-------------------------------------------------------------------------------
FROM_LOCATION="/u01/db/Disk1/stage/products.xml"

#-------------------------------------------------------------------------------
#Name : FROM_LOCATION_CD_LABEL
#Datatype : String
#Description: This variable should only be used in multi-CD installations. It includes the label of the compact disk where the file "products.xml" exists. The label can be found in the file "disk.label" in the same directory as products.xml.
#Example: FROM_LOCATION_CD_LABEL = "CD Label"
#-------------------------------------------------------------------------------
FROM_LOCATION_CD_LABEL=

#-------------------------------------------------------------------------------
#Name : ORACLE_HOME
#Datatype : String
#Description: Complete path of the Oracle Home.
#Example: ORACLE_HOME = "C:\OHOME1"
#-------------------------------------------------------------------------------
ORACLE_HOME="/u01/app/oracle/product/10.2.0/db_1"

#-------------------------------------------------------------------------------
#Name : ORACLE_HOME_NAME
#Datatype : String
#Description: Oracle Home Name. Used in creating folders and services.
#Example: ORACLE_HOME_NAME = "OHOME1"
#-------------------------------------------------------------------------------
ORACLE_HOME_NAME="db_1"

#-------------------------------------------------------------------------------
#Name : SHOW_WELCOME_PAGE
#Datatype : Boolean
#Description: Set to true if the Welcome page in OUI needs to be shown.
#Example: SHOW_WELCOME_PAGE = false
#-------------------------------------------------------------------------------
SHOW_WELCOME_PAGE=true

#-------------------------------------------------------------------------------
#Name : SHOW_CUSTOM_TREE_PAGE
#Datatype : Boolean
#Description: Set to true if the custom tree page in OUI needs to be shown.
#Use this page to select or de-select dependencies. This page appears only in a custom install type.
#Example: SHOW_CUSTOM_TREE_PAGE = false
#-------------------------------------------------------------------------------
SHOW_CUSTOM_TREE_PAGE=true

#-------------------------------------------------------------------------------
#Name : SHOW_COMPONENT_LOCATIONS_PAGE
#Datatype : Boolean
#Description: Set to true if the component locations page in OUI needs to be shown.
#This page only appears if there are products whose installed directory can be changed.
#If you set this to false you will prevent the user from being able to specify alternate directories.
#Example: SHOW_COMPONENT_LOCATIONS_PAGE = false
#-------------------------------------------------------------------------------
SHOW_COMPONENT_LOCATIONS_PAGE=true

#-------------------------------------------------------------------------------
#Name : SHOW_SUMMARY_PAGE
#Datatype : Boolean
#Description: Set to true if the summary page in OUI needs to be shown.
#The summary page shows the list of components that will be installed in this session.
#Example: SHOW_SUMMARY_PAGE = true
#-------------------------------------------------------------------------------
SHOW_SUMMARY_PAGE=true

#-------------------------------------------------------------------------------
#Name : SHOW_INSTALL_PROGRESS_PAGE
#Datatype : Boolean
#Description: Set to true if the install progress page in OUI needs to be shown.
#This page shows the current status in the installation. The current status includes the product being installed and the file being copied.
#Example: SHOW_INSTALL_PROGRESS_PAGE = true
#-------------------------------------------------------------------------------
SHOW_INSTALL_PROGRESS_PAGE=true

#-------------------------------------------------------------------------------
#Name : SHOW_REQUIRED_CONFIG_TOOL_PAGE
#Datatype : Boolean
#Description: Set to true if the required config assistants page in OUI needs to be shown.
#This page shows the list of required configuration assistants that are part of this installation.
#It shows the status of each assistant, including any failures with detailed information on why it failed.
#Example: SHOW_REQUIRED_CONFIG_TOOL_PAGE = true
#-------------------------------------------------------------------------------
SHOW_REQUIRED_CONFIG_TOOL_PAGE=true

#-------------------------------------------------------------------------------
#Name : SHOW_CONFIG_TOOL_PAGE
#Datatype : Boolean
#Description: Set to true if the config assistants page in OUI needs to be shown.
#This page shows the list of configuration assistants that are part of this installation and are configured to launch automatically.
#It shows the status of each assistant, including any failures with detailed information on why it failed.
#Example: SHOW_CONFIG_TOOL_PAGE = true
#-------------------------------------------------------------------------------
SHOW_CONFIG_TOOL_PAGE=true

#-------------------------------------------------------------------------------
#Name : SHOW_RELEASE_NOTES
#Datatype : Boolean
#Description: Set to true if the release notes of this installation need to be shown at the end of installation.
#This dialog is launchable from the End of Installation page and shows the list of release notes available for the products just installed.
# This also requires the variable SHOW_END_SESSION_PAGE variable to be set to true.
#Example: SHOW_RELEASE_NOTES = true
#-------------------------------------------------------------------------------
SHOW_RELEASE_NOTES=true

#-------------------------------------------------------------------------------
#Name : SHOW_ROOTSH_CONFIRMATION
#Datatype : Boolean
#Description: Set to true if the Confirmation dialog asking to run the root.sh script in OUI needs to be shown.
#Valid only for Unix platforms.
#Example: SHOW_ROOTSH_CONFIRMATION = true
#-------------------------------------------------------------------------------
SHOW_ROOTSH_CONFIRMATION=true

#-------------------------------------------------------------------------------
#Name : SHOW_END_SESSION_PAGE
#Datatype : Boolean
#Description: Set to true if the end of session page in OUI needs to be shown.
#This page shows if the installation is successful or not.
#Example: SHOW_END_SESSION_PAGE = true
#-------------------------------------------------------------------------------
SHOW_END_SESSION_PAGE=true

#-------------------------------------------------------------------------------
#Name : SHOW_EXIT_CONFIRMATION
#Datatype : Boolean
#Description: Set to true if the confirmation when exiting OUI needs to be shown.
#Example: SHOW_EXIT_CONFIRMATION = true
#-------------------------------------------------------------------------------
SHOW_EXIT_CONFIRMATION=true

#-------------------------------------------------------------------------------
#Name : NEXT_SESSION
#Datatype : Boolean
#Description: Set to true to allow users to go back to the File Locations page for another installation. This flag also needs to be set to true in order to process another response file (see NEXT_SESSION_RESPONSE).
#Example: NEXT_SESSION = true
#-------------------------------------------------------------------------------
NEXT_SESSION=false

#-------------------------------------------------------------------------------
#Name : NEXT_SESSION_ON_FAIL
#Datatype : Boolean
#Description: Set to true to allow users to invoke another session even if current install session has failed. This flag is only relevant if NEXT_SESSION is set to true.
#Example: NEXT_SESSION_ON_FAIL = true
#-------------------------------------------------------------------------------
NEXT_SESSION_ON_FAIL=true

#-------------------------------------------------------------------------------
#Name : NEXT_SESSION_RESPONSE
#Datatype : String
#Description: Set to true to allow users to go back to the File Locations page for another installation. This flag also needs to be set to true in order to process another response file (see NEXT_SESSION_RESPONSE).
#Example: NEXT_SESSION_RESPONSE = "nextinstall.rsp"
#-------------------------------------------------------------------------------
NEXT_SESSION_RESPONSE=

#-------------------------------------------------------------------------------
#Name : DEINSTALL_LIST
#Datatype : StringList
#Description: List of components to be deinstalled during a deinstall session.
#Example: DEINSTALL_LIST = {"oracle.server","10.2.0.1.0"}
#-------------------------------------------------------------------------------
DEINSTALL_LIST={"oracle.server","10.2.0.1.0"}

#-------------------------------------------------------------------------------
#Name : SHOW_DEINSTALL_CONFIRMATION
#Datatype : Boolean
#Description: Set to true if deinstall confimation is needed during a deinstall session.
#Example: SHOW_DEINSTALL_CONFIRMATION = true
#-------------------------------------------------------------------------------
SHOW_DEINSTALL_CONFIRMATION=true

#-------------------------------------------------------------------------------
#Name : SHOW_DEINSTALL_PROGRESS
#Datatype : Boolean
#Description: Set to true if deinstall progress is needed during a deinstall session.
#Example: SHOW_DEINSTALL_PROGRESS = true
#-------------------------------------------------------------------------------
SHOW_DEINSTALL_PROGRESS=true

#-------------------------------------------------------------------------------
#Name : CLUSTER_NODES
#Datatype : StringList
#Description: This variable represents the cluster node names selected by the user for installation.
#Example: CLUSTER_NODES = {"node1","node2"}
#-------------------------------------------------------------------------------
CLUSTER_NODES={}

#-------------------------------------------------------------------------------
#Name : ACCEPT_LICENSE_AGREEMENT
#Datatype : Boolean
#Description: By setting this variable to true, you are accepting the license agreement. This variable is used only for silent installations.
#Example: ACCEPT_LICENSE_AGREEMENT = true
#-------------------------------------------------------------------------------
ACCEPT_LICENSE_AGREEMENT=false

#-------------------------------------------------------------------------------
#Name : TOPLEVEL_COMPONENT
#Datatype : StringList
#Description: The top level component to be installed in the current session.
#Example: TOPLEVEL_COMPONENT = {"oracle.server","10.2.0.1.0"}
#-------------------------------------------------------------------------------
TOPLEVEL_COMPONENT={"oracle.server","10.2.0.1.0"}

#-------------------------------------------------------------------------------
#Name : SHOW_SPLASH_SCREEN
#Datatype : Boolean
#Description: Set to true if the initial splash screen in OUI needs to be shown.
#Example: SHOW_SPLASH_SCREEN = true
#-------------------------------------------------------------------------------
SHOW_SPLASH_SCREEN=true

#-------------------------------------------------------------------------------
#Name : SELECTED_LANGUAGES
#Datatype : StringList
#Description: Languages in which the components will be installed.
#Component : oracle.server
#-------------------------------------------------------------------------------

SELECTED_LANGUAGES={"en_GB","en"}

#-------------------------------------------------------------------------------
#Name : COMPONENT_LANGUAGES
#Datatype : StringList
#Description: Languages supported by this component.List of supported languages : {"en","fr","ar","bn","pt_BR","bg","fr_CA","ca","hr","cs","da","nl","ar_EG","en_GB","et","fi","de","el","iw","hu","is","in","it","ja","ko","es","lv","lt","ms","es_MX","no","pl","pt","ro","ru","zh_CN","sk","sl","es_ES","sv","th","zh_TW","tr","uk","vi"}
#Component : oracle.server
#-------------------------------------------------------------------------------

COMPONENT_LANGUAGES={"en_GB","en"}

#-------------------------------------------------------------------------------
#Name : INSTALL_TYPE
#Datatype : String
#Description: Installation type of the component.
#Component : oracle.server
#-------------------------------------------------------------------------------

INSTALL_TYPE="Enterprise Edition"

#-------------------------------------------------------------------------------
#Name : sl_superAdminPasswds
#Datatype : StringList
#Description: List of passwords
#Component : oracle.server
#-------------------------------------------------------------------------------

sl_superAdminPasswds=

#-------------------------------------------------------------------------------
#Name : sl_dlgASMCfgSelectableDisks
#Datatype : StringList
#Description: Disk Groups that can be selected
#Component : oracle.server
#-------------------------------------------------------------------------------

sl_dlgASMCfgSelectableDisks={}

#-------------------------------------------------------------------------------
#Name : s_superAdminSamePasswd
#Datatype : String
#Description: Same Password Field
#Component : oracle.server
#-------------------------------------------------------------------------------

s_superAdminSamePasswd=

#-------------------------------------------------------------------------------
#Name : s_globalDBName
#Datatype : String
#Description: Global Database Name
#Component : oracle.server
#-------------------------------------------------------------------------------

s_globalDBName="TSH1.WORLD"

#-------------------------------------------------------------------------------
#Name : s_dlgASMCfgRedundancyValue
#Datatype : String
#Description: Redundancy Value
#Component : oracle.server
#-------------------------------------------------------------------------------

s_dlgASMCfgRedundancyValue="2 (Norm)"

#-------------------------------------------------------------------------------
#Name : s_dlgASMCfgNewDisksSize
#Datatype : String
#Description: New Disks Size
#Component : oracle.server
#-------------------------------------------------------------------------------

s_dlgASMCfgNewDisksSize="0"

#-------------------------------------------------------------------------------
#Name : s_dlgASMCfgExistingFreeSpace
#Datatype : String
#Description: Existing Freee Space
#Component : oracle.server
#-------------------------------------------------------------------------------

s_dlgASMCfgExistingFreeSpace="0"

#-------------------------------------------------------------------------------
#Name : s_dlgASMCfgDiskGroupName
#Datatype : String
#Description: Disk Group Name
#Component : oracle.server
#-------------------------------------------------------------------------------

s_dlgASMCfgDiskGroupName="DATA"

#-------------------------------------------------------------------------------
#Name : s_dlgASMCfgDiskDiscoveryString
#Datatype : String
#Description: Disk Discovery STring
#Component : oracle.server
#-------------------------------------------------------------------------------

s_dlgASMCfgDiskDiscoveryString=""

#-------------------------------------------------------------------------------
#Name : s_dlgASMCfgAdditionalSpaceNeeded
#Datatype : String
#Description: Additional Space Needed
#Component : oracle.server
#-------------------------------------------------------------------------------

s_dlgASMCfgAdditionalSpaceNeeded=" MB"

#-------------------------------------------------------------------------------
#Name : s_dbSelectedUsesASM
#Datatype : String
#Description: SID selected for upgrade
#Component : oracle.server
#-------------------------------------------------------------------------------

s_dbSelectedUsesASM=""

#-------------------------------------------------------------------------------
#Name : s_dbSIDSelectedForUpgrade
#Datatype : String
#Description: SID selected for upgrade
#Component : oracle.server
#-------------------------------------------------------------------------------

s_dbSIDSelectedForUpgrade=""

#-------------------------------------------------------------------------------
#Name : s_dbRetChar
#Datatype : String
#Description: Return value for database character set.
#Component : oracle.server
#-------------------------------------------------------------------------------

s_dbRetChar="Responsefile entry West European WE8ISO8859P1"

#-------------------------------------------------------------------------------
#Name : s_dbOHSelectedForUpgrade
#Datatype : String
#Description: OH selected for upgrade
#Component : oracle.server
#-------------------------------------------------------------------------------

s_dbOHSelectedForUpgrade=""

#-------------------------------------------------------------------------------
#Name : s_ASMSYSPassword
#Datatype : String
#Description: ASM SYS Password
#Component : oracle.server
#-------------------------------------------------------------------------------

s_ASMSYSPassword=

#-------------------------------------------------------------------------------
#Name : n_performUpgrade
#Datatype : Number
#Description: 1 if user selects to perform upgrade
#Component : oracle.server
#-------------------------------------------------------------------------------

n_performUpgrade=0

#-------------------------------------------------------------------------------
#Name : n_dlgASMCfgRedundancySelected
#Datatype : Number
#Description: Redundancy value selected
#Component : oracle.server
#-------------------------------------------------------------------------------

n_dlgASMCfgRedundancySelected=2

#-------------------------------------------------------------------------------
#Name : n_dbType
#Datatype : Number
#Description: This variable contains the dbType i.e. GP, TP, DW or Advanced
#Component : oracle.server
#-------------------------------------------------------------------------------

n_dbType=1

#-------------------------------------------------------------------------------
#Name : n_dbSelection
#Datatype : Number
#Description: row selected in the spread table of upgradable DB instances
#Component : oracle.server
#-------------------------------------------------------------------------------

n_dbSelection=0

#-------------------------------------------------------------------------------
#Name : b_useSamePassword
#Datatype : Boolean
#Description: Usable only when SHOW_SCHEMA_PASSWORDS_PAGE is set to false.
Set this to true if same password across all the schemas is desired, else false to enter distinguish passwords for each schema.
If set to true, values from s_superAdminSamePasswd and s_superAdminSamePasswdAgain are picked up, else stringlists sl_superAdminPasswds and sl_superAdminPasswdsAgain are used.
#Component : oracle.server
#-------------------------------------------------------------------------------

b_useSamePassword=true

#-------------------------------------------------------------------------------
#Name : b_useFileSystemForRecovery
#Datatype : Boolean
#Description: Usable only when SHOW_BACKUP_RECOVERY_OPTION_PAGE is set to false and b_enableAutoBackup is set to true.
Set this to true (default) if recovery into file system is desired, else to false for ASM recovery .
#Component : oracle.server
#-------------------------------------------------------------------------------

b_useFileSystemForRecovery=true

#-------------------------------------------------------------------------------
#Name : b_receiveEmailNotification
#Datatype : Boolean
#Description: Usable only when SHOW_DATABASE_MANAGEMENT_PAGE is set to false and b_useDBControl is set to true.
Set this to true if email update is desired, false is the default .
#Component : oracle.server
#-------------------------------------------------------------------------------

b_receiveEmailNotification=false

#-------------------------------------------------------------------------------
#Name : b_loadExampleSchemas
#Datatype : Boolean
#Description: Usable only when SHOW_DATABASE_OPTIONS_PAGE is set to false.
Set this to true if loading example schemas is desired, else false so database won't be created with example schemas. The default is false.
#Component : oracle.server
#-------------------------------------------------------------------------------

b_loadExampleSchemas=false

#-------------------------------------------------------------------------------
#Name : b_enableAutoBackup
#Datatype : Boolean
#Description: Usable only when SHOW_BACKUP_RECOVERY_OPTION_PAGE is set to false.
Set this to true if automatic backup of the database is desired, else false to disable backup.
#Component : oracle.server
#-------------------------------------------------------------------------------

b_enableAutoBackup=false

#-------------------------------------------------------------------------------
#Name : b_dlgASMShowCandidateDisks
#Datatype : Boolean
#Description: set to true if Candidate Disks is selected in ASM dialog
#Component : oracle.server
#-------------------------------------------------------------------------------

b_dlgASMShowCandidateDisks=true

#-------------------------------------------------------------------------------
#Name : b_centrallyManageASMInstance
#Datatype : Boolean
#Description: true if ASM instance needs to be managed by grid control
#Component : oracle.server
#-------------------------------------------------------------------------------

b_centrallyManageASMInstance=true

#-------------------------------------------------------------------------------
#Name : sl_dlgASMDskGrpSelectedGroup
#Datatype : StringList
#Description: Disk Groups that is selected
#Component : oracle.server
#-------------------------------------------------------------------------------

sl_dlgASMDskGrpSelectedGroup={" "," "," "," "}

#-------------------------------------------------------------------------------
#Name : s_dlgRBOUsername
#Datatype : String
#Description: Username
#Component : oracle.server
#-------------------------------------------------------------------------------

s_dlgRBOUsername=""

#-------------------------------------------------------------------------------
#Name : s_dlgEMCentralAgentSelected
#Datatype : String
#Description: Strores the central agent selected
#Component : oracle.server
#-------------------------------------------------------------------------------

s_dlgEMCentralAgentSelected="No Agents Found"

#-------------------------------------------------------------------------------
#Name : b_useDBControl
#Datatype : Boolean
#Description: Usable only when SHOW_DATABASE_MANAGEMENT_PAGE is set to false.
Set this to true if using database control to manage the database is desired, else false so database can be managed by grid control.
#Component : oracle.server
#-------------------------------------------------------------------------------

b_useDBControl=true

#-------------------------------------------------------------------------------
#Name : s_superAdminSamePasswdAgain
#Datatype : String
#Description: Confirmation of password.
#Component : oracle.server
#-------------------------------------------------------------------------------

s_superAdminSamePasswdAgain=

#-------------------------------------------------------------------------------
#Name : s_dlgEMSMTPServer
#Datatype : String
#Description: Stores SMTP Server name
#Component : oracle.server
#-------------------------------------------------------------------------------

s_dlgEMSMTPServer=""

#-------------------------------------------------------------------------------
#Name : s_dlgEMEmailAddress
#Datatype : String
#Description: stores the email address
#Component : oracle.server
#-------------------------------------------------------------------------------

s_dlgEMEmailAddress=""

#-------------------------------------------------------------------------------
#Name : s_dlgRBORecoveryLocation
#Datatype : String
#Description: Recovery area location
#Component : oracle.server
#-------------------------------------------------------------------------------

s_dlgRBORecoveryLocation="/u01/app/oracle/flash_recovery_area/"

#-------------------------------------------------------------------------------
#Name : n_upgradeDB
#Datatype : Number
#Description: 1 if user selects to upgrade DB
#Component : oracle.server
#-------------------------------------------------------------------------------

n_upgradeDB=1

#-------------------------------------------------------------------------------
#Name : n_configurationOption
#Datatype : Number
#Description: This variable contains the configuration option i.e. createDB or configureASM or SoftwareOnly
#Component : oracle.server
#-------------------------------------------------------------------------------

n_configurationOption=1

#-------------------------------------------------------------------------------
#Name : sl_upgradableSIDBInstances
#Datatype : StringList
#Description: This is list of SIDs, OH and whether SID uses ASM or not. contains DB instance details that are displayed in dialog's spread table.
#Component : oracle.server
#-------------------------------------------------------------------------------

sl_upgradableSIDBInstances={}

#-------------------------------------------------------------------------------
#Name : n_upgradeASM
#Datatype : Number
#Description: 1 is user selects to upgrade DB
#Component : oracle.server
#-------------------------------------------------------------------------------

n_upgradeASM=0

#-------------------------------------------------------------------------------
#Name : sl_dlgASMCfgDiskSelections
#Datatype : StringList
#Description: List of Selected Member Disks
#Component : oracle.server
#-------------------------------------------------------------------------------

sl_dlgASMCfgDiskSelections={}

#-------------------------------------------------------------------------------
#Name : s_ASMSYSPasswordAgain
#Datatype : String
#Description: ASM Sys password confirmation
#Component : oracle.server
#-------------------------------------------------------------------------------

s_ASMSYSPasswordAgain=

#-------------------------------------------------------------------------------
#Name : n_dbStorageType
#Datatype : Number
#Description: Usable only when SHOW_DATABASE_FILE_STORAGE_OPTION_PAGE is set to false.
Set this to the following numbers for corresponding database storage type desired:
1 - File System (default)
2 - ASM
3 - Raw Devices
#Component : oracle.server
#-------------------------------------------------------------------------------

n_dbStorageType=1

#-------------------------------------------------------------------------------
#Name : s_rawDeviceMapFileLocation
#Datatype : String
#Description: Text2
#Component : oracle.server
#-------------------------------------------------------------------------------

s_rawDeviceMapFileLocation=""

#-------------------------------------------------------------------------------
#Name : sl_upgradableRACDBInstances
#Datatype : StringList
#Description: contains DB instance details that are displayed in dialog's sprea table.
#Component : oracle.server
#-------------------------------------------------------------------------------

sl_upgradableRACDBInstances={}

#-------------------------------------------------------------------------------
#Name : s_dlgRBOPassword
#Datatype : String
#Description: Password
#Component : oracle.server
#-------------------------------------------------------------------------------

s_dlgRBOPassword=

#-------------------------------------------------------------------------------
#Name : b_stateOfUpgradeDBCheckbox
#Datatype : Boolean
#Description: stores the state of checkbox in UI
#Component : oracle.server
#-------------------------------------------------------------------------------

b_stateOfUpgradeDBCheckbox=false

#-------------------------------------------------------------------------------
#Name : s_dbSid
#Datatype : String
#Description: Value that $ORACLE_SID will be set to.
#Component : oracle.server
#-------------------------------------------------------------------------------

s_dbSid="TSH1"

#-------------------------------------------------------------------------------
#Name : b_dbSelectedUsesASM
#Datatype : Boolean
#Description: stores the state of checkbox in UI
#Component : oracle.server
#-------------------------------------------------------------------------------

b_dbSelectedUsesASM=false

#-------------------------------------------------------------------------------
#Name : sl_superAdminPasswdsAgain
#Datatype : StringList
#Description: Confirm Password list.
#Component : oracle.server
#-------------------------------------------------------------------------------

sl_superAdminPasswdsAgain=

#-------------------------------------------------------------------------------
#Name : s_mountPoint
#Datatype : String
#Description: Database file location: directory for datafiles, control files, redo logs.
#Component : oracle.server
#-------------------------------------------------------------------------------

s_mountPoint="/u01/app/oracle/oradata/"

#-------------------------------------------------------------------------------
#Name : b_stateOfUpgradeASMCheckbox
#Datatype : Boolean
#Description: stores the state of checkbox in UI
#Component : oracle.server
#-------------------------------------------------------------------------------

b_stateOfUpgradeASMCheckbox=false

#-------------------------------------------------------------------------------
#Name : OPTIONAL_CONFIG_TOOLS
#Datatype : String
#Description: #The following choices are available. The value should contain only one of these choices.
#The choices are of the form Internal Name : External name. Please use the internal name while specifying the value.List of optional config assistants that need to be launched.
# localconfig, : Cluster Synchronization Service Configuration
# dbma, : Database Upgrade Assistant
#Example: OPTIONAL_CONFIG_TOOLS = {"localconfig"}
#Component : oracle.assistants.server
#-------------------------------------------------------------------------------

oracle.assistants.server:OPTIONAL_CONFIG_TOOLS="{}"

#-------------------------------------------------------------------------------
#Name : OPTIONAL_CONFIG_TOOLS
#Datatype : String
#Description: #The following choices are available. The value should contain only one of these choices.
#The choices are of the form Internal Name : External name. Please use the internal name while specifying the value.List of optional config assistants that need to be launched.
# LocalConfig, : Deinstall Oracle Cluster Synchronization Service
#Example: OPTIONAL_CONFIG_TOOLS = {"LocalConfig"}
#Component : oracle.has.common
#-------------------------------------------------------------------------------

oracle.has.common:OPTIONAL_CONFIG_TOOLS="{}"

#-------------------------------------------------------------------------------
#Name : OPTIONAL_CONFIG_TOOLS
#Datatype : String
#Description: #The following choices are available. The value should contain only one of these choices.
#The choices are of the form Internal Name : External name. Please use the internal name while specifying the value.List of optional config assistants that need to be launched.
# netca_deinst, : Oracle Net Configuration Assistant - Deinstall Script
#Example: OPTIONAL_CONFIG_TOOLS = {"netca_deinst"}
#Component : oracle.network.client
#-------------------------------------------------------------------------------

oracle.network.client:OPTIONAL_CONFIG_TOOLS="{}"

#-------------------------------------------------------------------------------
#Name : OPTIONAL_CONFIG_TOOLS
#Datatype : String
#Description: #The following choices are available. The value should contain only one of these choices.
#The choices are of the form Internal Name : External name. Please use the internal name while specifying the value.List of optional config assistants that need to be launched.
# isqlplus, : iSQL*Plus Configuration Assistant
# removeisqlplusSrvc, : Remove iSQL*Plus Service
#Example: OPTIONAL_CONFIG_TOOLS = {"isqlplus"}
#Component : oracle.sqlplus.isqlplus
#-------------------------------------------------------------------------------

oracle.sqlplus.isqlplus:OPTIONAL_CONFIG_TOOLS="{}"

#-------------------------------------------------------------------------------
#Name : OPTIONAL_CONFIG_TOOLS
#Datatype : String
#Description: #The following choices are available. The value should contain only one of these choices.
#The choices are of the form Internal Name : External name. Please use the internal name while specifying the value.List of optional config assistants that need to be launched.
# launchBrowser, : Launch browser
#Example: OPTIONAL_CONFIG_TOOLS = {"launchBrowser"}
#Component : oracle.sysman.console.db
#-------------------------------------------------------------------------------

oracle.sysman.console.db:OPTIONAL_CONFIG_TOOLS="{}"

#-------------------------------------------------------------------------------
#Name : varSelect
#Datatype : Number
#Description: Return index selected from dialog
#Component : oracle.assistants.server
#-------------------------------------------------------------------------------

varSelect=1

#-------------------------------------------------------------------------------
#Name : s_nameForOPERGrp
#Datatype : String
#Description: oper group
#Component : oracle.rdbms
#-------------------------------------------------------------------------------

s_nameForOPERGrp="dba"

#-------------------------------------------------------------------------------
#Name : s_nameForDBAGrp
#Datatype : String
#Description: dba group
#Component : oracle.rdbms
#-------------------------------------------------------------------------------

s_nameForDBAGrp="dba"

:wq! (end of the responsefile)

A silent installation is initiated using the following command.

./runInstaller -silent -responseFile /tmp/10gR2.rsp

The "-silent" parameter indicates that this is a silent installation and the "-responseFile" parameter defines the name and location of the response file.

A silent installation using the 10gR2.rsp file results in the following output.

[oracle@centos4 database]$ ./runInstaller -silent -responseFile /tmp/10gR2.rsp
Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLin ux-1.0, asianux-1 or asianux-2
Passed


All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2006-11-24_09 -51-29AM. Please wait ...
[oracle@centos4 database]$ Oracle Universal Installer, Version 10.2.0.1.0 Production
Copyright (C) 1999, 2005, Oracle. All rights reserved.

You can find a log of this install session at:
/u01/app/oracle/oraInventory/logs/installActions2006-11-24_09-51-29AM.log
................................................................................
.................... 100% Done.


Loading Product Information
................................................................................
................................... 100% Done.


Analyzing dependencies
.........................................................................
Starting execution of Prerequisites...
Total No of checks: 11

Performing check for CertifiedVersions
Checking operating system requirements ...
Expected result: One of redhat-3,redhat-4,SuSE-9,asianux-1,asianux-2
Actual Result: redhat-4
Check complete. The overall result of this check is: Passed


Check complete: Passed
=======================================================================
Performing check for Packages
Checking operating system package requirements ...
Checking for make-3.79; found make-1:3.80-5. Passed
Checking for binutils-2.14; found binutils-2.15.92.0.2-15. Passed
Checking for gcc-3.2; found gcc-3.4.4-2. Passed
Checking for libaio-0.3.96; found libaio-0.3.103-3. Passed
Check complete. The overall result of this check is: Passed


Check complete: Passed
=======================================================================
Performing check for Kernel
Checking kernel parameters
Checking for semmsl=250; found semmsl=250. Passed
Checking for semmns=32000; found semmns=32000. Passed
Checking for semopm=100; found semopm=100. Passed
Checking for semmni=128; found semmni=128. Passed
Checking for shmmax=536870912; found shmmax=2147483648. Passed
Checking for shmmni=4096; found shmmni=4096. Passed
Checking for shmall=2097152; found shmall=2097152. Passed
Checking for file-max=65536; found file-max=65536. Passed
Checking for VERSION=2.6.9; found VERSION=2.6.9-22.EL. Passed
Checking for ip_local_port_range=1024 - 65000; found ip_local_port_range=1024 - 65000. Passed
Checking for rmem_default=262144; found rmem_default=262144. Passed
Checking for rmem_max=262144; found rmem_max=262144. Passed
Checking for wmem_default=262144; found wmem_default=262144. Passed
Checking for wmem_max=262144; found wmem_max=262144. Passed
Check complete. The overall result of this check is: Passed


Check complete: Passed
=======================================================================
Performing check for GLIBC
Checking Recommended glibc version
Expected result: ATLEAST=2.3.2-95.27
Actual Result: 2.3.4-2.13
Check complete. The overall result of this check is: Passed


Check complete: Passed
=======================================================================
Performing check for TotalMemory
Checking physical memory requirements ...
Expected result: 922MB
Actual Result: 1008MB
Check complete. The overall result of this check is: Passed


Check complete: Passed
=======================================================================
Performing check for SwapSpace
Checking available swap space requirements ...
Expected result: 1512MB
Actual Result: 2040MB
Check complete. The overall result of this check is: Passed


Check complete: Passed
=======================================================================
Performing check for DetectIfDHCPAssignedIP
Checking Network Configuration requirements ...
Check complete. The overall result of this check is: Passed


Check complete: Passed
=======================================================================
Performing check for OracleBase
Validating ORACLE_BASE location (if set) ...
Check complete. The overall result of this check is: Passed


Check complete: Passed
=======================================================================
Performing check for OracleHomeSpace
Checking Oracle Home path for spaces...
Check complete. The overall result of this check is: Passed


Check complete: Passed
=======================================================================
Performing check for DetectAnyInvalidASMHome
Checking for proper system clean-up....
Check complete. The overall result of this check is: Passed


Check complete: Passed
=======================================================================
Performing check for CompatibilityChecks
Checking for Oracle Home incompatibilities ....
Actual Result: NEW_HOME
Check complete. The overall result of this check is: Passed


Check complete: Passed
=======================================================================
PrereqChecks complete

.......................................... 100% Done.


-----------------------------------------------------------------------------
Summary
Global Settings
Source: /tmp/database/stage/products.xml
Oracle Home: /u01/app/oracle/product/10.2.0/db_1 (db_1)
Installation Type: Enterprise Edition
Product Languages
English (United Kingdom)
English
Space Requirements
/ Required 2.05GB (includes 108MB temporary) : Available 3.84GB
New Installations (107 products)
Oracle Database 10g 10.2.0.1.0
Enterprise Edition Options 10.2.0.1.0
Oracle Partitioning 10.2.0.1.0
Oracle Spatial 10.2.0.1.0
Oracle OLAP 10.2.0.1.0
Oracle Enterprise Manager Console DB 10.2.0.1.0
Oracle Net Services 10.2.0.1.0
Oracle Database 10g 10.2.0.1.0
Oracle Net Listener 10.2.0.1.0
HAS Files for DB 10.2.0.1.0
Oracle Internet Directory Client 10.2.0.1.0
Oracle Call Interface (OCI) 10.2.0.1.0
Oracle Programmer 10.2.0.1.0
Oracle interMedia 10.2.0.1.0
Enterprise Manager Agent Core 10.2.0.1.0
Oracle JVM 10.2.0.1.0
Database Configuration and Upgrade Assistants 10.2.0.1.0
Oracle interMedia Locator 10.2.0.1.0
Oracle XML Development Kit 10.2.0.1.0
Oracle Text 10.2.0.1.0
Oracle Database Utilities 10.2.0.1.0
Generic Connectivity Common Files 10.2.0.1.0
Oracle Advanced Security 10.2.0.1.0
Enterprise Manager Repository Core 10.2.0.1.0
PL/SQL 10.2.0.1.0
Oracle Net 10.2.0.1.0
Assistant Common Files 10.2.0.1.0
Enterprise Manager plugin Common Files 10.2.0.1.0 Beta
Buildtools Common Files 10.2.0.1.0
Installation Common Files 10.2.0.1.0
Oracle LDAP administration 10.2.0.1.0
Oracle Java Client 10.2.0.1.0
Precompiler Common Files 10.2.0.1.0
Oracle Recovery Manager 10.2.0.1.0
SQL*Plus 10.2.0.1.0
iSQL*Plus 10.2.0.1.0
Enterprise Manager plugin Common Files 10.2.0.1.0
HAS Common Files 10.2.0.1.0
Oracle Clusterware RDBMS Files 10.2.0.1.0
Oracle Wallet Manager 10.2.0.1.0
Enterprise Manager Minimal Integration 10.2.0.1.0
Oracle Database User Interface 2.2.13.0.0
Secure Socket Layer 10.2.0.1.0
Oracle ODBC Driver 10.2.0.1.0
Required Support Files 10.2.0.1.0
Database SQL Scripts 10.2.0.1.0
OLAP SQL Scripts 10.2.0.1.0
PL/SQL Embedded Gateway 10.2.0.1.0
Oracle Globalization Support 10.2.0.1.0
Character Set Migration Utility 10.2.0.1.0
LDAP Required Support Files 10.2.0.1.0
Oracle Help for the Web 1.1.10.0.0
Oracle JDBC Thin Driver for JDK 1.4 10.2.0.1.0
Oracle JDBC Thin Driver for JDK 1.2 10.2.0.1.0
Oracle interMedia Client Option 10.2.0.1.0
Oracle Notification Service 10.1.0.3.0
Oracle Code Editor 1.2.1.0.0I
Perl Interpreter 5.8.3.0.2
JDBC Common Files 10.2.0.1.0
Oracle Locale Builder 10.2.0.1.0
Oracle Containers for Java 10.2.0.1.0
Database Workspace Manager 10.2.0.1.0
Oracle Core Required Support Files 10.2.0.1.0
Platform Required Support Files 10.2.0.1.0
Oracle interMedia Locator RDBMS Files 10.2.0.1.0
Oracle JDBC/OCI Instant Client 10.2.0.1.0
Oracle interMedia Annotator 10.2.0.1.0
SQLJ Runtime 10.2.0.1.0
Oracle interMedia Java Advanced Imaging 10.2.0.1.0
Oracle Database 10g interMedia Files 10.2.0.1.0
Oracle Data Mining RDBMS Files 10.2.0.1.0
Enterprise Manager Baseline 10.2.0.1.0
Oracle Help For Java 4.2.6.1.0
Oracle UIX 2.1.22.0.0
XML Parser for Java 10.2.0.1.0
Precompiler Required Support Files 10.2.0.1.0
XML Parser for Oracle JVM 10.2.0.1.0
Oracle Message Gateway Common Files 10.2.0.1.0
Oracle Starter Database 10.2.0.1.0
Sample Schema Data 10.2.0.1.0
Parser Generator Required Support Files 10.2.0.1.0
Agent Required Support Files 10.2.0.1.0
Oracle RAC Required Support Files-HAS 10.2.0.1.0
RDBMS Required Support Files 10.2.0.1.0
RDBMS Required Support Files for Instant Client 10.2.0.1.0
XDK Required Support Files 10.2.0.1.0
Oracle OLAP API 10.2.0.1.0
Oracle OLAP RDBMS Files 10.2.0.1.0
DBJAVA Required Support Files 10.2.0.1.0
SQL*Plus Required Support Files 10.2.0.1.0
Oracle JFC Extended Windowing Toolkit 4.2.33.0.0
Oracle Ice Browser 5.2.3.6.0
Oracle Display Fonts 9.0.2.0.0
Oracle Extended Windowing Toolkit 3.4.38.0.0
Enterprise Manager Common Files 10.2.0.1.0
Enterprise Manager Agent DB 10.2.0.1.0
Oracle Net Required Support Files 10.2.0.1.0
Enterprise Manager Repository DB 10.2.0.1.0
SSL Required Support Files for InstantClient 10.2.0.1.0
regexp 2.1.9.0.0
Bali Share 1.1.18.0.0
Oracle Universal Installer 10.2.0.1.0
Oracle One-Off Patch Installer 10.2.0.1.0
Installer SDK Component 10.2.0.1.0
Java Runtime Environment 1.4.2.8.0
Sun JDK 1.4.2.0.8
Sun JDK extensions 10.1.2.0.0
-----------------------------------------------------------------------------

[oracle@centos4 database]$
Installation in progress (Fri Nov 24 09:52:02 GMT 2006)
[oracle@centos4 database]$
............................................................... 11% Done.
............................................................... 23% Done.
............................................................... 35% Done.
............................................................... 47% Done.
.............................................. 55% Done.
Install successful

Linking in progress (Fri Nov 24 09:56:13 GMT 2006)
. 55% Done.
Link successful

Setup in progress (Fri Nov 24 09:58:44 GMT 2006)
.................... 100% Done.
Setup successful

End of install phases.(Fri Nov 24 09:58:54 GMT 2006)
Starting to execute configuration assistants
Configuration assistant "Oracle Net Configuration Assistant" succeeded
Configuration assistant "Oracle Database Configuration Assistant" succeeded
Configuration assistant "iSQL*Plus Configuration Assistant" succeeded
WARNING:The following configuration scripts
/u01/app/oracle/product/10.2.0/db_1/root.sh
need to be executed as root for configuring the system. If you skip the execution
of the configuration tools, the configuration will not be complete and the product
wont function properly. In order to get the product to function properly, you will
be required to execute the scripts and the configuration tools after exiting the OUI.

The installation of Oracle Database 10g was successful.
Please check '/u01/app/oracle/oraInventory/logs/silentInstall2006-11-24_09-51-29AM.log' for more details.

[oracle@centos4 database]$

Once the "root.sh" file is run as instructed, the installation is complete.

Thursday, March 19, 2009

Blocking access to Oracle from TOAD

CREATE OR REPLACE TRIGGER NOTOAD_VB AFTER LOGON ON DATABASE
DECLARE SHOULD_EXECUTE INTEGER;
BEGIN
SELECT DECODE(SUBSTR(UPPER(PROGRAM),1,4),'TOAD',1,'VB',1,0)+DECODE(INSTR(PROGRAM,'\',-1),0,0,
DECODE(SUBSTR(UPPER(SUBSTR(PROGRAM,INSTR(PROGRAM,'\',-1)+1)),1,4),'TOAD',1,'VB',1,0))
INTO SHOULD_EXECUTE FROM V$SESSION WHERE SID=(SELECT SID FROM V$MYSTAT WHERE ROWNUM=1);
IF SHOULD_EXECUTE > 0 THEN
raise_application_error(-20001,'Please no toad yet, try again later');
--EXECUTE IMMEDIATE 'ALTER SESSION SET EVENTS ''10046 TRACE NAME CONTEXT FOREVER,LEVEL 12''';
END IF;
END;

Script to generates a sql script to shrink a tablespace

SET PAGES 999 LINESIZE 100 TRIMS ON ECHO OFF VERIFY OFF FEEDBACK OFF
SET SERVEROUTPUT ON
TTITLE OFF
CLEAR COLUMN
SPOOL shrink_ts.sql
PROMPT
declare
wtablespace varchar2 (30) := '&Tablespace_name_in_caps';
/* database block size (in K) */
wblocksize_kb number := 0;
/* datafile max level */
cursor cdf is
select F.file_name,
L.max_level
from dba_data_files F,
(select E.file_id,
(E.block_id + E.blocks­-1) as max_level
from dba_extents E,
(select file_id, Max(block_id) as max_block_id
from dba_extents
group by file_id) MB
where E.file_id = MB.file_id
and E.block_id = MB.max_block_id) L,
(select file_id,
Round(Sum(bytes)/1024,0) as total_size
from dba_data_files
group by file_id) TS,
(select file_id,
Round((Sum(bytes)/1024),0) as free_size
from dba_free_space
group by file_id) FS
where F.file_id = L.file_id
and F.file_id = TS.file_id
and F.file_id = FS.file_id
and F.tablespace_name = Upper(wtablespace)
and TS.total_size <> L.max_level;
begin
dbms_output.enable(100000);
/* database block size (in bytes) */
select value/1024 into wblocksize_kb
from v$parameter
where name = 'db_block_size';
for rdf in cdf loop

dbms_output.put_line( 'alter database datafile ''' ||
rdf.file_name || ''' resize ' ||
rdf.max_level*wblocksize_kb || 'K;' );

end loop;
end;
/
SPOOL OFF
CLEAR COLUMN
SET SERVEROUTPUT OFF
SET PAGES 24 LINESIZE 80 TRIMS ON ECHO OFF VERIFY ON FEEDBACK ON
PROMPT
PROMPT Output saved at shrink_ts.sql
PROMPT

Wednesday, March 18, 2009

Hot Backup

In Windows: -

set head off
set feedback off
set term on
prompt HOT BACKUP in progress .....
set term off
alter database begin backup;
spool c:\dbcopy.bat
select 'copy '||name||' C:\HOTBACKUP' from v$datafile;
select 'copy '||name||' c:\HOTBACKUP' from v$tempfile;
spool off
host md c:\HOTBACKUP
host c:\dbcopy.bat
set term on
host del c:\dbcopy.bat
alter database backup controlfile to 'c:\HOTBACKUP\control_bak.ctl';
alter database end backup;
alter system switch logfile;
prompt HOT BACKUP successfully completed.
set head on
set feedback on

In Linux: -

set head off
set feedback off
set term on
prompt HOT BACKUP in progress .....
set term off
alter database begin backup;
spool /u01/app/oracle/dbcopy.bat
select 'copy '||name||' /u01/app/oracle/HOTBACKUP' from v$datafile;
select 'copy '||name||' /u01/app/oracle/HOTBACKUP' from v$tempfile;
spool off
host md /u01/app/oracle/HOTBACKUP
host /u01/app/oracle/dbcopy.bat
set term on
host del /u01/app/oracle/dbcopy.bat
alter database backup controlfile to '/u01/app/oracle/HOTBACKUP/control_bak.ctl';
alter database end backup;
alter system switch logfile;
prompt HOT BACKUP successfully completed.
set head on
set feedback on

Cold Backup

In Windows: -
set term off
set head off
set feedback off
set verify off
prompt COLD BACKUP in progress .....
spool c:\startcopy.bat
select 'copy '||name||' c:\DBBACKUP' from v$datafile;
select 'copy '||name||' c:\DBBACKUP' from v$controlfile;
select 'copy '||name||' c:\DBBACKUP' from v$tempfile;
select 'copy '||member||' c:\DBBACKUP' from v$logfile;
spool off
shutdown IMMEDIATE
host c:\startcopy.bat
startup
host del c:\startcopy.bat
prompt COLD BACKUP successfully completed.
set term on
set head on
set feedback on
set verify on

In Linux: -

set term off
set head off
set feedback off
set verify off
prompt COLD BACKUP in progress .....
spool /u01/app/oracle/startcopy.bat
select 'copy '||name||' /uo1/app/oracle/DBBACKUP' from v$datafile;
select 'copy '||name||' /u01/app/oracle/DBBACKUP' from v$controlfile;
select 'copy '||name||' /u01/app/oracle/DBBACKUP' from v$tempfile;
select 'copy '||member||' /u01/app/oracle/DBBACKUP' from v$logfile;
spool off
shutdown IMMEDIATE
host /u01/app/oracle/startcopy.bat
startup
host del /u01/app/oracle/startcopy.bat
prompt COLD BACKUP successfully completed.
set term on
set head on
set feedback on
set verify on

Using free space to create logical volume on LVM partition

[root@igloo ~]# vgdisplay

--- Volume group ---

VG Name VolGroup00

System ID

Format lvm2

Metadata Areas 1

Metadata Sequence No 5

VG Access read/write

VG Status resizable

MAX LV 0

Cur LV 2

Open LV 2

Max PV 0

Cur PV 1

Act PV 1

VG Size 74.41 GB

PE Size 32.00 MB

Total PE 2381

Alloc PE / Size 193 / 6.03 GB

Free PE / Size 2188 / 68.38 GB

VG UUID JoY5DH-S0HV-Q5Dw-b2wC-Rpe0-XeaR-QFbG75



[root@igloo ~]# lvscan

ACTIVE '/dev/VolGroup00/LogVol00' [5.03 GB] inherit

ACTIVE '/dev/VolGroup00/LogVol01' [1.00 GB] inherit



[root@igloo ~]# lvcreate -l 2188 VolGroup00 -n LogVol02

Logical volume "LogVol02" created



[root@igloo ~]# lvscan

ACTIVE '/dev/VolGroup00/LogVol00' [5.03 GB] inherit

ACTIVE '/dev/VolGroup00/LogVol01' [1.00 GB] inherit

ACTIVE '/dev/VolGroup00/LogVol02' [68.38 GB] inherit



[root@igloo ~]# mkfs -t ext3 /dev/VolGroup00/LogVol02

mke2fs 1.36 (05-Feb-2005)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

8962048 inodes, 17924096 blocks

896204 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=20971520

547 block groups

32768 blocks per group, 32768 fragments per group

16384 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000, 7962624, 11239424



Writing inode tables: done

Creating journal (8192 blocks): done

Writing superblocks and filesystem accounting information: done



This filesystem will be automatically checked every 21 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.



[root@igloo ~]# e2label /dev/VolGroup00/LogVol02 /oracle



[root@igloo ~]# cat /etc/fstab

# This file is edited by fstab-sync - see 'man fstab-sync' for details

/dev/VolGroup00/LogVol00 / ext3 defaults 1 1

LABEL=/boot /boot ext3 defaults 1 2

LABEL=/realvar /realvar ext3 defaults 1 2

none /dev/pts devpts gid=5,mode=620 0 0

none /dev/shm tmpfs defaults 0 0

none /proc proc defaults 0 0

none /sys sysfs defaults 0 0

/dev/VolGroup00/LogVol01 swap swap defaults 0 0

/dev/VolGroup00/LogVol02 /oracle ext3 defaults 1 2

/dev/hdc /media/cdrom auto pamconsole,exec,noauto,managed 0 0

/dev/fd0 /media/floppy auto pamconsole,exec,noauto,managed 0 0



Create the partition name with required name in / and mount it:-

[root@igloo ~]#mkdir /oracle

[root@igloo ~]#mount /oracle

Check with the df –h command .

Oracle user script

create user a identified by a;
create user b identified by b;
create user c identified by c;
create user d identified by d;
create user e identified by e;
create user f identified by f;
create user g identified by g;
create user h identified by h;
create user i identified by i;
create user j identified by j;
create user k identified by k;
create user l identified by l;
create user m identified by m;
create user n identified by n;
create user o identified by o;
create user p identified by p;
create user q identified by q;
create user r identified by r;
create user s identified by s;
create user t identified by t;
create user u identified by u;
create user v identified by v;
create user w identified by w;
create user x identified by x;
create user y identified by y;
create user z identified by z;
create user aa identified by aa;
create user ab identified by ab;
create user ac identified by ac;
create user ad identified by ad;
create user ae identified by ae;
create user af identified by af;
create user ag identified by ag;
create user ah identified by ah;
create user ai identified by ai;
create user aj identified by aj;
create user ak identified by ak;
create user al identified by al;
create user am identified by am;
create user an identified by an;
create user ao identified by ao;
create user ap identified by ap;
create user aq identified by aq;
create user ar identified by ar;
create user at identified by at;
create user au identified by au;
create user av identified by av;
create user aw identified by aw;
create user ax identified by ax;
create user ay identified by ay;
create user az identified by az;
create user ba identified by ba;
create user bb identified by bb;
create user bc identified by bc;
create user bd identified by bd;
create user be identified by be;
create user bf identified by bf;
create user bg identified by bg;
create user bh identified by bh;
create user bi identified by bi;
create user bj identified by bj;
create user bk identified by bk;
create user bl identified by bl;
create user bm identified by bm;
create user bn identified by bn;
create user bo identified by bo;
create user bp identified by bp;
create user bq identified by bq;
create user br identified by br;
create user bs identified by bs;
create user bt identified by bt;
create user bu identified by bu;
create user bv identified by bv;
create user bw identified by bw;
create user bx identified by bx;
create user bz identified by bz;
create user ca identified by ca;
create user cb identified by cb;
create user cc identified by cc;
create user cd identified by cd;
create user ce identified by ce;
create user cf identified by cf;
create user cg identified by cg;
create user ch identified by ch;
create user ci identified by ci;
create user cj identified by cj;
create user ck identified by ck;
create user cl identified by cl;
create user cm identified by cm;
create user cn identified by cn;
create user co identified by co;
create user cp identified by cp;
create user cq identified by cq;
create user cr identified by cr;
create user cs identified by cs;
create user ct identified by ct;
create user cu identified by cu;
create user cv identified by cv;
create user cw identified by cw;
create user cx identified by cx;
create user cy identified by cy;
create user cz identified by cz;
create user da identified by da;
create user db identified by db;
create user dc identified by dc;
create user dd identified by dd;
create user de identified by de;
create user df identified by df;
create user dg identified by dg;
create user dh identified by dh;
grant connect,resource to a;
grant connect,resource to b;
grant connect,resource to c;
grant connect,resource to d;
grant connect,resource to e;
grant connect,resource to f;
grant connect,resource to g;
grant connect,resource to h;
grant connect,resource to i;
grant connect,resource to j;
grant connect,resource to k;
grant connect,resource to l;
grant connect,resource to m;
grant connect,resource to n;
grant connect,resource to o;
grant connect,resource to p;
grant connect,resource to q;
grant connect,resource to r;
grant connect,resource to s;
grant connect,resource to t;
grant connect,resource to u;
grant connect,resource to v;
grant connect,resource to w;
grant connect,resource to x;
grant connect,resource to y;
grant connect,resource to z;
grant connect,resource to aa;
grant connect,resource to ab;
grant connect,resource to ac;
grant connect,resource to ad;
grant connect,resource to ae;
grant connect,resource to af;
grant connect,resource to ag;
grant connect,resource to ah;
grant connect,resource to ai;
grant connect,resource to aj;
grant connect,resource to ak;
grant connect,resource to al;
grant connect,resource to am;
grant connect,resource to an;
grant connect,resource to ao;
grant connect,resource to ap;
grant connect,resource to aq;
grant connect,resource to ar;
grant connect,resource to at;
grant connect,resource to au;
grant connect,resource to av;
grant connect,resource to aw;
grant connect,resource to ax;
grant connect,resource to ay;
grant connect,resource to az;
grant connect,resource to ba;
grant connect,resource to bb;
grant connect,resource to bc;
grant connect,resource to bd;
grant connect,resource to be;
grant connect,resource to bf;
grant connect,resource to bg;
grant connect,resource to bh;
grant connect,resource to bi;
grant connect,resource to bj;
grant connect,resource to bk;
grant connect,resource to bl;
grant connect,resource to bm;
grant connect,resource to bn;
grant connect,resource to bo;
grant connect,resource to bp;
grant connect,resource to bq;
grant connect,resource to br;
grant connect,resource to bs;
grant connect,resource to bt;
grant connect,resource to bu;
grant connect,resource to bv;
grant connect,resource to bw;
grant connect,resource to bx;
grant connect,resource to bz;
grant connect,resource to ca;
grant connect,resource to cb;
grant connect,resource to cc;
grant connect,resource to cd;
grant connect,resource to ce;
grant connect,resource to cf;
grant connect,resource to cg;
grant connect,resource to ch;
grant connect,resource to ci;
grant connect,resource to cj;
grant connect,resource to ck;
grant connect,resource to cl;
grant connect,resource to cm;
grant connect,resource to cn;
grant connect,resource to co;
grant connect,resource to cp;
grant connect,resource to cq;
grant connect,resource to cr;
grant connect,resource to cs;
grant connect,resource to ct;
grant connect,resource to cu;
grant connect,resource to cv;
grant connect,resource to cw;
grant connect,resource to cx;
grant connect,resource to cy;
grant connect,resource to cz;
grant connect,resource to da;
grant connect,resource to db;
grant connect,resource to dc;
grant connect,resource to dd;
grant connect,resource to de;
grant connect,resource to df;
grant connect,resource to dg;
grant connect,resource to dh;

Friday, March 13, 2009

Some scripts which can be used in automation

To allow Oracle start on boot-up, create a file called oracledb (or whatever name you want to call it) and put it in /etc/init.d with the contents below. This script was copied and pasted from a tutorial by Graham Williams. It will read the /etc/oratab and fire up any instances it finds.
#!/bin/bash
#
# /etc/init.d/oracledb
#
# Run-level Startup script for the Oracle Instance, Listener, and Web Interface

export ORACLE_HOME=/oracle/app/product/10.2.0/db_1/
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=cjperf
ORA_OWNR="oracle"

# if the executables do not exist -- display error

if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi

# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display

case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
su $ORA_OWNR -c $ORACLE_HOME/bin/dbstart
touch /var/lock/oracle

su $ORA_OWNR -c "$ORACLE_HOME/bin/emctl start dbconsole"
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
su $ORA_OWNR -c $ORACLE_HOME/bin/dbshut
rm -f /var/lock/oracle

su $ORA_OWNR -c "$ORACLE_HOME/bin/emctl stop dbconsole"
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac

exit 0


vi /etc/oratab

database_sid:oracle_home_dir:Y|N

change entry from N to Y

and if you want, make it run at every boot:
# update-rc.d oracledb defaults 99
Adding system startup for /etc/init.d/oracledb ...
ln -s /etc/init.d/oracledb /etc/rc.d/rc0.d/K01oracledb
ln -s /etc/init.d/oracledb /etc/rc.d/rc0.d/S99oracledb
ln -s /etc/init.d/oracledb /etc/rc.d/rc2.d/K01oracledb
ln -s /etc/init.d/oracledb /etc/rc.d/rc2.d/S99oracledb
ln -s /etc/init.d/oracledb /etc/rc.d/rc3.d/K01oracledb
ln -s /etc/init.d/oracledb /etc/rc.d/rc3.d/S99oracledb
ln -s /etc/init.d/oracledb /etc/rc.d/rc4.d/K01oracledb
ln -s /etc/init.d/oracledb /etc/rc.d/rc4.d/S99oracledb
ln -s /etc/init.d/oracledb /etc/rc.d/rc5.d/K01oracledb
ln -s /etc/init.d/oracledb /etc/rc.d/rc5.d/S99oracledb
ln -s /etc/init.d/oracledb /etc/rc.d/rc6.d/K01oracledb
ln -s /etc/init.d/oracledb /etc/rc.d/rc6.d/S99oracledb
Before finishing, add the following lines to your /etc/.bash_profile . Be careful, since these values are valid system-wide. So make sure the paths are set according to your particular setup (if you have been doing everything according to this text, you should be fine).
export ORACLE_BASE/oracle/app/product/10.2.0/db_1/
export ORACLE_HOME=/oracle/app/oracle/product/10.2.0/db_1
export ORACLE_SID=cjperf
export PATH=$PATH:/oracle/app/oracle/product/10.2.0/db_1/bin
Last operation: add yourself to the dba group. You can use usermod or just edit the /etc/group file and add your username at the end of the line that starts with dba (my username is ‘harsha’):
dba:x:1002:oracle,harsha
If you chose to not create a starter database during your install, you’ll have to do two extra steps. You should create a listener (with netca) and after that, create the starter database (also with netca). If you chose to have the installer create a database for you, then you should be fine, since when doing that, it asks for a password for the default accounts (SYS, SYSTEM, and DBSNMP, SYSMAN if you choose to install it with the enterprise manager option selected).
If everything has gone well, open a terminal window and, as the oracle user, type:
$ sqlplus

SQL*Plus: Release 10.2.0.1.0 - Beta on Wed Jul 11 17:11:53 2007

Copyright (c) 1982, 2007, Oracle. All rights reserved.

Enter user-name:
If you see these messages (and I sincerely hope you do) you’re all set! That means that you have finished a quite long install of Oracle 10g and you are ready to begin destroying it.
Harshavardhan.
NOTE:
Release 2 bug:
Inside $ORACLE_HOME/bin/dbstart there is a bug that will prevent the listener to start
(Failed to auto-start Oracle Net Listener using /ade/vikrkuma_new/oracle/bin/tnslsnr);
to solve change line 78 from
ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle/bin/tnslsnr
to
ORACLE_HOME_LISTNER=$ORACLE_HOME

Platform
Symbolic Links Commands
AIX
# ln -s /etc/dbora /etc/rc.d/rc2.d/S99dbora
# ln -s /etc/dbora /etc/rc.d/rc2.d/K01dbora
HP-UX
# ln -s /sbin/init.d/dbora /sbin/rc3.d/S990dbora
# ln -s /sbin/init.d/dbora /sbin/rc3.d/K001dbora
Linux
# ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/K01dbora
# ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/S99dbora
# ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/K01dbora
# ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/S99dbora
Solaris
# ln -s /etc/init.d/dbora /etc/rc3.d/K01dbora
# ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora

Tru64 UNIX
# ln -s /sbin/init.d/dbora /sbin/rc3.d/S99dbora
# ln -s /sbin/init.d/dbora /sbin/rc3.d/K01dbora

Oracle 10g installation on Ubuntu Linux

Steps followed for oracle installation and dbcreation for perf db in cj on ubuntu 8.04

Step One: -

Install some system requirements. There are a few packages that I had to install on this box (it was a recently installed system which didn’t have all these packages). After several attempts of installing Oracle, the equivalent command-line for installing all the necessary packages at once was something like this:
# apt-get install gcc make binutils lesstif2 libc6 libc6-dev rpm libmotif3 libaio libstdc++5 gawk alien libg++2.8.1.3-glibc2.2 ksh gcc-3.3 g++-3.3 libstdc++5 libstdc++5-3.3-dev libstdc++5 libc6-dev-i386 g++-multilib ia32-libs libc6-dev g++-4.1 xscreensaver
It’s possible that when installing the packages mentioned above, the installer will install some other prerequisites as well, as these packages themselves may have prerequisites.

Step Two: -

Choose where you are going to install your Oracle 10g server and create the ORACLE_BASE directory. This is the place where Oracle will be installed. Make sure there is at least 3 GB on the partition/mount point before moving to the next step. After installed, my basic installation took about 3.4 GB on disk (without the starter database!). As your database grows, it will need more space. Reserve a total of at least 6 GB for the unpacked installer and the basic installation. You can get rid of the installer files afterwards.
# mkdir -p /home/oracle/


Step Three: -

Add a few users and change groups to make the installer more comfortable. Remember, we are tricking the installer to think it’s installing on a Red Hat box.
# addgroup oinstall
# addgroup dba
# addgroup nobody
# useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle
# usermod -g nobody nobody
The usermod command is needed since because when running, the installer looks for a user called nobody which is part of a group named nobody (in Ubuntu, the user nobody it’s assigned to nogroup by default).

Step Four: -

Make some symlinks. Apparently, the installer uses absolute paths, so it must find the binaries in the right places.
# ln -s /usr/bin/awk /bin/awk
# ln -s /usr/bin/rpm /bin/rpm
# ln -s /usr/bin/basename /bin/basename

Step Five: -

We need to mimic the /etc/rc.d directory structure of a Red Hat box. We do this with more symlinks:
# mkdir /etc/rc.d
# ln -s /etc/rc0.d /etc/rc.d/rc0.d
# ln -s /etc/rc2.d /etc/rc.d/rc2.d
# ln -s /etc/rc3.d /etc/rc.d/rc3.d
# ln -s /etc/rc4.d /etc/rc.d/rc4.d
# ln -s /etc/rc5.d /etc/rc.d/rc5.d
# ln -s /etc/rc6.d /etc/rc.d/rc6.d
# ln -s /etc/init.d /etc/rc.d/init.d

Step Six: -

I’ve created a file called /etc/redhat-release and put only one line on it. The same can be achieved by issuing the following as root:
echo "Red Hat Linux release 4" > /etc/redhat-release

Step Seven: -

We tweak the system default limits on a few items. The shared-memory are specially important, since Oracle relies on shared memory for process communications. There is a file called /etc/sysctl.conf and it should have these lines on it:
fs.file-max = 65535
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
Now that they are in a config file, these limits will be issued automatically at the next boot sequence. For now, we need to make the system re-read the config file:
# sysctl -p
Now, what do those parameters and values actually mean?
fs.file-max sets the maximum number of open files that can be handled by the Linux kernel.
kernel.shmall determines the total amount of shared memory to be allocated in pages. In this example, I’ve set it to 8GB, which is way above the amount of memory I can handle in my box, even with swap.
kernel.shmmax controls the maximum amount of memory to be allocated for shared memory which in this example is 2GB.
kernel.shmmni defines the maximum number of segments system-wide.
net.core.rmem_default and net.core.rmem_max define the default and maximum read buffer queue for network operations (1 MB in this example)
net.core.wmem_default and net.core.wmem_max define the default and maximum write buffer queue for network operations (256 KB in this example)
net.ipv4.ip_local_port_range tells the kernel the port ranges that will be used for outbound connections.
kernel.sem has four parameters:
1.SEMMSL - semaphores per array
2.SEMMNS - max semaphores system-wide (SEMMNI*SEMMSL)
3.SEMOPM - max operations per semop call
4.SEMMNI - max number of semaphore arrays
To check your current semaphores configuration, you can run cat /proc/sys/kernel/sem or ipcs -ls. On machine, after the modifications on sysctl.conf, these commands output:
# cat /proc/sys/kernel/sem
250 32000 100 128

# ipcs -ls

------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 100
semaphore max value = 32767
(I really don’t know if these are enough or too much, but I’ll keep you posted.)
For a better understanding of these kernel-tweaking settings, I’d recommend these resources:
schogini.us/wordpress/index.php/2005/11/01/setting-semaphores/
performancewiki.com/linux-tuning.html
pythian.com/blogs/245/the-mysterious-world-of-shmmax-and-shmall

Step Eight: -

Add these lines to /etc/security/limits.conf, letting the oracle user use more resources than the defaults allowed. You may notice that all these values are a power of 2 minus one. When soft limits are exceeded, you’ll get a warning; the hard limits can’t be exceeded in any situation: you’ll get an error. I’m not completely sure, but I think these limits apply to each session/login (and since Oracle doesn’t exactly log in to the machine, my best guess is these limits apply per instance running).
oracle soft nproc 2047
oracle hard nproc 16383
oracle soft nofile 1023
oracle hard nofile 65535

Step Nine: -

Make sure the limits.conf is being interpreted as the oracle user logs in by adding these lines to /etc/pam.d/login. You will want to make sure that is actually happening, since the defaults are way lower and you may get all sorts of problems.
session required /lib/security/pam_limits.so
session required pam_limits.so

Step Ten: -

Unpack and prepare the installation.

Directions
1.Unzip the file: gunzip
2.2. Extract the file: cpio -idmv <

# cd /path/to/zipfile
# unzip 10201_database_linux_x86_64.cpio.gz
# cpio –idmv 10201_database_linux_x86_64.cpio.gz

(And wait… wait a bit more… go get a cup of coffee…)
After your second cup of coffee, you should have a multi-gigabyte set of files; this is our installer.
# chown -R oracle:oinstall /oracle
# chown -R oracle:oinstall /u01
# chown -R oracle:oinstall /u02


# sudo chmod -R 775 /oracle
# sudo chmod -R 775 /u01
# sudo chmod -R 775 /u02

Step Eleven: -

Fire up the installer as the oracle user itself. This is what you will probably see on the output window:
# su - oracle
$ cd /path/to/extracted/zip/file
$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 80 MB. Actual 58633 MB Passed
Checking swap space: must be greater than 150 MB. Actual 2900 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2007-07-11_04-38-56PM. Please wait ...
Oracle Universal Installer, Version 11.1.0.2.0 Production
Copyright (C) 1999, 2007, Oracle. All rights reserved.

ulimit: 1: Illegal option -u
ulimit: 1: Illegal option -u
rpm: To install rpm packages on Debian systems, use alien. See README.Debian.
error: cannot open Packages index using db3 - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
rpm: To install rpm packages on Debian systems, use alien. See README.Debian.
error: cannot open Packages index using db3 - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
There are a few errors that can be safely ignored: the ulimit and the RPM-related errors, since the limits don’t restrict the installer and since we actually don’t have a RPM database on the machine — we are running on Ubuntu, remember?
After a few moments, you will be prompted to choose where to install the Oracle server. You’ll notice that I asked the installer to create a starter database — I can also create that later.
Choose the Oracle Base and correct the group if needed.
I personally recommend sticking with the defaults if you are a newbie like me.


./runInstaller

Graphical mode
For the graphical mode, no more simply, just follow the instructions if you have no idea of what you are doing, default options works fine.

Victory, now you can see that:

Warning : When you'll see the following image, execute the script that it demand
to.

At some point, it will ask you to run some commands as root. Do that when it asks, since the install depends on a few modifications on the base system (like creating the /etc/oratab file).

In a different console.
$ sudo -i
Password:

# /u01/app/oracle/oraInventory/orainstRoot.sh

Changing permissions of /oracle/app/oracle/oraInventory to 770.

Changing groupname of /oracle/app/oracle/oraInventory to oinstall.
The execution of the script is complete

# /oracle/app/oracle/product/10.2.0/db_1/root.sh
Running Oracle 10g root.sh script...

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /oracle/app/oracle/product/10.2.0/db_1
[: 185: ==: unexpected operator
[: 189: ==: unexpected operator
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...

Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
After these scripts finish their execution (the errors seem to be ignorable)


Finally, you have finished the installation:

To finish
The installation is done, we have to reboot the system to kill some installation's daemons. After, you'll have to do the following to launch the Oracle server:
$ sudo su oracle
Password: enter your sudo password
[oracle] $ lsnrctl start

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 19-JAN-2006 13:55:02

Copyright (c) 1991, 2005, Oracle. All rights reserved.

Starting /u01/app/oracle/oracle/product/10.2.0/db_1//bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/oracle/product/10.2.0/db_1/network/admi n/listener.ora
Log messages written to /u01/app/oracle/oracle/product/10.2.0/db_1/network/log/l istener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(P ORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 19-JAN-2006 13:55:04
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/oracle/product/10.2.0/db_1/network/adm in/listener.ora
Listener Log File /u01/app/oracle/oracle/product/10.2.0/db_1/network/log /listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

[oracle] $ sqlplus connect as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jan 19 13:55:21 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Enter password: enter the DB password
Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 92276304 bytes
Database Buffers 188743680 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

[oracle] $ isqlplusctl start
iSQL*Plus 10.2.0.1.0
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Starting iSQL*Plus ...
iSQL*Plus started.

[oracle] $ emctl start dbconsole
TZ set to Indian/Reunion
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://localhost.localdomain:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control ........................ started.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/oracle/product/10.2.0/db_1/localhost.localdomain_orcl/sysman/log

Database Upgrade from 8i to 9i

1)Make sure that you have 9iR2 software (9.2.0 CD Dump) before starting the installation.

first need to download the software on the server. Following are the details of the software to be downloaded:

i. 9.2.0.1 for Solaris:

Disk1: Part# A99349-01
Disk2: Part# A99350-01
Disk3: Part# A99351-01

ii. 9.2.0.1 for Linux

Disk1: Part# A99339-01
Disk2: Part# A99340-01
Disk3: Part# A99341-01

2) Login to oracle user and make sure that you have minimum 4 GB free space in /u01/app/oracle mount point. If you do not have enough free space, you need to send the TAR to SA team for adding more space to /u01/app/oracle mount point.

3) Make sure that you have oraInst.loc file in the below given locations and it has 777 privileges over it. If the file is not there or it does not have 777 privileges, you need to send the TAR to SA team for creating the file or granting 777 on it.
a. On Solaris: /var/opt/oracle/oraInst.loc
b. On Linux: /etc/oraInst.loc

4) Look out for the oraInventory on your instance. As per EBSO standards the location of oraInventory is “/u01/app/oracle/product/oraInventory”. If it is not present in this location you need to search for it. Once you know the location of oraInventory and you have privileges to update oraInst.loc file, make sure that the contents of oraInst.loc is as shown below. If the file was already existing and had some other values, just update it as shown below:
inventory_loc=/u01/app/oracle/product/oraInventory
inst_group=oistall

5) Make sure that you have /igold symbolic link pointing to /u01 on the file system.

Preparing the System for Upgrade

1) Declare blackout on all the Components of APPS Instance and shutdown all Middle-Tier services of the instance. Keep Database server and DB listener up.

2) Check the free space in SYSTEM tablespace and if it is less than 1 GB free, add another datafile to create free space. Similarly, make sure that you have minimum 750 MB free in RBS tablespace. One example of how to add datafile is given below.

SQL> select tablespace_name, round(sum(bytes)/1024/1024) free_space from dba_free_space where tablespace_name in (‘SYSTEM’,’RBS’) group by tablespace_name;

SQL> alter tablespace SYSTEM add datafile ‘/xxxxxx/oradata02/data02/systemxx.dbf’ size 1000m autoextend on next 25m maxsize 1800m;

3) Make sure that the value of maxextents for all Rollback Segments is Unlimited. Run the below given query to check this. The value of “32765” means the Unlimited size. If the value is less than 32765 then alter the rollbacks segment to make maxextents unlimited.

SQL> select segment_name, max_extents,status from dba_rollback_segs;
SQL> alter rollback segment rbsXX storage (maxextents unlimited);

4) Set the values of following parameters in initXXXXXX.ora file as given below.
db_domain =
aq_tm_processes = 0
job_queue_processes = 0
log_archive_start = false
_system_trig_enabled = FALSE

5) Search for any “event=” set in initXXXXXX.ora or ifilecbo.ora files. If you find any event, comment that entry. Also, you may not find some of the initialization parameters given above in initXXXXXX.ora file. In that case check the parameter in ifilecbo.ora file.

6) Alter the database to NOARCHIVELOG mode and shut it down. Also shutdown the DB listener.

$ sqlplus “/ as sysdba”
SQL> shutdown immediate
SQL> startup mount
SQL> alter database noarchivelog;
SQL> archive log list
SQL> shutdown immediate
SQL> exit
$ lsnrctl stop XXXXXX


7) Create new ORACLE_HOME and set environment for that.

a. Create new directory “920” in product directory for the new HOME
$ cd /xxxxxx/oracle/product
$ mkdir 920

b. Copy the environment file from old ORACLE_HOME (817) to new ORACLE_HOME (920)
$ cd /xxxxxx/oracle/product/920
$ cp ../817/.env .

c. Edit the environment file in new ORACLE_HOME and change all the references from “817” to “920” by performing a global replace in “vi”.
$ vi .env
:1,$ s/817/920/g

d. Edit “.profile” file and “.bash_profile” (only in Linux) and edit all the references of “817” to “920”

$ cd $HOME
$ vi .profile
:1,$ s/817/920/g
$ vi .bash_profile
:1,$ s/817/920/g

e. Log out from orxxxxxx user, login again and make sure that the following environment variables are pointing to new ORACLE_HOME i.e. “/orxxxxxx/product/920”.
$ echo $ORACLE_HOME
$ echo $LD_LIBRARY_PATH
$ echo $TNS_ADMIN

8) At this stage we are ready to perform our upgrade. Just review all the steps in these first 2 sections and make sure that you have followed all of them. Then proceed to next section and perform the upgrade.

Performing 920 Upgrade

1) Login to orxxxxxx user and make sure that the environment variables like ORACLE_HOME, TNS_ADMIN and LD_LIBRARY_PATH are pointing to new ORACLE_HOME of 920. Also, make sure that /igold symbolic link is pointing to /xxxxxx and oraInst.loc file has been correctly updated. All these things had been discussed in the previous sections of the document.

2) Start a Reflection X session and connect to orxxxxxx user using Fsecure SSH client. Run xclock to see if you can run GUI. If you are performing the upgrade from a remote location (from India) do not run the Installer from your own PC but use VNC Viewer to connect to a Desktop in the US and then run the upgrade from the US PC. In case of Your Place customers, the normal SSH session is enabled to run GUI Installers and there is no performance hit from any location. You can run the installer without opening any Reflection or VNC viewer.

3) Start “runInstaller” from Disk1 of 9.2.0.1 CD Set which has been downloaded earlier and choose the following options while installation:

a. File Locations:
ORACLE_HOME name: IGOLD920_HOME
ORACLE_HOME path=/igold/oracle/product/920
Do not give the actual location of 920 ORACLE_HOME (/xxxxxx/oracle/product/920) here. We are deliberately using “igold” as it helps in patching of cloned instances

b. Select a Product:
Oracle 9i Database 9.2.0.1.0

c. Type of Installation:
Enterprise Edition

d. Database Configuration
Software Only

4) Download 9.2.0.4 PatchSet (Patch# 3095277) and unzip it in a temporary directory and run below given cpio command. It will create a new Disk1 directory.
Solaris:
$ unzip 9204_solaris_release.cpio.z
$ cpio -idmv < 9204_solaris_release.cpio
Linux:
$ cpio -idmv < 9204_lnx32_release.cpio

5) Start “runInstaller” from /xxxxxx/oracle/product/oui directory to install 9.2.0.4 PatchSet files and choose the following options:

a. Files Locations:
Source Path: /Disk1/stage/products.jar
ORACLE_HOME name: IGOLD920_HOME
ORACLE_HOME path=/igold/oracle/product/920

b. Choose OUI installation and complete it. Exit the installer, do not choose continue with “Next Install”. You have to restart installer.

c. Start installer again with the same File Location values as given above and choose 9.2.0.4 PatchSet installation.

6) Relink Oracle executables to remove igold dependencies and verify that libraries being referenced after relinking are from correct ORACLE_HOME location and not from igold link.
$ cd $ORACLE_HOME/bin
$ ./relink all
$ ldd lsnrctl
$ ldd sqlplus
$ ldd oracle

7) Copy initXXXXXX.ora and ifilecbo.ora files from old ORACLE_HOME to new 920 ORACLE_HOME. Do not change the value of any initialization parameter; this will be done in later steps.
$ cd $ORACLE_HOME/dbs
$ cp ../../817/dbs/initXXXXXX.ora .
$ cp ../../817/dbs/ifilecbo.ora .

8) Perform the DB upgrade from 8.1.7 to 9.2.0 using the manual scripts as given below. These upgrade scripts may take 4-5 hours to complete. “startup migrate” statement will throw “ORA-32004: obsolete and/or deprecated parameter(s) specified” exception. At this point of time ignore this error it will be taken care in later steps. Once the upgrade scripts complete, query “dba_registry” table to make sure that Oracle components have been upgraded.
$ sqlplus “/ as sysdba”
SQL> startup migrate
SQL> spool db_upgrade.log
SQL> @?/rdbms/admin/u0801070.sql
SQL> spool off
SQL> spool dbcmp_upgrade.log
SQL> @?/rdbms/admin/cmpdbmig.sql
SQL> spool off
SQL> SELECT comp_name, status, substr(version,1,10) as version from dba_registry;
COMP_NAME STATUS VERSION
Oracle9i Catalog Views VALID 9.2.0.4.0
Oracle9i Packages and Types VALID 9.2.0.4.0
JServer JAVA Virtual Machine VALID 9.2.0.4.0
Oracle9i Java Packages VALID 9.2.0.4.0
Oracle XDK for Java UPGRADED 9.2.0.2.0
Oracle interMedia Text LOADED 8.1.7.4
Oracle9i Real Application Clusters INVALID 9.2.0.4.0
Oracle interMedia LOADED 8.1.6.0.0
Oracle Spatial LOADED 8.1.6.0.0

9) Shutdown the instance, start it up again and execute utl_recomp package to recompile invalid objects using parallel workers. This may take 3-4 hours.
a. SQL> shutdown immediate
b. SQL> startup
c. SQL> @?/rdbms/admin/utlrcmp.sql
d. SQL> exec utl_recomp.recomp_parallel(6)

10) Upgrade Oracle Text, Oracle interMedia and Orace Spatial as given in the following steps. Run “catpatch.sql” script to complete the installation of 9.2.0.4 patchset. Then query dba_registry table to verify the upgrade.
a. Upgrade Oracle Spatial
SQL> spool spatial_upgrade.log
SQL> connect / as sysdba
SQL> @?/md/admin/mdprivs.sql
SQL>connect mdsys/mdsys
SQL> @?/md/admin/c81Xu9X.sql
SQL> spool off
b. Upgrade Oracle interMedia
SQL> spool intermedia_upgrade.log
SQL> connect / as sysdba
SQL> @?/ord/im/admin/imdbma.sql
SQL> @?/ord/admin/u0801070.sql
SQL> @?/ord/im/admin/u0801070.sql
SQL> connect ordsys/ordsys
SQL> @?/ord/im/admin/imchk.sql
SQL> spool off
c. Upgrade Oracle Text
SQL> spool text_upgrade.log
SQL> connect / as sysdba
SQL> @?/ctx/admin/s0900010.sql
SQL> connect ctxsys/ctxsys
SQL> @?/ctx/admin/u0900010.sql
SQL> connect / as sysdba
SQL> @?/ctx/admin/s0902000.sql
SQL> connect ctxsys/ctxsys
SQL> @?/ctx/admin/u0902000.sql
SQL> spool off
d. Complete 9.2.0.4 Patchset
SQL> shutdown immediate
SQL> startup migrate
SQL> spool patch.log
SQL> @?/rdbms/admin/catpatch.sql
SQL> spool off
e. Compile invalids
SQL> shutdown immediate
SQL> startup
SQL> exec utl_recomp.recomp_parallel(4)
f. Verify the upgrade
SQL> SELECT comp_name, status, substr(version,1,10) as version from dba_registry;
COMP_NAME STATUS VERSION
Oracle9i Catalog Views VALID 9.2.0.4.0
Oracle9i Packages and Types VALID 9.2.0.4.0
JServer JAVA Virtual Machine VALID 9.2.0.4.0
Oracle9i Java Packages VALID 9.2.0.4.0
Oracle XDK for Java VALID 9.2.0.6.0
Oracle interMedia Text VALID 9.2.0.4.0
Oracle9i Real Application Clusters INVALID 9.2.0.4.0
Oracle interMedia VALID 9.2.0.4.0
Oracle Spatial VALID 9.2.0.4.0

11) Copy tnsnames.ora and listener.ora files from TNS_ADMIN directory of old ORACLE_HOME (817) to TNS_ADMIN directory of new ORACLE_HOME (920) and change references of 817 ORACLE_HOME to 920 ORACLE_HOME. Then start DB listener and make sure that “tnsping” works.

12) Update initXXXXXX.ora and ifilecbo.ora files as given below. These values have been taken from Note# 216205.1.

a. Update the following parameters in initXXXXXX.ora file:
Set the value of “aq_tm_processes” to the original value which was there before starting the upgrade
Set the value of “job_queue_processes” to the original value which was there before starting the upgrade
Set “compatible = 9.2.0”
Set “_system_trig_enabled = TRUE”
Set “log_archive_start = true”

b. Add the following new parameters in initXXXXXX.ora file:
nls_length_semantics = BYTE
pga_aggregate_target = 1000M
workarea_size_policy = AUTO

c. Comment the following parameters in initXXXXXX.ora as these are obsoleted in 9iR2 database:
DB_BLOCK_MAX_DIRTY_TARGET
sort_area_size
db_block_lru_latches
job_queue_interval
always_anti_join
always_semi_join

d. Update the following parameter in ifilecbo.ora file”
Set “optimizer_features_enable = 9.2.0”

e. Comment the following parameters in ifilecbo.ora as these are obsoleted in 9iR2 database:
_optimizer_undo_changes
_optimizer_mode_force
_complex_view_merging
_push_join_predicate
_use_column_stats_for_function
_or_expand_nvl_predicate
_push_join_union_view
_ordered_nested_loop
optimizer_percent_parallel=0
always_anti_join
always_semi_join
_new_initial_join_orders

13) Restart the database and alter it in arhivelog mode. Make sure that you do not get “ORA-32004: obsolete and/or deprecated parameter(s) specified” error while starting the database. If you get this error, check the erroring parameter name in alertXXXXXX.log file and comment that in init.ora.
$ sqlplus “/ as sysdba”
SQL> shutdown immediate
SQL> startup mount
SQL> alter database archivelog;
SQL> shutdown immediate
SQL> startup

14) Execute the post-install scripts
SQL> conn / as sysdba
SQL> @?/javavm/install/jvmsec3.sql
SQL> @?/javavm/install/jvmsec5.sql
SQL> conn apps/
SQL> @/patch/115/sql/adgrn9i.sql apps

15) Apply APPS patches required for 9iR2 database.

a. Apply FND Patch# 2838093
b. If adpatch hangs while executing “adinvset.pls” for more than 10 minutes then you may be hitting Bug# 2651057. Apply Patch# 2651057 to fix the issue.
c. Apply AD Patch# 2361208

16) Complete the upgrade and start APPS services

a. Run “Re-create grants and synonyms” from adadmin
b. Run “Compile APPS schema” from adadmin
c. Start all APPS services
d. Expire the blackout
e. Perform health checks and release the instance to the customer
f. Rename old ORACLE_HOME as 817_old
$ mv /xxxxxx/oracle/product/817 /xxxxxx/oracle/product/817_old