enjoylife's Stuff

Home » enjoylife (3 trails)
enjoylife's Stats (public trails only):
Trails created: 80
Marks created: 1245
Views received: 100,343
Positive ratings: 1
Negative ratings:
Comments received: 3
Comments left: 0
super master (enjoylife)

enjoylife's Trails: database    (view all)
    How to List my tables in Oracle database

http://www.dba-oracle.com/bk_sqlplus_list_tables_views.htm

SELECT * FROM all_tables; <- all tables you have access to
SELECT * FROM user_tables; <- all tables owned by currently logged in user
SELECT * FROM dba_tables; <- all tables in database


I am glad to know that we have Database forum here.

Just installed Oracle database server under Ubuntu Linux, It did took some time but finally beast is installed.

Now how do I list tables? Mysql has
Code:
SHOW DATABASES;
USE mydb;
SHOW TABLES;
SELECT * FROM mytable;
So far I am able to login into the Oracle using command-line tool called SQL*Plus:
Code:
$ sqlplus scott/tiger
Now how do I list tables?

I am just taking print out of Oracle sql pdf but please give me command so that I know it is working.
Reply With Quote
  #2 (permalink)  
Old 12-19-2006, 02:03 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 848
nixcraft is an unknown quantity at this point
Default

To list all your tables in Oracle server, use the following command:
Code:
SELECT * FROM cat;
First connect to server using Oracle sql plus client:
Code:
sqlplus scott/tiger
Now type at sql> prompt:
Code:
SELECT * FROM cat;
Also don't forget to set the column widths
Code:
COL table_name FORMAT a30;
COL table_type FORMAT a30;
Now to get list of tables in oracle:
Code:
SELECT * FROM cat;
Tags: tables, code, sql, oracle, select, ...
A trail of 3 pages

SQL JOIN

The JOIN keyword is used in an SQL statement to query data from two or more tables, based on a relationship between certain columns in these tables.

Tables in a database are often related to each other with keys.

A primary key is a column (or a combination of columns) with a unique value for each row. Each primary key value must be unique within the table. The purpose is to bind data together, across tables, without repeating all of the data in every table.

Look at the "Persons" table:

Tags: data, tables, sql, persons, bind, ...
A trail of 3 pages

I love the Drupal CMS. One of my favorite features of Drupal is the ability to do a multisite install. This site and my other blog, i <3 stella, are hosted on the same box, using the same Drupal install. Several sites can share one codebase. Updates are easily rolled out to every site simultaneously. Overall, it's a wonderful idea. But I have some problems with the implementation...

The standard way to set up a multisite install is to point each of the domain names at the Drupal install folder and let Drupal sort out which domain each request is coming from. It does a good job, too. But this method introduces some complications. For example, any content uploaded to site a is accessible from site b. A user that visits http://site1.com/myimage.jpg will find the same image as she finds at http://site2.com/myimage.jpg. Websites can't have domain specific .htaccess or robots.txt files either, which might hurt search engine optimization of individual sites.

An interesting side effect of this is if you want to install something in a subdirectory of your site, for example a WordPress blog at http://site1.com/blog, that exact same WordPress blog will exist in its full glory at http://site2.com/blog...

Another, and perhaps more grave, problem is that all that stands between the interweb and your very own personal settings is an .htaccess file. Install scripts, includes, site configurations and database passwords are in web accessible directories, and that is never a good thing.

We'll look at one solution to these problems.

I assume here that you are using Linux hosting, that you have shell access, and that you have at least a passing acquaintance with symlinks. If you're looking for a webhost that meets these requirements, check out 1and1 shared hosting. I've been happy with them, and all of their packages above $9.99/mo will do what you need.

Microsoft/IIS guys, you can't do a symlink. You're looking for something called a junction... good luck with that.

Tags: install, http, jpg, htaccess, multisite, ...
A trail of 29 pages