IBM Informix dbcron SQL admin() function examples -- Posted by inturi on Sunday, March 9 2008
To create a dbspace
dbaccess sysadmin;
execute function admin("create dbspace", "dbsp1","$INFORMIXDIR/storage/dbsp1","20M", "0");

To drop dbspace
dbaccess sysadmin;
execute function admin("drop dbspace", "dbsp1");

To create sbspace
dbaccess sysadmin;
execute function admin("create sbspace", "sbsp1","$INFORMIXDIR/storage/sbsp1","20M", "0");

To drop sbspace
dbaccess sysadmin;
execute function admin("drop sbspace", "sbsp1");

To create temporary dbspace
execute function admin("create tempdbspace", "tmpdbs1","$INFORMIXDIR/storage/tmpdbs1","20M", "0");

To drop temporary dbspace
dbaccess sysadmin;
execute function admin("drop tempdbspace", "tmpdbs1");

To rename dbspace/sbspace
dbaccess sysadmin;
execute function admin("rename space", "dbsp1", "newname");

To add new logical log
dbaccess sysadmin;
execute function admin('add log', 'logdbs', "20M");

To drop log file number 10
dbaccess sysadmin;
execute function admin('drop log', "10");

TIP:Query command_history table in sysadmin database to get history of admin commands executed using admin() and task() functions.

For documentation about admin API please visit http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp

[Edit] Home
If this information is helpful to you then please click here and post one simple tip that you know. Share your knowledge!