Not owner ,668: system command cannot be executed
Posted in 2000
A user running as informix got "Not owner, 668: system command cannot be executed" from an SPL stored procedure whose SYSTEM calls echo an UNLOAD script to a file and then run dbaccess. Suggestions: use absolute paths for the generated files and redirects (e.g. /tmp/user.sql) since the working directory for SYSTEM redirects is unpredictable, and remember that the procedure inherits the environment the database server was started with, so hard-code the path to dbaccess or ensure $INFORMIXDIR/bin is in $PATH before starting the server. The poster still reported the first SYSTEM statement failing, and no confirmed fix is recorded in the thread.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Stored Procedures & SPL, Security, Permissions & Auditing
I have created a stored procedure using user informix. When I go to execute this procedure I get this error. Being user informix I should not have to specify a database username and password or do I? Any help would be great.
Matt Phillips wrote: > > I have created a stored procedure using user informix. When I go to > execute this procedure I get this error. Being user informix I should > not have to specify a database username and password or do I? Any help > would be great. It seems, that You a "SYSTEM"-command in Your procedure and something with the command, which should be executed by Your OS doens't work correctly. For a better analysis of Your program, I need Your whole "SYSTEM"-command and the operating system Your database-server is running on. wolfgang
Thanks for responding so quickly. Here is the procedure that I am trying to
execute:
create procedure inf2ora_extuser(app_manager char(30))
system "echo 'unload to ""user.dat"" select ""ops$""||username"||
",""oracle"" "||
"from sysusers where username not matches ""public""' > user.sql";-- system "dbaccess "||app_manager||" user";
-- system "rm user.sql";
end procedure
Platform Solaris 7
Thanks.
Wolfgang Zager wrote:
> Matt Phillips wrote:
> >
> > I have created a stored procedure using user informix. When I go to
> > execute this procedure I get this error. Being user informix I should
> > not have to specify a database username and password or do I? Any help
> > would be great.
>
> It seems, that You a "SYSTEM"-command in Your procedure and something
> with the command, which should be executed by Your OS doens't work
> correctly.
>
> For a better analysis of Your program, I need Your whole
> "SYSTEM"-command
> and the operating system Your database-server is running on.
>
> wolfgang
Matt Phillips wrote:
>
> Thanks for responding so quickly. Here is the procedure that I am trying to
> execute:
>
> create procedure inf2ora_extuser(app_manager char(30))
> system "echo 'unload to ""user.dat"" select ""ops$""||username"||
> ",""oracle"" "||
> "from sysusers where username not matches ""public""' > user.sql";> -- system "dbaccess "||app_manager||" user";
> -- system "rm user.sql";
> end procedure
>
Here's a possibility:
create procedure inf2ora_extuser(app_manager char(30))system "echo 'unload to ""/tmp/user.dat"" select ""ops$""||username"||
",""oracle"" "||
"from sysusers where username not matches ""public""' > /tmp/user.sql";
-- system "dbaccess "||app_manager||" /tmp/user";
-- system "rm /tmp/user.sql";
end procedure
When a redirect is run in this manner, determining where the output file
is created can be quite difficult. I always use a hard path, just to
make sure.
> Platform Solaris 7
Ours is HPUX 10.20
--
John Carlson
Informix DBA
WHSmith USA
#include std_disclaimer.h /* These are my opinions, not my company's
opinion */
I seem to get the same error when I do that. Must be a permissions thing
somewhere. The user.sql file gets created but after that it dies. In the
statement 'create procedure inf2ora_extuser(app_manager char(30))',
app_manager is the database name, is this syntax correct?
"Carlson@WHSmith" wrote:
> Matt Phillips wrote:
> >
> > Thanks for responding so quickly. Here is the procedure that I am trying to
> > execute:
> >
> > create procedure inf2ora_extuser(app_manager char(30))
> > system "echo 'unload to ""user.dat"" select ""ops$""||username"||
> > ",""oracle"" "||
> > "from sysusers where username not matches ""public""' > user.sql";> > -- system "dbaccess "||app_manager||" user";
> > -- system "rm user.sql";
> > end procedure
> >
>
> Here's a possibility:
>
> create procedure inf2ora_extuser(app_manager char(30))> system "echo 'unload to ""/tmp/user.dat"" select ""ops$""||username"||
> ",""oracle"" "||
> "from sysusers where username not matches ""public""' > /tmp/user.sql";
> -- system "dbaccess "||app_manager||" /tmp/user";
> -- system "rm /tmp/user.sql";
> end procedure
>
> When a redirect is run in this manner, determining where the output file
> is created can be quite difficult. I always use a hard path, just to
> make sure.
>
> > Platform Solaris 7
>
> Ours is HPUX 10.20
>
> --
> John Carlson
> Informix DBA
> WHSmith USA
>
> #include std_disclaimer.h /* These are my opinions, not my company's
> opinion */
Matt Phillips wrote:
>
> I seem to get the same error when I do that. Must be a permissions thing
> somewhere. The user.sql file gets created but after that it dies. In the
> statement 'create procedure inf2ora_extuser(app_manager char(30))',
> app_manager is the database name, is this syntax correct?
>
> "Carlson@WHSmith" wrote:
>
> > Matt Phillips wrote:
> > >
> > > Thanks for responding so quickly. Here is the procedure that I am trying to
> > > execute:
> > >
> > > create procedure inf2ora_extuser(app_manager char(30))
> > > system "echo 'unload to ""user.dat"" select ""ops$""||username"||
> > > ",""oracle"" "||
> > > "from sysusers where username not matches ""public""' > user.sql";> > > -- system "dbaccess "||app_manager||" user";
> > > -- system "rm user.sql";
> > > end procedure
> > >
> >
> > Here's a possibility:
> >
> > create procedure inf2ora_extuser(app_manager char(30))> > system "echo 'unload to ""/tmp/user.dat"" select ""ops$""||username"||
> > ",""oracle"" "||
> > "from sysusers where username not matches ""public""' > /tmp/user.sql";
> > -- system "dbaccess "||app_manager||" /tmp/user";
> > -- system "rm /tmp/user.sql";
---^^^^^^^^^^^
What about the --? If I remember correctly, SQL assumes that a double
dash is a comment. Does SPL do the same thing???
> > end procedure
> >
> > When a redirect is run in this manner, determining where the output file
> > is created can be quite difficult. I always use a hard path, just to
> > make sure.
> >
> > > Platform Solaris 7
> >
> > Ours is HPUX 10.20
> >
> > --
> > John Carlson
> > Informix DBA
> > WHSmith USA
> >
> > #include std_disclaimer.h /* These are my opinions, not my company's
> > opinion */
--
John Carlson
Informix DBA
WHSmith USA
#include std_disclaimer.h /* These are my opinions, not my company's
opinion */
Yes those are coments. For some reason the first system statement is not working. Is
putting the database name next to the datatype the right syntax?
Thanks.
"Carlson@WHSmith" wrote:
> Matt Phillips wrote:
> >
> > I seem to get the same error when I do that. Must be a permissions thing
> > somewhere. The user.sql file gets created but after that it dies. In the
> > statement 'create procedure inf2ora_extuser(app_manager char(30))',
> > app_manager is the database name, is this syntax correct?
> >
> > "Carlson@WHSmith" wrote:
> >
> > > Matt Phillips wrote:
> > > >
> > > > Thanks for responding so quickly. Here is the procedure that I am trying to
> > > > execute:
> > > >
> > > > create procedure inf2ora_extuser(app_manager char(30))
> > > > system "echo 'unload to ""user.dat"" select ""ops$""||username"||
> > > > ",""oracle"" "||
> > > > "from sysusers where username not matches ""public""' > user.sql";> > > > -- system "dbaccess "||app_manager||" user";
> > > > -- system "rm user.sql";
> > > > end procedure
> > > >
> > >
> > > Here's a possibility:
> > >
> > > create procedure inf2ora_extuser(app_manager char(30))> > > system "echo 'unload to ""/tmp/user.dat"" select ""ops$""||username"||
> > > ",""oracle"" "||
> > > "from sysusers where username not matches ""public""' > /tmp/user.sql";
> > > -- system "dbaccess "||app_manager||" /tmp/user";
> > > -- system "rm /tmp/user.sql";
>
> ---^^^^^^^^^^^
>
> What about the --? If I remember correctly, SQL assumes that a double
> dash is a comment. Does SPL do the same thing???
>
> > > end procedure
> > >
> > > When a redirect is run in this manner, determining where the output file
> > > is created can be quite difficult. I always use a hard path, just to
> > > make sure.
> > >
> > > > Platform Solaris 7
> > >
> > > Ours is HPUX 10.20
> > >
> > > --
> > > John Carlson
> > > Informix DBA
> > > WHSmith USA
> > >
> > > #include std_disclaimer.h /* These are my opinions, not my company's
> > > opinion */
>
> --
> John Carlson
> Informix DBA
> WHSmith USA
>
> #include std_disclaimer.h /* These are my opinions, not my company's
> opinion */
Also another thing to consider is that your procedure inherits the server
environment *at* startup. Thus, any environment variable that you use
in your system calls needs to be in the environment in which you start
the database server.
Having said all of this, either hardwire the path to the "dbaccess"
utility, OR put $INFORMIXDIR/bin in the $PATH variable before you
start INFORMIX, if its not done already.
HTH,
Mark
--
"In America, any boy may become president and I suppose that's just
one of the risks he takes."
-- Adlai Stevenson