Oraset 12c

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 7

============================================= Required Packages

=======================================

Here are the steps for preconfiguring a system for Oracle Database installation
using oracle-validated:

As an authorized user (for example, root), retrieve the file that configures
repository locations:

# cd /etc/yum.repos.d
# wget http://public-yum.oracle.com/public-yum-ol6.repo

Next, install the oracle-validated RPM using the yum install command.

The output in Listing 2 shows how the installation checks dependencies and then
downloads and installs the required packages.

# yum install oracle-rdbms-server-11gR2-preinstall

===================================================================================
===

/etc/init.d/NetworkManager stop
chkconfig NetworkManager off

/etc/init.d/NetworkManager start
chkconfig NetworkManager on

service iptables stop


chkconfig iptables off

====================================== Required Steps before installation


=================================

Hosts File

The "/etc/hosts" file must contain a fully qualified name for the server.

<IP-address> <fully-qualified-machine-name> <machine-name>

For example.

127.0.0.1 localhost.localdomain localhost


192.168.2.181 ol5-11gr2.localdomain ol5-11gr2

====================================

Amend the "/etc/security/limits.d/90-nproc.conf" file as described below. See MOS


Note [ID 1487773.1]

# Change this
* soft nproc 1024
# To this
* - nproc 16384

=====================================================

Add the following lines to the "/etc/pam.d/login" file, if it does not already
exist.

session required pam_limits.so

======================================================

============================
Create the new groups and users.

groupadd -g 501 oinstall


groupadd -g 502 dba
groupadd -g 503 osoper
groupadd -g 504 asmadmin
groupadd -g 506 asmdba
groupadd -g 505 asmoper

usermod -g oinstall -G dba,osoper,asmadmin oracle


#useradd -g oinstall -G dba,oper,asmadmin oracle
passwd oracle
id oracle

======================================

Set secure Linux to permissive by editing the "/etc/selinux/config" file, making


sure the SELINUX flag is set as follows.

SELINUX=permissive

Alternatively, this alteration can be done using the GUI tool (Applications >
System Settings > Security Level).
Click on the SELinux tab and disable the feature. If SELinux is disabled after
installation,
the server will need a reboot for the change to take effect.

=====================================

confirm everything

cat /etc/hosts
cat /etc/sysctl.conf
cat /etc/security/limits.conf
cat /etc/pam.d/login
cat /etc/security/limits.d/90-nproc.conf
cat /etc/selinux/config

=========================================

Create the directories in which the Oracle software will be installed.

mkdir -p /d01/app/oracle/product/12.1.0.2
chown -R oracle:oinstall /d01
chmod -R 775 /d01

=============================================================

Login as root and issue the following command.


xhost +<machine-name>
xhost +test3.htw.com

Login as the oracle user and add the following lines at the end of the
".bash_profile" file, remembering to adjust them for your specific installation.

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=ol5-112.localdomain; export ORACLE_HOSTNAME


ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
ORACLE_BASE=/d01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=DB11G; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH


CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

Installation

Log into the oracle user. If you are using X emulation then set the DISPLAY
environmental variable.

DISPLAY=<machine-name>:0.0; export DISPLAY

export JAVA_HOME=/usr/java/jdk1.8.0_05/bin/java
export PATH=$PATH:/usr/java/jdk1.8.0_05/bin

********* LOGOUT and then log in back as user ORACLE

Start the Oracle Universal Installer (OUI) by issuing the following command in the
database directory.
./runInstaller

Post Installation

Edit the "/etc/oratab" file setting the restart flag for each instance to 'Y'.

DB11G:/u01/app/oracle/product/11.2.0/db_1:Y

delete .bash_profile info

===================================================================================
=====================

put this in bashrc

PATH=/home/oracle/script/shell:/home/oracle/script:$PATH; export PATH


alias lssid='find /home/oracle/env -type f -name "*.env" ! -name "*.nb.env" -print'

create a file in /home/oracle


vi .vimrc
set number
syntax off

alias rlsqlplus='rlwrap sqlplus'


alias rlrman='rlwrap rman'
alias asmcmd='rlwrap asmcmd'
alias dgmgrl='rlwrap dgmgrl'

For a dummy database, just place an entry in /etc/oratab and then create a .env
file from it.

++++++++++++ Create a env file for the database. This file calls oraenv and sets
the environment.

[oracle@HVQSQOP01:pltor1 : HVQSQOP01 ]$cat /home/oracle/env/hvqsqop0.env

