Showing posts with label Oracle 10g. Show all posts
Showing posts with label Oracle 10g. Show all posts

Tuesday, July 21, 2009

Why Enterprise Manager was not showing up from a Linux server?

I was working on a Redhat Linux 5 server when I noticed that the Enterprise Manager was not starting from my local windows laptop. The database is hosted on a Redhat Linux server and I was trying to access EMCTL from my windows laptop. After checking database logs, I was sure that it was nothing to do with database but the system.

Now from Linux, I opened firefox and then tried to run the EMCTL from there. It was working. Clearly, the problem was related to firewall (either at windows laptop side or from Linux server side). Upon disabling windows firewall also when it did not work, then it was confirmed that Linux firewall was blocking EMCTL's port connections.

Here is the steps to enable one specific port for EMCTL on Linux. This can be used to enable any other port as well.

1) Open /usr/bin/system-config-securitylevel from Linux side (after setting correct display)
2) Append/enable 1158 port with TCP.
3) Apply + select Ok.

Boom! You have just enabled one port from Linux firewall. :-)





[root@dbserver ~]# ls -l /etc/sysconfig/iptables ; cat /etc/sysconfig/iptables
-rw------- 1 root root 870 Jun 8 23:54 /etc/sysconfig/iptables
# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT


Following is to invoke Linux firewall settings gui:

[root@dbserver ~]# /usr/bin/system-config-securitylevel &
[1] 15722




Note that after making any such change in system, the connection to server has to be re-established. It disconnects all the existing connections. so, be careful on production boxes!


login as: root
root@dbserver's password:
[root@dbserver ~]#
[root@dbserver ~]#
[root@dbserver ~]# ls -l /etc/sysconfig/iptables ; cat /etc/sysconfig/iptables
-rw------- 1 root root 951 Jul 21 13:02 /etc/sysconfig/iptables
# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1158 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
[root@dbserver ~]#

Friday, June 19, 2009

Netbackup Oracle RMAN agent implementation

Implementing Netbackup's Oracle RMAN agent is pretty straight forward for any simple configuration. Here is the step-by-step procedure:

STEP 1) On Netbackup master server:
- Install Oracle Database extension
- During above add-on installation, you will be asked for RMAN license

STEP 2) On Netbackup client (which is running a database)
- Install Netbackup client (if not already installed)
- Test a normal file system backup to avoid any unwanted complication
- Once test file system backup is done successfully, then install Netbackup's Oracle add-on on this client.

STEP 3) Configuring a test policy on Netbackup master server for RMAN backup
- Create a new policy (eg. CL-SERVER1-RMAN-DEMO)
- Select Policy type "Oracle"
- In Clients tab, select the client (in our case, lets say SERVER1)
- In schedule (for test purpose only), just make sure that the backup type is "Application backup"
- Save the policy and exit from here. Next step is in SERVER1

STEP 4) On SERVER1 (client which is running database):
- need to shutdown the database - It is just for the one time only to link the database to netbackup agent
- Login as oracle user and set the ORACLE_SID
- As oracle dba user, run the script /usr/openv/netbackup/bin/oracle_link
- Once done, basic things are done. Lets move on to RMAN test backup now.

STEP 5) On SERVER1 itself:
- Login as oracle or database admin
- Set the oracle SID (eg. export ORACLE_SID=db1)
- Type commands given below:


oracle@SERVER1:/export/home/oracle $ rman target /

Recovery Manager: Release 10.2.0.3.0 - Production on Thu Oct 25 17:56:03 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: NBTEST (DBID=2904014931)

RMAN> run {
2> ALLOCATE CHANNEL c1 DEVICE TYPE sbt;
3> send 'NB_ORA_POLICY=CL-SERVER1-RMAN-DEMO,NB_ORA_SERV=NBU-MASTER-SRV';
4> BACKUP DATABASE PLUS ARCHIVELOG;
5> }




using target database control file instead of recovery catalog
allocated channel: c1
channel c1: sid=120 instance=nbtest1 devtype=SBT_TAPE
channel c1: VERITAS NetBackup for Oracle - Release 6.0 (2006110304)

sent command to channel: c1


Starting backup at 25-OCT-07
current log archived
channel c1: starting archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=1 sequence=1 recid=3 stamp=636919005
input archive log thread=2 sequence=1 recid=1 stamp=636919003
input archive log thread=3 sequence=1 recid=2 stamp=636919004
channel c1: starting piece 1 at 25-OCT-07
channel c1: finished piece 1 at 25-OCT-07
piece handle=01ivd777_1_1 tag=TAG20071025T175654 comment=API Version 2.0,MMS Version 5.0.0.0
channel c1: backup set complete, elapsed time: 00:01:46
Finished backup at 25-OCT-07


