Sunday, September 23, 2007

Batch File Scripts..

Batch file 1

cmd >
C: > edit test.bat ("Creating Batch file named test")

test.bat file contains

sqlplus hr/hr@ROCK @D:\ctas.sql

and ctas.sql contains

create table batch_test as select * from employees;
exit;

============================================================

Batch file 2

Now, I will create a batch file for hot backup, that will copy all the tablespaces & archived redo log files, daily. That will be running automatically (at specified time, interval of days), and copy the all the tablespaces including SYSTEM, archived redo log files, REDOLOGS, and control files.

cmd>
c:> edit hot.bat

sqlplus system/manager@rock @d:\hot.sql

This batch file is calling hot.sql and hot.sql contains following commands.

host MD d:\hot\"%DATE:/=_%"
host MD d:\hot\"%DATE:/=_%"\ARCHIVELOGS
alter tablespace SYSTEM begin backup;
host copy D:\oracle\oradata\rock\SYSTEM01.DBF d:\hot\"%DATE:/=_%";
alter tablespace SYSTEM end backup;
exit;

The above (hot.sql) sript, create a new folder named Sun 09_23_2007 (current date) in directory d:\hot\ and ARCHIVELOGS folder within that created folder, Then, backup begins and copies the SYSTEM01.dbf file and pastes in Sun 09_23_2007; when all files for specified tablespace are copied it places the tablspace in default mode. (end backup).

You can check the 09_23_2007 folder whether files are copied or not, and issue the following command to check

SELECT * from v$backup;
check the status column If its status is NOT ACTIVE that means file is not in backup mode.
SQL> select * from V$backup;
FILE# STATUS CHANGE# TIME
---------------------------- ---------- ----------------
1 NOT ACTIVE 787967 24-SEP-07

If you issue the alter tablespace system command the status of file will be changed.

SQL> alter tablespace system begin backup;
Tablespace altered.

SQL> select * from V$backup;
FILE# STATUS CHANGE# TIME
------- ---------------- ---------- ---------
1 ACTIVE 788012 24-SEP-07

You can checkup the status column of v$backup, to verify whether script ran successfuly, and all the tablspace are in default(End Backup/No Backuo mode).

Note: This hot.sql script contains only one system tablespace, i will test for all tablespace Archived redo log files, REDOLOGS, and Control Files, some time later.

Saturday, September 22, 2007

Enabling Archive Log

Enabling ARCHIVELOG Mode

Lets start by checking the current archive mode.

SQL> SELECT LOG_MODE FROM SYS.V$DATABASE;
LOG_MODE
------------
NOARCHIVELOG

I'll add the following lines to the end of pfile:

log_archive_start=true
log_archive_dest_1="location=f:/mandatory"
log_archive_format=arch_%s.arc
log_archive_max_processes=2

Now we can startup the database in mount mode and put it in archivelog mode.

SQL> startup mount
ORACLE instance started.
Total System Global Area 184549376 bytes
Fixed Size 1300928 bytes
Variable Size 157820480 bytes
Database Buffers 25165824 bytes
Redo Buffers 262144 bytes
Database mounted.

SQL> alter database archivelog;
Database altered.

SQL> alter database open;
Database altered.

There are several system views that can provide us with information reguarding archives, such as:


V$DATABASE Identifies whether the database is in ARCHIVELOG or NOARCHIVELOG mode and whether MANUAL (archiving mode) has been specified.

V$ARCHIVED_LOG Displays historical archived log information from the control file. If you use a recovery catalog, the RC_ARCHIVED_LOG view contains similar information.

V$ARCHIVE_DEST Describes the current instance, all archive destinations, and the current value, mode, and status of these destinations.

V$ARCHIVE_PROCESSES Displays information about the state of the various archive processes for an instance.

V$BACKUP_REDOLOG Contains information about any backups of archived logs. If you use a recovery catalog, the RC_BACKUP_REDOLOG contains similar information.

V$LOG Displays all redo log groups for the database and indicates which need to be archived.

V$LOG_HISTORY Contains log history information such as which logs have been archived and the SCN range for each archived log. Using these tables we can verify that we are infact in ARCHIVELOG mode:


SQL> select log_mode from v$database;
LOG_MODE------------ARCHIVELOG


SQL> select DEST_NAME,STATUS,DESTINATION from V$ARCHIVE_DEST;

Learn more about managing archive redo logs in the Oracle Database Administrator's Guide:


http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10739/archredo.htm

==================================================================

Disabling Archive Log Mode

SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination f:/
Oldest online log sequence 26
Next log sequence to archive 28
Current log sequence 28

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

CHange the Values at init file, You can disable automatic archiving of filled redo log files by setting the LOG_ARCHIVE_START initialization parameter to FALSE or add # in the begining of parameters that are related to archive mode. check the following example:

#log_archive_start=true
#log_archive_dest_1="location=f:/ mandatory"
#log_archive_format=arch_%s.arc
#log_archive_max_processes=2

Then startup database in nomount mode, and disable archivelog mode.

SQL> startup mount
ORACLE instance started.

Total System Global Area 118255568 bytes
Fixed Size 282576 bytes
ariable Size 83886080 bytes
Database Buffers 33554432 bytes
Redo Buffers 532480 bytes
Database mounted.

