Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: sys vs. "normal" User

Re: sys vs. "normal" User

From: Stefan Knecht <knecht.stefan_at_gmail.com>
Date: Tue, 4 Sep 2007 10:52:26 +0200
Message-ID: <486b2b610709040152x769aaf4do4bf6b10252728891@mail.gmail.com>


Hi

There's several issues I've ran into due to such objects being created.

What comes to mind is Full Export / Import. SYS doesn't get exported, therefore a lot of stuff will be invalid when importing, because of possible dependencies on objects that just weren't imported. When doing database upgrades, the dictionary objects your code relies on may change. This can't be prevented by putting the stuff in another user, but at least you won't have corruption in SYS. I've run into several databases at clients where some variants of custom V$ views and procedures were created, that during an upgrade would point to no-longer-existant x$ objects, and therefore raise nasty ORA-600's.

And as Toon has already nicely put "it's just not done" :-)

Just my 2 cents

On 9/4/07, Koppelaars, Toon <T.Koppelaars_at_centraal.boekhuis.nl> wrote:
>
> Jorg,
>
> It wouldn't be my choice to create custom procedures in the SYS-schema.
> Other than "it's just not done" I am unaware of "something bad" when doing
> so.
>
> Instead I would create a new (third) schema. Grant it the create session
> and create procedure system privileges, and grant it the necessary object
> priviges on the SYS objects you mention.
> Then you can create your procedure in this schema, and finally grant
> execute on your procedure to the application schema.
>
> Toon
>
>
> -----Original Message-----
> From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org]
> On Behalf Of Jost," Jörg
> Sent: dinsdag 4 september 2007 9:52
> To: oracle-l_at_freelists.org
> Subject: sys vs. "normal" User
>
> Hello List,
>
> as often, there is a discussion between our developers and me, the
> dba ;-)
>
> Our application connects to Oracle via SQLNet as a normal User. Every
> application client connects as the same user, so there are many
> connections with the same username in v$session.
>
> At some important points this application locks rows with dbms_lock.
>
> The lockname is the rowid of the row. Sometimes an evil user stays
> forever at this row and other users are unable to change it.
>
> This case in mind, i have written a small procedure, which get the
> Primary Key of the locked rows and shows it via dbms_output.
>
> Because of the Tables/Views i need to query, this procedure belongs to
> SYS.
>
> My question is, is there something bad to install procedures as sys and
> grant the procedure to the application user? Is there a "Dogma" that
> says, never create or install self written packages as sys?
>
> Should i grant select on the underlying Tables/Views instead?
>
> The Objects i query are:
>
> dbms_lock_allocated
> dba_locks
> v$session
>
> Also this objects, which are no problem because they exists also for the
> normal user:
>
> dba_cons_columns
> dba_constraints
> dba_objects
>
> Thx in advance
>
> Jörg
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

-- 
=========================

Stefan P Knecht
Consultant
Infrastructure Managed Services

Trivadis AG
Europa-Strasse 5
CH-8152 Glattbrugg

Phone +41-44-808 70 20
Fax +41-808 70 12
Mobile +41-79-571 36 27
stefan.knecht_at_trivadis.com
http://www.trivadis.com

OCP SCSA SCNA
=========================

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Sep 04 2007 - 03:52:26 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US