Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
Oracle 2

Oracle 2

Ratings: (0)|Views: 154 |Likes:
Published by Sachin

More info:

Published by: Sachin on Apr 24, 2009
Copyright:Attribution Non-commercial


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





 Give the two types of tables involved in producing a star schema and the type ofdata they hold. Answer :
 Fact tables and dimension tables. A fact table contains measurements whiledimension tables will contain data that will help describe the fact tables.
How does one change the default Oracle passwords? Answer :
 Passwords for SYS/CHANGE_ON_INSTALL, SYSTEM/MANAGER, and SAPR3/SAP should bechanged forsecurityreasons.The easiest way to change them is using the R3INST program. The only negativeconsequence when SYSTEM’s password is changed is that sapdba will request apassword to perform most actions.You can use command ’sapdba -sapr3 ‘ to change the SAPR3 user password. Thisalso updates the SAPUSER table entry. There is also a ommandsapdba -alter_user /to change other Oracle user passwords.
Is it better to put code in triggers or procedures? What is the difference? Answer :
 In earlier releases of Oracle it was better to put as much code as possible inprocedures rather than triggers. At that stage procedures executed faster thantriggers as triggers had to be re-compiled every time before executed (unlesscached). In more recent releases both triggers and procedures are compiled whencreated (stored p-code) and one can add as much code as one likes in eitherprocedures or triggers.
 What is a mutating and constraining table? Answer :
 “Mutating” means “changing”. A mutating table is a table that is currently beingmodified by an update, delete, or insert statement. When a trigger tries toreference a table that is in state of flux (being changed), it is considered“mutating” and raises an error since Oracle should not return data that has notyet reached its final state.Another way this error can occur is if the trigger has statements to change theprimary, foreign or unique key columns of the table off which it fires. If youmust have triggers on tables that have referential constraints, the workaroundis to enforce the referential integrity through triggers as well.There are several restrictions in Oracle regarding triggers:1. A row-level trigger cannot query or modify a mutating table. (Of course, NEWand OLD still can be accessed by the trigger).2. A statement-level trigger cannot query or modify a mutating table if thetrigger is fired as the result of a CASCADE delete.
 What are the difference between DDL, DML and DCL commands? Answer :
 DDL (Data Definition Language) statements are used to define the databasestructure or schema. Some examples:
1. CREATE - to create objects in thedatabase 2. ALTER - alters the structure of the database3. DROP - delete objects from the database4. TRUNCATE - remove all records from a table, including all spaces allocatedfor the records are removed5. COMMENT - add comments to the data dictionary6. RENAME - rename an objectDML (Data Manipulation Language) statements are used for managing data withinschema objects. Some examples:1. SELECT - retrieve data from the a database2. INSERT - insert data into a table3. UPDATE - updates existing data within a table4. DELETE - deletes all records from a table, the space for the records remain5. MERGE - UPSERT operation (insert or update)6. CALL - call a PL/SQL or Java subprogram7. EXPLAIN PLAN - explain access path to data8. LOCK TABLE - control concurrencyDCL is Data Control Language statements. Some examples:1. GRANT - gives user’s access privileges to database2. REVOKE - withdraw access privileges given with the GRANT commandTransaction ControlManages the changes made by DML statements. These commands allow statements tobe grouped together into logical transactions.1. COMMIT - save work done2. SAVEPOINT - identify a point in a transaction to which you can later rollback3. ROLLBACK -restore databaseto original since the last COMMIT4. SET TRANSACTION - Change transaction options like isolation level and whatrollback segment to use
 What’s the command to change the SQL prompt name? Answer :
 SQL> set sqlprompt “database-1 > ”database-1 >database-1 >
 What’s the command to see the current user name? Answer :
 Sql> show user;
Explain the difference between $ORACLE_HOME and $ORACLE_BASE. Answer :
 ORACLE_BASE is the root directory for oracle. ORACLE_HOME located beneathORACLE_BASE is where the oracle products reside.
Explain an ORA-01555. Answer :
 You get this error when you get a snapshot too old within rollback. It canusually be solved by increasing the undo retention or increasing the size of
rollbacks. You should also look at the logic involved in the application gettingthe error message.
How would you go about increasing the buffer cache hit ratio? Answer :
 Use the buffer cache advisory over a given workload and then query thev$db_cache_advice table. If a change was necessary then I would use the altersystem set db_cache_size command.
How would you go about generating an EXPLAIN plan? Answer :
 Create a plan table with utlxplan.sql. Use the explain plan set statement_id =‘tst1
into plan_table for a SQL statement. Look at the explain plan withutlxplp.sql or utlxpls.sql
 What column differentiates the V$ views to the GV$ views and how? Answer :
 The INST_ID column which indicates the instance in a RAC environment theinformation came from.
Give the stages of instance startup to a usable state where normal users mayaccess it Answer :
 STARTUPNOMOUNT - Instance startup. STARTUP MOUNT - The database is mounted.STARTUP OPEN - The database is opened
Explain the difference between ARCHIVELOG mode and NOARCHIVELOG mode and the benefits and disadvantages to each. Answer :
 ARCHIVELOG mode is a mode that you can put thedatabasein for creating a backupof all transactions that have occurred in the database so that you can recoverto any point in time. NOARCHIVELOG mode is basically the absence of ARCHIVELOGmode and has the disadvantage of not being able to recover to any point in time.NOARCHIVELOG mode does have the advantage of not having to write transactions toan archive log and thus increases the performance of the database slightly.
 A table is classified as a parent table and you want to drop and re-create it.How would you do this without affecting the children tables? Answer :
 Disable the foreign key constraint to the parent, drop the table, re-create thetable, enable the foreign key constraint.
Explain the difference between a data block, an extent and a segment. Answer :
 A data block is the smallest unit of logical storage for adatabase object. Asobjects grow they take chunks of additional storage that are composed ofcontiguous data blocks. These groupings of contiguous data blocks are calledextents. All the extents that an object takes when grouped together areconsidered the segment of the database object.
Explain the difference between a hot backup and a cold backup and the benefitsassociated with each. Answer :
 A hot backup is basically taking a backup of thedatabasewhile it is still upand running and it must be in archive log mode. A cold backup is taking a backupof the database while it is shut down and does not require being in archive logmode. The benefit of taking a hot backup is that the database is still available

You're Reading a Free Preview

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