Ascmd.exe process stuck on OLAP creation - sql-server-2008

I'm pulling my hair out here for that I can't understand what is going on
I have the following:
Windows Server 2008 R2 64-bit
SQL Server 2008 R2 64-bit
When I run ascmd.exe it giving xml file in order to build OLAP database, most of the time the process just gets stuck and the console window is open even after ten minutes with no further messages.
However if I check in the SQL Server Managment, I can see that the OLAP database is created. Then in other times (Same machine, Same scenario, Same snapshot) it succeeds.
What can cause this odd behaviour?
I've tried to search everywhere but did not find any similar issue
I've tried to replace the ascmd.exe tool with its latest(Version 10.0.87.5)
I don't know whats causing this, please help!
Thanks!!!
Update:
Please someone? it is very important
Update:
I think I have a progress on it but can't explain the behaviour.
I've looked into the code of the Ascmd and I've found that for some reason the trace file(log file) did not start, therefore the code got into a loop forever section and did not get out(I've added prints to the code to check out if it is get stuck here and i've noticed that it gets stuck on while (!TraceStarted) { Thread.Sleep(1); } :
private static void WaitForTraceToFinish()
{
int delay = Int32.Parse(TraceTimeout, CultureInfo.CurrentCulture);
TraceTimeoutCount = TraceTimeoutCountReset = delay * PollingInterval; // TraceTimeoutCount is in 1/4 seconds
Console.WriteLine("TraceTimeoutCount is : " + TraceTimeoutCount);
Console.WriteLine("Did Trace Start Already ? : " + TraceStarted);
// Wait for trace to start to flow
while (!TraceStarted) { Thread.Sleep(1); } // loop every 20ms waiting for trace to start
// Wait BeginEndBlockCount becomes 0 or TraceTimeoutCount expires
while (TraceTimeoutCount > 0)
{ // loop forever until TraceFinished
Console.WriteLine("TraceTimeoutCount is : " + TraceTimeoutCount);
Console.WriteLine("PollingInterval is : " + PollingInterval);
Console.WriteLine("1000 / PollingInterval = " + 1000 / PollingInterval);
if (BeginEndBlockCount == 0) return;
Thread.Sleep(1000 / PollingInterval); // wait a polling interval
Console.WriteLine("TraceTimeoutCount is : " + TraceTimeoutCount);
TraceTimeoutCount--;
Console.WriteLine("TraceTimeoutCount is : " + TraceTimeoutCount);
}
Console.WriteLine("Got out from trace");
// TraceTimeoutCount expired -- just exit
}
Does anyone know why the trace file is not started?
Does it related to Windows Server 2008 hard security rules?
I cannot remove the trace file since its a requirement for us
Any suggestions? thanks!

Its so frustrating to know that administrative privileges in Windows Server 2008 + SQL Server 2008 could make those errors
Running as administrator solved my problem and the OLAP creation process did not stuck

Related

MYSQL select beep; - make mysql console beep when selected - or notified

Rather a peculiar question.
Is there a possibility to "select beep" in mysql or any sql for that matter ? - I often run a few queries / updates / alter commands which takes quite some time and I wish when the query ends to be notified.
Is there anyway for the mysql client console to notify using audio / sound / beep ?
Before you all start crucifying me let's remember:
MySQL does beep on errors - so the possibility exists
MySQL or any console should be "friendly to the user", for example it includes the \G which allows to view the results in a more human readable format.
So why not beep ?
I know it is possible to achieve it using shell / bash command line or any scripting language.
There is no simple solution. However mysql use putchar('\a') in its code to make a beep.
if (info_type == INFO_ERROR) {
if (!opt_nobeep) putchar('\a'); /* This should make a bell */
if (error) {
if (sqlstate)
(void)tee_fprintf(file, "ERROR %d (%s): ", error, sqlstate);
else
(void)tee_fprintf(file, "ERROR %d: ", error);
} else
tee_puts("ERROR: ", file);
}
If you compile mysql from the source you can use it everywhere in mysql-server/client/mysql.cc specially at the end of for loop in read_and_execute function.

ODBC data source of windows does not work

I allow myself to post my problem, having been looking for the solution for more than two hours, without finding the least solution.
Context: I want to connect to an Access database thanks to the PHP PDO. For that, I have the following code:
public function connect () {
$this->dsn = 'odbc:Driver={Microsoft Access Driver (*.mdb)};charset=UTF-8;Dbq='.$this->dbway.';Uid=;Pwd=;';
$this->user = '';
$this->password = '';
try {
$this->pdo = new PDO($this->dsn, $this->user, $this->password);
die("'eee");
}catch (\PDOException $e) {
die('Error : ' . $e->getMessage());
}
}
$this->dbway = absolute path to the .mdb database
When i try this, i've this response :
Error : : SQLSTATE[IM002] SQLDriverConnect: 0 [Microsoft][Gestionnaire de pilotes ODBC] Source de donnΘes introuvable et nom de pilote non spΘcifiΘ
Obviously, I tried to find the solution by searching the internet before.
I checked in the administration of ODBC data sources, in the "system data sources", I have:
Name: Microsoft Access Driver
Platform: 32 bits
Driver: Microsoft Access Driver (* .mdb)
So I tried to add the same thing in the user odbc data sources, without success.
I also tried to add the Microsoft Access Driver (* .mdb, * .accdb), which always returns the same error.
Moreover, I checked in php.ini and phpForApache.ini that extension = php_odbc.dll and extension = php_pdo_odbc.dll are really active in PHP extensions, and that's the case
I admit I do not know where to look, and where my concern might come from.
Knowing that the database is present, and that in the ODBC data sources, I see the driver in question, I do not understand why I still can not conquer me.
Thanks to those who will take the time to read me,
have a good day :)

