Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
6Activity
0 of .
Results for:
No results containing your search query
P. 1
ORACLE DBA Interview Preparation & Guidence to Basic Concepts

ORACLE DBA Interview Preparation & Guidence to Basic Concepts

Ratings: (0)|Views: 965|Likes:
Published by Rajneesh
Notes on ORACLE DATABASE. Please share your view, if you download this document
Notes on ORACLE DATABASE. Please share your view, if you download this document

More info:

Categories:Types, Research
Published by: Rajneesh on Feb 24, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

08/14/2013

pdf

text

original

 
Create Database Manually
1]c:\>oradim –new –sid <sid name> -srvc <service_name>2]Create sub directory in oracle directoryd:\oracle9i\admin\sonu\archive and\udump,\bdump,\cdump,\pfile,\create3]create initsid.ora file in pfile directorydb_name=sonuinstance_name=sonucontrol_files (d:\oracle\oradata\sonu\control01.ctl,d:\oracle\oradata\sonu\control02.ctl)4]create database
Multiplexing Control FileUsing SPFILE
1]Alter system set control_files=’D:\oracle9i\oradata\sonu\control01.ctl’,’D:\oracle9i\oradata\sonu\control03.ctl’ scope=spfile;2]Shutdown Normal;3]Copy the file using os command4]startup
Using PFILE
1]Shutdown Normal2]copy the file using os command3]add new file with location and name in initsid.ora file.4]startup
Online Redo Logfile
ALTER SYSTEM CHECKPOINT;ALTER DATABASE ADD LOGFILE GROUP 3(‘D:\ORACLE91\ORADATA\log3a.rdo’,‘D:\ORACLE91\ORADATA\log3b.rdo’) SIZE 1M;ALTER DATABASE CLEAR LOGFILE ‘D:\ORACLE91\ORADATA\log3c.rdo’VIEW :-V$log ,V$logfile
Rename Online Redo Log Member.
1]First you have to Shutdown the Instance.Shutdown Immediate2]Copy Old Redolog file in New Location or New Name3]Start Database with MOUNT mode.Connect sys as sysdbaStartup Mount4] alter database rename file 'D:\ORACLE9I\ORADATA\SONU\OLD_NAME.LOG' to'D:\ORACLE9I\ORADATA\SONU\NEW_NAME.LOG';5] alter database open;
Re Size the Online Redo Log Group.
1] First you want to add new log Group in Database with size which you want.alter database add logfile group 3('D:\ORACLE9I\ORADATA\SONU\REDOa3.log') size 1m;2] Drop the old group (if it is current group)ALTER SYSTEM SWITCH LOGFILE;alter database drop logfile group 3;
Droping Log Group
1]ALTER DATABASE DROP LOGFILE GROUP 3;*ERROR at line 1:ORA-01623: log 3 is current log for thread 1 - cannot dropORA-00312: online log 3 thread 1: 'D:\ORACLE9I\ORADATA\SONU\REDO03.LOG'Adding Log Member in Group2]ALTER SYSTEM SWITCH LOGFILE;
 
3]ALTER DATABASE DROP LOGFILE GROUP 3;
Adding Redo Log Member in Group
alter database add logfile member 'D:\ORACLE9I\ORADATA\SONU\REDO01a.LOG' to group 1;alter database add logfile member 'D:\ORACLE9I\ORADATA\SONU\REDO02a.LOG' to group 2;
Dropping Log Member
1]alter database drop logfile member 'D:\ORACLE9I\ORADATA\SONU\REDO01a.LOG';ERROR at line 1:ORA-01609: log 2 is the current log for thread 1 - cannot drop membersORA-00312: online log 2 thread 1: 'D:\ORACLE9I\ORADATA\SONU\REDO02.LOG'ORA-00312: online log 2 thread 1: 'D:\ORACLE9I\ORADATA\SONU\REDO02A.LOG'if the status is CURRENT of the group which member you can not delete.if any way you want to delete2]ALTER SYSTEM SWITCH LOGFILE;3]alter database drop logfile member 'D:\ORACLE9I\ORADATA\SONU\REDO01a.LOG';
TablespacesLocally Managed
 