Starting backup at 25-OCT-07
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00001 name=+ASMDGPRD1/nbtest/datafile/system.875.636916501
input datafile fno=00003 name=+ASMDGPRD1/nbtest/datafile/sysaux.912.636916501
input datafile fno=00002 name=+ASMDGPRD1/nbtest/datafile/undotbs1.692.636916503
input datafile fno=00005 name=+ASMDGPRD1/nbtest/datafile/undotbs2.717.636916761
input datafile fno=00006 name=+ASMDGPRD1/nbtest/datafile/undotbs3.878.636916763
input datafile fno=00004 name=+ASMDGPRD1/nbtest/datafile/users.867.636916503
channel c1: starting piece 1 at 25-OCT-07
channel c1: finished piece 1 at 25-OCT-07
piece handle=02ivd7aj_1_1 tag=TAG20071025T175842 comment=API Version 2.0,MMS Version 5.0.0.0
channel c1: backup set complete, elapsed time: 00:01:05
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel c1: starting piece 1 at 25-OCT-07
channel c1: finished piece 1 at 25-OCT-07
piece handle=03ivd7ck_1_1 tag=TAG20071025T175842 comment=API Version 2.0,MMS Version 5.0.0.0
channel c1: backup set complete, elapsed time: 00:00:47

Finished backup at 25-OCT-07

Starting backup at 25-OCT-07
current log archived
channel c1: starting archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=1 sequence=2 recid=6 stamp=636919239
input archive log thread=2 sequence=2 recid=4 stamp=636919238
input archive log thread=3 sequence=2 recid=5 stamp=636919239
channel c1: starting piece 1 at 25-OCT-07


channel c1: finished piece 1 at 25-OCT-07
piece handle=04ivd7e7_1_1 tag=TAG20071025T180039 comment=API Version 2.0,MMS Version 5.0.0.0
channel c1: backup set complete, elapsed time: 00:07:07
Finished backup at 25-OCT-07
released channel: c1

RMAN>



This way, the simplest Oracle RMAN backup using Netbackup client is performed. The same can be seen on netbackup console as well.

Thursday, May 14, 2009

How to see Virtual memory parameters for Oracle databases in Solaris 10?

Sometimes, DBA need to know how virtual memory parameters are tuned for their databases. Uptil Solaris 9, it was easy to find in sysdef command's output. But from Solaris 10 onwards, there is a little change. The details virtual memory parameters can be found by using a database process's PID. Here is what I did:

1) Select any database process
2) Get the PID and proceed as below.


# ps -eaf | grep 10044 | grep -v grep
oracle 10044 22731 0 May 13 ? 16:41 oraPROD (LOCAL=NO)


# prctl -i process 10044
process: 10044: oraPROD (LOCAL=NO)
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
process.max-port-events
privileged 65.5K - deny -
system 2.15G max deny -
process.max-msg-messages
privileged 8.19K - deny -
system 4.29G max deny -
process.max-msg-qbytes
privileged 64.0KB - deny -
system 16.0EB max deny -
process.max-sem-ops
privileged 512 - deny -
system 2.15G max deny -
process.max-sem-nsems
privileged 512 - deny -
system 32.8K max deny -
process.max-address-space
privileged 16.0EB max deny -
system 16.0EB max deny -
process.max-file-descriptor
privileged 65.5K - deny -
system 2.15G max deny -
process.max-core-size
privileged 8.00EB max deny -
system 8.00EB max deny -
process.max-stack-size
basic 32.0MB - deny 10044
privileged 8.00EB max deny -
system 8.00EB max deny -
process.max-data-size
privileged 16.0EB max deny -
system 16.0EB max deny -
process.max-file-size
privileged 8.00EB max deny,signal=XFSZ -
system 8.00EB max deny -
process.max-cpu-time
privileged 18.4Es inf signal=XCPU -
system 18.4Es inf none -
task.max-cpu-time
system 18.4Es inf none -
task.max-lwps
system 2.15G max deny -
project.max-contracts
privileged 10.0K - deny -
project.max-device-locked-memory
privileged 1.96GB - deny -
project.max-locked-memory
system 16.0EB max deny -
project.max-port-ids
privileged 8.19K - deny -
project.max-shm-memory
privileged 7.84GB - deny -
project.max-shm-ids
privileged 128 - deny -
project.max-msg-ids
privileged 128 - deny -
project.max-sem-ids
privileged 128 - deny -
project.max-crypto-memory
privileged 7.84GB - deny -
project.max-tasks
system 2.15G max deny -
project.max-lwps
system 2.15G max deny -
project.cpu-shares
privileged 1 - none -
zone.max-swap
privileged 16.0GB - deny -
zone.max-locked-memory
system 16.0EB max deny -
zone.max-shm-memory
system 16.0EB max deny -
zone.max-shm-ids
system 16.8M max deny -
zone.max-sem-ids
system 16.8M max deny -
zone.max-msg-ids
system 16.8M max deny -
zone.max-lwps
system 2.15G max deny -
zone.cpu-shares
privileged 1 - none -


