Solved

query

Posted on 2012-12-31
5
225 Views
Last Modified: 2013-01-16
SQL> create tablespace my_tb datafile '/u01/oracle/oradata/repdb/my_tbs.dbf' size 100m; Tablespace created.


 SQL> create table my_tab tablespace my_tbs as select * from dba_objects;

why we are using the part " select * from dba_objects" in the query.....


??
0
Comment
Question by:walkerdba
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 9

Expert Comment

by:armchair_scouse
ID: 38733833
Presumably to adopt the structure/columns of dba_objects as the basis of the structure of your table my_tbs, and possibly to import any records from dba_objects if there are any present in the table.

Happy New Year!!
0
 
LVL 23

Expert Comment

by:David
ID: 38733872
The sys.dba_objects view shows the data dictionary (every database object).  It is a commonly cited set of "random" data.  As your example shows, it's a quick way to populate a test table.  The other advantage is that it gives you a consistent test bed if you need to drop and repopulate the table.
0
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 500 total points
ID: 38735647
you have 2 different names of tablespace in the 2 commands.

tablespace created: MY_TB
table destination tablespace: MY_TBS

was the intention not the same tablespace  ?
or just a typo ... :)
0
 
LVL 35

Expert Comment

by:Mark Geerlings
ID: 38736518
Or, are you asking: "Why create a table that is a copy of data that is already available from a view?"  One reason for doing this is for performance.  If you need to retrieve this data multiple times, repeated queries of this table will likely be much faster (and cause many fewer logical block reads) than a query from the view.
0
 

Author Closing Comment

by:walkerdba
ID: 38784013
solved
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

731 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question