Académique Documents
Professionnel Documents
Culture Documents
Fold
Table of Contents
Background & Overview
Assumptions & Pre-Requisites
Useful Information
Step-By-Step Guide
How to Disable Oracle HAS
Security Compliance
Regression
File Listings
oracle .profile
oratab
listener.ora
ASM Parameter File
initSID.ora
createdb.sql
tnsnames.ora
File Systems
Example ASM Install
Example Database Install
Other References
Known Issues
ORA-7445 [kokscold()+849]
Description
Fix
Running root.sh on the Database
Description
Example Output
Miscellaneous
OS Packages for Oracle Enterprise Linux v5
Removing an 11g Database
Deinstalling Oracle 11g Binaries and Database
Step-by-Step
Example Output
The resultant database will be standalone, i.e. not part of a cluster or failover
configuration.
o
Documentation for failover configurations can be found here. - Add link when
documentation available
All references to SID should be replaced with correct database name as derived
using a suitable database naming standard.
All $variable references assume the .profile as described in the File Listings section
has been implemented and run.
Useful Information
This section outlines useful information and changes to previous 10g documentation found
on this site. Some have been made for cosmetic reasons, others for more practical
considerations.
A new deinstallation tool is used for deinstalling Oracle software and databases.
SeeDeinstalling Oracle 11g section below.
On Linux the oratab and the oraInst.loc file is kept in directory /etc.
A new init.ora parameter called diag_dest has been set and maps to
the diag directory in the new directory structure mentioned above.
There are a number of new maintenance jobs in 11g. These will be turned off as part
of this step-by-step guide.
In order to get the database working with ASM, Oracle Grid Infrastructure will
need to be installed. This should not be mistaken for Oracle Grid Control. The
following guide explains how to install Oracle Grid Infrastructure and any prerequisite packages like ASMLIB.
At the time of writing this guide there are no supported Veritas Cluster agents for
database version 11.2.
Step-By-Step Guide
1. Get a UNIX administrator to check the following Metalink article 169706.1 to ensure
that the SE Linux build meets Oracle's requirements.
2. Ensure oracle account and dba group exists.
3. Ensure the Oracle Linux version is 5.3 or higher.
lsb_release -id
uname -r
5. Ask a UNIX administrator to check that the correct OS packages have been installed as
detailled in the Packages for Oracle Enterprise Linux v5 section below.
6. Ensure that SHMMAX is set to 4Gb minus 1 byte. This is to accomodate feature/bug
detailled in Metalink nore 567506.1.
setenforce 0
getenforce
cd /dev/shm
df -h .
11. Ask a Unix administrator to install ASMLIB. At the time of writing this guide, the
following Linux package had been identified by the Unix team,oracleasm-2.6.18128.4.1.0.1.el5-2.0.5-1.el5.x86_64.rpm. This will install the follwing ASM 2.0 libraries
12. Ask a Unix administrator to create a single partition on each device to be used by ASM.
oracleasm createdisk < disk label > /dev/mapper/< alias >< partition >
14. Create and run .profile - see File Listings section below.
15. Ensure the database file systems have been created with correct permissions and have
been sized appropriately for the application. - see File Systemssection below.
16. Download the latest oracle binaries from OTN. For example:
Enterprise Edition for Linux Operating System (64-bit)
linux.x64_11gR2_database_1of2.zip : 1,239,269,270 bytes; cksum - 3152418844
linux.x64_11gR2_database_2of2.zip : 1,111,416,131 bytes; cksum - 3669256139
linux.x64_11gR2_grid.zip : 1,052,897,657 bytes; cksum - 3369676398
17. Unzip the downloaded files using the following commands
cd /u01/app/oracle/software/
unzip <filename>
unset ORACLE_HOME
unset TNS_ADMIN
export ORACLE_BASE=/u01/app/oracle
cd /u01/app/oracle/software/grid
./runInstaller
24. Follow the instructions as demonstrated in the Example ASM Install section below.
Before continuing apply any oneoff patches or patch bundles or CPU patch bundles
recommended by Oracle or the application vendor.
25. Create additional ASM Disk Groups
SQL> exit;
SQL> exit;
SQL> exit;
cd $ORACLE_HOME/dbs
rm orapw+ASM
SQL> quit
SQL> quit
cd $ORACLE_HOME/dbs
rm init.ora
rm init+ASM.ora
SQL> startup
SQL> quit
unset ORACLE_HOME
unset TNS_ADMIN
cd /u01/app/oracle/software/database
./runInstaller
40. Follow the instructions as demonstrated in the Example Install section below.
Before continuing apply any oneoff patches or patch bundles or CPU patch bundles
recommended by Oracle or the application vendor.
41. Configure /etc/oratab file and test using . oraenv command - see File Listings section
below.
42. Configure $ORACLE_BASE/admin/SID/create/createdb.sql file, adjusting
parameters accordingly - see File Listings section below.
43. Configure $ORACLE_BASE/admin/SID/pfile/initSID.ora file, adjusting parameters
accordingly and create symbollic link to it from$ORACLE_HOME/dbs - see File
Listings section below.
44. Remove template init.ora file from $ORACLE_HOME/dbs.
. oraenv
SID
cd $ORACLE_HOME/dbs
cd $ORACLE_BASE/admin/SID/create
SQL> @createdb.sql
o
SQL> exit
rm initSID.ora
ln -s /u01/app/oracle/admin/SID/pfile/spfileSID.ora spfileSID.ora
SQL> startup
SQL>quit
sqlplus /nolog
SQL> BEGIN
SQL> END;
SQL> /
50. Confirm database has been recognised by the listener using the command lsnrctl
status - this may take a minute or so to occur.
51. Remove unwanted files
cd $TNS_ADMIN
rm -rf samples
52. Configure $TNS_ADMIN/tnsnames.ora file, adjusting parameters accordingly see File Listings section below.
53. Confirm connections via SQLnet are working using the following commands:
sqlplus system/<password>@SID
SQL> exit
Security Compliance
The following steps should be performed once the database has been built to ensure that
the environment conforms to Oracle's Best Practices and also ensures that it doesn't fall foul
of Internal Audit.
1. Remove the GRANT EXECUTE TO PUBLIC privilege from potentially harmful packages.
SQL> exit
2. Ensure the following user-ids' passwords, where applicable, have been changed:
SYS
SYSTEM
DBSNMP
OUTLN
CTXSYS
PERFSTAT
1. Adjust the database DEFAULT TABLESPACE settings so that the SYSTEM tablespace is
not used inappropriately.
2. Correct any users that already have SYSTEM as their DEFAULT TABLESPACE
SQL> exit
SQL> exit
Regression
To restore the environment back to its initial state, perform the following
1. Shutdown the database and listener.
2. Remove all database files, binaries, trace files and administration logs using
the deinstall tool - see Miscellaneous Section below.
File Listings
oracle .profile
#---------------------------------------------------------------------# Configure Terminal Settings.
#---------------------------------------------------------------------stty susp ^Z
stty quit ^C
stty erase ^H
export TERM=vt100-w
export ORACLE_TERM=vt100
#---------------------------------------------------------------------# Configure Shell Settings.
#---------------------------------------------------------------------set -o vi
export PATH=/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/ccs/bin:$PATH
export EDITOR=vi
export HOSTNAME=hostname`
export PS1=$LOGNAME@$HOSTNAME:$ORACLE_SID> '
export TMPDIR=/tmp
export TEMP=/tmp
umask 022
#---------------------------------------------------------------------# Configure Aliases.
#---------------------------------------------------------------------alias ll="ls -la"
alias bdf="df -k"
#---------------------------------------------------------------------# Configure Oracle Settings.
#---------------------------------------------------------------------export ORACLE_BASE=/u01/app/oracle
export SQLPATH=$ORACLE_BASE/scripts/sql
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORACLE_HOME_LISTNER=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
export ORATAB=/etc/oratab
oratab
SID:/u01/app/oracle/product/11.2.0/dbhome_1:Y
+ASM:/u01/app/oracle/product/11.2.0/grid:N
listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = <SID>)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = <SID>)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = <hostname>)(PORT = 1521))
)
ADR_BASE_LISTENER = /u01/app/oracle
###########################################
# ASM Instance Parameters
###########################################
instance_type = asm
asm_power_limit = 1
###########################################
# Security and Diagnostics
###########################################
remote_login_passwordfile = exclusive
diagnostic_dest = '/u01/app/oracle'
###########################################
# Disk Groups
###########################################
asm_diskstring = '/dev/oracleasm/disks/*'
asm_diskgroups = 'DATA','FRA'
initSID.ora
###########################################
# Cache and I/O
###########################################
db_block_size=8192
memory_target=1606418432
db_block_checking=MEDIUM
db_block_checksum='FULL'
###########################################
# Cursors and Library Cache
###########################################
open_cursors=500
###########################################
# Database Identification
###########################################
compatible='11.2.0.0.0'
db_name='SID'
###########################################
# Diagnostics and Statistics
###########################################
diagnostic_dest='/u01/app/oracle'
###########################################
# File Configuration
###########################################
control_files='+DATA/SID/control01.ctl','+DATA/SID/control02.ctl','+DATA/SID/control03.ctl
'
###########################################
# Processes
###########################################
processes=1000
###########################################
# System Managed Undo and Rollback Segments
###########################################
undo_tablespace='UNDO'
###########################################
# Security and Auditing
###########################################
audit_trail='db'
remote_login_passwordfile='EXCLUSIVE'
###########################################
# Enabling Archivelog mode
###########################################
log_archive_dest='+FRA/SID/arch/d1'
log_archive_format=arch_%t_%s_%r.log
###########################################
# Defer Segment Creation
###########################################
deferred_segment_creation=FALSE
createdb.sql
----------
Title : createdb.sql
Description : Build an empty database.
Usage/Notes : For use with 11g databases.
Required answers for SYS,
SYSTEM and SID.
tnsnames.ora
<SID> =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = tcp)(HOST = <hostname>)(PORT = 1521))
(CONNECT_DATA = (SID = <SID>))
)
File Systems
--- /u01 --- /app --- /oraInventory
|aaaaaaaaaaaaaa|
|aaaaaaaaaaaaaa--- /oracle --- /software
|aaaaaaaaaaaaaaaaaaaaaaa|
|aaaaaaaaaaaaaaaaaaaaaaa--- /dba --- /scripts
|aaaaaaaaaaaaaaaaaaaaaaa|
|aaaaaaaaaaaaaaaaaaaaaaa|aaaaaaa--- /sql
|aaaaaaaaaaaaaaaaaaaaaaa|
|aaaaaaaaaaaaaaaaaaaaaaa--- /diag
|aaaaaaaaaaaaaaaaaaaaaaa|
|aaaaaaaaaaaaaaaaaaaaaaa--- /product ---/11.2.0 ---/dbhome_1
|aaaaaaaaaaaaaaaaaaaaaaa|
|aaaaaaaaaaaaaaaaaaaaaaa--- /product ---/11.2.0 ---/grid
|aaaaaaaaaaaaaaaaaaaaaaa|
|aaaaaaaaaaaaaaaaaaaaaaa--- /admin --- /SID --- /adump
|aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--- /create
|aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--- /exp
|aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|aa (link to /u09)
|aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--- /parfile
|aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--- /pfile
|aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--- /scripts ---/base ---/rfc
|
|
|
--- /u09 --- /oradata --- /SID -------- /exp ------- /d1
Click Next
Click Next
NB It is assumed that external disk infrastricture will mirror the disks. If not,
review this option.
Tick the box next to the candidate disk(s) you wish to add to the disk group.
Click Next
Click Next
Click Next
Click Next
Click Finish
Click Yes
Click Close
Un-tick the I wish to receive security updates via My Oracle Support box.
o
Click Next.
Click Next.
Click Next.
Click Next.
Click Next.
Click Next.
Click Next
Click Finish
Ask Unix Administrator to run root.sh. - Note: There is a known issue with running
this script. See here.
Click OK.
Click Close.
Other References
Known Issues
ORA-7445 [kokscold()+849]
Description
This is due to unpublished Bug 9594372, documented in Note 1115493.1 and occurs
when running SQL_ANALYZE from a scheduled job. The SQL statement is likely to be similar
to the following.
/* SQL Analyze(397,1) */ MERGE INTO MGMT_ARU_PATCH_RECOMMENDATIONS p USING ..
Fix
Apply patch 9594372
Example Output
[root@myhost dbhome_1]# ./root.sh
Running Oracle 11g root.sh script
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1
Enter the full pathname of the local bin directory: [/usr/local/bin]: /usr/local/bin
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying dbhome to /usr/local/bin
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying coraenv to /usr/local/bin
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.
Miscellaneous
OS Packages for Oracle Enterprise Linux v5
The following OS packages at the following minimum version should be installed on Oracle
Enterprise Linux v5 before you start the Oracle software install.
Correct as of 01 September 2009
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3 (32 bit)
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-2.5-24 (32 bit)
glibc-common-2.5
glibc-devel-2.5
glibc-devel-2.5 (32 bit)
glibc-headers-2.5
ksh-20060214
libaio-0.3.106
libaio-0.3.106 (32 bit)
libaio-devel-0.3.106
libaio-devel-0.3.106 (32 bit)
libgcc-4.1.2
libgcc-4.1.2 (32 bit)
libstdc++-4.1.2
libstdc++-4.1.2 (32 bit)
libstdc++-devel 4.1.2
make-3.81
sysstat-7.0.2
unixODBC-2.2.11
unixODBC-2.2.11 (32 bit)
unixODBC-devel-2.2.11
unixODBC-devel-2.2.11 (32 bit)
diskgroup
diskgroup
diskgroup
diskgroup
diskgroup
diskgroup
diskgroup
diskgroup
diskgroup
alter
alter
alter
alter
alter
alter
alter
alter
alter
diskgroup
diskgroup
diskgroup
diskgroup
diskgroup
diskgroup
diskgroup
diskgroup
diskgroup
Step-by-Step
1. Run this tool from ORACLE_HOME first.
cd $ORACLE_HOME/deinstall
./deinstall
When prompted for the database name enter the *SID* you want to remove.
o
When asked Do you still want to modify the details of SID database(s)?
[n]: Answer N
o
The tool should now complete okay after performing several tasks.
See example output below.
NOTES
An error will occur if there are any missing deinstall files at which point the tool prompts
you to download the standalone version available in the deinstall directory on the
installation media
Example Output
The following output is example output for removing a standalone database and the related
binaries.
oracle@myhost.mydomain.com:> ./deinstall
Checking for required files and bootstrapping
Please wait
Location of logs /u01/app/oracle/oraInventory/logs/
############ ORACLE DEINSTALL & DECONFIG TOOL START ############
######################## CHECK OPERATION START
########################
Install check configuration START
Checking for existence of the Oracle home location /u01/app/oracle/SID/product/11.2.0
Oracle Home type selected for de-install is: SIDB
Oracle Base selected for de-install is: /u01/app/oracle
Checking for existence of central inventory location /u01/app/oracle/oraInventory
Install check configuration END
Network Configuration check config START
Network de-configuration trace file location:
/u01/app/oracle/oraInventory/logs/netdc_check627197374662265908.log
Network Configuration check config END
Database Check Configuration START
Database de-configuration trace file location:
/u01/app/oracle/oraInventory/logs/databasedc_check6468731932053553666.log
Use comma as separator when specifying list of values as input
Specify the list of database names that are configured in this Oracle home [SID]: SID
###### For Database 'SID' ######
Single Instance Database
The diagnostic destination location of the database:
/u01/app/oracle/SID/admin/SID/trace/diag/rdbms/SID
Storage type used by the Database: FS
Database file location:
/u03/oradata/SID/users/d1,/u03/oradata/SID/tools/d1,/u03/oradata/SID/indx/d1,/u03/ora
data/SID/system/d1,/u03/oradata/SID/sysaux/d1,/u04/oradata/SID/undo/d1
Flash recovery area location: /u10/oradata/SID/flash/d1/SID
database spfile location: /u01/app/oracle/SID/product/11.2.0/dbs/spfileSID.ora
The details of database(s) SID have been discovered automatically. Do you still want to
modify the details of SID database(s)? [n]:
Database Check Configuration END