Monday, January 7, 2008

Some Oracle RAC Commands on Solaris platform

The following are the set of commands and their output are just to get an overview on how RAC commands output looks like :-)

HOW TO CHECK ORACLE 10G CRS STATUS?

$ /u01/app/oracle/product/10.2.0/crs/bin/crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE abcracprd1
ora....D1.lsnr application ONLINE ONLINE abcracprd1
ora....rd1.gsd application ONLINE ONLINE abcracprd1
ora....rd1.ons application ONLINE ONLINE abcracprd1
ora....rd1.vip application ONLINE ONLINE abcracprd1
ora....SM2.asm application ONLINE ONLINE abcracprd2
ora....D2.lsnr application ONLINE ONLINE abcracprd2
ora....rd2.gsd application ONLINE ONLINE abcracprd2
ora....rd2.ons application ONLINE ONLINE abcracprd2
ora....rd2.vip application ONLINE ONLINE abcracprd2
ora....SM3.asm application ONLINE ONLINE abcracprd3
ora....D3.lsnr application ONLINE ONLINE abcracprd3
ora....rd3.gsd application ONLINE ONLINE abcracprd3
ora....rd3.ons application ONLINE ONLINE abcracprd3
ora....rd3.vip application ONLINE ONLINE abcracprd3
ora....bprd.db application ONLINE OFFLINE
ora....d1.inst application ONLINE OFFLINE
ora....d2.inst application ONLINE OFFLINE
ora....d3.inst application ONLINE OFFLINE
ora.nbtest.db application ONLINE ONLINE abcracprd2
ora....t1.inst application ONLINE ONLINE abcracprd1
ora....t2.inst application ONLINE ONLINE abcracprd2
ora....t3.inst application ONLINE ONLINE abcracprd3
ora....mcdb.db application ONLINE ONLINE abcracprd3
ora....b1.inst application ONLINE ONLINE abcracprd1
ora....b2.inst application ONLINE ONLINE abcracprd2
ora....b3.inst application ONLINE ONLINE abcracprd3
ora....atch.cs application ONLINE ONLINE abcracprd1
ora....db1.srv application ONLINE ONLINE abcracprd1
ora....orms.cs application ONLINE ONLINE abcracprd3
ora....db1.srv application ONLINE ONLINE abcracprd1
ora....db2.srv application ONLINE ONLINE abcracprd2
ora....db3.srv application ONLINE ONLINE abcracprd3
ora....orts.cs application ONLINE ONLINE abcracprd3
ora....db1.srv application ONLINE ONLINE abcracprd1
ora....db2.srv application ONLINE ONLINE abcracprd2
ora....db3.srv application ONLINE ONLINE abcracprd3
ora....asdb.db application ONLINE ONLINE abcracprd2
ora....b1.inst application ONLINE ONLINE abcracprd1
ora....b2.inst application ONLINE ONLINE abcracprd2
ora....b3.inst application ONLINE ONLINE abcracprd3
ora.testias.db application ONLINE OFFLINE
ora....s1.inst application OFFLINE OFFLINE
ora....s2.inst application OFFLINE OFFLINE
ora....s3.inst application OFFLINE OFFLINE


HOW TO CHECK ORACLE 10G APPLICATION SERVER STATUS (using opmnctl)

$/u01/app/oracle/product/10.1.3.1/OracleAS_1/opmn/bin/opmnctl status

Processes in Instance: iasj2eet.abcmidt3.somecompany.com
---------------------------------+--------------------+---------+---------
ias-component process-type pid status
---------------------------------+--------------------+---------+---------
OC4JGroup:abcwebgrp OC4J:abcweb 27783 Alive
OC4JGroup:default_group OC4J:home 18315 Alive
ASG ASG N/A DownHTTP_Server HTTP_Server 18314 Alive



CHECKING ORACLE LISTENER STATUS/ START / STOP

To see the status of oracle listener:
->lsnrctl status

LSNRCTL for Solaris: Version 10.2.0.3.0 - Production on 18-DEC-2007 09:05:19

Copyright (c) 1991, 2006, Oracle. All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Solaris: Version 10.2.0.3.0 - Production
Start Date 17-DEC-2007 06:53:18
Uptime 1 days 2 hr. 12 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=abcbtchp1.somecompany.com)(PORT=1521)))
Services Summary...
Service "abcrman.somecompany.com" has 1 instance(s).
Instance "abcrman", status READY, has 1 handler(s) for this service...
Service "abcrmanXDB.somecompany.com" has 1 instance(s).
Instance "abcrman", status READY, has 1 handler(s) for this service...
Service "abcrman_XPT.somecompany.com" has 1 instance(s).
Instance "abcrman", status READY, has 1 handler(s) for this service...
The command completed successfully

To start oracle listener:
oracle@servername-> lsnrctl start

To start oracle listener:
oracle@servername-> lsnrctl start