//////////////////////////////////////////////////////////////////////////// // // This script will install/deploy the UDDI 1.5 Database structure // // Author: lucasm // //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// // Consts // var c_logfile = "uddi.v2.builddb.log"; var c_log = true;//true = log all the time var c_verbose = false;//true = output all info to console var c_dbserver = "(local)";//sql server where you want to deploy var c_dbname = "uddi_v2";//name of the uddi database var c_mode = 0;//0=DROPDB;1=CODEONLY;2=NODROP var c_datadir = "C:\\sqldata";//dir local to db server for data files var c_logdir = "C:\\sqldata";//dir local to db server for log files var c_backupdir = "C:\\sqldata";//dir local to db server for backup files var c_stagedir = "C:\\sqldata";//dir local to db server for staging files var c_scriptdir = "C:\\dev\\nt\\inetsrv\\uddi\\source\\setup\\db\\ca";//dir local to this script where the t-sql files can be found var c_backupscr = "createBackupSched.vbs";//script to run to configure backup on the db // //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// // Globals // var g_fso = new ActiveXObject( "Scripting.FileSystemObject" ); var g_shell = new ActiveXObject( "WScript.Shell" ); var g_sqlserver;// = new ActiveXObject( "SQLDMO.SQLServer" ); var g_logfile ;//= c_dbname + "_log.ldf";//database log file name var g_sysfile ;//= c_dbname + "_sys.mdf";//sys database file name var g_datafile1 ;//= c_dbname + "_data_1.ndf";//database data file name var g_datafile2 ;//= c_dbname + "_data_2.ndf";//database data file name var g_journfile ;//= c_dbname + "_journal_1.ndf";//database journal file name var g_stagefile ;//= c_dbname + "_stage_1.ndf";//database stageing file name // //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// // Arrays // var g_dropdbcmd;//holds t-sql commands to drop the db var g_cleanupcmd;//holds t-sql commands to run to clean and prep filesystem var g_createdbcmd;//holds t-sql commands to create the db var g_configdbcmd;//holds t-sql commands to config the db var g_scriptarr;//holds sql file names to run to create and configure table schema var g_codescrarr;//holds sql file names that pertain to code( sprocs,funcs, etc) var g_taxonarr;//holds txt file names for taxonomy import // //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// // This is the help screen // var c_help = " deploydb.js help \r\n"+ "\r\n"+ " CScript deploydb.js [(-c)odeonly|(-d)ropdb|(-n)odrop] [options]\r\n"+ "\r\n"+ " -c Codeonly build of the database(1)\r\n"+ " -d Drop Current Database and Restart Clean(0)\r\n"+ " -n Do Not Drop the Current Database(2)\r\n"+ " ( Default is " + c_mode + " )\r\n" + "\r\n"+ "Options:\r\n"+ "\r\n"+ " -s servername Name of database server( "+ c_dbserver +" )\r\n"+ " -a datbase name Name of database( "+ c_dbname +" )\r\n"+ " -l logname Enable logging and specify log( " + c_log + ", "+c_logfile+" )\r\n"+ " -v Verbose Mode( " + c_verbose + ")\r\n"+ " -D DataDir Database Data Directory( " + c_datadir + " )\r\n"+ " NOTE: This path is local to the database server\r\n"+ " -L LogDir Database Log Directory( " + c_logdir + " )\r\n"+ " NOTE: This path is local to the database server\r\n"+ " -B BackupDir Database Backup Directory( " + c_backupdir + " )\r\n"+ " NOTE: This path is local to the database server\r\n"+ " -S ScriptDir Database Script Location( " + c_scriptdir + " )\r\n"+ " -N StagingDir Location to place Staging Files( " + c_stagedir + " )\r\n"+ " -b BackupScript Script to run to install Backup Schedule\r\n" + " ( " + c_backupscr + " )\r\n"+ " \r\n"+ "\r\n"; // //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// // Handles command line arguments // function args( ) { var i =0; try { if( WScript.Arguments.Length>0 ) { if( WScript.Arguments( 0 ) =="-?"||WScript.Arguments( 0 ) =="/?" ) log( c_help,6,"HELP" ); for( i=0;i 2 ) WScript.Echo( entry ); if( lvl > 5 ) WScript.Quit(1); } // //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// // // g_fso = null; g_sqlserver.Close(); g_sqlserver= null; g_shell=null; // ////////////////////////////////////////////////////////////////////////////