Posted by arpz on Jan 14, 2010 in
DBA,
Oracle
My last post about Turn on/off RAC basically is to implement Converting/Migrating Oracle RAC to Single instance. I try to find a way to do this in Google but it seem no result regarding this. You can find thousand of article on converting Single Instance to Oracle RAC but not the other way around. Why?
You'll find a Doc. on Metalink with step by step instructions on "How to convert a
single instance Database to RAC", but not the other way round.
The analyst's response from Oracle is "We cannot convert a RAC database into a Single
instance database, that is the reason why you didnt find any steps.
It is not supported.
Why Oracle mentioned it is not supported? It does not makes any sense that you cannot convert from RAC to non-RAC environment, unless Oracle does not want their customers to go away from RAC.
Anyway…it’s all about $$$$$.
So, based on my knowledge on how Oracle RAC work, I’ve successfully done it.
This is based on Oracle 10G Release 2 and assumes:
1. Oracle RAC running with cluster file system
2. You have basic knowledge about Oracle RAC
Test Server:
OS : Red Hat Enterprise Linux Server release 5.4
Database Version : 10.2.0.4
File system: OCFS2
1. Stop database and CRS on both node
$ srvctl stop database -d mydb
# crsctl stop crs
2. Turn Off RAC
SQL> startup
ORA-29702 error occurred in Cluster Group Service operation
Relink with the RAC OFF.
$ cd $ORACLE_HOME/rdbms/lib
$ /usr/ccs/bin/make -f ins_rdbms.mk rac_off
Relinking oracle
$ make -f ins_rdbms.mk ioracle
## OR , both working fine
$ cd $ORACLE_HOME/bin
$ relink oracle
If ASM Instance Exist, run below command as root
# /oracle/product/10.2.0/db/bin/localconfig delete
# /oracle/product/10.2.0/db/bin/localconfig add
3. Parameter(Pfile/spfile) & database changes
SQL> startup
SQL> alter database disable thread 2;
SQL> alter system set remote_listener='';
3a. Remove unwanted logfile
SQL> select thread#, group# from v$log;
SQL> alter database drop logfile group 3;
SQL> alter database drop logfile group 4;
3b. Remove unwanted tablespace
SQL> drop tablespace UNDOTBS2 including contents and datafiles;
3c. Rename instance name.
SQL> alter system set instance_name=<new_name> scope=spfile;
SQL> shutdown immediate
SQL> startup
- Change your ORACLE_SID environment
4. Run $ORA_CRS_HOME/install/rootdelete.sh on both node
- This will stop and remove all CRS startup related file
5. Remove $ORA_CRS_HOME binary using Clusterware OUI installer
- Ignore any error if 2nd node already down
- rm -rf $ORA_CRS_HOME
6. Modify listener file
$ vi $ORACLE_HOME/network/admin/listener.ora
6a. Modify tnsname file
$ vi $ORACLE_HOME/network/admin/tnsnames.ora
Tags: migration, Oracle, rac
Posted by arpz on Nov 17, 2009 in
DBA,
Oracle
Today I’ve completed Oracle RAC installation on AIX 5.3 machine. Lot of thing I don’t know about AIX. Can’t play around with this Os as we need the machine itself. Not like Sun OS, available for x86.
Few things I take note during the installation,
1. Make sure all packages installed
2. Prepare enough space for /tmp
3. There is no unzip in AIX by default
4. HACMP is not mandatory
5. No issue if Major and Minor number not same for OCR and VOTING, mknod c M m. Should be fine.
6. There is a bug if you installed 10.2.0.3. So patch it to 10.2.0.4 (That’s is what I did) even the requirement from client is 10.2.0.3.
That’s all, can’t capture the screen shot of everything. Need to installed from console. Bla bla bla from client when asking to remote.
Tags: aix, Oracle, rac
Posted by arpz on Jul 2, 2009 in
DBA,
Oracle
When a node in RAC stops & re-start, oracle clusterware try to start the instance as soon as node starts. This may not be desirable, because instance start-up may fail, if system components on which instance depends are not ready
For example: Volume Manager is not started, file system is not mounted automatically
This scenario might occur, if oracle clusterware does not manage system components.
To manager automatic restart, we can use AUTO_START attribute.
AUTO_START parameter may have three values
1. always (1)
2. restore (0)
3. never (2)
How to change this parameter?
$ crs_stat -p <resource name> <filename>.cap
then change AUTO_START to a new value
$ vi <filename>.cap
$ crs_register -u <resource name >
verify the change by
$ crs_stat -p <resource name >
BTW, this method can be used for any resource. Just make sure you know what you’re doing.Backup the crs and you can messup with the CRS. Good luck with that.
Tags: crs, Oracle, rac
Posted by arpz on Mar 11, 2009 in
DBA,
Oracle
While I was implementing rac, I notice some of the service were online and some were unknown. I try to start the service itself, it didn’t start and ‘placement’ error showed up. This happend because when trying to start the crs with the crsctl start crs command on both nodes, there was not enough time between the start process.
I manage to solve this by try and error method. Not an issue because this is only test rac environment, not production.
$ crs_stat -t
Name Type Target State Host
————————————————————
ora….SM1.asm application ONLINE ONLINE innotiive01
ora….01.lsnr application ONLINE ONLINE innotiive01
ora….e01.gsd application ONLINE UNKNOWN innotiive01
ora….e01.ons application ONLINE ONLINE innotiive01
ora….e01.vip application ONLINE ONLINE innotiive01
ora….SM2.asm application ONLINE ONLINE innotiive02
ora….02.lsnr application ONLINE ONLINE innotiive02
ora….e02.gsd application ONLINE UNKNOWN innotiive02
ora….e02.ons application ONLINE UNKNOWN innotiive02
ora….e02.vip application ONLINE ONLINE innotiive02
ora.orcl.db application ONLINE ONLINE innotiive02
ora….l1.inst application ONLINE ONLINE innotiive01
ora….l2.inst application ONLINE UNKNOWN innotiive02
ora…._taf.cs application ONLINE UNKNOWN innotiive02
ora….cl1.srv application ONLINE UNKNOWN innotiive01
ora….cl2.srv application ONLINE UNKNOWN innotiive02
when you try to start any of the services, it will gave placement error. To view the real name of the services, just issue crs_stat command.
$./crs_start ora.orcl.orcl_taf.orcl2.srv
So, in order to make all the services goes back online, we must shutdown/startup back all the services in the correct order. I’m executing the command one by one on node 1.
Stop procedure
1. stop taf service
$ srvctl stop service -d orcl -s orcl_taf
2. stop instance
$ srvctl stop instance -d orcl -i orcl1
$ srvctl stop instance -d orcl -i orcl2
3. stop asm
$ srvctl stop asm -n innotiive01
$ srvctl stop asm -n innotiive02
4. stop nodeapps
$ srvctl stop nodeapps -n innotiive01
$ srvctl stop nodeapps -n innotiive02
At this point, all the services will be in offline state. Let’s start it back. Remember, execute one by one the command at node 1.
$ crs_stat -t
Name Type Target State Host
————————————————————
ora….SM1.asm application OFFLINE OFFLINE
ora….01.lsnr application OFFLINE OFFLINE
ora….e01.gsd application OFFLINE OFFLINE
ora….e01.ons application OFFLINE OFFLINE
ora….e01.vip application OFFLINE OFFLINE
ora….SM2.asm application OFFLINE OFFLINE
ora….02.lsnr application OFFLINE OFFLINE
ora….e02.gsd application OFFLINE OFFLINE
ora….e02.ons application OFFLINE OFFLINE
ora….e02.vip application OFFLINE OFFLINE
ora.orcl.db application OFFLINE OFFLINE
ora….l1.inst application OFFLINE OFFLINE
ora….l2.inst application OFFLINE OFFLINE
ora…._taf.cs application OFFLINE OFFLINE
ora….cl1.srv application OFFLINE OFFLINE
ora….cl2.srv application OFFLINE OFFLINE
Start procedure
1. start nodeapps
$ srvctl start nodeapps -n innotiive01
$ srvctl start nodeapps -n innotiive02
2. start asm
$ srvctl start asm -n innotiive01
$ srvctl start asm -n innotiive02
3. start instance
$ srvctl start instance -d orcl -i orcl1
$ srvctl start instance -d orcl -i orcl2
4. start taf
$ srvctl start service -d orcl -s orcl_taf
Actually for taf service, I’m not sure when to start/stop it first. I can’t find any information regarding this. But this procedure work fine with my rac.
Tags: Oracle, oracle 10g rac, rac