Thursday, 14 March 2013

Restore the Windows 7 MBR

1. Boot your computer to the Windows 7 DVD (or to a "Repair CD"). At this screen choose to install now.






Repair and select "Command Prompt".




The command we will use, bootsect.exe, is in a folder (named boot) on the DVD.

Use your DVD drive letter and

To restore the "bootsector code":


TYPE: bootsect /nt60 SYS /mbr
and press Enter

Completed successfully,



More information : http://www.sevenforums.com/tutorials/20864-mbr-restore-windows-7-master-boot-record.html
 

Friday, 20 April 2012

sqlplus Error : Oracle 11g

Error : sqlplus: error while loading shared libraries: /opt/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1 

What could be the problem and how to resolve it. 

Reason : The SELinux is running in "Enforcing" mode on Linux Server. So the required permission should be assign for sqlplus.


Solution : Change SELinux from the default “Enforcing” mode to the “disabled” mode.

Wednesday, 1 February 2012

move tablespace datafile between filesystems

Move datafile to another filesystem on a separate mount point

Offline the tablespace
SQL>ALTER TABLESPACE DOMAIN OFFLINE;

Move datafile to new location
$mv /u01/domain01.dbf /opt/

Rename datafile
SQL>ALTER TABLESPACE DOMAIN RENAME DATAFILE '/u01/domain01.dbf' TO '/opt/domain01.dbf';

Online the tablespace again
SQL>ALTER TABLESPACE DOMAIN ONLINE;



For Temporary tablespace
SQL>ALTER DATABASE TEMPFILE '/u01/tempdom1.dbf' OFFLINE;

Drop the existing tablespace
SQL>DROP TABLESPACE TEMPDOMAIN INCLUDING CONTENTS;

Create new Temporary tablespace
SQL>CREATE TEMPORARY TABLESPACE TEMPDOMAIN
TEMPFILE '/opt/tempdom1.dbf' SIZE 200 M AUTOEXTEND ON EXTENT MANAGEMENT LOCAL;

Thursday, 5 January 2012

Restore Archivelogs to new location using RMAN

The solution is used to copy archivelogs from RMAN catalog.

Step 1: uncatalog the required archivelogs from RMAN prompt

RMAN>CHANGE ARCHIVELOG FROM LOGSEQ=60 UNTIL LOGSEQ=70 UNCATALOG;

Once the archivelogs have been successfully uncataloged, you are now able to successfully restore the archive logs to a new location.

RMAN>run{
set archivelog destination to '/tmp/arch';
restore archivelog from logseq=60 until logseq=70;
}

Cataloging archivelogs again by added them to the RMAN repository

RMAN>CATALOG ARCHIVELOG '/opt/log/1_60_archivelog.log';

Cataloging multiple copies in a directory

RMAN>CATALOG START WITH '/opt/log';

Thursday, 3 November 2011

Redo Log Recovery

Recover Redo01.dbf
============================
SQL>SHUTDOWN IMMEDIATE;

SQL>STARTUP MOUNT;

SQL>SELECT GROUP#, ARCHIVED,STATUS FROM V$LOG;
1 NO CURRENT
2 YES INACTIVE
3 YES INACTIVE

SQL>ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP 1;

DROP logfile Group
====================
SQL>ALTER DATABASE DROP LOGFILE GROUP 1;
(Remove redo01.log manualy)

Create Logfile Group
====================

SQL>ALTER DATABASE ADD LOGFILE GROUP 1 ('/opt/app/oracle/oradata/scdcc/redo01.log') size 50000K;

SQL>ALTER DATABASE OPEN;

Wednesday, 6 July 2011

Oracle Index

Oracle Index
An index is an optional structure associated with a table to have direct access to rows, which can be created to increase the performance of data retrieval. Index can be created on one or more columns of a table.

Indexes are automatically maintained and used by Oracle.


SQL>create index test on company (cname);

Index created.

SQL>drop index test;

Index dropped.

Altering Oracle Index
SQL>ALTER INDEX ix_emp_01 REBUILD ;

Synonym

A synonym is an alternative name for objects such as tables, views, sequences, stored procedures, and other database objects.

SQL>create public synonym suppliers for app.suppliers;

Now, users of other schemas can reference the table called suppliers without having to prefix the table name with the schema named app..

SQL>select * from suppliers;




Drop public synonym suppliers;

SQL>drop public synonym suppliers;
This drop statement would drop the synonym called suppliers that we defined earlier.



Create View

A view is a virtual table. Every view has a query attached to it. (The query is a SELECT statement that identifies the columns and rows of the table(s) the view uses.)

SQL> CREATE OR REPLACE VIEW myView (First_Name, Last_Name) AS
select First_Name,Last_Name
from Employee
where Salary > 2000;

View created.


SQL> drop view myView;

View dropped.

Monday, 20 June 2011

Official Certification Track

Preparation video

OCA 11g Preparation 4

Give name of manager and salary of employee SUNIL.

SQL>select emp_company.salary,manager.mname
from emp_company,manager
where emp_company.ename = 'SUNIL'
and emp_company.ename = manager.ename;

List the employee living in city 'BOMBAY' and those having company located in city 'DELHI'

SQL>select ename from emp_company
where ename In
(select ename from employee where city='BOMBAY') and
cname In (select cname from company where city ='DELHI');

How To Install LAMP on Ubuntu 12.04

L inux         A pache         M ySQL             P HP Step One—Install Apache open terminal and type in these commands: s udo apt-ge...