Dictionary Managed
1] Free Space manage within TablespaceFree Space Manage within data dictionary2] No redo generated when space is allocated/de allocatedRedo is generated3] No Coalescing requiredCoalescing required if the pctincrease nonZero 
Creating Tablespace
1]create tablespace test datafile'D:\ORACLE9I\ORADATA\SONU\TEST.DBF' SIZE 200MEXTENT MANAGEMENT LOCALUNIFORM SIZE 128K;2] create tablespace test1 datafile'D:\ORACLE9I\ORADATA\SONU\TEST1.DBF' SIZE 500MAUTOEXTEND ON NEXT 5M;3]create tablespace test2 datafile'D:\ORACLE9I\ORADATA\SONU\TEST2.DBF' SIZE 200MEXTENT MANAGEMENT LOCALSEGMENT SPACE MANAGEMENT AUTO;4] create tablespace test3 datafile'D:\ORACLE9I\ORADATA\SONU\TEST3.DBF' SIZE 200MEXTENT MANAGEMENT DICTIONARYDEFAULT STORAGE (initial 1M next 1M);
5]
create tablespace test4 datafile'D:\ORACLE9I\ORADATA\SONU\TEST2.DBF' SIZE 200MEXTENT MANAGEMENT LOCALAUTOALLOCATE;
Offline Tablespace
alter tablespace test offline;
Altering Tablespace1] Adding Datafile in Tablespace
alter tablespace test1 add datafile'D:\ORACLE9I\ORADATA\SONU\TEST_A.DBF' SIZE 200M;
2] Renaming DatafileYou must follow these steps when the file is Non-System File
1] Bring the tablespace offline.alter tablespace test offline normal;2] Use the operating system command to move or copy the file3] Execute the ALTER TABLESPACE RENAME DATAFILE commandalter tablespace test rename file'D:\oracle9i\oradata\sonu\test.dbf' to 'd:\oracle9i\oradata\sonu\test100.dbf';
 
4] Bring the tablespace online.alter tablespace test online;
3] Resize Datafile
alter database datafile 'd:\ora9i\oradata\test1\test.dbf' resize 50m;
Resize Tempfile
select TABLESPACE_NAME,sum(bytes)/1024/1024 MB from dba_data_files group byTABLESPACE_NAME
Creating and Managing IndexBtree
 
Bitmap
Suitable for high cardinality column Low cardinality column.Inefficient for queries using OR Operatorefficient for queries using OR OperatoUse for OLTPUse for data warehousing.
Creating Normal B-tree Index
Create Index hr.emp_last_name_idx on hr.emp(last_name) pctfree 30Storage(initial 200k next 200k pctincrease 0 maxextents 50) Tablespace indx;
Creating Bit Map Index
Create bitmap index ord_idx on order(order_id) pctfree 30Storage(initial 200k next 200k pctincrease 0 maxextents 50) Tablespace indx;
Changing Storage Parameter for Index
Alter Index ord_idx Storage(next 400k maxextents 100);
Allocating and Deallocating Index Space
Alter index ord_idx allocate extent (size 200k datafile ‘d:\disk6\index01.dbf’)Alter index ord_idx deallocate unused;
Rebuilding Index
1] Move an Index to different Tablespace.2] Improve the space Utilization by removing deleted entries.3] Change the reverse key index to Normal B-Tree Index vice versa.Alter Index ord_idx rebuild tablespace index01;Alter table ……Move Tablespace;
Online Rebuild of Indexes
1] Rebuilding indexes can be done with minimal table locking.Alter Index ord_idx rebuild Online;
Coalescing Index
Alter index ord_idx Coalesce;
Checking Index Validity/Analyze Index
Analyze Index ord_idx Validate Structure;--Populate the view Index_stats with the index information.
Dropping Index
Drop Index ord_idx;
Identify Unused Index
1]To start Monitoring index usageAlter index ord_idx Monitoring Usage;2]To Stop Monitoring index usageAlter index ord_idx Nomonitoring Usage;
Object Information View
DBA_INDEXES,DBA_IND_COLUMNS, DBA_IND_EXPRESSIONS,V$OBJECT_USAGE,INDEX_STATE
Tablespace Backup
1]select file_name,tablespace_name from dba_data_file;2]alter tablespace test begin backup;3]go to command prompt4]if the multiple database is there then SET ORACLE_SID=SONU

Activity (6)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
kmufasa liked this
trskaran liked this
prams9 liked this
Nizam Shaik liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->