Start Free Trial
SQL> create tablespace my_tb datafile '/u01/oracle/oradata/repdb
f' 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.....
8/22/2022 - Mon
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!!
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.
ASKER CERTIFIED SOLUTION
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
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.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Plans and Pricing
Certified Expert Program
© 1996-2023 Experts Exchange, LLC. All rights reserved. Covered by US Patent