Install and configure SVN ( Subversion ) on Ubuntu Linux

Install Subversion

sudo apt-get install subversion 


Install apache module


sudo apt-get install  libapache2-svn



Create Repository
--------------------
Repository is a central place where the data is stored and maintained in  an organized way.

Command to create the repository.

            sudo svnadmin create /svn


Edit the configuration file for the subversion webdav.

            vi /etc/apache2/mods-enabled/dav_svn.conf 


               uncomment this element  : this is the end tag of location
               uncomment DAV svn


Location element in this file denotes the root directory where the subversion will be accessible from,
for example


http://YOUR-IP-ADDRESS/svn

               uncomment  SVNPath /svn
SVNPath should be set to the same place where you created your repository using svnadmin command

Basic Authentication.

Uncomment the following three lines to enable the basic authentication.AuthUserFile sets the password file

              AuthType Basic
              AuthName "Subversion Repository"
             AuthUserFile /etc/apache2/dav_svn.passwd

 Creating users for the repository:
Command to create user:
             sudo htpasswd -cm etc/apache2/dav_svn.passwd
             -c   --  Create user for the first time.
             -m  --  Create another user for same repository.
If  -c is given after having some users, all those users will be deleted . Use -m to create new user for same repository.

Restart apache2 server to see the web console  of svn

             sudo /etc/init.d/apache2 restart.





Troubleshooting network Bandwidth Usage - Mahesh Patil ( Hexagrid.com )

a) dstat  -f             <==== Showed me that there is more network traffic on  eth1  when compared to eth0 and that too.. it is outgoing traffic.




b) iftop -i eth1        <====  Confirms what dstat says and also mentions  which IP is pulling Data from some 'X' location


c) nethogs eth1     <==== Shows which process is the culprit.  apache2 is the process using up the bandwidth in sending job.


 Once it was established that it was Apache process.. I stopped and restarted it.  Looks like what ever process was downloading data  got canceled and the network usage has come down to normal.

Tested with  the above commands again after apache restart to confirm same.

vnstat  <== good command to tell the usage.


Script to recursively check a folder and delete files older



#!/bin/bash
Dir="/backup/backup/"
days="30"

find $Dir -type f -mtime +$days -exec rm {} \;




modify days value according to requirement. How old files you want to delete.

How to reduce size of tablespace

 If temp is the tablespace that need to be reduced
 
1. Create new temp1 tablespace
2. Make new temp1 tablespace as default
3. Drop the temp tablespace
4. create  temp tablespace
5. Make the temp tablepsace as default
6. Drop  temp1  tablespace..

Oracle architecture and its categories

Oracle architecture is described in three categories:

* User related process
* Instance(Logical memory structure) and
* Physical file structure

Instance + Database= Oracle server

User Process : Whenever a user wants to connect to the oracle server for extraction of the data or to insert any data using sql statement. The user process then initiates a connection and hence a session is established for the user in the instance. After establishing a session, each user then starts a server process which will actually allow the user to interact to the database and retrieve the data or insert it. To be precise, Server process communicates with the oracle instance on behalf of the user. An additional memory structure called PGA (Program Global Area) is also created during this process. It stores the user session variables and bind variables.

Oracle Instance: Oracle instance is made up of SGA (System Global Area) and Background process. SGA further divided into three main components.

* Shared Pool: Caches the recently used sql statements.
Database Buffer cache: Cashes the data that has been most recently used by the user.
Redo log buffer: Stores transaction information.

Oracle uses LRU (Least Recently Used) algorithm.

It will caches the most recently used sql statements in shared pool and data in buffer cache. If for example we as a user1 are entering a sql statement (select * from emp). This statement will be cached by the shared pool and the data which is extracted will be cached in Database buffer cache. Now if any other user wants the same data, obviously he is going to use the same sql statement, so the data will be presented to the user directly from the database buffer thus improving the performance.

SGA size can be allocated manually or automatically. This is determined by the settings in a configuration file called parameter initialization file.

find vmware vmx files and copy to specific directory



find /vmfs -name \*.vmx -exec cp {} backup/ \;

this command will find all the vmx files in /vmfs directory to /backup folder