Cloning a db in 'noarchivelog' mode using 'create controlfile set database' option

Cloning a db in ‘noarchivelog’ mode on the same server without using ‘rman’ backups and duplicate option.



1. Identify the list of data files, control files, redo logs of the db to be cloned
2. Create backup control file from trace
3. Create pfile from spfile (if it’s not already available)
4. Copy it as init.ora and edit the below
               a. Path of ‘control files’ to reflect the new directory path
               b. dump directories etc
               c. db_name is set to “clonedb”
5. alter system switch logfile
6. shutdown immediate
7. cp –rp  datafiles and redologs to the new clonedb path
8. edit the original control file from the trace from step 2 above
similar to below
CREATE CONTROLFILE SET DATABASE "" RESETLOGS NOARCHIVELOG
......
.......
LOGFILE
GROUP 1 '/u01/oradata//clonedb/redo01.log' SIZE 50M,
........
DATAFILE
/u01/oradata/clonedb/system01.dbf,
......
.......
CHARACTER SET WE8ISO8859P1;
RECOVER DATABASE USING BACKUP CONTROLFILE;
ALTER DATABASE OPEN RESETLOGS;
ALTER TABLESPACE TEMP ADD TEMPFILE ‘/u01/oradata/clonedb/temp01.dbf,
SIZE ......;


9. export ORACLE_SID=clonedb
10. sqlplus /nolog
startup nomount pfile=’path to edited init.ora’ from step 4 above
11. Run the create-controlfile script prepared at step 8
12. Create spfile from pfile
13. Shutdown immediate
14. Create password file
15. Startup
16. Show parameter db_name


The above process doesn’t change the ‘dbid’ and if that too needs to be changed, we need to use dbnewid (nid) utility.


The only reason you need to copy the redologs too is if the 'recover using backup contolfile' does ask for a change in the redolog, you need to manually provide the path of the redolog.
If you switch the logfile prior to shutdown, it won't be required but it's better to copy them anyway.


Installing Oracle Developer Suite on Windows 7

Was recently trying to install Oracle Developer Suite 10.1.2.0.2 on a new Windows 7 64bit laptop and the Universal Installer was exiting with failed OS pre-requisite checks...and here's the procedure to make it work.


  • right-click on setup -àtroubleshoot compatibility -àTroubleshoot program
  • Click on the check box “The program worked in earlier versions of Windows but won’t install or run now...”
  • On screen “Which version of windows did this program work on before...”...I selected Windows XP service pack 2
  • Then click “Test compatibility settings for the program...”
  • It’ll come back with “Settings applied” windows compatibility mode windows XP (Service Pack 2)
  • Click on "Start the program"
  • Click “Next...” and then once the Universal Installer launched successfully...just click on 'yes save these settings for this program' and close the troubleshooter.

And half way through the installation it complained “install has encountered an error while attempting to verify your virtual memory settings...pls verify that the sum of the initial sizes of the paging file is at least 256 MB.” and the fix was to update the page file size by uncheck the ‘automatically manage paging file size for all drives’ and set the value using ‘custom size’ setting with a minimum value above the value in the error.

After this step...it complained again for the environment variable ‘PATH’ being more than 1023 characters...and had to clean up some of the values from the PATH variable and the installation finished successfully.




RAC to Single Instance conversion...

Had this requirement recently to convert a RAC to Single Instance DB and here's process that worked for me...btw..this is a 10.2.x cluster.

  • backup the db's
  • shutdown the cluster db's using 'srvctl stop database '
  • check the status of nodeapps using 'srvctl status nodeapps -n '
  • stop the nodeapps on all the nodes 'srvctl stop nodeapps -n '...repeat this for all the nodes
  • stop the cluster CRS services as root..'/etc/init.d/init.crs stop'
  • gather the patches installed using 'opatch lsinventory'
  • shutdown the nodes ...and restart the node that will be used for single instance db's.
  • present the storage to this single node as ext3 filesystems
  • verify all the filesystems are present ....
  • rename the oracle_home directory ...say db_1 as db_1.RAC (if you need to drop the home for space reasons, make sure you backup the tns file for ref.)
  • reinstall the single instance binaries
  • apply all the interim patches (using the info collected above using lsinventory)
  • remove all the cluster related settings from the old init.ora
  • change the cluster_database=false and cluster_database_instances=1
  • startup the instance using the modified pfile
  • disable thread 2 using 'alter database disable thread 2'
  • drop the log groups belonging to thread 2...and 3...etc (you may need to switch the logs if the archived=NO
  • drop the thread 2 undo tablespace
  • run a 'show parameter cluster' to verify there're no references to instance 2
  • shutdown immediate
  • create spfile from pfile;
  • startup
  • create the listener
  • update the tnsnames.ora as required
  • update the oracle autostart scripts as required

OWB 11.2.0.2 upgrade issues

We were trying to upgrade our OWB installation from 10.2.0.5 to 11.2.0.2 and during the repository export phase, it's constantly hanging at 95%. It hangs at the same point (95%) every time we try the export and the object it's struck at is "wb_rt_audit_scripts" table.


We tried to increase the java heap size to 1280M as suggested in one of the metalink notes by modifying the -Xmx setting in the 'reposinst.sh' script however that didn't resolve the hang issue.


Further analysis suggested the clob column 'script' in the wb_rt_audit_scripts table is quite large...around 900M in our db...so we then purged the audit data using purge_audit_template.sql which is available under /rtp/sql directory (from the source 10.2 path).





The options that we used were as below...

@purge_audit_template.sql rep_owner DEPLOYMENT ALL null null


@purge_audit_template.sql MY_RUNTIME EXECUTION "number_task_errors > 0" null null



After running the above, we then shrink the lob using

alter table rep_owner.wb_rt_audit_scripts modify lob(script) (shrink space);



And that released the space back into the tablespace.



After this step...we tried the export and it finished quite quickly and the issue is resolved.





ORA-16047:DGID mismatch between destination setting and standby

ORA-16047:DGID mismatch between destination setting and standby

PING[ARC2]: Heartbeat failed to connect to standby '(DESCRIPTION=(ADDRESS_LIST=(
ADDRESS=(PROTOCOL=tcp)(HOST=xxxxx)(PORT=xxxx)))(CONNECT_DATA=(SERVICE_NAME=
xxxxx_XPT)(INSTANCE_NAME=xxxxxx)(SERVER=dedicated)))'. Error is 16047

You may've come across this error message in v$dataguard_status a few times if you've implemented dataguard and if the network connectivity is ok, it's a bit difficult to troubleshoot.

One solution I've implemented to success a few times so far is to verify the status of standby 'dest_id' in v$archive_dest view on primary database.

On primary, execute the query select dest_id,status from v$archive_dest;

If the status is 'DISABLED' or 'ERROR', then run 'alter system set log_archive_dest_state_2='ENABLE' scope=both' on primary.

This will fix the above mentioned error and the log shipping/apply will start happening resolving any gaps automatically.

if you do a "show parameter log_archive_dest_state_2" on primary it shows enable even though the actual status is 'DISABLED' from the dynamic view v$archive_dest.