Questions About Chapter 2 in Oracle DB 10g: SQL Fundamentals II

Hello,
first of all i'm glad to be a member of your forum. I have joined a beginner Oracle Course: Intro to SQL. I'm facing some problems understanding some concepts in Chapter 2 of Oracle Database 10g: SQL Fundamentals II text book. I got about 15 questions. However, i will only ask two questions at first. Since i'm a newbie, please answer it in a simplistic form. Excuse me if you see grammatical mistakes.
Dropping a column can take a while if the column has a large number of values. In this case it may be better to set it to be unused and drop it when the number of users on the system are fewer to avoid extended locks.
Questions:
"when the number of users on the system are fewer to avoid extended locks."
1. Can you explain this to me please?! fewer than before? fewer than? What if users kept increasing during the years! then this "fewer" may not happen until the company collapse!
2. Why do we need to use unused columns? When should we use unused columns?

Great! .... I got more questions, i just do not want to open a new same thread. Thus, i will just post the questions in here and i hope i will get help from experts...Please bare with me guys...The questions are numbered, unnumbered parts are information that helps you understand my question.
Note: just answer what you are willing to, one question or whatever you want. I'm not expecting to get all the answers from one member :)
Thanks for understanding
Page 2-7:
Certain columns can never be dropped such as columns that form part of the partitioning
key for a partitioned table or columns that form part of the primary key of an index- organized table.
Questions:
"columns that form part of the partitioning key for a partitioned table"
*1. Do they mean one table can be split into two different storage? What is the thing that*
link these both tables to make Oracle Server realize these two tables are actually one  table? Is is tablespace_name?
"columns that form part of the primary key of an index-organized table."
*2. Can you clarify the above sentence please*
*3. If i have set of columns that has large amount of data, i rather set them unused then*
drop them because the response time is going to be faster! I do not get it, can you
explain please? What i know is drop drops the column and release the disk space whilst
unused column make the columns useless and does not release disk space yet until we drop them, so
drop column does it in one step unlike taking the unused column process. In brief, i would like to know
why dropping unused columns that has large set of data is faster then dropping the column
directly...
Page 2-12
4. ALTER TABLE emp2 ADD CONSTRAINT emp_dt_fk
FOREIGN KEY (Department_id)
REFERENCES departments ON DELETE CASCADE);
The above query is written in text book. I think it should be written as
ALTER TABLE emp2 ADD CONSTRAINT emp_dt_fk
FOREIGN KEY (Department_id)
REFERENCES departments(dept_id) ON DELETE CASCADE;
Am i correct?
*5. Can you tell me what deferring constraints is in one sentence please? Why do we need it? When do we need it in real-life?*
*7. You can defer checking constraints for validity until the end of the transaction. A*
constraint is deferred if the system checks that it is satisfied only on commit. If a
deferred constraint is violated, then commit causes the transaction to roll back.
I do not understand the above paragraph, please explain. What i know is "end of
transaction" ends with ; or commit
Page 2-18
create table test1 (
pk NUMBER PRIMARY KEY,
fk NUMBER,
col1 NUMBER,
col2 NUMBER,
CONSTRAINT fk_constraint FOREIGN KEY (fk) REFERENCES test1,
CONSTRAINT ck1 CHECK (pk > 0 and col1 > 0),
CONSTRAINT ck2 CHECK (col2 > 0) );
-- "CONSTRAINT fk_constraint FOREIGN KEY (fk) REFERENCES test1"
*8. This is wrong isn't it? It references to test1 but no column specified.*
An error is returned for the following statements:
ALTER TABLE test1 DROP (pk); -- pk is a parent key.
*9. We can not drop it because we did not mention ON DELETE CASCADE. Am i right?*
ALTER TABLE test1 DROP (col1) -- col1 is referenced by multicolumn constraint ck1.
*10. I do not get it, can you explain please. col1 is not referenced, i see CHECK constraint is applied*
but no references made. Secondly, is ck1 considered multicolumn because it check two columns?
Or multicolumn here represents something else?
ALTER TABLE emp2
DROP COLUMN employee_id CASCADE CONSTRAINTS;
*11. This drop employee_id column and all its child. Correct?*
ALTER TABLE test1
DROP (pk, fk, col1) CASCADE CONSTRAINTS;
*12. This drops three columns and all its child if there are any. Correct?*
*13. Then what's the difference between ON DELETE CASCADE and CASCADE CONSTRAINTS?*
For example, What if employee_id in emp2 table definition does not have ON DELETE CASCADE,
will CASCADE CONSTRAINTS work? Please explain...
Page 2-22
When you are expecting a large data load and want to speed the operation. You may want
to disable the constraints while performing the load and then enable them, in which case
having a unique index on the primary key will still cause the data to be verified during
the load. So you can first create a nonunique index on the column designated as PRIMARY
KEY, and then create the PRIMARY KEY column and specify that it should use the existing
index.
Example:
1. create the table
create table new_emp
(employee_id number(6),
first_name varchar2(10)
2. create the index
create index emp_id_idx2 on new_emp(employee_id);
"You may want to disable the constraints while performing the load and then enable them"
so i suggest to load all data i want into new_emp.
3. create the primary key
alter table new_emp ADD primary key (employee_id) USING index emp_id_idx2;
What i understand is the following:
If we want to load large data into the new_emp, its better to create the table without any
constraints - in our case the constraint is primary key. After that, we create nonunique
index points to employee_id and then load data into new_emp. Finally, specify employee_id
as primary key using the nonunique index.
*14. Is my explanation correct?*
"in which case having a unique index on the primary key will still cause the data to be
verified during the load."
*15. Data to be verified against what? Is it to be verified whether its NULL or NOT NULL? I*
know primary key does not take NULL and every value must be unique.
After loading all data we want, what if i did
"alter table new_emp ADD primary key (employee_id);"
*16. Will i face any problems or inefficient process?*
I do not think we need step two, we could do the following:
1. create the table
create table new_emp
(employee_id number(6),
first_name varchar2(10)
"You may want to disable the constraints while performing the load and then enable them"
so i suggest to load all data i want itno new_emp.
2. create the primary key
alter table new_emp ADD primary key (employee_id);
*17. The above steps are as efficient as the three steps i mentioned above. The only difference*
is we let index be created implicitly. Right? If no, why?
Page 2-23
CREATE INDEX upper_dept_name_idx ON dept2(UPPER(department_name));
The following statement may use the index, but without the WHERE clause the
Oracle server may perform a full table scan:
select *
from employees
where UPPER(last_name) IS NOT NULL
ORDER BY UPPER (last_name);
"but without the WHERE clause the Oracle server may perform a full table scan"
*18. The above query let oracle server perform full table scan anyway! Right? It has to go*
through every field and check is it not null or not. I know we are using function-based
index but there are alot of not null last_name! so oracle server must scan one by one. If
we only had one not null field, then i would say Oracle server can point to that field
immediately by the aid of function-based index we created above. Can you clarify please...
Another related topic statement that i do not get it yet:
"The oracle server treats indexes with columns marked DESC as function-based indexes."
*19. The bove statements is so general. What if we have a column ordered by DESC order and we*
did not create any function-based indexes, will statement be true?!
Lets go back the above query:
ORDER BY UPPER (last_name);
*20. Its not DESC. To me, the above query does not flow with this statement "The oracle server treats*
*indexes with columns marked DESC as function-based indexes."?*
Page 2-27
Regarding FLASHBACK TABLE, you can invoke a flashback table operation on one or more
tables, even on tables in different schema. You specify the point in time to which you
want to revert by providing a valid timestamp. By default, database triggers are disabled
for all tables involved. You can override this default behavior by specifying the ENABLE
TRIGGERS clause.
"By default, database triggers are disabled for all tables involved. You can override this
default behavior by specifying the ENABLE TRIGGERS clause."
*21. What are database triggers?*
*22. About External Tables. What are external tables? When is it used in real-life? Why do*
we want External Tables?
Page 2-30
Oracle server provides two major access drivers for external tables. They are
ORACLE_LOADER access driver and ORACLE_DATAPUMP access driver. ORACLE_DATAPUMP used to
both import and export data using a platform-independent format.
"platform-independent format."
*23. What is the format? Is it .dat?*
Page 2-35
CREATE TABLE oldemp ( fname char(25), lname char(25) )
ORGANIZATION EXTERNAL
(TYPE ORACLE_LOADER
DEFAULT DIRECTORY emp_dir
ACCESS PARAMETERS
(RECORDS DELIMINATED BT NEWLINE
NOBADFILE
NOLOGFILE
FIELDS TERMINATED BY ',' (fname POSITION (1:20) CHAR, lname POSITION (22:41) CHAR)
LOCATION ('emp.dat') )
PARALLEL 5
REJECT LIMIT 200;
*24. Can you please explain the below part:*
ACCESS PARAMETERS
(RECORDS DELIMINATED BT NEWLINE
NOBADFILE
NOLOGFILE
FIELDS TERMINATED BY ',' (fname POSITION (1:20) CHAR, lname POSITION (22:41) CHAR)
*25. Can you please explain what is PARALLEL 5? and Why do we need it?*
Again, any help is appreciated...
Edited by: user11164565 on Jul 21, 2009 4:41 AM

Similar Messages

  • Oracle Database 10g:SQL Fundamentals II 2-12

    In Oracle Database 10g:SQL Fundamentals II Edition 1.1 Dated August 2004. On the page 2-12.
    The last parenthesis is closed but not opened.

    Is this book part of the Oracle product, or a third-party book (including Oracle Press)? If it's third-party, the publisher would appreciate knowing the problem, but you'd have to write to them. The Oracle staff monitoring documentation questions on this forum don't have anything to do with the third-party books.
    Thanks,
    Diana

  • "Oracle Database 10g: SQL Fundamentals I"  with a FRENCH language ?

    S'il vous plait ,je veux telecharger des cours en "Oracle Database 10g: SQL Fundamentals I" en francais est ce qu'il ya des liens disponible...? Merci
    -Please i want to download a Course "Oracle Database 10g: SQL Fundamentals I" with a FRENCH language wat do i do?
    thanks for your

    You could look for it in your local bookstore or at amazon.
    I think oracle provides only documentation in english language for download, but I may be wrong.
    Edited by: hm on 09.11.2011 04:08

  • Tablesusing in the work practice of Oracle Database 10g-SQL Fundam 1

    I want scripts sql builder for the tables (LOCATIONS, DEPARTMENTS, JOB_HISTORY, COUNTRIES, EMPLOYEES, JOBS, REGIONS, JOB_GRADES) use in the work practice of Oracle Database 10g-SQL Fundamentals(I)
    I thank you
    Youssef BENABDELLAH

    These exist in the HR schema.
    You may need to log in as SYS user and unlock the HR user account so you can log in with it (and set a password too if appropriate/necessary)

  • Questions about free Download Oracle 10g, Database and Developer suite

    Hi everyone, got some questions..
    1) Is it possible to download free Oracle 10g and Developer suite? is a 30 day license trial or something like that?
    2) On windows systems which are the minimun requirements?, for example in a Pentium 4, 512Mb RAM, Windows XP Home edition is OK?
    3) Should I download Standard Edition? Personal?
    4) If I am trying to update my Oracle Developer knowledge (I was developer on 1999 with Oracle 7.3 and Developer 2000) what products do I have to install?? Oracle DB 10g, Developer Suite,Application Server too?, what else?
    Thanks guys!
    J.

    My answer you could find here Questions about free download Oracle 10g, Developer Suite

  • Oracle Database 11g: SQL Fundamentals I 1Z0-051 Question

    i bought the OCA Oracle Database 11g: SQL Fundamentals I Exam Guide (Exam 1Z0-051) and i am not sure do i have to read the whole book ! or just go through the exam objectives table ? because the book covers lots of topics that's not in the exam and i am kind of tight on time if any one had the book or used it pls help
    To make it more clear i have a table in the book that shows each exam topic with page number next to it Like this:
    Restricting and Sorting Data
    [ ]      Limit the rows that are retrieved by a query Pg:104
    [ ]      Sort the rows that are retrieved by a query Pg:136
    [ ]      Use ampersand substitution to restrict and sort output at runtime
    Using Single-Row Functions to Customize Output
    [ ]      Describe various types of functions available in SQL Pg:170
    [ ]      Use character, number, and date functions in SELECT statements Pg:177
    Edited by: user7804566 on 01-Mar-2009 02:00

    Yes indeed. Practice at work (and elsewhere) is the best way to learn and ro reinforce learning.
    However, the more you read, the more you will be exposed to ideas and variations. Eventually you will find that many of the books have errors in various places. You will be winning when you are able to read and identify the errors AND explain why they are errors.
    The way your original question was written implied that you were after the minimum effort to pass an exam. Your last reply implies a different, and better, attitude.
    My suggestion therefore is to concentrate on the actual examples, but as quickly as possible expand to areas of interest. Explore as much as you possibly can, but make it a 'learning exploration' byut asking yourself questions and then investigating what the answer is.
    Also note that in Oracle nearly every answer has an exception. The best of the best know this and try very hard to understand when things go according to plan and when (and why) expections occur.

  • Question about Communication with Oracle 7

    Hi,
    Generally we use Oracle Snapshots for Communication, but since Oracle 9.2.0.5 do not work with Oracle 7.1.5.2.4. we are thinking about do use Oracle Interconnect for this Link.
    Now I have the following two Questions about Communication with Oracle 7:
    1. Is an Adapter for Oracle 7.1.5.2.4 available?
    2. From your experience, does it make sense to install Oracle Interconnect for implementation of only one read only Link with 3 Tables if an OAS for BI is available?
    Thanks,
    Hannes

    1. The Oracle database adapter is for Oracle 8i and up. I checked the code needed in the database and doubt that will work in Oracle 7.
    1. The other option Advanced Queuing also needs 8i and up.
    2. For me it doesnt make sense that you want to connect to Oracle 7. Oracle 7 is unsupported and should not have to be developed against. Also the license costs for Oracle Interconnect ~17K without any discount is a bit steep for read only links to three tables. Having the OAS means you wont have to pay another additional ~17K for the apps server.

  • 1Z0-051 Oracle Database 11g: SQL Fundamentals I

    Hi ,
    Could any one pls help which book i need to refer to get oca . Thanks
    Pls give me free download able links to download ebooks if possible .Thanks

    The book is not free quite expensive :) .Any one having oca prep book .I have to write 1Z0 -051 exam for 11g cert.
    Can i get either one of the book listed below for oca Exam
    Introduction to oracle9i SQL or Oracle database 10g SQL Fundamental I or Oracle Database 11g Introduction to SQL .
    Thanks !

  • Book: oracle database 11g sql fundamentals i

    dear all,
    i would like to pass the oracle certification in forms application.
    where can i find the ebook (pdf) of the fist course (oracle database 11g sql fundamentals i) in order to study and applying to take the Oracle PL/SQL Developer Certified Associate.
    Tnank you. i ll appreciate your help.

    Hi,
    where can i find the ebook (pdf) of the fist course (oracle database 11g sql fundamentals i) in order to study and applying to take the Oracle PL/SQL Developer Certified AssociateBy attending the class at OU or purchasing the book.
    Thanks,
    Hussein

  • 1z0-051 Oracle Database 11g SQL Fundamentals 1 exam DUMPS

    Hi dear associates.
    can you please help me 1z0-051 Oracle Database 11g SQL Fundamentals 1 exam dumps for preparation sql fundamental exam......!

    https://blogs.oracle.com/certification/entry/0477
    https://blogs.oracle.com/certification/entry/the_route_you_choose
    If you sincerely expect to get certified via legitimate means, pl edit your post to remove words with negative connotations
    HTH
    Srini

  • Do i have to pay exam center fee to an authorized oracle exam center(new horizon) in Bangladesh rather than the exam fee of Oracle Database 11g: SQL Fundamentals I ?

    Do i have to pay exam center fee to an authorized oracle exam center(new horizon) in Bangladesh rather than the exam fee of Oracle Database 11g: SQL Fundamentals I ?

    I agree with Matthew that I cannot be sure exactly what you are asking.
    Generally i regard it as less risk to yourself to schedule and pay Pearson Vue directly.
    However if you contact the exam center and get them to schedule for you my understanding is you pay them. Unfortunately there is risk of the exam center overcharging you (99%++ of most most worldwide wont).
    The only reasons for doing this I can think of is (there may be more) :-
    - is if you do not have credit/debit cards that Pearson Vue would accept.
    - The center will accept turn up and schedule and your transport to the exam center might be unreliable and you are worried you might miss the appointment and you are hoping to pay on arrival (some will not accept this).

  • Questions about free download Oracle 10g, Developer Suite

    Hi everyone, got some questions..
    1) Is it possible to download free Oracle 10g and Developer suite? is a 30 day license trial or something like that?
    2) On windows systems which are the minimun requirements?, for example in a Pentium 4, 512Mb RAM, Windows XP Home edition is OK?
    3) Should I download Standard Edition? Personal?
    4) If I am trying to update my Oracle Developer knowledge (I was developer on 1999 with Oracle 7.3 and Developer 2000) what products do I have to install?? Oracle DB 10g, Developer Suite,Application Server too?, what else?
    Thanks guys!
    J.

    1. It's posssible to download full version. Look at http://www.oracle.com/technology/software/index.html
    2. Minimum requirements are described in documentation.
    More at: http://www.oracle.com/technology/documentation/index.html
    3. AFAIK there are not Standard or Personal edition of Oracle Developer Suite just DB is in that versions.
    Check the details about product and choose one.
    4. I'think you just need Oracle DB and Oracle DS. Beter check the details about each of product and make your own decision.

  • Questions about 1Z0-047 Oracle Database SQL Expert

    I am planning to take this exam and I have several questions:
    1) I am using Steve O'Hearn's 'SQL Certified Expert Exam Guide' book and this states the following about SQL functions:
    "Be sure to review the Oracle Database SQL Language Reference Manual and review the lengthy description of all of the SQL functions before taking the exam"
    In trial tests it seemed that book's information was enough, but how about real exam? Is it necessary to study something in addition to this book information? You can answer regarding other exam objectives as well, if there is something that I should read from some other materials.
    2) The book states that I can add not null constraint to column that has null values, if I specify default value. I tried and cannot, I get error. So the book states it wrongly or do I misunderstand something?
    3) The book states that I cannot drop a NOT NULL constraint, but I can get the job done using: ALTER TABLE table_name MODIFY column_name NULL;
    I tried and I can execute: alter table table_name drop constraint nameofnotnullconstraint;
    4) To use external tables, is only read grant on the directory necessary or also write?
    5) I understood from the book that to flashback table (e.g to before drop) I need to have row movement enabled on the table. But I tried and I can make this flashback operation to table that does not have row movement enabled. How can this be explained!
    Big thanks in advance!

    #1) well, the manual is free; find here the SQL Language Reference - http://www.oracle.com/pls/db112/portal.all_books#index-SQL
    #2 & 3) If you proved it yourself, that settles it!
    #4) Here's a good article about external tables: http://www.oracle-developer.net/display.php?id=512
    I noted this paragraph in it, which might answer your question:
    In addition to the standard read-write Oracle directory that we need for our external table, we also need an additional executable directory object for the preprocessor. This directory defines the location of the executables used by the preprocessor (we will be using gzip below). As far as Oracle is concerned, an executable directory is one that has EXECUTE privileges granted on it (this is an 11g feature specifically to support the preprocessor).
    #5) don't know

  • Question about JDBC and Oracle 10g AL32UTF8

    Hey all,
    Currently I have a Java program that uses lib: ojdbc14.zip. It works fine for our Oracle 10g database, but when we converted our character set to AL32UTF8, our program seems to have stopped working properly. For instance, I grab a count(*), to see how many rows an ID has in a table. Then I take that list and display and count(*) that are greater than 0. Well, my first getString works properly to generate the select count(*) statements for all the tables in the database. But then when I execute those select count(*) I can grab out the number greater than 0. That's column 1. Then the owner name is displayed in column 2. and the table name is displayed in column 3. When I do a getString(2) we only get the first letter (sometimes) of the owner of the table. Same with the table name.
    For instance, before AL32UTF8
    getString(2): SCOTT
    getString(3): PEOPLE
    After
    getString(2): S
    getString(3): P
    Now to open my connection I use:
    static Connection conn;
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection(connection_string, username, password);
    And to create query I use:
    Statement query_1 = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
    Any help will be greatly appreciated. Thanks
    Sincerely,
    Mel

    orkun wrote:
    I was wondering whether it was a correct way :
    -retrieving data with resultset and putting them to an arraylist, then getting to jsf datatable.Your question/problem statement is unclear, but just lookup the DAO pattern.
    Is there any better way I can speed up retrieving data from databse ?Performance is a matter of good code and datamodel and decent hardware.

  • Question about transfer between oracle and sql server

    Could i program to transfer lots of data between Oracle and SQL Server quickly?
    I have tried make two connection between two databases, but it took me lots of time to transfer data.
    How could I do it?
    Thanks

    Hi,
    If you need to move data fast, then use the Oracle Migration Workbench to Generate SQL Server BCP data extraction scripts and Oracle SQL Loader files.
    This is the fastest way to migrate the data.
    In the Oracle Model UI tab of the Oracle Migration Workbench, right mouse click on the tables folder. there is a menu option to 'Generate SQL Loader ...' scripts. This will help you migrate your data efficiently.
    Regards
    John

