Sunday, December 11, 2011

Oracle Database 11g Express Edition for Windows Download

Free to develop, deploy, and distribute

Oracle Database 11g Express Edition (Oracle Database XE) is an entry-level, small-footprint database based on the Oracle Database 11g Release 2 code base.  It's free to develop, deploy, and distribute; fast to download; and simple to administer. 
Oracle Database XE is a great starter database for:

  • Developers working on PHP, Java, .NET, XML, and Open Source applications
  • DBAs who need a free, starter database for training and deployment
  • Independent Software Vendors (ISVs) and hardware vendors who want a starter database to distribute free of charge
  • Educational institutions and students who need a free database for their curriculum.

    Download Link for Oracle 11g Express Edition for Windows


    Download Link for Oracle 11g Express Edition for Linux

     

Friday, December 9, 2011

MyOra - Free SQL Tool for Oracle


MyOra is a free SQL Tool for Oracle database Developers, DBAs and Companies. This tool is simple, fast and easy to use, requires no installation, no Oracle client and  no internet connection. Download MyOra to run SQL queries and Monitor database performance in Real Time.

Please download the below link

Date wise cumulative count in Mysql


Date wise cumulative count

Dear all,
I can take date wise count using group by in mysql.But i want date wise cumulative count in mysql.How?

For example, 

date count 
10-11-2011 200 
11-11-2011 500 
12-11-2011 700 

This is day wise count. 

But i want day wise cumulative count. 

date count 
10-11-2011 200 
11-11-2011 700 
12-11-2011 1400 

like this.


Answer

You can do that with a self-join, but only works with a single value per day:

CREATE TABLE t1 (DateField TIMESTAMP, CountValue INT);
INSERT INTO t1 VALUE ("2011-11-10",200),("2011-11-11",500),("2011-11-12",700);

SELECT t1a.DateField, SUM(t1b.CountValue) FROM t1 t1a, t1 t1b WHERE t1a.DateField>=t1b.DateField GROUP BY t1a.DateField;

datefield sum(t1b.countvalue)
2011-11-10 200
2011-11-11 700
2011-11-12 1400

If you have more than one value per date, you can probably make it work with a derived table.

Get tablename and schema names in PostGresql



select distinct schemaname from pg_tables where schemaname not in
('information_schema', 'pg_catalog');

select  schemaname,tablename from pg_tables

select tablename from pg_tables where schemaname='name_of_schema';

select * from pg_tables

postgres Backup and restore commands



postgres restore

C:/Program Files/PostgreSQL/8.4/bin\pg_restore.exe --host localhost --port 5432 --username postgres --dbname kanyakumari --verbose "D:\MySQL_From_SivaGanesh_HDD1\kanyakumari.backup"

Backup
C:/Program Files/PostgreSQL/8.4/bin\pg_dump.exe --host localhost --port 5432 --username postgres --format custom --verbose --file "D:\MySQL_From_SivaGanesh_HDD1\kanyakumari.backup_dist03.backup" --schema dist03 kanyakumari

Backup
C:/Program Files/PostgreSQL/8.4/bin\pg_dump.exe --host localhost --port 5432 --username postgres --format custom --blobs --verbose --file "D:\MySQL_From_SivaGanesh_HDD1\kanyakumari.backup_dist03.backup" kanyakumari

Thursday, December 8, 2011

What is Database Maintenance?


                Database maintenance is an activity which is designed to keep a database running smoothly. A number of different systems can be used to build and maintain databases, with one popular example being MYSQL. Maintenance of databases is generally performed by people who are comfortable and familiar with the database system and the specifics of the particular database, although some maintenance tasks can be performed by people who do not have experience.
One important aspect of database maintenance is simply backing up the database so that if anything happens, there will be another copy available. Some databasing systems actually do this automatically, sending a backup to another location every day, every week, or within any other set period of time. However, backups are not quite enough.
                  Database maintenance includes checking for signs of corruption in the database, looking for problem areas, rebuilding indexes, removing duplicate records, and checking for any abnormalities in the database which might signal a problem. The goal is to keep the database operating smoothly for users, so that ideally they never need to think about maintenance issues. A database which is not maintained can become sluggish, and people may start to experience problems when trying to access records.
                 Many servers have extensive databases which are used to serve up content to users on an internal network or on the Internet. An important part of server maintenance is database maintenance to confirm that these databases are working properly. This also includes checks for security flaws and other issues which could threaten the integrity of the database, ranging from viruses to records which are entered improperly.

Thursday, December 1, 2011

DIFFERENCE BETWEEN INNODB AND MyISAM


InnoDB is a high-reliability and high-performance storage engine for MySQL. Starting with MySQL 5.5, it is the default MySQL storage
engine. Key advantages of InnoDB include:
• Its design follows the ACID model, with transactions featuring commit, rollback, and crash-recovery capabilities to protect user
data.
• Row-level locking and Oracle-style consistent reads increase multi-user concurrency and performance.
• InnoDB tables arrange your data on disk to optimize common queries based on primary keys. Each InnoDB table has a primary
key index called the clustered index that organizes the data to minimize I/O for primary key lookups.
• To maintain data integrity, InnoDB also supports FOREIGN KEY referential-integrity constraints.
• You can freely mix InnoDB tables with tables from other MySQL storage engines, even within the same statement. For example,
you can use a join operation to combine data from InnoDB and MEMORY tables in a single query.


MyISAM: The MySQL storage engine that is used the most in Web, data warehousing, and other application environments. MyISAM
is supported in all MySQL configurations, and is the default storage engine prior to MySQL 5.5.5.


Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate
the file type. An .frm file stores the table format. The data file has an .MYD (MYData) extension. The index file has an .MYI
(MYIndex) extension.