by http://webgeektutorials.blogspot.com

Friday, March 25, 2011

RHEL6 - New Features

Red Hat is pleased to announce the availability of Red Hat Enterprise Linux 6 Beta, the next generation of the Red Hat Enterprise Linux platform. Red Hat Enterprise Linux 6 blurs the lines between virtual, physical, and cloud computing to address shifts taking place in the modern IT environment. Featuring updated core technology, from the kernel to the application infrastructure to the development toolchain, Red Hat Enterprise Linux 6 is designed to meet the needs of the coming generations of hardware and software technologies.

Less than five months after releasing Red Hat Enterprise Linux (RHEL) 6.0, Linux distributor Red Hat has now announced the beta phase of the first RHEL6 update. As usual in this phase of the RHEL version families' seven to ten-year life cycle, minor release 6.1 offers not only bug fixes and minor improvements, but also various new functions and hardware drivers.
Red Hat Enterprise 6 Feature Function and Benefit summary

The Red Hat Enterprise Linux 6 platform has a larger feature set compared to prior releases as is evident by the greater number of packages compared to Red Hat Enterprise Linux 5. The following are some of the many improvements and new features that are included in the Red Hat Enterprise Linux 6 Beta:

Updated kernel and core technology stack: a completely updated core which includes a newer kernel and associated user-space management tools. Also updated are core applications like httpd, Samba and NFS.

Auditing in Oracle 10g Release 2

SERVER SETUP
Auditing is a default feature of the Oracle server. The initialization parameters that influence its behaviour can be displayed using the SHOW PARAMETER SQL*Plus command.
SQL> SHOW PARAMETER AUDIT

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest                      string      C:\ORACLE\PRODUCT\10.2.0\ADMIN
                                                 \DB10G\ADUMP
audit_sys_operations                 boolean     FALSE
audit_trail                          string      NONE
SQL>
Auditing is disabled by default, but can enabled by setting the AUDIT_TRAIL static parameter, which has the following allowed values.
AUDIT_TRAIL = { none | os | db | db,extended | xml | xml,extended }
The following list provides a description of each setting:
none or false - Auditing is disabled.
db or true - Auditing is enabled, with all audit records stored in the database audit trial (SYS.AUD$).
db,extended - As db, but the SQL_BIND and SQL_TEXT columns are also populated.
xml- Auditing is enabled, with all audit records stored as XML format OS files.
xml,extended - As xml, but the SQL_BIND and SQL_TEXT columns are also populated.
os- Auditing is enabled, with all audit records directed to the operating system's audit trail.
Note. In Oracle 10g Release 1, db_extended was used in place of db,extended. The XML options are new to Oracle 10g Release 2.

Wednesday, March 16, 2011

Ruby : Google map, markers and bounds

You can use a function to load Google map with Marker and bounds, function is as below.