#!/usr/bin/ksh
################################################################
# Environment-File <db_name>.env
# usage:
# . <db_name>.env [<ORACLE_SID>}
# <ORACLE_SID> only required for an idle instance on a Linux-RAC
#################################################################
DB_NAME=hvqsqop0; export DB_NAME
#--simplification: RAC only on Linux
ORAENV_ASK=NO; export ORAENV_ASK
TERM=xterm; export TERM
for pth in /usr/local/bin /home/oracle/script
do
if [ `echo ${PATH} | grep ${pth} | wc -l` -eq 0 ]
then
PATH=${PATH}:${pth}; export PATH
fi
done
#---
if [ "`uname -a | cut -d' ' -f1`" = "Linux" ]
then
#-- instance (ORACLE_SID) running on this node ?
if [ `ps -ef | grep -i "ora_pmon_$DB_NAME" | grep -v grep | wc -l` -gt 0 ]
then
ORACLE_SID=`ps -ef | grep -i "ora_pmon_$DB_NAME" | grep -v grep | sed '2,$d' |
awk '{print $NF}' | cut -d"_" -f3- `
export ORACLE_SID
. oraenv
else
echo "Instance for database $DB_NAME not running on this host (`hostname`)"
#-- instance (ORACLE_SID) ASM running on this node ?
if [ `ps -ef | grep -i "asm_pmon_$DB_NAME" | grep -v grep | wc -l` -gt 0 ]
then
ORACLE_SID=`ps -ef | grep -i "asm_pmon_$DB_NAME" | grep -v grep | sed '2,$d' |
awk '{print $NF}' | cut -d"_" -f3- `
export ORACLE_SID
. oraenv
else
echo "Instance for database $DB_NAME not running on this host (`hostname`)"
if [ $# -eq 1 ] # may be an idle instance, check optional parameter for
ORACLE_SID
then
ORACLE_SID=$1
export ORACLE_SID
echo "ORACLE_SID=${ORACLE_SID} given by optional call-parameter"
. oraenv
else
echo "Please go to one of this node(s) ..."
GH=`cat /etc/oratab | grep ^+ASM | awk -F':' '{print $2}'`
${GH}/bin/srvctl status database -d $DB_NAME
echo "... or call script <db_name>.env with parameter <ORACLE_SID>"
export ORACLE_SID=NotSet
fi
fi
fi
else # No RAC
ORACLE_SID=`echo ${DB_NAME} | tr '[:lower:]' '[:upper:]'` ; export ORACLE_SID
. oraenv
fi
echo "Setting Environment for instance ${ORACLE_SID}"
# ORACLE_HOME will be set via oratab!
LD_LIBRARY_PATH=/usr/openv/netbackup/bin:/usr/X11R6/lib:${ORACLE_HOME}/lib:/usr/
lib:${ORACLE_HOME}/ctx/lib:/usr/ucblib; export LD_LIBRARY_PATH
OB=$ORACLE_BASE ; export OB
TNS_ADMIN=$ORACLE_HOME/network/admin ; export TNS_ADMIN
#NLS_LANG=american_america.WE8ISO8859P15 ; export NLS_LANG
OH=$ORACLE_HOME ; export OH
SQLPATH=/home/oracle/script:$ORACLE_HOME/rdbms/admin ; export
SQLPATH
ADR_HOME=$OB/diag/rdbms/${DB_NAME}/${ORACLE_SID} ; export ADR_HOME
AH=${ADR_HOME} ; export AH
export PS1=\h:\u@[$ORACLE_SID]: ${PWD}>
export PATH=$PATH:$ORACLE_HOME/OPatch
echo "Oracle Home $ORACLE_HOME "
echo "Oracle Base $ORACLE_BASE"
echo "Oracle Network files $TNS_ADMIN"
echo "Oracle ADR $ADR_HOME"
#aliases
alias home='cd $ORACLE_HOME'
alias tns='cd $ORACLE_HOME/network/admin'
alias al='cd $AH'
#list only directories
alias lsd="ls -l | grep '^d'"
# show top cpu consuming processes
alias topc="ps -e -o pcpu,pid,user,tty,args | sort -n -k 1 -r | head"
# show top memory consuming processes
alias topm="ps -e -o pmem,pid,user,tty,args | sort -n -k 1 -r | head"
# find largest files below this point
alias flf="find . -ls | sort -nrk7 | head -10"
# find largest directories consuming space below this point
alias fld="du . -h --max-depth=1 | sort -n -r"
#find all files greater than this size
alias fls='find . -size +90M'
#list files according to sizes
alias lfs='ls -alSh'
alias pl='sqlplus / as sysdba'
export LD_BIND_NOW=1
# Database name Alias
alias $DB_NAME=". /home/oracle/env/$DB_NAME.env"

====================================Creating a Password
File=============================

$ cd $ORACLE_HOME/dbs
orapwd file=orapw<ORACLE_SID> password=<sys password>

set the initialization parameter REMOTE_LOGIN_PASSWORDFILE


to EXCLUSIVE

SQL> grant sysdba to heera;


Grant succeeded.

You can query the V$PWFILE_USERS


=========================================== JAVA_HOME
=========================================

for swing bench. install jdk and then set the following paths

export JAVA_HOME=/usr/java/jdk1.8.0_05
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib

You might also like