Posts

Showing posts from 2011

Oracle impdp

# impdp system/ @>ORACLE_SID> commit=y full=y show=y Location: SQL> select owner, directory_name, directory_path from dba_directories where directory_name like 'DATA_PU%'; OWNER DIRECTORY_NAME ------------------------------ ------------------------------ DIRECTORY_PATH -------------------------------------------------------------------------------- SYS DATA_PUMP_DIR /u01/app/oracle/admin/linpe9004/dpdump/

Linux iptable static NAT

modprobe iptable_nat echo 1 > /proc/sys/net/ipv4/ip_forward # Please make a note # eth0 -- internet interface # eth1 -- private interface # PREROUTING statements for 1:1 NAT # (Connections originating from the Internet) iptables -t nat -A PREROUTING -d PUBLIC_IP -i eth0 -j DNAT --to-destination PRIVATE_IP # POSTROUTING statements for 1:1 NAT # (Connections originating from the home network servers) iptables -t nat -A POSTROUTING -s PRIVATE_IP -o eth0 -j SNAT --to-source PUBLIC_IP # POSTROUTING statements for Many:1 NAT # (Connections originating from the entire home network) iptables -t nat -A POSTROUTING -s PRIVATE_SUBNET/24 -j SNAT -o eth0 --to-source ETH0_IP # Allow forwarding to each of the servers configured for 1:1 NAT # (For connections originating from the Internet. Notice how you # use the real IP addresses here) iptables -A FORWARD -p tcp -i eth0 -o eth1 -d PIP -m multiport --dports 80,443,22 \ -m state --state NEW -j ACCEPT # Allow forwarding for all New and Esta

Linux iptables static NAT

modprobe iptable_nat echo 1 > /proc/sys/net/ipv4/ip_forward # Please make a note # eth0 -- internet interface # eth1 -- private interface # PREROUTING statements for 1:1 NAT # (Connections originating from the Internet) iptables -t nat -A PREROUTING -d PUBLIC_IP -i eth0 -j DNAT --to-destination PRIVATE_IP # POSTROUTING statements for 1:1 NAT # (Connections originating from the home network servers) iptables -t nat -A POSTROUTING -s PRIVATE_IP -o eth0 -j SNAT --to-source PUBLIC_IP # POSTROUTING statements for Many:1 NAT # (Connections originating from the entire home network) iptables -t nat -A POSTROUTING -s PRIVATE_SUBNET/24 -j SNAT -o eth0 --to-source ETH0_IP # Allow forwarding to each of the servers configured for 1:1 NAT # (For connections originating from the Internet. Notice how you # use the real IP addresses here) iptables -A FORWARD -p tcp -i eth0 -o eth1 -d PIP -m multiport --dports 80,443,22 \ -m state --state NEW -j ACCEPT # Allow forwarding for all New and Esta

Rebuild Oracle EM

A. On both nodes stop dbconsole emctl stop dbconsole B. Drop DBConsole manaully Step 1: Drop AQ related objects in the SYSMAN schema Logon SQLPLUS as user. Bypass any errorSYSMAN SQL> exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'MGMT_NOTIFY_QTABLE',force =>TRUE); Step 1:Logon SQLPLUS as user SYS or SYSTEM, and drop the sysman account and management objects: SQL> exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'SYSMAN.MGMT_NOTIFY_QTABLE',force =>TRUE); SQL> EXEC sysman.emd_maintenance.remove_em_dbms_jobs; SQL> EXEC sysman.setEMUserContext('',5); SQL> REVOKE dba FROM sysman; SQL> DECLARE CURSOR c1 IS SELECT owner, synonym_name name FROM dba_synonyms WHERE table_owner = 'SYSMAN'; BEGIN FOR r1 IN c1 LOOPIF r1.owner = 'PUBLIC' THEN EXECUTE IMMEDIATE 'DROP PUBLIC SYNONYM 'r1.name; ELSE EXECUTE IMMEDIATE 'DROP SYNONYM 'r1.owner'.'r1.name; END IF; END LOOP; END;/ SQL> DROP USER mgmt_view CASCADE; S

Rebuild OCR & Voting disk

