Tuesday, 26 August 2014

Installing WAMP on Windows server 2003

I have downloaded WAMP, and am preparing to install in on my new VS. Plenty of detail to follow.

Installing WampServer 2
c:/wamp
creating Quick Launch and desktop icons
specified localhost as SMTP mail server (will probably update this later)
specified my work email as the admin. email

now have a c:\wamp folder that is 221 MB

1st problem - did not take long! WAMP SERVER is not loading after the install.

I check in the servers application error

Start|Programs|Admin Tools|Computer Management

and saw an error:

Faulting application wampmanager.exe, version 1.6.1.33...

Did a little googling and found this forum - that said you need to install this other MS program called Visual C++ 2008. I went to the download page, downloaded and installed. No reboot necessary. Launched the WAMP server again, and it is up and running.

There is an icon in my system tray for WAMP 2.2.

Second Problem #2, when I browsed my localhost, the page did not load. I am using IE, since that come with the server. IE would say "page not found". I eventually realized that Apache was not yet active. I found this by using the Wamp icon hovering 0ver Apache folder and then Service and seeing that the service was not running. I used option in the Wamp Apache menu option Test Port 80, a DOS like window opened and said port 80 not being used and would set Apache up to use it.

After setting up port 80, my Wamp icon in the system tray turned from red to green, nice visual. that was encouraging.

I loaded my localhost (actually had to use the localhost IP, http://127.0.0.1/) page in IE again and this time got the Wamp server summary page, yea.



I had been messing with the content setting in the browser prior to realizing Apache was not working. In IE 8. under Tools|Options|Connections|Lan settings - I had enabled the Proxy server settings. I disabled them and now both the ip and localhostload the summary page above.

Clicking the phpinfo() function on the summary page shows useful php information.

The next thing I wanted to do was create a php script and run it in the browser.

I downloaded notepad ++, as a nice light editor for use on the server. Then created a new php file with some basic scripting inside, saved it to the www root folder and loaded the file. Everything seems in order, the php executed as expected.

Saturday, 23 August 2014

JavaScript- onClick enable/disable radio buttons of same id but diffrent name

<script type="text/javascript">
  function Miracle() {
 var radio=document.getElementById('A');
 var len=form.A.length;
  for(var i=0; i<len; i++) {
  if(form.A[i].checked) {
  form.A[i].disabled=false; }
else
   { form.A[i].disabled=true; }
              } }
 </script>

<html>
<form id="form" name="form" method="post" action="action.php">
  <p>
    <label>
      <input type="radio" name="Radio1" value="radio" id="A" />
      Radio</label>
    <br />
    <label>
      <input type="radio" name="Radio2" value="radio" id="A" />
      Radio</label>
    <br />
    <label>
      <input type="radio" name="Radio3" value="radio" id="A" />
      Radio</label>
    <br />
    <label>
      <input type="radio" name="Radio4" value="radio" id="A" />
      Radio</label>
    <br />
    <label>
      <input type="radio" name="Radio5" value="radio" id="A" />
      Radio</label>
    <br />
    <label>
      <input type="radio" name="Radio6" value="radio" id="A" />
      Radio</label>
    <br />
  </p>
</form>

</html>

JavaScript- enable/ disable all radio buttons of a form

<HTML>
<Head>
<Script Language=JavaScript>

function Radios(isForm){

nElements = isForm.length;
for (i=0; i<nElements; i++)
{if (isForm[i].type == "radio"){isForm[i].disabled = true /false}}
}

</Script>
</Head>
<Body>
<Form name='Form1'>
<input type="radio" name="Product_1" value="1" id="q21">1
<input type="radio" name="Product_1" value="2" id="q21">2
<input type="radio" name="Product_1" value="3" id="q21">3<br>

<input type="radio" name="Product_2" value="1" id="q22">1
<input type="radio" name="Product_2" value="2" id="q22">2
<input type="radio" name="Product_2" value="3" id="q22">3<br>

<input type="radio" name="Product_3" value="1" id="q23">1
<input type="radio" name="Product_3" value="2" id="q23">2
<input type="radio" name="Product_3" value="3" id="q23">3<br>

<input type="radio" name="Product_4" value="1" id="q24">1
<input type="radio" name="Product_4" value="2" id="q24">2
<input type="radio" name="Product_4" value="3" id="q24">3<br>
<br>
<input type=button value="Disable All Radio" onclick="Radios(this.form)">
</Form>
</Body>
</HTML>

Saturday, 16 August 2014

ORA-01033: ORACLE initialization or shutdown in progress

Actually , while trying to find out the problem , the archive log was full and removed some of the archived log file to create the space Now another problem came i.e. oracale initalization or shutdown in progress.
Solution 1:
if you have a backup of the database + archive logs: restore and recover
without backup, the tablespace became useless: drop it while in mount mode, then open the database
i.e.
sqlplus /nolog
SQL> connect / as sysdba
SQL> shutdown abort
SQL> startup nomount
SQL> alter database mount;
SQL> alter database open;

Sometime the above syntax dont work resulting the following error
ORA-00600: internal error code, arguments: [kcratr1_lostwrt]
Under this situation follow the following steps:
SQL> startup mount

ORACLE Instance started

SQL> recover database 

Media recovery complete

SQL> alter database open

Database altered

Friday, 15 August 2014

ORA-01172: recovery of thread 1 stuck at block 224 of file 3

ORA-01172: recovery of thread 1 stuck at block 224 of file 3

ORA-01151: use media recovery to recover block, restore backup if needed


When starting the database I got error above

SQL> startup
ORACLE instance started.

Total System Global Area  417546240 bytes
Fixed Size                  2227080 bytes
Variable Size             310379640 bytes
Database Buffers          100663296 bytes
Redo Buffers                4276224 bytes
Database mounted.
ORA-01172: recovery of thread 1 stuck at block 224 of file 3
ORA-01151: use media recovery to recover block, restore backup if needed

Solution - According to the error you should contact oracle support, but this is what I did

Find name of the file having problem

select name,status,enabled from v$datafile where file#=3;

/u01/app/oracle/oradata/XE/undotbs1.dbf


SQL> recover datafile 3;
Media recovery complete.

SQL> alter database open;

Database altered.