Showing posts with label Oracle Linux 6. Show all posts
Showing posts with label Oracle Linux 6. Show all posts

Monday, February 12, 2018

Virtual Box Usefull Commands


You just need to install the kernel devel as the same version of your kernel OS.
 
# yum install kernel-uek-devel-'uname -r' kernel-headers 

Then run your command 
 
./VBoxLinuxAdditions.run

Reboot.
 
 
If you get the /media/sf_sharedFolder/: Permission denied 
 
Then add yourself to the vbox group  
 
# sudo adduser oracle vboxsf
 
# sudo usermod -aG vboxsf oracle 

Tuesday, July 26, 2016

Linux IAAS, Usefull commands

One you have attached a volume here you have usefull commands:

Disk information:

lsblk
blkid

Mount: sudo mount /dev/xvdc /mnt/opc_data

Format : sudo mkfs -t ext3 /dev/xvdc

Install if needed:
sudo yum install e4fsprogs

Create folder if needed:
sudo mkdir /mnt/opc_data

mount as default:
vi /etc/fstab

add following line:
/dev/xvdc               /mnt/opc_data        ext3    defaults        0 0

Change user and group one command:
sudo chown opc:opc opc_data/

Check if process is on startup:
chkconfig --list | grep vncserver
"vncserver       0:off   1:off   2:on    3:on    4:on    5:on    6:off"

install vncserver if not installed:
yum install tigervnc-server

Put vncserver on startup:
sudo chkconfig vncserver on

Configure vncserver once installed (modify according your settings)
cat  /etc/sysconfig/vncservers

VNCSERVERS="2:opc 3:oracle"
VNCSERVERARGS[2]="-geometry 1280x1024 -nolisten tcp -localhost"
VNCSERVERARGS[3]="-geometry 1280x1024"

Restart Service

sudo service vncserver start
sudo service vncserver stop


sudo service vncserver status

Use vncpasswd to change password users
vncpasswd opc

If you don't have xterm install it
sudo yum install xterm

Enable X11Forwarding
sudo vi /etc/ssh/sshd_config

Restart sshd
sudo /etc/init.d/sshd restart

With operative systems with no graphic interface, but you want enable vncserver:

gconftool-2 -s -t bool /apps/gnome-screensaver/lock_enabled false
vncserver :3 -depth 16 -alwaysshared -geometry 1200x1024 -s off

sudo yum install xorg-x11-twm
sudo yum install xterm
sudo yum install xsetroot
sudo yum install xorg-x11-apps

Add LC_ALL=en_US; export LC_ALL=en_US in .bashrc or in .bash_profile 

sudo yum install liberation-sans-fonts

same procedure as vncserver

search text in files recursively in a folders and subfolders:
grep -rl 'windows' ./ | xargs sed -i 's/windows/linux/g'

grep -rnw . -e 172.28.88.111 --exclude-dir={*.out,*.log}
grep -rnw . -e 172.28.88.111 --exclude={*.out*,*.log*}

using escape character: 
grep -rl '/opt/oracle/obiee/user_projects' ./ | xargs sed -i 's/\/opt\/oracle\/obiee\/user_projects/\/opt\/oracle\/admin\/user_projects/g'

Create aliases .bash_aliases file, Example:
alias startobi='sh $ORACLE_BI_HOME/bitools/bin/start.sh'
alias stopobi='sh $ORACLE_BI_HOME/bitools/bin/stop.sh'

Disable firewall
systemctl disable firewalld.

Friday, July 24, 2015

Change Dynamic Ip to Static Ip Oracle Linux Server



Change the network file, and set the gateway


[oracle@alexdb ~]$ cat  /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=alexdb.oracle.com
GATEWAY=192.168.x.x

Change your interface:
/etc/sysconfig/network-scripts/ifcfg-eth0

Check the values in red

DEVICE=eth0
NM_CONTROLLED=yes
HWADDR=00:21:F6:3F:3A:69
TYPE=Ethernet
UUID=ea5fd29b-4752-4ef7-890f-9611c18eb4c6
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
ONBOOT=yes
PEERROUTES=yes
IPADDR=192.168.128.63
GATEWAY=192.168.128.1
NETMASK=255.255.255.0
BOOTPROTO=static
USERCTL=no


Change the hosts file /etc/hosts


issue the following command:
service network restart

Your mac address must match HWADDR=00:21:F6:3F:3A:69 to your interface address

ifup eth0 if your interface is not available. 

Cheers!


Tuesday, June 30, 2015

Installing DB 11g on Virtual Box part 2