http://oracleinstance.blogspot.com/2010/08/recover-corruptmissing-ocr-and-voting.html https://forums.oracle.com/forums/thread.jspa?threadID=1007560 http://www.idevelopment.info/data/Oracle/DBA_tips/Oracle10gRAC/CLUSTER_65.shtml#View%20Voting%20Disk%20Configuration%20Information http://www.filibeto.org/~aduritz/truetrue/oracle/How_to_OCR_and_Voting_disk.pdf My Notes: edit /u01/app/crs/install/rootconfig to modify the correct Linux disk ID ---- Start Editting -- SILENT=falseORA_CRS_HOME=/u01/app/crs CRS_ORACLE_OWNER=oracle CRS_DBA_GROUP=oinstall CRS_VNDR_CLUSTER=false CRS_OCR_LOCATIONS=/dev/sdb1 CRS_CLUSTER_NAME=linpe_cluster CRS_HOST_NAME_LIST=linpe9007.boseng.local,1,linpe9008.boseng.local,2 CRS_NODE_NAME_LIST=linpe9007.boseng.local,1,linpe9008.boseng.local,2 CRS_PRIVATE_NAME_LIST=linpe9007-priv.boseng.local,1,linpe9008-priv.boseng.local,2CRS_LANGUAGE_ID='AMERICAN_AMERICA.WE8ISO8859P1' CRS_VOTING_DISKS=/dev/sde1CRS_NODELIST=linpe9007,linpe9008CRS_NODEVI

Vmware EMC issue

If the virtual server could not boot; remove it from inverntory; then add into; but failed; we can try the following commands: [root@vmeng02 /]# vmware-cmd -s unregister /vmfs/volumes/4d826ef4-d4d3c58c-afcd-1cc1de004cc1/BOSLABMS02/BOSLABMS02.vmx [root@vmeng02 /]# vmware-cmd -l less grep -i BOS /vmfs/volumes/4d811a30-767857b0-ccc8-001517618598/BOSRH-VM/BOSRH-VM.vmx /vmfs/volumes/4d811a30-767857b0-ccc8-001517618598/bosqasrv02/bosqasrv02.vmx /vmfs/volumes/4d811a30-767857b0-ccc8-001517618598/hsdswebdemo.bosqalab.com/hsdswebdemo.bosqalab.com.vmx /vmfs/volumes/4d811a30-767857b0-ccc8-001517618598/bosappsec-ub/bosappsec-ub.vmx/vmfs/volumes/4d890b53-93e28560-2e8d-d8d385df5f81/BOSLABDC02/BOSLABDC02.vmx /vmfs/volumes/4d890b53-93e28560-2e8d-d8d385df5f81/auto34.bosqalab.com/auto34.bosqalab.com.vmx /vmfs/volumes/4cdb0190-9a49d4ac-70bd-0017a4772412/AUTO37.bosqalab.com/AUTO37.bosqalab.com.vmx /vmfs/volumes/4d826edc-d606e968-51ae-1cc1de004cc1/auto32.bosqalab.com/auto32.bosqalab.com.vmx /vmfs/volumes/4d
umount /all-vgxx-mountpoints # If needed vgexport -s -v -p -m /tmp/vgxx-s.map /dev/vgxx # If needed vgexport -v -m /tmp/vgxx.map /dev/vgxx # If needed vgchgid /dev/rdsk/c6t0d0 /dev/rdsk/c6t0d1 /dev/rdsk/c6t0d2 /dev/rdsk/c6t0d3 mkdir /dev/vgxx mknod /dev/vgxx/group c 64 0x0?0000 vgimport -v /dev/vgxx /dev/dsk/c6t0d0 /dev/dsk/c6t0d1 /dev/dsk/c6t0d2 /dev/dsk/c6t0d3 vgchange -a y /dev/vgxx vgcfgbackup /dev/vgxx mkdir /new-vgxx-mountpoints # If needed mount /dev/vgxx/lvol1 /new-vgxx-mountpoints # If needed

GFS2

