Jump to content

Granting authority


vram

Recommended Posts

Hi Friends

I created a webpage thru which i allow users to learn SQL through DB2 UDB.Initially I created an instance which i set to environment variable.

Then i attached the instance to the Win NT user name and password.My prj needs db2 commands to be executed from a webpage.Actually i am able to execute all those db2 commands which needs no

authorization.But when i tried to create sample db which has sysadm authority thru php,I enocounter this error \"SQL1092N \"SYSTEM\" does not have the authority to perform the requested command\".Pls let me know how to grant authority to server to create sample db thru webpage and allow access to all db2 commands which has sysadm or sysctrl or dbadm authority.I use PHP 4.1,Apache 3.x,Win NT and DB2UDB 7.1.I ve attached the code for ur reference

 

<?php //Start of PHP

session_start(); //Staring a SESSION

$_SESSION[\'instance\']=$_POST[instance];

$_SESSION[\'Login\']=$_POST[Login];

$_SESSION[\'pwd\']=$_POST[pwd];

$instance=$_SESSION[\'instance\'];

$Login=$_SESSION[\'Login\'];

$pwd=$_SESSION[\'pwd\'];

 

$instance contains the instance name obtained from the previous page in a form

//ly $login and $pwd contains the domain username and password

 

system(\'db2stop\'); //Stopping the current instance

 

$ins=\"db2icrt \".$instance.\" -s ee -p D: -u \".$Login.\",\".$pwd;

system($ins); //Executing $ins

 

echo \"<BR>Instance ($instance) created succseefully\";

prints::Instance (newinst) created succseefully

 

putenv(\"db2instance=$instance\"); Setting the current instance to env variable

 

system(\'db2cmd /c /w /i db2 get instance\');

Prints ::The current database manager instance is: NEWINST

 

system(\'db2start\');

Prints::

SQL5043N Support for one or more communications protocols failed to start successfully. However, core database manager functionality started successfully.

 

system(\'db2sampl\');

Prints::

SQL1092N \"SYSTEM\" does not have the authority to perform the requested command

 

session_write_close();

 

 

?> //End of PHP

 

 

Thanx in advance.

Thanks and regards

VRAM

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.