Archive for April, 2006

Apache 2.0 and mod_plsql

Wednesday, April 26th, 2006

do not go together (yet).

Today I needed a standalone Apache and what seemed logical to me is that I installed it from the Application Server Companion CD (10.1.3). It never occurred to me that the Apache you get with your iAS is not the same you get when you install it from the Companion CD. The companion CD will give you Apache 2.0, which according to http://www.oracle.com/technology/products/ias/ohs/htdocs/ohs-1013-faq.pdf does not support mod_plsql, even thought the startpage says this at the bottom:

mod_plsql users should refer to the “Creating a DAD” section in the Oracle HTTP Server Standalone Administrator’s Guide Based On Apache 2.0.

(I haven’t been able to locate this guide yet)

Instead, there is an advanced option on the iAS installation CD, which lets you select a standalone webserver, which is indeed Apache 1.3.

Cloning your database

Monday, April 3rd, 2006

Today I wanted to run a copy of the database on my laptop on a machine at home, and this is what I did:

  • I logged onto the database as SYSDBA
  • I backed up my control files using ALTER DATABASE BACKUP CONTROLFILE TO TRACE RESETLOGS;

This resulted in the following script:

CREATE CONTROLFILE REUSE DATABASE "OLD_SID" RESETLOGS ARCHIVELOG
MAXLOGFILES 32
MAXLOGMEMBERS 2
MAXDATAFILES 32
MAXINSTANCES 16
MAXLOGHISTORY 1815
LOGFILE
GROUP 1 'E:ORACLEORADATAOLD_SIDREDO03.LOG'  SIZE 1M,
GROUP 2 'E:ORACLEORADATAOLD_SIDREDO02.LOG'  SIZE 1M,
GROUP 3 'E:ORACLEORADATAOLD_SIDREDO01.LOG'  SIZE 1M
DATAFILE
'E:ORACLEORADATAOLD_SIDSYSTEM01.DBF',
'E:ORACLEORADATAOLD_SIDRBS01.DBF',
'E:ORACLEORADATAOLD_SIDTEMP01.DBF',
'E:ORACLEORADATAOLD_SIDTOOLS01.DBF',
'E:ORACLEORADATAOLD_SIDINDX01.DBF',
'E:ORACLEORADATAOLD_SIDDR01.DBF',
'E:ORACLEORADATAOLD_SIDWORK01.DBF',
'E:ORACLEORADATAOLD_SIDTEMP02.DBF'
CHARACTER SET WE8ISO8859P1;
  • I changed REUSE to SET and added the extra datafiles that the database I want to copy has.
  • I shutdown the database
  • I copied the datafiles from the old database to the new
  • I started the database using STARTUP NOMOUNT
  • I ran the create controlefile statement
  • I tried to open the database using ALTER DATABASE OPEN RESETLOGS; This gave me this error:

SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: ‘C:ORACLEPRODUCT10.1.0ORADATAORCLSYSTEM01.DBF’

  • I solved this by recovering the database using one of the redologs :

SQL> recover database using backup controlfile;

  • and as the redolog I entered

C:oracleproduct10.1.0oradataorclREDO01.log
Log applied.
Media recovery complete.

  • I then shut the database down and started it up again:
    alter database open resetlogs;

This worked

(EDIT)

I discovered my temp tablespace didn’t have any files, so I added one with this command:

ALTER TABLESPACE TEMP ADD TEMPFILE ‘C:ORACLEPRODUCT10.1.0ORADATAORCLTEMP01.DBF’
SIZE 20971520  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;