Hi
I m facing problem in my project.I want to create an instance,then setting it to environment variable,then i should create a sample database.I succeded in the first two task but sample db creation failed .I know the reason.since im executing from a webpage,db2 has no way to know which user tries to create sample db.hence the authorization error.Anybody pls tell me how to grant previlige to the user bfore creating sample.Everything has to be done thru webpage.for ur conveniance,i ve included the code below
Thanks in adv.Bye.
Thanks and regards
Vram
<?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
echo "<BR>";
system('db2cmd /c /w /i db2 get instance');
Prints ::The current database manager instance is: NEWINST
echo "<BR>";
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