SQL> alter database noarchivelog;

Database altered.

SQL> alter database open
2 /
Database altered.

SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination D:\oracle\ora90\RDBMS
Oldest online log sequence 26
Current log sequence 28

Friday, September 21, 2007

Wednesday, September 19, 2007

Oracle10g Grid

Oracle Grid Computing

For years, when you needed more computing capacity, you bought more expensive computers. Now, with the Oracle Grid, add capacity on demand with one inexpensive PC server at a time for superior scalability and fast ROI. And if one department needs more capacity, use Oracle software to borrow it from another while the grid just keeps running. The Oracle Grid. Runs faster. Costs less. And never breaks.
Get the Most out of Your Oracle GridMaximize your cost savings and ease-of-management with these steps: standardize, consolidate, and automate.

Oracle Grid Products
For 40 years the mainframe has been the leader in computer performance and reliability. But now there's the Oracle Grid. A group of low-cost servers connected by Oracle software.
The Oracle Grid runs applications faster than the fastest mainframe. And if a server fails, the mainframe stops while the Oracle Grid just keeps running.
GRID TECHNOLOGY — KEY PRODUCTS
Oracle DatabaseOracle Database 10g and Real Application Clusters coordinate the use of large numbers of servers and storage acting as one self-managing Grid for the highest quality of service on low-cost, modular hardware.
Oracle Fusion MiddlewareOracle Fusion Middleware gives your enterprise the ability to streamline and optimize business and IT operations, increase the accuracy and timeliness of business decisions, and secure information and drive compliance.
Oracle Enterprise ManagerOracle Enterprise Manager with Oracle Grid Control provides a single, integrated interface for administering and monitoring applications and systems in an Oracle Grid.
Reduce Cost and Increase Efficiency with Grid Computing (2 min.)Watch analysts and customers discuss how Oracle Grid Computing automates processes, provides large-scale manageability, and reduces IT costs.


Oracle Grid Computing: Standardize
Every business today has a mix of server and storage technologies. By standardizing these technologies, you can significantly lower costs and in the process form the basis of a grid computing infrastructure. Here are some of the grid computing technologies that will drive down the cost of your infrastructure:
Low-cost, high volume Intel or AMD processors provide the benefits of proprietary processors at a fraction of the cost
Blade server technology reduces the cost of hardware and increases the density of servers
Network storage technologies such as Network Attached Storage (NAS) and Storage Area Networks (SANs) further reduce disk storage costs
Gigabit Ethernet and Fibre Channel drives down the cost of connecting clusters of servers
Linux provides a cost-effective and enterprise-ready operating system
Once you've standardized on low-cost servers and storage, consolidate your databases, application servers and storage, and automate day-to-day management tasks.

Oracle Grid Computing: Consolidate
Another step toward grid computing is to consolidate your infrastructure using clusters of servers. Oracle 10g is the only infrastructure that has full grid server cluster capabilities for all applications–transaction processing (OLTP), decision support (DSS), and enterprise content management. With Oracle Application Server clusters and with the Oracle Real Application Clusters option for the Oracle Database you can increase reliability and reduce management costs by as much as 20%. And only Oracle can run your existing applications in a grid computing environment with no rewrite required.
When evaluating infrastructure consolidation, also think about standardizing on low-cost servers and storage, and automating day-to-day management tasks.
Oracle Grid Computing: Automate
Automate your grid so you can manage it effectively as it grows. Because enterprise grids can have hundreds, potentially thousands of servers, a grid is simply too large to be managed manually server-by-server. Oracle Enterprise Manager 10g has automated the day-to-day maintenance required for an enterprise grid, and provides a centralized management console called Oracle Grid Control.
Software installation, patching, upgrading, workload balancing, security, and much more are all handled centrally from Oracle Grid Control. This means the entire infrastructure can be managed as one large computing system. One or a few administrators can maintain even the largest grid data center.
To simplify automating day-to-day management tasks in your data center, consider standardizing on low-cost servers and storage, and consolidating your databases, application servers and storage.

BENEFITS
· Flexibility to meet changing business needs
· High quality of service at low cost
· Faster computing for better information
· Investment protection and rapid ROI
· A shared computing environment
Oracle Grid Computing customers are achieving an average of 150 percent return on investment (ROI) over five years, according to an independent study from Mainstay Partners. The study included Chicago Stock Exchange, Dell, Electronic Arts, Ohio Savings Bank, University of Oslo, and Vanderbilt University.
===================
It [Oracle Grid computing technology] represents a significant rethinking of the traditional role of software infrastructure in areas such as system performance, clustering and storage. The software is the first infrastructure designed for Grid computing”
Grid computing is the on-demand sharing of computing resources with in a tightly-coupled network

=================
Summary:

Grid computing is a new IT architecture that produces more resilient and lower cost enterprise information systems. With grid computing, groups of independent, modular hardware and software components can be connected and rejoined on demand to meet the changing needs of businesses.

My Birth Place


Radhan Station..

I m born and raised in Radhan Station. Radhan is small city (village), that is located in Dadu District, and it's around 27 kilometers away from Moen-Jo-Daro, Sindh, Pakistan.