9.-  Add the following groups

sudo groupadd -g 501 oinstall
sudo groupadd -g 502 dba
sudo groupadd -g 503 oper
sudo groupadd -g 504 asmadmin
sudo groupadd -g 506 asmdba
sudo groupadd -g 505 asmoper

10.- If you don't have the user created yet:

sudo useradd -u 502 -g oinstall -G dba,asmdba,oper oracle

if the user already exists:

sudo usermod -g oinstall -G dba,asmdba,oper oracle

if you want to change the user password:

passwd oracle

11.- For the 11GR2 version add the following line to this file "/etc/security/limits.d/90-nproc.conf"
# Change this
*          soft    nproc    1024

#to this:
* - nproc 16384


12.- Add the following property to the file "/etc/selinux/config"
SELINUX=permissive

13.- Restart OS.

14.- Disable firewall

15.- Create directories
sudo mkdir -p /u01/app/oracle/product/11gr2/db_1

16.- Change Group
sudo chown -R oracle:oinstall /u01

17.- If your installation is remote, set the display for launching windows
xhost +alexdb.oracle.com

alexdb.oracle.com being added to access control list

18.- Add the following lines to your db owner user

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

ORACLE_HOSTNAME=yourhost; export ORACLE_HOSTNAME
ORACLE_UNQNAME=yoursid; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11gr2/db_1; export ORACLE_HOME
ORACLE_SID=yoursid; 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

19.- Run the installer
./runInstaller

If you have missing libraries, install them with yum

Example:

sudo yum install compat-libstdc++-33
yum install libaio.i686 libaio-devel.i686 compat-libstdc++-33.i686 libstdc++.i686
yum install libaio libaio-devel compat-libstdc++-33 libstdc++
yum install unixODBC
yum install unixODBC-devel
yum install elfutils-libelf-devel
yum install pdksh

Finish your installation, executing the following sentences:

sh /u01/app/oraInventory/orainstRoot.sh
sh /u01/app/oracle/product/11gr2/db_1/root.sh 

if you want your db starting every time your machine restart, add this line to /etc/oratab

your_sid:/u01/app/oracle/product/11gr2/db_1:y

Enterprise Manager Database Control URL - (yoursid) :
https://localhost:1158/em

Thursday, June 18, 2015

Installing DB 11g on Virtual Box

1.- Add oracle to sudoers.

2.- Add hostname to hosts file

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

3.- Add or amend the following lines in the "/etc/sysctl.conf" file, use an editor or vi command.

fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586

4.- Let's check the file 
ls -la /etc/sysctl.conf


5.- Save the file.

6.- Recompile kernel parameters

/sbin/sysctl -p

7.- Add the following lines to the "/etc/security/limits.conf" file.

oracle              soft    nproc   16384
oracle              hard    nproc   16384
oracle              soft    nofile  4096
oracle              hard    nofile  65536
oracle              soft    stack   10240

8.- Check if the following libraries are present

rpm -Uvh binutils-2*x86_64*
rpm -Uvh glibc-2*x86_64* nss-softokn-freebl-3*x86_64*
rpm -Uvh glibc-2*i686* nss-softokn-freebl-3*i686*
rpm -Uvh compat-libstdc++-33*x86_64*
rpm -Uvh glibc-common-2*x86_64*
rpm -Uvh glibc-devel-2*x86_64*
rpm -Uvh glibc-devel-2*i686*
rpm -Uvh glibc-headers-2*x86_64*
rpm -Uvh elfutils-libelf-0*x86_64*
rpm -Uvh elfutils-libelf-devel-0*x86_64*
rpm -Uvh gcc-4*x86_64*
rpm -Uvh gcc-c++-4*x86_64*
rpm -Uvh ksh-*x86_64*
rpm -Uvh libaio-0*x86_64*
rpm -Uvh libaio-devel-0*x86_64*
rpm -Uvh libaio-0*i686*
rpm -Uvh libaio-devel-0*i686*
rpm -Uvh libgcc-4*x86_64*
rpm -Uvh libgcc-4*i686*
rpm -Uvh libstdc++-4*x86_64*
rpm -Uvh libstdc++-4*i686*
rpm -Uvh libstdc++-devel-4*x86_64*
rpm -Uvh make-3.81*x86_64*
rpm -Uvh numactl-devel-2*x86_64*
rpm -Uvh sysstat-9*x86_64*
rpm -Uvh compat-libstdc++-33*i686*
rpm -Uvh compat-libcap*


In the next post i'm going to finish the main configuration.