Summary

 

Certificate of Oracle enterprise manager expired on December 2010. This means we have to install a patch that creates a new certificate with 10 years Validity.

Steps:

 

When there is need to reconfigure enterprise for some reason and you have a 10g database you will get stuck with configuring EM. You won’t be able to start dbconsole. The reason is because the certificate that enterprise manager uses has expired.

To fix this issue you’ll have to install a patch.

Check Metalink and look for:

Patch 8350262: CREATE DBCONSOLE CERT WITH  10 YEAR VALIDITY

There are some preinstall steps you have to keep in mind.

-         Check what Opatch version you have, you need the same version as your database. For example: if your database is version 10.2.0.3 your Opatch version should also be 10.2.0.3.
You can check this by typing the following command:
./opatch lsinventory

Issue this command in the $ORACLE_HOME/OPatch/

-         Create a location for your zipped patch

unzip -dp8350262_102040_Generic.zip

Patch Installation Steps:

————————-

1. Shutdown DB Console using the following command.
% $ORACLE_HOME/bin/emctl stop dbconsole

2. Set your current directory to the directory where the patch is located:

% cd <PATCH_TOP>/8350262

Ensure that the directory containing the opatch script appears in
your $PATH; then enter the following command:

% opatch apply

3. Start EM DB Console using the following command
% $ORACLE_HOME/bin/emctl start dbconsole

When installed drop and recreate dbconsole.
Done!

It’s easy to duplicate a database with RMAN. Since Oracle 10g it will even create the duplicate database for you — you only have to create the instance.

Setup auxiliary instance:
1. Create admin directory under $ORCLE_BASE/admin and password file
2. Register duplicate database in TNS and listener, $TNS_ADMIN/tnsnames.ora and $TNS_ADMIN/listener.ora
3. Create a the parameter file init.ora to start the instance, don’t forget to set DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT

Directory naming example:
• ORACLE_BASE = /oracle
• ORACLE_HOME = $ORACLE_BASE/ 10.2.0
• TNS_ADMIN = $ORACLE_HOME/network/admin

SQL> show parameter file_dest

NAME TYPE VALUE
———————————— ———– ——————————
db_create_file_dest string /oradata2/EX1DUPL/EX1DUPL/
db_recovery_file_dest string /u02/app/oracle/fra
db_recovery_file_dest_size big integer 2G

Step 1
1. mkdir /oracle/10.2.0/admin/EX1DUPL

