2013年10月9日 星期三

Linux Server - upgrade and 指定要boot的os image file


yum:
CentOS 與 Fedora 所常用的自動升級機制,透過 FTP 或 WWW 來進行線上升級以及線上直接安裝套件;
up2date:
這是 Red Hat 所使用的自動升級機制,需要註冊才能使用,並且依據付費與否而管制其流量;

//****************************************************************************
mount -o ro,loop /source/Enterprise-R5-U5-Server-x86_64-dvd.iso /mnt

vi /etc/yum.repos.d/local.repo
[local]
name=local
baseurl=file:///mnt/Server/
enabled=1
gpgcheck=0

yum repolist

yum list update

yum update

shutdown -r now


//*****************************************************************************




Oracle Linux 5
# cd /etc/yum.repos.d
# wget https://public-yum.oracle.com/public-yum-el5.repo

# grep -B 5 enabled=1 public-yum-el5.repo

Oracle Linux 6
# cd /etc/yum.repos.d
# wget https://public-yum.oracle.com/public-yum-ol6.repo

Oracle VM 2
# cd /etc/yum.repos.d
# wget https://public-yum.oracle.com/public-yum-ovm2.repo

Enable the appropriate repository by editing the yum configuration file

Open the yum configuration file in a text editor
Locate the section in the file for the repository you plan to update from, e.g. [el4_u6_base]
Change enabled=0 to enabled=1
Begin using yum, for example:

yum repolist --to show the registered channels and you see we are including everything including the latest published RPMs.

yum list

yum install firefox



//*****************************************************************************



Reference:

1. yum upgrade - OL5_u5 to OL5_u6:
http://surachartopun.com/2011/01/yum-upgrade-ol5u5-to-ol5u6.html

2. http://husnusensoy.wordpress.com/2013/02/13/upgrade-to-oracle-enterprise-linux-5-9-andso-uek2/


Oracle Linux: Upgrade between major releases is not supported (Doc ID 821668.1)


//*****************************************************************************

Bootloader default 會找第一個 Title,可以修改 default來做指定。

[root@testdb4 grub]# pwd
/boot/grub
[root@testdb4 grub]# more grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/xvda
default=0   <== default會找第一個title
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Oracle Linux Server (2.6.18-274.el5xen)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-274.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet numa=off
        initrd /initrd-2.6.18-274.el5xen.img
title Oracle Linux Server (2.6.32-200.13.1.el5uek)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-200.13.1.el5uek ro root=/dev/VolGroup00/LogVol00 rhgb quiet numa=off
        initrd /initrd-2.6.32-200.13.1.el5uek.img
title Enterprise Linux (2.6.18-194.el5xen)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-194.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet numa=off
        initrd /initrd-2.6.18-194.el5xen.img

2013年10月1日 星期二

DR 異地備援 - windows server 適用的超低成本方案


你們公司有沒有花大錢做DR? 
檔案異地抄寫? 
頻寬不足怎麼辦? 

分享各位一個妙招,尤其適用windows server。
1. 將主機先做虛擬化,一式兩份。 A1 -> A2 and A3
2. A2放到同機房,A3放到異地機房。
3. 在A2 and A3上面安裝dropbox軟體。
4. 在A2,安裝fastcopy,將A1需要傳送到異地的資料,作差異同步到A2的dropbox folder。
5. 這些檔案,就會利用dropbox的同步機制,自動複製一份到雲端,也會複製一份到remote site的A3。

版權沒有,歡迎引用,設定成功後請我喝咖啡即可。

2013年6月11日 星期二

Linux Server - lvextend

df -h
pvscan
lvscan
vgdisplay VolGroup00
lvextend -l +144 /dev/VolGroup00/LogVol02
resize2fs /dev/VolGroup00/LogVol02

2013年5月9日 星期四

Linux Server - How to configure VNC server to load up the complete GNOME desktop and auto startup after server power on


[root@testdb4 ~]# chkconfig vncserver on --level 5
[root@testdb4 ~]# chkconfig --list|grep vnc
vncserver       0:off   1:off   2:off   3:off   4:off   5:on    6:off

[oracle@testdb4 .vnc]$ pwd
/home/oracle/.vnc
[oracle@testdb4 .vnc]$ cat xstartup
#!/bin/sh

# Uncomment the following two lines for normal desktop:
 unset SESSION_MANAGER
 exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
#gnome-session &

[root@testdb4 rc5.d]# more /etc/sysconfig/vncservers
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own).  You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, see
# <URL:http://www.uk.research.att.com/archive/vnc/sshvnc.html>.

# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.

# Use "-nohttpd" to prevent web-based VNC clients connecting.

# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel.  See the "-via" option in the
# `man vncviewer' manual page.

# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"

 VNCSERVERS="2:oracle"
 VNCSERVERARGS[2]="-geometry 1024x768 -nohttpd -nolisten tcp"

2013年3月7日 星期四

Oracle Database - 移除Oracle Management Agent in Silent Mode



  • Deinstalling Oracle Management Agent in Silent Mode


/u01/oracle/agent11g/oui/bin/runInstaller -silent -deinstall "REMOVE_HOMES={/u01/oracle/agent11g}" -removeallfiles


/u01/oracle/agent11g/bin/emctl pingOMS



emctl upload agent
Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
EMD upload error: uploadXMLFiles skipped :: OMS version not checked yet. If this issue persists check trace files for ping to OMS related errors.


Solution
1. Stop the agent:
<AGENT_HOME>/BIN> emctl stop agent

2. Secure the agent which will generate a new key:
<AGENT_HOME>/BIN> emctl secure agent

3.  Start the agent:
<AGENT_HOME>/BIN> emctl start agent

4. Login to the grid console >> Setup >> Agents >> Navigate to the problematic agent home page >> Click on Agent resynchronization

5. Once the Agent resynchronization works fine,  perform an upload agent:
<AGENT_HOME>/BIN> ./emctl upload

2013年3月6日 星期三

Oracle Database - 用export backup 特定table/tablespaces



--Backup 特定table

exp system/xxxxxxxx tables=simctl.F0092,simctl.F9000,simctl.F9001,simctl.F9002,simctl.F9005,simctl.F9005D,simctl.F9006,simctl.F9006D file=simctl_menu.exp log=exp_simctl_menu.log

--Backup 特定tablespaces
day=`date +%Y-%m-%d`
exp system/xxxxxxxx tablespaces=DEV_MDS,DEV_IAS_TEMP,DEV_BIPLATFORM,BIEE_BIPLATFORM,BIEE_MDS,BIEE_IAS_TEMP,BIEE_ODI_TEMP,BIEE_ODI_USER file=biee_$day.exp log=exp_biee_$day.log




2013年2月7日 星期四

影音播放軟體


再便宜的NB上面沒有內建影音撥放解碼軟體,曾經用過兩套大陸開發的影音播放軟體,相容性體高的。

1. 迅雷看看
2. 暴風影音