Welcome

Wheresoever you go, go with all your heart. (Confucius)

10/25/2012

Fail to start Oracle Enterprise Manager 11g

I will post how to recover Oracle Enterprise Manager (OEM) for 11g when failing to start OEM after changing the password of sysdba. Normally OEM is working well. However, OEM has a problem after changing the password sometimes. To fix this problem, you can reconfigure the setting of OEM.
Here is a way.
First of all, type the following command.

oracle> emca -deconfig dbcontrol db
oracle> emctl start dbconsole
   -> after doing this command, if OEM is not working, try to run this command.
oracle> emca -config dbcontrol db

Enter the following information:
Database SID: bm
Listener port number: 1521
Listener ORACLE_HOME [ /db/app/oracle/product/11.2.0/dbhome_1 ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Enter your database SID, listener port, oracle home, and the passwords of SYS, DBSNMP, SYSMAN.
This command will reconfigure all the settings for OEM.

8/09/2012

Compile Qt 4.8.2 64bit library with Visual Studio 2010 Professional


Qt does not support 64bit library officially, but you can build that.
Although 64bit library is unstable, it is useful to establish 64bit environment with QT and Visual Studio 2010 professional. First of all, Visual Studio 2010 professional is installed on you system. Steps are as followings:
  1. Install Perl if Qt version is more than 4.8.0 because it use Perl to configure building.
  2. Download and install Qt libraries 4.8.2 for Windows (VS 2010).
  3. Open Visual Studio x64 Win64 Command Prompt (2010)
    • Location: Start->All Programs->Microsoft Visual Studio 2010->Visual Studio Tools->Visual Studio x64 Win64 Command Prompt (2010)
  4. Set up environmental variables
    > Set QTDIR=C:\Qt\4.7.1
    > Set QMAKESPEC=win32-msvc2010
  5. Update PATH variable to include %QTDIR%\bin in System environments
  6. Download the latest version of jom which speeds up Visual C++ Qt Builds by supporting parallel processes.
  7. Extract jom files to C:\Qt\jom folder
  8. Run following commands in it (every line is a different command: type it then press Enter):
    > cd c:\Qt\4.7.1
    > configure -debug-and-release -opensource -platform win32-msvc2010 -opengl desktop
    > ..\jom\jom.exe -j N
    Where N is number of CPU cores you want to utilize for Qt compilation. Larger is better.

  9. Run the following command. 
    • > ..\jom\jom.exe clean
    • One can safely shrink its size by deleting temporary files created during the process.  Note that PDB files will be deleted too. 
  10. Download and install Qt Visual Studio Add-in.
  11. Run Visual Studio 2010. Integrate just compiled Qt to IDE using menu Qt > Qt Options > Qt Versions > Add

Remarks

* Jom is nmake replacement for Qt compilation on multi-core CPU. Its parameter -j N allows to setup number of parallel processes for compilation. Number of physical CPU cores is a good choice for N.

6/19/2012

[Oracle] Identify the locked row id in table described

This sql will get locked id in Table <table_name>

select dbms_rowid.rowid_create(1,row_wait_obj#, row_wait_file#, row_wait_block#, row_wait_row#) from v$session where sid = (select s.sid from dba_objects,  v$lock s where object_id = s.ID1 and object_name = '<table_name>');

5/25/2012

Environment variables on Oracle 11g Release 2

  • Setting up environment variables

$ vi .bashrc
# add ORACLE_HOME, ORACLE_BASE and ORACLE_SID
# example
export ORACLE_BASE=/db/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=oracle_sid


  • Test

$ sqlplus /nolog
SQL> connect / as sysdba
SQL>  startup
ORA-01078: failure in processing system parametersLRM-00109: could not open parameter file 'anywhere'
If you are facing the above error while startup of oracle, possible reasons might be the init{ORACLE_SID}.ora file not accessible by oracle user. To solve this problem, you can get your pfile at the location $ORACLE_BASE/admin/$ORACLE_SID/pfile/. A typical file name is init.ora.{NUMBER}. From that location, make a spfile by the following:
$ORACLE_BASE=/db/app/oracle/ and $ORACLE_SID=ora_sid
$sqlplus /nolog
SQL> connect / as sysdba
SQL> create spfile from pfile='/db/app/oracle/admin/ora_sid/pfile/init.ora.{NUMBER}
   File created.
SQL> startup

Using Key simulation in MFC

Sometimes, we need to send keys to another process when developing MFC application.
We called sending keys "Key simulation"
For this purpose, we can use the function "SendInput" as a function of MFC.
Here I will describe an example. So, see the function description.


We have to get a window handle to send keys.
In MFC, there are several methods for this. Here I will use FindWindowEx method.
When finding the specific window handle, you can describe "class name" or "Window title name"
I think "Window title name" is more convenient.

// Get window handle

HWND hWindow = ::FindWindowEx(NULL, NULL, "Class Name", 0);
or
HWND hWindow = ::FindWindowEx(NULL, NULL, 0, "Window title name");

// Get thread and process id

PROCESS_INFORMATION pi;
pi.dwThreadId = ::GetWindowThreadProcessId(hWindow, &(pi.dwThreadId));

SendKey(WORD('A'), MapVirtualKey('A',0), pi);


Refer two methods 'SendKey' and 'SendCtrlShiftKey'


void SendKey(WORD vk, WORD scan, PROCESS_INFORMATION pi)
{

INPUT is;

is.type = INPUT_KEYBOARD;  //INPUT_KEYBOARD = 1
is.ki.time = 0;

is.ki.wVk = vk;
is.ki.wScan = scan;
is.ki.dwFlags = NULL;
is.ki.dwExtraInfo = NULL;

SendInput(1, &is, sizeof(INPUT)); // Key down
WaitForInputIdle( pi.hProcess, INFINITE );

is.ki.wVk = vk;
is.ki.dwFlags = KEYEVENTF_KEYUP;
is.ki.wScan = scan;
is.type = INPUT_KEYBOARD;

SendInput(1, &is, sizeof(INPUT)); // Key up
WaitForInputIdle( pi.hProcess, INFINITE );
}


void SendCtrlShiftKey(WORD vk, PROCESS_INFORMATION pi)
{
INPUT inp[6];
short Ecnt = 0x00;


// VK_CONTROL down.
inp[0].ki.time = NULL;
inp[0].type = INPUT_KEYBOARD;
inp[0].ki.dwExtraInfo = NULL;
inp[0].ki.dwFlags = NULL;
inp[0].ki.wVk = VK_CONTROL;
inp[0].ki.wScan = MapVirtualKey(VK_CONTROL,0);

// VK_SHIFT down.
inp[1].ki.time = NULL;
inp[1].type = INPUT_KEYBOARD;
inp[1].ki.dwExtraInfo = NULL;
inp[1].ki.dwFlags = NULL;
inp[1].ki.wVk = VK_SHIFT;
inp[1].ki.wScan = MapVirtualKey(VK_SHIFT,0);

// Character Key down.
inp[2].ki.time = NULL;
inp[2].type = INPUT_KEYBOARD;
inp[2].ki.dwExtraInfo = NULL;
inp[2].ki.dwFlags = NULL;
inp[2].ki.wVk = vk;
inp[2].ki.wScan = MapVirtualKey(vk,0);

// VK_CONTROL up.
inp[3].ki.time = NULL;
inp[3].type = INPUT_KEYBOARD;
inp[3].ki.dwExtraInfo = NULL;
inp[3].ki.dwFlags = KEYEVENTF_KEYUP;
inp[3].ki.wVk = VK_CONTROL;
inp[3].ki.wScan = MapVirtualKey(VK_CONTROL,0);

// VK_SHIFT up.
inp[4].ki.time = NULL;
inp[4].type = INPUT_KEYBOARD;
inp[4].ki.dwExtraInfo = NULL;
inp[4].ki.dwFlags = KEYEVENTF_KEYUP;
inp[4].ki.wVk = VK_SHIFT;
inp[4].ki.wScan = MapVirtualKey(VK_SHIFT,0);

// Character Key up.
inp[5].ki.time = NULL;
inp[5].type = INPUT_KEYBOARD;
inp[5].ki.dwExtraInfo = NULL;
inp[5].ki.dwFlags = KEYEVENTF_KEYUP;
inp[5].ki.wVk = vk;
inp[5].ki.wScan = MapVirtualKey(vk,0);



SendInput(1,inp,sizeof(INPUT)); // VK_CONTROL down
WaitForInputIdle( pi.hProcess, INFINITE );

SendInput(1,&inp[1],sizeof(INPUT)); // VK_SHIFT down
WaitForInputIdle( pi.hProcess, INFINITE );

SendInput(1,&inp[2],sizeof(INPUT)); // Key down
WaitForInputIdle( pi.hProcess, INFINITE );

SendInput(1,&inp[5],sizeof(INPUT)); // Key up
WaitForInputIdle( pi.hProcess, INFINITE );

SendInput(1,&inp[4],sizeof(INPUT)); // VK_SHIFT up
WaitForInputIdle( pi.hProcess, INFINITE );

SendInput(1,&inp[3],sizeof(INPUT)); // VK_SHIFT up
WaitForInputIdle( pi.hProcess, INFINITE );
}

Cydia

[Cydia Source List]

http://sinfuliphonerepo.com
http://cydia.hackulo.us
http://repo.hackyouriphone.org
http://repo.biteyourapple.net
http://cydia.xsellize.com
http://repo.insanelyi.com

[Essential applications]
1. mobileterminal: change password [alpine]
2. OpenSSH
3. SBSetting
4. CyDelete
5. afc2add
6. Installous 4
7. AppSync 5.0+
8. iFile