How to Setup GFS2 or GFS in Linux Centos Posted on April 22 by Clay var dzone_url = "http://hungred.com/how-to/setup-gfs2-gfs-linux-centos/"; var dzone_title = "How to Setup GFS2 or GFS in Linux Centos"; var dzone_style = "1"; var dzone_blurb = " It has been a nightmare for me setting up GFS2 with my 3 servers and 1 SAN Storage. I have been reading all over the internet and the solutions to this is either outdated or contains bug that cannot make my SAN storage SAN to work. Finally, i..."; digg_url = "http://hungred.com/how-to/setup-gfs2-gfs-linux-centos/"; digg_bgcolor = "#FFFFFF"; digg_skin = ""; digg_window = "new"; digg_title = "How to Setup GFS2 or GFS in Linux Centos"; digg_media = "news"; digg_topic = ""; digg_bodytext = "It has been a nightmare for me setting up GFS2 with my 3 servers and 1 SAN Storage. I have been reading all over the internet and the solutions t

EMC, Device-mapper multipath, Linux

Install device-mapper-multipath: yum install device-mapper-multipath Check udev package: rpm -q udev Load Multipath: #modprobe dm_multipath #lsmod grep multi dm_multipath 21577 0 dm_mod 56537 13 dm_multipath,dm_snapshot,dm_zero,dm_mirror

Drupal Notes:

Install: package needed: 1) yum install php-mbstring (unicode lib) Process to migrate the live site: Configure the new servers to reverse-proxy Drupal requests to the old servers Switch DNS from the old load balancer to the new one. Put the site in read-only mode just long enough to transfer the database Do a final database load on the new DB server

Performace tool

On Linux : iostat (IO status) vmstat (Memory) mpstat (CPU) mpstat -P ALL (all cores CPU) top sar Top 10 CPU uage: ps -eo pcpu,pid,user,args sort -k 1 -r head 10 or ps -eo pcpu,pid,user,args sort -r -k1 less who is using the CPU ps -e -o pcpu,cpu,nice,state,cputime,args –sort pcpu sed ‘/^ 0.0 /d’ check CPU: cat /proc/cpuinfo less /proc/interrupts ls /sys/devices/system/cpu

Change the Solaris Zone

1> Rename the zone (not rename the server name) a> shutdown the zone : # zoneadm -z halt b> Change the configuration: # cd /etc/zones # mv .xml .xml # vi .xml # cd /export/zones # mv c> Boot the zone: # zoneadm -z boot 2> Change the server name: (two ways to do it) a> during the zone up b> during the zone down # cd /export/zones/ /root # vi /etc/hosts # vi /etc/nodename # vi /etc/hostname. more info: http://www.softpanorama.org/Solaris/Virtualization/zones.shtml

Create new solaris zone

How to create Solaris Zone 1> Created a Zone Home directory mkdir -p /export/zones/ 2> Change premission chmod 700 /export/zones/ 3> Configure the the Zone zonecfg -z (in our case, we call the zone_name as sunrmg zonecfg:sunrmg> create zonecfg:sunrmg> set zonepath=/export/home/sunrmg zonecfg:sunrmg> add net zonecfg:sunrmg:net> set address=xxx.xxx.xxx.xxx zonecfg:sunrmg:net> set physical=ce0 zonecfg:sunrmg:net> end zonecfg:sunrmg> set autoboot=true (The above information is sufficient to configure a basic zone, with most software shared from the global zone. Other options could have been used, for example to inherit parts of the Global zone's file system, mount directories (e.g. /software) from the Global zone, restrict the zone's resources (e.g. CPU, memory)) zonecfg:sunrmg> info zonepath: /export/zones/sunrmg autoboot: true pool: inherit-pkg-dir: dir: /lib inherit-pkg-dir: dir: /platform inherit-pkg-dir: dir: /sbin inherit-pkg-dir: dir: /usr ne
Understanding your (Red Hat Enterprise Linux) daemons by Len DiMaggio A Unix daemon is a program that runs in the “background,” enabling you to do other work in the “foreground,” and is independent of control from a terminal. Daemons can either be started by a process, such as a system startup script, where there is no controlling terminal, or by a user at a terminal without “tying up” that terminal as the daemon runs . But which daemons can you safely play with? Which should you leave running? An introduction to daemons The real-world (i.e., non-computer) definition of “daemon” is either a spirit (an evil one) or an inner or private voice. It’s interesting to note that each of the real-world definitions actually does apply to Unix daemon programs. Like mythological daemons, Unix daemon programs skulk around unseen in the background just as a daemon would. And daemons act like an inner voice in that they can run continuously and, like a conscience, can always be accessed. The word “dae