Showing posts with label Linux/Unix. Show all posts
Showing posts with label Linux/Unix. Show all posts

Thursday, October 31, 2024

Check IPs routing

ggate:poctest_1:~/alex>netstat -rn

Kernel IP routing table

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.197.20.1     0.0.0.0         UG        0 0          0 bond0
10.190.36.0     0.0.0.0         255.255.255.0   U         0 0          0 bond2
10.190.208.0    0.0.0.0         255.255.252.0   U         0 0          0 bond1
10.197.20.0     0.0.0.0         255.255.252.0   U         0 0          0 bond0
169.254.0.0     0.0.0.0         255.255.224.0   U         0 0          0 bond2


 

How to SSH Without a Password with Putty

https://www.youtube.com/watch?v=4jakCV5JYx0 

Saturday, June 7, 2014

Friday, April 20, 2012

How to check sudo access given to oracle user?

sudo -l



$ sudo -l
Matching Defaults entries for oracle on this host:
    syslog_goodpri=alert, env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS
    LC_CTYPE LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS
    _XKB_CHARSET XAUTHORITY"


User oracle may run the following commands on this host:
    (root) NOPASSWD: /ora/fs0000/grid/oracle/product/11.2.0.1/bin/crsctl, (root) /ora/fs0000/grid/oracle/product/11.2.0.1/bin/srvctl, (root)
    /ora/fs0000/grid/oracle/product/11.2.0.1/bin/oifcfg, (root) /ora/fs0000/grid/oracle/product/11.2.0.1/bin/ocrconfig, (root)
    /ora/fs0000/grid/oracle/product/11.2.0.1/bin/srvconfig, (root) /ora/fs0000/grid/oracle/product/11.2.0.1/bin/lsnrctl, (root)
    /ora/fs0000/grid/oracle/product/11.2.0.1/OPatch/opatch, (root) /ora/fs0000/grid/oracle/product/11.2.0.1/crs/install/rootcrs.pl, (root)
    /ora/fs0000/grid/oracle/product/11.2.0.1/rdbms/install/rootadd_rdbms.sh, (root) /ora/fs0000/app/oracle/product/11.2.0.1/bin/srvctl, (root)
    /ora/fs0000/app/oracle/product/11.2.0.1/OPatch/opatch

Wednesday, April 11, 2012

The only way to get real size of swap on Solaris


swap -l - and convert blocks to bytes

you can use:

swap -l|grep -v swap|awk '{print "swap size is "$4*512/1024/1024/1024"GB"}'
please note that commands below can provide wrong data:

top
swap -s
df -h swap

Wednesday, April 20, 2011

Rename part of multiple files

 for old in *test*.sh
do
new=`echo $old | sed 's/test/dev/g'`
mv $old $new
done

Tuesday, February 1, 2011

DBA day-to-day tips

  • Don't use rm -rf *.* for any reason at anytime, do rm *.log or *.lis or *.trc: It is safer to back up a directory and use rmdir instead. It would be even better if you renamed the entire directory and left it in place renamed for a day or two.
  • Add a note hereAssuming that all of the datafiles in a certain directory only pertain to one database is a recipe for disaster, those files can be created anywhere on the filesystem as long as Oracle has write access
  • Modifying access for a production instance at the SQL*Plus level is unusual and generally not granted to programming staff unless there is a single point of accountability, such as a lead programmer.

Monday, January 24, 2011

Check number of CPUs on Solaris


sn778865:DUMMY:/home/oracle:>psrinfo -pv
The physical processor has 64 virtual processors (0-63)
  UltraSPARC-T2 (chipid 0, clock 1417 MHz)

Monday, October 25, 2010

How to define SSH public keys

BOTH NODES
$/home/oracle
mkdir .ssh
chmod 777 .ssh
ssh-keygen -t rsa
ssh-keygen -t dsa


NODE1 Only:
cd /home/oracle/.ssh
ssh rac1 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
ssh rac1 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys
ssh rac2 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
ssh rac2 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys
scp authorized_keys rac2:/home/oracle/.ssh
scp known_hosts rac2:/home/oracle/.ssh

Tuesday, August 31, 2010

Linux alternative to ‘truss’ command on Solaris

The topic may seem unclear to those unfamiliar with Linux operating system but no worries I can explain.  strace can help you troubleshoot any process on the system.  Generally, people look into tools such as strace because some process is acting funky and in order to understand better what it’s doing while it’s being funky is to watch it’s every move while it’s running.  strace is similar to truss on Solaris operating system and as you’ll see it’s a very handy tool for troubleshooting.

Thursday, December 24, 2009

How to change permissions of Unix directory using SQL*Plus


  1. Under /oracle/scripts/general directory create chmod_exp.sh script:

    #!/bin/csh
    chmod -fR 777 /gibuy/export
    exit;


    And give it execute privileges:

    oracle@ayevenunxdev1:/oracle/scripts/general>chmod +x chmod_exp.sh

    This script changes permissions to all the directories and files under/gibuy/export directory.

Cannot restore segment prot after reloc: Permission denied


When packaging an application on RHEL or CentOS, you may receive the following error:

"cannot restore segment prot after reloc: Permission denied"
 
This is likely due the the SE Linux setting being set to "enforcing".
 
To Temporarily disable enforcement on a running system
 
/usr/sbin/setenforce 0

To permanently disable enforcement during a system startup change "SELINUX=enforcing" to "SELINUX=disabled" in "/etc/selinux/config" and reboot.

By default, CentOS 5 has the SE Linux feature set to "enforcing".