ssh -X This email address is being protected from spambots. You need JavaScript enabled to view it..77.X
date
date +%D -s '2016-04-29 18:40:00'
hwclock --localtime --systohc
Autostart Oracle script
Check if Grid environment exist on server. If yes skip this step
cd
ls
env |grep SID
env |grep HOME
ps -ef | grep [s]mon
Set databases autostart
cat /etc/oratab
sed -i.gres "s/:N/:Y/g" /etc/oratab
cat /etc/oratab
Solaris: /var/opt/oracle/oratab
Change path to the bin directory and username. IMPORTANT: without "/" symbol at the end
ls /u01/app/oracle/product/11.2.0/db_1/bin
cat /etc/rc.d/init.d/startupOracleDatabase11R2
Show startupOracleDatabase11R2
Show startupOracleDatabase12R1
scp -r /work/scr_sh/startupOracleDatabase11R2 This email address is being protected from spambots. You need JavaScript enabled to view it..X:/etc/rc.d/init.d/startupOracleDatabase11R2
vi /etc/rc.d/init.d/startupOracleDatabase11R2
oracle
ora11
chmod +x /etc/rc.d/init.d/startupOracleDatabase11R2
chkconfig --add startupOracleDatabase11R2
chkconfig --level 345 startupOracleDatabase11R2 on
chkconfig --list |grep startupOracleDatabase11R2
vi /u01/oracle/database/11.2/bin/dbstart
or
vi /u01/app/oracle/product/11.2.0/db_1/bin/dbstart
Find
/*) $SQLDBA <<EOF
Add this rows after "Startup"
##################################
alter pluggable database all open;
##################################
IP tables
vi /etc/rc.d/init.d/network
Add this before the last row:
######################## Open Ports ########################
iptables -I INPUT 1 -p TCP --destination-port 1521 -j ACCEPT
iptables -I INPUT 1 -p TCP --destination-port 1158 -j ACCEPT
# OEM Cloud Agent, also range could be 1830-1849
iptables -I INPUT 1 -p TCP --destination-port 3938 -j ACCEPT
# Zabbix Agent
iptables -I INPUT 1 -p TCP --destination-port 10050 -j ACCEPT
# FTP, uncomment if you need
# iptables -I INPUT 1 -p TCP --destination-port 21 -j ACCEPT
############################################################
Change OS Startup timeout
sed -i.bkp -e "s/timeout=5/timeout=2/g" /boot/grub/grub.conf
cat /boot/grub/grub.conf | grep timeout
or
sed -i.bkp -e "s/timeout=5/timeout=2/g" /boot/grub2/grub.cfg
cat /boot/grub2/grub.cfg | grep timeout
Packets
cat /etc/yum.conf |grep proxy=
vi /etc/yum.conf
proxy=http://192.168.33.22:3128
yum update -y
yum install open-vm-tools.x86_64
yum install --nogpgcheck -y \
sos \
mc \
nano \
vim \
emacs \
wget \
xinetd \
screen \
ntp \
unzip
yum install --nogpgcheck -y \
readline-devel.x86_64
Download on you PC "rewrap" from this link http://utopia.knoware.nl/~hlub/uck/rlwrap/
Transfer from your MAC to the server
scp -r /work/install/linux/rlwrap-0.42.tar.gz This email address is being protected from spambots. You need JavaScript enabled to view it..X:/opt
cd /opt
tar zxvf rlwrap-0.42.tar.gz
cd rlwrap-0.42
yum install readline-devel - for linux 5
./configure
make
make check
make install
Root environment
vi /root/.bash_profile
alias pss='ps -ef | grep [s]mon'
alias psp='ps -ef | grep [p]mon'
# A red prompt for root (copy from /etc/skel/, if not already):
PS1='\[\e[1;31m\][\u@\h \W]\$\[\e[0m\] '
source /root/.bash_profile
Oracle environment
su - oracle
vi .bash_profile
alias s='rlwrap sqlplus "/as sysdba"'
alias sqlplus='rlwrap sqlplus'
alias r='rlwrap rman target /'
alias rman='rlwrap rman'
# alias sa='rlwrap sqlplus "/as sysasm"'
alias pss='ps -ef | grep [s]mon'
alias psp='ps -ef | grep [p]mon'
alias i1='tail -1000f /u01/app/oracle/diag/rdbms/dbname/DBNAME/trace/alert_DBNAME.log'
alias l1='tail -100f /u01/app/oracle/diag/tnslsnr/hostname/listener/trace/listener.log'
#alias a1='tail -100f /u01/oracle/database/11.2/diag/asm/+asm/+ASM/trace/alert_+ASM.log'
# A green prompt for regular users:
PS1='\[\e[1;32m\][\u@\h \W]\$\[\e[0m\] '
source ~/.bash_profile