Maybe you are looking for

  • Can we do a fresh install of TES 6.2.1 on a new server, but point to an database currently used by the older version (v5.3.x)

    The current database is 2.5 gb, but it is already on SQL Server 2008, and doesn't need to be upgraded. In reading the documentation, it looks like the installer can install a fresh copy, which I'm assuming creates the requisite tables in the database

  • Manufacturer Part Number (MPN) in iProcurement

    Hi, We are in Oracle EBS 11.5.10.2 and have a requirement to be able to search items based on Manufacturer and/or Manufacturer Part Number(MPN) in Oracle iProcurement. We have created an Item and mapped few MPNs to it. The Items has been extracted to

  • Music stream from pc (home media server) to n80

    Hi I have successfully connected my N80 over wlan to my pc. i can copy music to my mobile over the wlan using the media server... But is ist also possible to play music wich is stored on my pc on my N80, without copying it to the phone. I mean someth

  • Reader window doesn't resize elements between monitors

    Reader 11.0.10 on Windows 8.1 x64. I have a dual monitor setup with two 80cm (30") monitors. One is an Eizo EV3237 UHD monitor running at its native 3840x2160 resolution, the other is a Dell U3011 running at its native 2560x1600 resolution. Because t

  • Swings & crystal reports.

    hi i am working with Crystal Reports & Java swings. i am able to view a simple report in the viewer using ReportViewerBean. how should i pass parameters to the report. every time i try to view a report which need parameters i get "Please Provide Info