function initialize(lat, lon, div_id) {
var myLatlng = new google.maps.LatLng(lat, lon);
var myOptions = {
zoom: 8,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var bounds = new google.maps.LatLngBounds ();
var map = new google.maps.Map(document.getElementById(div_id), myOptions);
var trucklatlng = new google.maps.LatLng(lat,lon);
var marker = new google.maps.Marker({
position: trucklatlng,
map: map,
title:"Assist"
});

Sunday, March 13, 2011

Create abstract background

A quick and simple way of making a background and then how it can be customised. Thanks to Gavin Hoey for this great share.


Create a Colorful Aurura Effect

This tutorial on creating a streaky colored Aurura effect with a wispy smokey effect smudged on top as well. Learn about the techniques used to create those glowing vibrant color effects that you see so often in web design these days! Thank you tutvid for you contribution..

Photoshop : Professional Black & White

A very quick tutorial how to make your color photo to professional black & white photos, thanks to video maker, just in 60 second so don't expect more, you can do more at your end to enhance it. :)


Photoshop : Digital weight loss

Photoshop CS5 tutorial explainig how to virtually make someone fit using the liquify filter. This is very quick tutorial, Thanks a  ton to uploader.



Adding color to makeup

Photoshop CS5 that enables photographers to open and manipulate images in non-destructive and now even more efficient ways. This covers the benefits of the raw processing, which makes it possible to more precisely control an image's appearance—exposure, shadow and highlight detail, color balance, sharpness, and more—including new workflow procedures and technical concepts and issues. Learn the entire Camera Raw workflow, from opening and resizing, toning and cropping, to sharpening and saving.




Thanks to Camera Raw 6 who provided this easy tutorials.

Digital makeup in photoshop

This demonstrates the digital  makeup using  blending  options and various tools, you will be learning how to add make up, digitally. Tutorial is quite  handy and informative.

Saturday, March 12, 2011

Oracle hot backup


When datafiles are put into hot backup mode, Oracle is still writing to them; this makes your average system administrator raise an eyebrow. Oracle slightly changes the way it performs updates to datafiles by copying whole datafile blocks, rather than just what has changed, into the online redo logs. Hot backups, by their very nature, take a corrupt copy of the datafiles. But relax, it’s OK. Since the instance is in ARCHIVELOG mode, all changes to the datafiles are available upon restore to correct any discrepancies created as the archiving process passes over any given datafile. This is why Oracle records redo information in whole blocks during hot backup: to help  recover any inconsistent blocks in the datafiles upon restore. 
User managed backup means you take backup without any oracle feature. Suppose if you take backup by Operating system then it is called user managed backup. And the term hot backup means taking your backup whenever your database is at open state.

To take full database backup follow the following steps.

1)Before proceed remember you can take online/hot backup whenever your database is in Archivelog mode. If your database run on noarchivelog mode then you must take consistent backup that is after cleanly shutdown. In order to determine the archival mode, issue the query..

SQL> SELECT LOG_MODE FROM V$DATABASE;
LOG_MODE
------------
ARCHIVELOG

Tuesday, March 8, 2011

Multiple Database Connection in Ruby on Rails

Ruby on Rails sets up the connection depending on your application’s database.yml file. In database.yml file you set up configration environmentwise.

As I active record allow to access single database but you want to access more than one databases than it required to have multiple connection at a time. Now you think that how this possible. So Rails provides gem to implement you need. Follow the below steps:

1. Install gem
sudo gem install magic_multi_connections

2. After installing gem there is one patch required in connected.rb(/usr/lib/ruby/gems/1.8/gems/magic_multi_connections-1.2.1/lib/magic_multi_connections/connected.rb)
replace

raise NameError.new ( "uninitialized constant # (const_id)") unless
target_class

with

Shell script: Automatic backup of mySql database

This script will create a backup file including the current date so you can have multiple copies of the backups of the same database under one directory.
Create a file called mysqlbkup.sh

# vi /root/mysqlback.sh
and paste the following code in the file as it is.

##############THE SCRIPT##############
#!/bin/bash
# Specify the temporary backup directory
BKUPDIR="/tmp"
# Database Name
dbname="dbname_here"
# store the current date

Some handy mySql command

To login (from unix shell) use -h only if needed.
# [mysql dir]/bin/mysql -h hostname -u root -p
Create a database on the sql server.
mysql> create database [databasename];
List all databases on the sql server.
mysql> show databases;
Switch to a database.
mysql> use [db name];
To see all the tables in the db.
mysql> show tables;
To see database’s field formats.
mysql> describe [table name];
To delete a db.
mysql> drop database [database name];
To delete a table.
mysql> drop table [table name];
Show all data in a table.
mysql> SELECT * FROM [table name];
Returns the columns and column information pertaining to the designated table.
mysql> show columns from [table name];

Optimize a database in Mysql

In case you remove a lot of data from the tables OR change the database structure, a de-fragmentation/optimizing of the database is necessary to avoid performance loss, especially while running queries. The above changes results in a performance loss, so make sure you run the “optimizer” on the database.
SSH to your server and execute:  
mysqlcheck -o  (where, -o stands for optimize)
You should look to defragment the tables regularly when using VARCHAR fields since these coloumns get fragmented too often.

OR you can follow below steps:
1.Go to phpMyAdmin and select your database.
2.click check all to select all tables of the database
3.In the drop down menu, click optimize tables .

Done

RMAN : CONTROLFILE AUTO BACKUP

Recovery Manager (RMAN) is the Oracle-preferred method and a command-line  utility for efficiently backing up and recovering an Oracle database. RMAN is designed to work intimately with the server, providing block-level corruption detection during backup and restore. RMAN optimizes performance and space consumption during backup with file multiplexing and backup-set compression, and integrates with Oracle Secure Backup and third-party media-management products for tape backup.
RMAN takes care of all underlying database procedures before and after backup or restore, removing dependency on OS and SQL*Plus scripts. It provides a common interface for backup tasks across different host operating-systems, and offers features not available through user-managed methods, such as parallelization of backup/recovery data streams, backup-files retention policy, and detailed history of all backups.

RMAN> show all;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default

Saturday, March 5, 2011

How to Flashback in oracle 10g

Oracle9i introduced the DBMS_FLASHBACK package to allow queries to reference older versions of the database. Oracle 10g has taken this technology a step further making it simpler to use and much more flexible.

Note: Internally Oracle uses SCNs to track changes so any flashback operation that uses a timestamp must be translated into the nearest SCN which can result in a 3 second error.
  • Flashback Query 
  • Flashback Version Query 
  • Flashback Transaction Query 
  • Flashback Table 
  • Flashback Drop (Recycle Bin) 
  • Flashback Database 
  • Flashback Query Functions
Flashback Query
Flashback Query allows the contents of a table to be queried with reference to a specific point in time, using the AS OF clause. Essentially it is the same as the DBMS_FLASHBACK functionality or Oracle9i, but in a more convenient form. For example:

CREATE TABLE flashback_query_test (
id NUMBER(10)
);

Friday, March 4, 2011

Oracle 10g Automated SGA Tuning

PURPOSE
This outlines Automatic Shared Memory Management feature introduced in Oracle Database 10g.
SCOPE & APPLICATION
These include:
Overview
  • Benefits of Automatic Shared Memory Management 
  • Configuring Automatic Shared Memory Management 
  • Behavior of Auto-Tuned SGA Parameters 
  • Behavior of Manual SGA Parameters 
  • Resizing SGA_TARGET 
  • Disable Automatic Shared Memory Tuning 
  • Manually Resizing Auto-Tuned Parameters 
  • SGA Background Process
  • Automatic Shared Memory Principles

Quick intro : SQL commands and syntax for DBA

ALTER DATABASE
ALTER DATABASE database_name;

ALTER DATABASE command changes the size or settings of a database. Its syntax varies widely among different database systems.

ALTER USER
ALTER USER user

ALTER USER statement changes a user's system settings such as password.

BEGIN TRANSACTION
1> BEGIN TRANSACTION transaction_name
2> transaction type
3> if exists
4> begin

BEGIN TRANSACTION statement signifies the beginning of a user transaction. A transaction ends when it is either committed (see COMMIT TRANSACTION) or canceled (see ROLLBACK TRANSACTION). A transaction is a logical unit of work.
CLOSE CURSOR
close cursor_name

CLOSE cursor_name statement closes the cursor and clears it of data. To completely remove the cursor, use the DEALLOCATE CURSOR statement.

COMMIT TRANSACTION
SQL> COMMIT;

COMMIT TRANSACTION statement saves all work begun since the beginning of the transaction (since the BEGIN TRANSACTION statement was executed).

What is Oracle architecture quick intro


Oracle Architecture
The Oracle Relational Database Management System, or RDBMS, is designed to allow simultaneous access to large amounts of stored information. The RDBMS consists of the database (the information) and the instance (the embodiment of the system). The database contains the physical files that reside on the system and the logical pieces such as the database schema. These database files take various forms, as described in the following section. The instance is the method used to access the data and consists of processes and system memory.
NOTE: Object extensions have been added to the RDBMS with Oracle8. The object extension to tables is covered in detail on Day 12, "Working with Tables, Views, and Synonyms." Oracle refers to Oracle8 as an O-RDBMS (Object-Relational Database Management System). In this book, I refer to Oracle as an RDBMS for clarity.
The Database
The Oracle database has a logical layer and a physical layer. The physical layer consists of the files that reside on the disk; the components of the logical layer map the data to these physical components.
The Physical Layer
The physical layer of the database consists of three types of files:
One or more datafiles--Datafiles store the information contained in the database. You can have as few as one datafile or as many as hundreds of datafiles. The information for a single table can span many datafiles or many tables can share a set of datafiles. Spreading tablespaces over many datafiles can have a significant positive effect on performance. The number of datafiles that can be configured is limited by the Oracle parameter MAXDATAFILES.