Saturday, February 22, 2014

How to gather the Oracle database information ?

The main components of the database are
1. spfile
2. controlfile,
3. datafile
4. redo log file.
5. Archive log file.

You can gather the information by following steps.

1. login in to the system using oracle.
2. connect to database using sys user

conn /as  sysdba



command description 
sql> show paramter spfile; 1. Location and name of the current spfile.
sql> select name from v$controlfile; 1. Location and name of the controlfile
sql> select name from v$datafile; 1. Location and name of the datafile
sql> select member  from v$logfile; 1. Location and name of the redo log file;
sql> select username from dba_users ordre by username; list of users in the database 
sql> select name from v$database; name of the database
sql> select name from v$tablespace order by name; name of the tablespace in the database

Wednesday, February 19, 2014

Common command for DBA

  1. Yum configuration.
  2. Installing the rpm packages for oracle.
  3. Creating the shared hard disk.
  4. fdisk command.
  5. oracleasm 

Common Database Operation


  1. Multiplexing the OCR
  2. Multiplexing the Voting disk
  3. Multiplexing the Controlfile
  4. Multiplexing the online redo logfile.
  5. Multiplexing Archive log file

RMAN DATABASE BACKUP

RMAN DATABASE BACKUP 

Connect to the local target database.
rman target / nocatalog

Restoring spfile and controlfile;
strartup force nomount;
restore spfile from file 'file_name';
resotore controlfile from 'file_name';

Reports of database backup.
report schema;
list backup of database;
list backup of archivelog all;

Taking the Database Backup.
backup database;
backup tablespace users;
backup datafile 1;

Restore the Database:
resotre database;
restore tablespace users;
restore datafile 1;

Recovering the database;
recover database;
recover database until time 'dd-mm-yyy  hh24:mm:ss';
recover database until scn 'scn';




Oracle Database Startup and Shutdown

Starting the oracle database;

startup nomount;
startup mount;
startup;

startup nomunt;
alter database mount;
alter database open;


Shutdown the databsae:
shutdown normal;
shutdown imediate;
shutdwon transactional;
shutdown abort;

Converting the oracle database from Noarchive log mode to Archive log mode

Converting the oracle database from Noarchive log mode to Archive log mode:

1. Check weather the database is in archive log mode or not.
archive log list

2. Shutdown the database.
shutdown immediate;

3. Start the database in mount mode.
startup mount;

4. Convert the database to archive log mode.
alter database archivelog;

5. Open the database.
alter database open ;

6. Check wheather the database is in archive log mode or not.
archive log mode;

Note: After the database is in archive log mode you must take the full database backup.