Error: Cannot enqueue Query after fatal error in mysql node

I am using felixge/node-mysql. Also I am using express-myconnection which prevents mysql timeout and in turn prevents killing of node server. What I am doing is logging the activities in mysql. The scenario is I have a file upload functionality once the file is uploaded I am performing different operations on the file. During every stage of processing I am logging those activities in database. This works fine if the file is small. If the file is large say 100 MB it takes some time to load so in the mean time the mysql server reconnects and creates a new connection but the logging code still uses the old reference. Error: Cannot enqueue Query after fatal error. So, my question is is there a way that i can use the new connection reference instead of the old one. There is a single function in which all the different phases of activities regarding file takes place. Any help is greatly appreciated. thanks
Hi #paul, if you have seen the gist link you can see that I have the upload.on('begin', function (fileInfo, reqs, resp) { } where I have logged the activity that file upload process has begin. Once the file is uploaded upload.on('end', function (fileInfo,request,response) { } is triggered. I am also logging some activity here. As I said in my question, if the file is big the upload takes time. In the mean time a new MySql connection is created but the insert query in 'end' event still refers to the old myconnection. So, I wanted to know how can I use the new mysql connection reference in this scenario? I hope this has explained the scenario better.
Actually, I decided to google your error for you, and after reading this thread: https://github.com/felixge/node-mysql/issues/832 I realized that you're not releasing the connection after the first query completes, and so the pool never tries to issue you a new one. You were correct that the stale connection might be the problem. here's how you fix that if it is:
upload.on('begin', function (fileInfo, reqs, resp) {
var fileType = resp.req.fields.file_type;
var originalFileName = fileInfo.name;
var renamedFilename = file.fileRename(fileInfo,fileType);
/*renaming the file */
fileInfo.name = renamedFilename;
/*start: log the details in database;*/
var utcMoment = conf.moment.utc();
var UtcSCPDateTime = new Date( utcMoment.format() );
var activityData = {
activity_type : conf.LIST_UPLOAD_BEGIN,
username : test ,
message : 'test has started the upload process for the file',
activity_datetime : UtcSCPDateTime
};
reqs.params.activityData = activityData;
req.getConnection(function(err,connection) {
var dbData = req.params.activityData;
var activity_type = dbData.activity_type;
console.dir("[ Connection ID:- ] "+connection.threadId+' ] [ Activity type:- ] '+activity_type);
var insertQuery = connection.query("INSERT INTO tblListmanagerActivityLog SET ? ",dbData, function(err, result) {
if (err) {
console.log("Error inserting while performing insert for activity "+activity_type+" : %s ",err );
} else {
console.log('Insert successfull');
}
/// Here is the change:
connection.release();
});
});
/*end: log the details in database;*/
});
I fixed mine. I always suspect that when errors occur along with my queries it has something to do with the MySQL80 Service being stopped in the background. In case other solutions failed. Try going to the task manager, head to the services, find MySQL80 and check if it is stopped, when it is, click start or set it as automatic so that it will start at the moment desktop is running.
For pool connection to work we need to comment out https://github.com/pwalczyszyn/express-myconnection/blob/master/lib/express-myconnection.js#L84 this line. Hope it helps anyone facing the same issue.
Also we can use single connection option.
I had the same issue. Came across one solution -
Re-Install MySQl and while doing so, in the configuration step, select "legacy encryption" option instead and finish the installation.
Hope this helps!