Step 2
Edit $TNS_ADMIN/tnsnames.ora and add the duplicate database:
EX1DUPL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = **********-vip.***********.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = EX1DUPL.******.com)
(INSTANCE_NAME = EX1DUPL)
(UR = A)
)
)
Add an entry to the Oracle listener, for example:
LISTENER_AMCMTSTRAC01 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ************-vip.********.com)(PORT = 521)
(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =************)(PORT = 1521)(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
and restart the listener:
1. lsnrctl stop
2. lsnrctl start

Step 3
Create the parameter file /oracle/10.2.0/db_1/dbs / initEX1DUPL.ora.
Take care and look for EX1DUPL string in the values and change them to reflect your naming.

This is for 10g:
EX1DUPL.__db_cache_size=377487360
EX1DUPL.__java_pool_size=4194304
EX1DUPL.__large_pool_size=4194304
EX1DUPL.__shared_pool_size=142606336
EX1DUPL.__streams_pool_size=0
*.audit_file_dest=’/oracle/10.2.0/admin/EX1DUPL/adump’
*.background_dump_dest=’/oracle/10.2.0/admin/EX1DUPL/bdump’
*.compatible=’10.2.0.3.0′
*.control_files=’/oradata2/EX1DUPL/EX1DUPL/control01.ctl’,’/oradata2/EX1DUPL/EX1DUPL/control02.ctl’,’/oradata2/EX1DUPL/EX1DUPL/control03.ctl’
*.core_dump_dest=’/oracle/10.2.0/admin/EX1DUPL/cdump’
*.db_block_size=8192
*.db_domain=’chellomedia.com’
*.db_file_multiblock_read_count=16
*.db_name=’EX1DUPL’
*.dispatchers='(PROTOCOL=TCP) (SERVICE=EX1DUPLXDB)’
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=402653184
*.processes=150
*.remote_login_passwordfile=’EXCLUSIVE’
*.sga_target=536870912
*.undo_management=’AUTO’
*.undo_tablespace=’UNDOTBS1′
*.user_dump_dest=’/oracle/10.2.0/admin/EX1DUPL/udump’
*.db_file_name_convert=(/u01/oradata/EX/,/oradata2/EX1DUPL/EX1DUPL/)
*.db_file_name_convert=(/oradata2/EX/,/oradata2/EX1DUPL/EX1DUPL/)
*.db_file_name_convert=(/oralog/tempfile/,/oradata2/EX1DUPL/EX1DUPL/)
*.log_file_name_convert=(/u01/oradata/EX/,/oradata2/EX1DUPL/EX1DUPL/)
*.log_file_name_convert=(/u03/oradata/EX/,/oradata2/EX1DUPL/EX1DUPL/)

and set the parameters DB|LOG_FILE_NAME_CONVERT to reflect changes in names for logfiles datafiles.
This is neccessary as the control files restored from backup contain paths to the original locations — and you want to access new files and don’t want to access or even overwrite the original ones. It’s very important if the duplicate database is on the same system as the original database.
The values in *_FILE_NAME_CONVERT consist of a simple list containing a pair of mappings: OLD_PATH, NEW_PATH[, OLD_PATH, NEW_PATH ...] .
*.db_file_name_convert=(/u01/oradata/EX/,/oradata2/EX1DUPL/EX1DUPL/)
*.db_file_name_convert=(/oradata2/EX/,/oradata2/EX1DUPL/EX1DUPL/)
*.db_file_name_convert=(/oralog/tempfile/,/oradata2/EX1DUPL/EX1DUPL/)

*.log_file_name_convert=(/u01/oradata/EX/,/oradata2/EX1DUPL/EX1DUPL/)
*.log_file_name_convert=(/u03/oradata/EX/,/oradata2/EX1DUPL/EX1DUPL/)
For 11g replace sga_target = 150m with memory_target = 180m and all three *_dump_dest parameters with diagnostic_dest = ‘ /oracle/admin/EX1DUPL’.
To be able to login AS SYSDBA via TNS, create a password file. This file has to be named orapwEX1DUPL and must be in directory $ORACLE_HOME/dbs. The password must be exactly like the one for the user SYS:
1. orapwd file=$ORACLE_HOME/dbs/orapwEX1DUPL password=oracle

Duplicate:

You might a new/fresh backup before you can use the DUPLICATE TARGET DATABASE command.
To duplicate a database, run the DUPLICATE TARGET DATABASE command. RMAN will automatically create the auxiliary database itself, the only thing needed is to start the Oracle instance in NOMOUNT mode before.
Take care of your ORACLE_SID and RMAN CONNECT strings.

Auxiliary:
1. export ORACLE_SID=EX1DUPL
2. $ sqlplus / as sysdba
3. SQL> startup nomount
( if listener BLOCKS the connection, start the instance like normal and shutdown and startup nomount )

Duplicate the database ORIGDB to EX1DUPL:
1. rman TARGET sys/*******@EX1 AUXILIARY sys/*******@EX1DUPL
2. RMAN> duplicate target database to EX1DUPL;
You can re-un the command from time to time to synchronize the duplicate database (e.g. in a script).

Refrence:
http://www.akadia.com/services/ora_duplicate_database_rman.html
http://blog.art-of-coding.eu/duplicate-an-oracle-database-with-rman
www.oraclenutsandbolts.net

Details:

ORA-38856: cannot mark instance UNNAMED_INSTANCE_2 (redo thread 2) as enabled.

Oracle bug, 4355382 ORA-38856: FAILED TO OPEN DATABASE WITH RESETLOGS WHEN USING RAC BACKUP, exists in the
Oracle 10g release 2.0 that affects backups taken from a RAC database. The problem is related to the number of threads
used by the source database and an expectation that the cloned database must have an identical number of threads.

Solution:

1. Set the following parameter in the auxiliary init.ora file: _ no_recovery_through_resetlogs=TRUE.

2. Open the database in resetlogs mode.

3. Remove _ no_recovery_through_resetlogs=TRUE from init.ora.

4. Restart database.

Recreate the temp tablespace..etc..
CREATE TEMPORARY TABLESPACE TEMP
TEMPFILE ‘/oradata2/EX1DUPL/temp01.dbf’ SIZE 500M REUSE
AUTOEXTEND ON NEXT 100M MAXSIZE 4096M;

ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp;

DROP TABLESPACE temp2 INCLUDING CONTENTS AND DATAFILES;

CREATE TEMPORARY TABLESPACE TEMP
TEMPFILE ‘/oradata2/EX1DUPL temp02.dbf’ SIZE 500M REUSE
AUTOEXTEND ON NEXT 100M MAXSIZE 4096M;

ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp2;

DROP TABLESPACE temp INCLUDING CONTENTS AND DATAFILES;

I ran into a problem that my diskspace was almost 100%.

I decided to move a big datafile to a different filesystem on the same server. This is how I did it..

First of all create the new location for the datafile. In this case it is:

/oradata2/EX

Owner is oracle and group is oinstall

chown –R oracle:oinstall EX

Disable all connections to the database in this case it was a (very busy) RAC database.

srvctl stop database –d EX

srvctl start database –d EX

Check if the database comes up normal and if so:
Make sure the tablespace is offline

ALTER TABLESPACE STV_DATA OFFLINE NORMAL;

Then we have to copy the datafile to the new location:

cd /u01/oradata/EX

cp STV_DATA01.DBF  STV_DATA02.DBF /oradata2/EX

ALTER TABLESPACE STV_DATA RENAME DATAFILE ‘/u01/oradata/EX/STV_DATA01.DBF’ TO ‘/oradata2/EX/STV_DATA01.DBF';

ALTER TABLESPACE STV_DATA RENAME DATAFILE ‘/u01/oradata/EX/STV_DATA02.DBF’ TO ‘/oradata2/EX/STV_DATA02.DBF';

I had to recover the datafile first before I could online it again…

alter database recover datafile ‘/oradata2/EX/STV_DATA01.DBF';

alter database recover datafile ‘/oradata2/EX/STV_DATA02.DBF';

ALTER TABLESPACE STV_DATA ONLINE;

When the datafiles have moved you can remove the “old” once.

Note: Make sure you are not IN any of the segments of the datafile when deleting the files on OS level otherwise the rm will hang and you have to restart the database again to     reclaim storage space…

cd /u01/oradata/EX/
rm -rf STV_DATA01.DBF
rm -rf STV_DATA02.DBF

You are done.

First off all, download hpacucli from this site:

http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&cc=US&swItem=MTX-55a52d8ab375437cbd05b938df

Then copy it to both nodes as root and

rpm -ivh hpacucli-8.50-6.0.noarch.rpm

startup hpacucli by typing:

hpacucli

then we can start:

-          controller all show
–          set target controller sn=<serialnumber>
–          physicaldrive all show (pd all show)
–          determine which drives you want to use,
in our case 1:5-1:6
–          create type=ld drives=1:5-1:6 raid=1
–          logicaldrive all show (ld all show)

exit and now we have to create a new partition on the new disk

# fdisk /dev/cciss/c1d0
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won’t be recoverable.

The number of cylinders for this disk is set to 4427.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sdb: 255 heads, 63 sectors, 4427 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-4427, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-4427, default 4427):
Using default value 4427

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

Now verify the new partition:

Ex:
# fdisk -l

Disk /dev/sdb: 36.4 GB, 36420075008 bytes
255 heads, 63 sectors/track, 4427 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        4427    35559846   83  Linux

Repeat the above steps for each disk to be partitioned.   Disk partitioning should be done from one node only.
When finished partitioning, run the ‘partprobe’ command as root on each of the remaining cluster nodes in order to assure that the new partitions are configured.

Then on the other node:

-          controller all show
–          set target controller sn=<serialnumber>
–          logicaldrive all show (ld all show)

To see if the controller can see the new Disk:

dmesg

and
/dev/cciss
fdisk –l

We the have to add the LABEL etc. to /etc/fstab on both nodes:

LABEL=/oradata2         /oradata2               ocfs2   _netdev,datavolume,nointr 0 0

When that has been done we run (on one node):

mkfs.ocfs2 –b 4K –C 32K –N 4 –L /oradata2 /dev/cciss/c1d1p1 (for example)
mkdir /oradata2 on both nodes

and then we can mount the new disk on both nodes:
mount /oradata2

Done!

The basic steps

When changing the private IP address in a RAC environment you must follow these basic steps:

1) Shut down everything but not the CRS stack
2) Change the public interfaces
3) Modify the VIP addresses
4) Shut down CRS
5) Modify IP addresses on OS level and reconfigure /etc/hosts, listener..
6) Restart

Please make sure you follow these steps in this way!

Shut Down Everything EXCEPT CRS

The database and nodeapps (on all nodes) are stopped.
[oracle@db01~]$ srvctl stop database -d <database_name>
[oracle@db01~]$ srvctl stop nodeapps -n <Node_name01>
[oracle@db01~]$ srvctl stop nodeapps -n <Node_name02>

(If you use ASM, it must be stopped as well.)

After that we verify the status.
[oracle@db01~]$ srvctl status database -d <database_name>

Instance EX1 is not running on node <Node_name01>
Instance EX2 is not running on node <Node_name02>

[oracle@db01~]$ srvctl status nodeapps -n <Node_name01>
VIP is not running on node: <Node_name01>
GSD is not running on node: <Node_name01>
Listener is not running on node: <Node_name01>
ONS daemon is not running on node: <Node_name01>

[oracle@db01~]$ srvctl status nodeapps -n <Node_name02>
VIP is not running on node: <Node_name02>
GSD is not running on node: <Node_name02>
Listener is not running on node: <Node_name02>
ONS daemon is not running on node: <Node_name02>

After this we can continue to the next step..

Change the Public Interface

First we check what the status is by entering this command:

[oracle@db01~]$ oifcfg getif
eth0 –ip– global public
eth1 –priv_ip– global cluster_interconnect

We need to change the interface eth0.
First we delete the interface, after that we set a new one.
[oracle@db01~]$ oifcfg delif -global eth0
[oracle@db01~]$ oifcfg setif -global eth0/<ip>:public

Note: Make sure you use the same user as you did when configuring CRS. Otherwise you’ll get an error message!


Modify the VIP Address

Due to the fact that we changed the subnet of the public IP address, we must also change the VIP address.
This can be done by using the following command:
[root@db01~]# $ORACLE_HOME/bin/srvctl modify nodeapps -n –nodename02– -A <vip-ip02>/255.255.255.0/eth0
!Make sure you use the VIP address!

[root@db01~]# $ORACLE_HOME/bin/srvctl modify nodeapps -n –nodename01– -A <vip-ip01>/255.255.255.0/eth0

!Note that the root user should be used for this action.

Shut Down CRS

The stop command must be performed on all nodes:
[root@db01] ORA_CRS_HOME/bin/crsctl stop crs
[root@db02] ORA_CRS_HOME/bin/crsctl stop crs

Modify the IP Address on OS Level

Modify the public IP address (eth0) on both nodes:
[oracle@db01 /] vi etc/sysconfig/network-scripts/ifcfg-eth0

Modify /etc/hosts and listener.ora files if required on both nodes:

[oracle@db01 ~]$ vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
**.**.**.*** db01-priv.*******.com db01-priv
**.**.**.*** db02-priv.*******.com db02-priv
**.**.**.* db01.*******.com db01
**.**.**.* db01.*******.com db02
**.**.**.* db01-vip.*******.com db01-vip
**.**.**.* db01-vip.*******.com db02-vip

[oracle@db01 ~]$ vi $ORACLE_HOME/network/admin/listener.ora
LISTENER_DB01 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = db01-vip.*******.com)(PORT = 1521)(IP = FIRST))
(ADDRESS = (PROTOCOL = TCP)(HOST = **.**.**.*)(PORT = 1521)(IP =
FIRST))
)
)
SID_LIST_LISTENER_DB01 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /opt/oracle/product/10.2.0/db10g)
(PROGRAM = extproc)
)
)

BEFORE the RESTART we have connected the server to the “new office switch”
Reboot all nodes and verify the status.
Shortly after reboot check the following:

[oracle@db01 ~]$ /sbin/ifconfig -a | egrep ‘(eth|Mask)’

After a couple seconds both VIP’s should be okay.

Check the status again of the RAC to see if they are up and running

[oracle@db01 ~]$ srvctl status database -d <database>
Instance EX1 is running on node <Node_name01>
Instance EX2 is running on node <Node_name02>

[oracle@db01 ~]$ srvctl status nodeapps -n –Node_name01–
VIP is running on node: <Node_name01>
GSD is running on node: <Node_name01>
Listener is running on node: <Node_name01>
ONS daemon is running on node: <Node_name01>

[oracle@db01 ~]$ srvctl status database -d <database>
Instance EX1 is running on node <Node_name02>
Instance EX2 is running on node <Node_name01>

[oracle@db02 ~]$ srvctl status nodeapps -n <Node_name02>
VIP is running on node: <Node_name02>
GSD is running on node: <Node_name02>
Listener is running on node: <Node_name02>
ONS daemon is running on node: <Node_name02>

[root@db02 ~]$ $ORA_CRS_HOME/bin/crs_stat -t
Name Type Target State Host
————————————————————
ora….X1.inst application ONLINE ONLINE db01
ora….X2.inst application ONLINE ONLINE db02
ora.EX.db application ONLINE ONLINE db01
ora….01.lsnr application ONLINE ONLINE db01
ora….b01.gsd application ONLINE ONLINE db01
ora….b01.ons application ONLINE ONLINE db01
ora….b01.vip application ONLINE ONLINE db01
ora….02.lsnr application ONLINE ONLINE db02
ora….b02.gsd application ONLINE ONLINE db02
ora….b02.ons application ONLINE ONLINE db02
ora….b02.vip application ONLINE ONLINE db02

That’s about it!

Follow

Get every new post delivered to your Inbox.