Home » RDBMS Server » Security » Creating table in other schema (oracle 11g)
icon5.gif  Creating table in other schema [message #537595] Thu, 29 December 2011 12:09 Go to next message
rajubuddha
Messages: 1
Registered: December 2011
Location: India
Junior Member
Hi Guys ,

I have a query ,

I need to create a structure DATABASE=>SCHEMA=>TABLE as

DB=>SC=>EMPLOYEE ...but after connecting database i could create table only user my user schema(own schema)only .I want to create a new schema called SC as public and need to create a table . Please help me out...


[EDITED by LF: fixed topic title typo; was "Creatingtableinother schema"]

[Updated on: Thu, 29 December 2011 13:15] by Moderator

Report message to a moderator

Re: Creatingtableinother schema [message #537602 is a reply to message #537595] Thu, 29 December 2011 12:48 Go to previous messageGo to next message
Littlefoot
Messages: 19508
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Create a table in your own schema, and then create a public synonym for this table.
SQL> create table test (col number);

Table created.

SQL> insert into test values (123);

1 row created.

SQL> create public synonym test for test;

Synonym created.

SQL> grant select on test to public;

Grant succeeded.

SQL> connect mike/lion
Connected.

Session altered.

SQL> select * from test;

       COL
----------
       123

SQL>

[EDIT: fixed an example]

[Updated on: Thu, 29 December 2011 12:53]

Report message to a moderator

Re: Creatingtableinother schema [message #537606 is a reply to message #537595] Thu, 29 December 2011 12:58 Go to previous message
Michel Cadot
Messages: 58906
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
want to create a new schema called SC as public


There is no such thing than public account.
An account can create a table in another schema only if he has the CREATE ANY TABLE privilege which is a privilege you should not grant.
If you need it then either you are a DBA either there is a flaw in your design.

Regards
Michel
Previous Topic: Database link password
Next Topic: Password Expire problem
Goto Forum:
  


Current Time: Wed Aug 27 10:26:59 CDT 2014

Total time taken to generate the page: 0.11580 seconds