Codeigniter : lock wait timeout exceeded, try restarting transaction

My Codeigniter Model Code is below
$last_qt_pk_id = "";
$i = 0;
foreach($query->result() as $row){
$data [] = $row;
$rq_pk_id = $row->id;
$question_type_pk_id = $row->question_type_pk_id;
if($question_type_pk_id != $last_qt_pk_id){
$i =1;
} else {
++$i;
}
$up_data = array('receive_serial_ato_qt'=>$i);
$this->db->where('id',$rq_pk_id);
$this->db->update('qms_received_question_info',$up_data);
$last_qt_pk_id = $question_type_pk_id;
}
My Above Code Firstly it do update, then the question list display in view.
My Code is working nicely but sometimes the problem/error is showing.
My Error is given below by image
I cannot understand that why is showing the error sometimes. If i restart xampp then it has ok for some time but after some time then the error is showing again. I have tried with wamp and xampp but it is showing same problem.
Please, any help?
This error is entirely MySQL not doing as it should. The best solution is to forget about MySQL and migrate to other SQL like PostgreSQL, but lacking this option, maybe the following will help you:
Performance blog post
SQL Server - fix
also consider increasing the "innodb_lock_wait_timeout" value, and stop using active records when working with transactions.
Personally i don't use active records as it takes a lot of memory and slows the performance time

SQL Server 2008 - Crash when opening recordset

I have to do some maintenance on a software that was delivered to a customer.
This software is using database and in order to do some debugging session on my computer, I had to install SQL server 2008 R2 and the two database (MyData and MyRecord) that are used by this software.
I had some troubles doing the setting (login, mapping of the database to sa user) but I managed to go over those issues.
Now I am trying to run the software but it crashes during initialization when it tries to open a recordset.
At first I do the following to connect to the database :
::CoInitialize(NULL);
try
{
HRESULT hr = pConnection.CreateInstance("ADODB.Connection");
if (SUCCEEDED(hr))
{
pConnection->ConnectionTimeout = 0;
CString strConnect;
strConnect.Format(_T("Data Source=MyRecord;uid=sa;pwd=sa123456;"));
hr = pConnection->Open((_bstr_t)strConnect,"","", -1);
}
}
with pConnection defined as :
_ConnectionPtr pConnection;
After that, I am trying to read some data from the database "MyRecord" with the following code :
CString sqlQuery = _T("select * from 通道1设置参数表");
try
{
pRecordset.CreateInstance(_uuidof(Recordset));
pRecordset->Open(_bstr_t(sqlQuery ),pConnection.GetInterfacePtr(),adOpenDynamic,adLockOptimistic,adCmdText);
}
catch(_com_error *e)
{
AfxMessageBox(e->Description());
}
with pRecordSet defined as :
_RecordsetPtr pRecordset;
When the line "pRecordset->Open(...)" is run, the software crashes in the function Recordset15::Open(...) of the msado15.tli file.
In this Recordset15::Open function, the raw_Open(...) function returns DB_E_NOTABLE.
However, I am sure that the table dbo.通道1设置参数表 exists in MyRecord database.
The error is :
I don't know if the problem lies in the SQL server configuration or in the code.
This code works perfectly well on the customer's PC so I would go with a configuration problem.
Thanks in advance !!
In the ODBC connector for this database, the setting "Change the default database to" was not set to the MyRecord database.
I have ticked the check-box, selected the database and now it is working correctly.
Your catch statement should be catch(_com_error & e)
MFC often throws exceptions by pointers, however _com_error is a reference.