Re: view not found
Date: Fri, 18 Jan 2008 07:58:37 -0800 (PST)
Message-ID: <7b1f26c2-5d76-42f8-9c2c-d8fd10e797c4@d4g2000prg.googlegroups.com>
On 18 Jan, 15:53, burrell.j..._at_yahoo.com wrote:
> Hello,
> I have created, and run, as sysdba this script to create an user and a
> view.
> drop view ADNAM;
> create view ADNAM as select Serial from reporter.status;
>
> drop user ADNAM;
> create user ADNAM identified by ADNAM;
> GRANT CONNECT TO ADNAM;
> GRANT RESOURCE TO ADNAM;
> GRANT SELECT ON ADNAM to ADNAM;
> GRANT UNLIMITED TABLESPACE TO ADNAM;
>
> But when I log in a ADNAM/ADNAM
>
> SQL> connect ADNAM/ADNAM
> Connected.
> SQL> select * from ADNAM;
> select * from ADNAM
> *
> ERROR at line 1:
> ORA-00942: table or view does not exist
>
> Clearly view adnam does exist - but user ADNAM is not referencing it
> correctly?
> Please help me out!
>
> J
Why are you doing this as SYS?
I would perform the following:
- Log in as SYSTEM
- Create your user:
drop user ADNAM;
create user ADNAM identified by ADNAM;
GRANT CONNECT TO ADNAM;
GRANT RESOURCE TO ADNAM;
GRANT SELECT ON ADNAM to ADNAM;
GRANT UNLIMITED TABLESPACE TO ADNAM;
3. Create your view as follows:
drop view ADNAM.ADNAM;
create view ADNAM.ADNAM as select Serial from reporter.status;
The convention <schema_name>.<object_name> needs to be used to create objects in a schema other than your own. Of course, you're not making life too easy for yourself by naming objects and schemas as the same thing!
HTH -g Received on Fri Jan 18 2008 - 09:58:37 CST