顯示具有 10g 標籤的文章。 顯示所有文章
顯示具有 10g 標籤的文章。 顯示所有文章

星期四, 1月 08, 2015

在Redhat 5.4 x86, 安裝Oracle 10.2.0.1 RAC的步驟


1.安裝clusterware software 10.2.0.1
  @node1, As root run $ORACLE_CRS_HOME/root.sh
  @node2, As root run fix_srvctl.sh, fix_vipca.sh, then run $ORACLE_CRS_HOME/root.sh
2.@node2, As root, run vipca 來建立虛擬ip與clusterware resources
3.clusterware安裝畫面結束
4.安裝database software 10.2.0.1,
  @node1, As root run $ORACLE_HOME/root.sh
  @node2, As root run $ORACLE_HOME/root.sh
5.netca
6.dbca.

以下是我所寫的scripts
script fix_srvctl.sh:
----------------------------------------------------------------------------
flag=`grep -q "unset LD_ASSUME_KERNEL" /u01/crs_1/bin/srvctl && echo $?`
if [ $flag -eq 0 ]; then
 echo "srvctl has been fixed !"
 exit 0
fi
mv -f /u01/crs_1/bin/srvctl /u01/crs_1/bin/srvctl.orig
cat /u01/crs_1/bin/srvctl.orig  |sed '/export LD_ASSUME_KERNEL/ a\unset LD_ASSUME_KERNEL' > /u01/crs_1/bin/srvctl
echo "srvctl fixed finished..."
----------------------------------------------------------------------------

script fix_vipca.sh:
----------------------------------------------------------------------------
flag=`grep -q "unset LD_ASSUME_KERNEL" /u01/crs_1/bin/vipca && echo $?`
if [ $flag -eq 0 ]; then
 echo "vipca has been fixed !"
 exit 0
fi
mv -f /u01/crs_1/bin/vipca /u01/crs_1/bin/vipca.orig
cat /u01/crs_1/bin/vipca.orig |sed '/\#End workaround/ a\unset LD_ASSUME_KERNEL' > /u01/crs_1/bin/vipca
echo "vipca fixed finished..."
----------------------------------------------------------------------------

星期日, 12月 14, 2014

Grid Control 10.2.0.1.1 安裝失敗時須注意的地方

Oracle 10.2.0.2
Grid Control 10.2.0.1.1

安裝GC 是使用Using existing database....

For Oracle Linux 5.4 32bit :

安裝Grid Control , OPMN Process Manager failed to start 問題解決方法:

As root:
ln -s /usr/lib/libgdbm.so.2.0.0 /usr/lib/libdb.so.2

For Redhat 4.8 32bit :
1.修改環境參數
.bash_profile

export ORACLE_SID=EMREP
export ORACLE_HOST_NAME=grid
export ORACLE_HOME=/u01/app/oracle/OracleHomes/db10g
export ORACLE_AGENT_HOME=/u01/app/oracle/OracleHomes/agent10g
export ORACLE_OMS_HOME=/u01/app/oracle/OracleHomes/oms10g
export ORACLE_BASE=/u01/app/oracle
export LD_LIBRARY_PATH=$ORACLE_OMS_HOME/lib:$ORACLE_OMS_HOME/opmn/lib:$ORACLE_AGENT_HOME/opmn/lib:$ORACLE_HOME/lib:$LD_LIBRARY_PATH

export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/jdk/bin:$ORACLE_AGENT_HOME/bin:$ORACLE_OMS_HOME/opmn/bin:$PATH

2.使用command 手動deploy
Symptom:
OC4J configuration failed,
caught exception while undeploying IsWebCacheWorking from home

ref: http://hustatyova.blogspot.tw/2012/07/installing-oracle-enterprise-manager.html


sol:
#猜測 主要還是環境參數造成的bug
/u01/app/oracle/OracleHomes/oms10g/jdk/bin/java -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir=/tmp -mx512M -classpath /u01/app/oracle/OracleHomes/oms10g/dcm/lib/dcm.jar:/u01/app/oracle/OracleHomes/oms10g/dcm/lib/oc4j_deploy_tools.jar:/u01/app/oracle/OracleHomes/oms10g/opmn/lib/opmnplugin.jar -Doracle.ias.sysmgmt.logging.logdir=/u01/app/oracle/OracleHomes/oms10g/j2ee/home/log oracle.j2ee.tools.deploy.Oc4jDeploy -oraclehome /u01/app/oracle/OracleHomes/oms10g -verbose -inifile /u01/app/oracle/OracleHomes/oms10g/j2ee/deploy.ini

3.新增listener.ora 參數
Symptom:
OMS configuration failed

add listener.ora :
SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF

星期六, 11月 15, 2014

使用Oracle Virtual Box 安裝Oracle RAC的disk 環境設定

http://oracle-base.com/articles/12c/oracle-db-12cr1-rac-installation-on-oracle-linux-6-using-virtualbox.php#create_shared_disks

--Create Disks
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" createhd --filename ocr.vdi --size 256 --format VDI --variant Fixed
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" createhd --filename voting.vdi --size 256 --format VDI --variant Fixed
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" createhd --filename asmdisk1.vdi --size 4096 --format VDI --variant Fixed
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" createhd --filename asmdisk2.vdi --size 4096 --format VDI --variant Fixed

--Attach Disks to RAC1
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RAC1 --storagectl "SATA" --port 1 --device 0 --type hdd --medium ocr.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RAC1 --storagectl "SATA" --port 1 --device 0 --type hdd --medium voting.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RAC1 --storagectl "SATA" --port 1 --device 0 --type hdd --medium asmdisk1.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RAC1 --storagectl "SATA" --port 1 --device 0 --type hdd --medium asmdisk2.vdi --mtype shareable

--Set disks to shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd ocr.vdi --type shareable

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd voting.vdi --type shareable

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd asmdisk1.vdi --type shareable

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd asmdisk2.vdi --type shareable

--Attach Disks to RAC2
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RAC2 --storagectl "SATA" --port 1 --device 0 --type hdd --medium ocr.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RAC2 --storagectl "SATA" --port 1 --device 0 --type hdd --medium voting.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RAC2 --storagectl "SATA" --port 1 --device 0 --type hdd --medium asmdisk1.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RAC2 --storagectl "SATA" --port 1 --device 0 --type hdd --medium asmdisk2.vdi --mtype shareable


P.S.
如果要resize 某硬碟至30GB (thin provision)
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd G:\RAC1\RAC1.vdi --resize 30720

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd G:\RAC2\RAC2.vdi --resize 30720

如果要複製虛擬機:
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" clonehd G:\RAC2\RAC2.vdi G:\RAC1\RAC1.vdi

星期六, 7月 26, 2014

[RMAN] list backup of archivelog all 與 list archivelog all 的差別

RMAN>  list backup of archivelog all;  ==> 會列出backuppiece 與archive logs
不要小看此指令, 當backupset 的檔名亂取時, 判斷arc log 資訊就是靠它

List of Backup Sets
===================

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ -----------------
2       54.22M     DISK        00:00:00     20140726 01:32:53
        BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: BACKUP_ORCL_000001_072614013149
        Piece Name: /oracle/db102/dbs/03peari5_1_1

  List of Archived Logs in backup set 2
  Thrd Seq     Low SCN    Low Time          Next SCN   Next Time
  ---- ------- ---------- ----------------- ---------- ---------
  1    31      426604     20140726 01:11:00 441429     20140726 01:15:19
  1    32      441429     20140726 01:15:19 444127     20140726 01:32:52

RMAN> list archivelog all;


List of Archived Log Copies
Key     Thrd Seq     S Low Time          Name
------- ---- ------- - ----------------- ----
1       1    31      A 20140726 01:11:00 /oracle/arch/1_31_853894793.dbf
2       1    32      A 20140726 01:15:19 /oracle/arch/1_32_853894793.dbf

RMAN>

星期六, 7月 20, 2013

RMAN recover時 資料庫居然跟我要 兩天前的archive log

最近在還原資料庫時居然發生此問題
百思不得其解
正常的RMAN recover 只會需要 Backup window期間所有的archive log 才對

直到看到這篇文章提到了...
RMAN was requesting archived logs that were generated almost a week back

某位路人說 The controlfile is may be older and datafiles are newer

是跟我類似的情境耶, 忽然恍然大悟...

原來rman script 中的channel 1 是做bkset 備份 , 做八個小時.
                                  channel 2 是做bkset , archive log 備份, 而channel 2 做了將近三天
如此則會導致還原時~ 遇到的問題一再發生...
下次如果要原時確定一下control file的時間到底為幾號備的
  或是使用以下方法

SQL>
RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL TIME 'YYYY-MM-DD:HH24:MI:SS';

以上的效果為: When Oracle starts recovery, it looks at the datafiles to know the last time a checkpoint was performed on the datafile. Oracle now knows to start applying recovery to the datafile for all SCNs after the SCN in the datafile header

星期三, 6月 26, 2013

HP UX syslog "Rebooting for cluster integrity" powerpath

安裝Oracle RAC 之前, 如果沒先處理好powerpath 等等的multi-path 軟體問題,
可能在dbca 之後一小時內會發生node reboot情形


以下連結供參考Ref:
https://forums.oracle.com/thread/927929
https://forums.oracle.com/thread/993066
https://forums.oracle.com/thread/581397

最後查到這篇才證實了我的猜測
==> 294430.1
LONG LATENCIES TO THE VOTING DISKS : EMC PowerPath path error detection and I/O repost and redirect greater than default misscount 

The most common problems relate to multi-path IO software drivers, and the reconfiguration times resulting from a failure in the IO path.
Hardware and (re)configuration issues that introduce these latencies should be corrected.


Reboot原因說明如下

Disk LUN I/O重新導向的狀況下...只要符合以下任一條件, 就會node reboot
Takes more than Disktimeout seconds (200 sec) or
Takes more than Misscount Seconds (30 sec)

* By default Misscount is less than Disktimeout seconds
只有在網路互ping超過misscountVoting disk超過disktimeout時機器才會reboot.

misscount :   Default Value is 60 Sec (Linux) and 30 Sec in Unix platform
disktimeout : Default Value is 200. (Disk IO)


星期二, 5月 07, 2013

Oracle 各帳號用途清查 for 9i/10g/11g


以下為Oracle原廠文件所提到的帳號清單, locked 代表一般安裝好的資料庫中,是停用的。

account
Usage
Account Status
ANONYMOUS
Oracle XML DB
Expired and locked
CTXSYS
Oracle Text
Expired and locked
DBSNMP
Oracle Enterprise Manager
Open
EXFSYS
Rules Manager and Expression Filter
Expired and locked
LBACSYS
Oracle Label Security
Expired and locked
MDSYS
Oracle Spatial and Oracle Multimedia Locator administrator account
Expired and locked
MGMT_VIEW
Oracle Enterprise Manager 
Open
OLAPSYS
OLAP Catalog 
Expired and locked
ORDDATA
Oracle Multimedia DICOM data model
Expired and locked
OWBSYS
Oracle Warehouse Builder repository
Expired and locked
ORDPLUGINS
Oracle Multimedia
Expired and locked
ORDSYS
Oracle Multimedia administrator
Expired and locked
OUTLN
Plan stability account
Expired and locked
SI_INFORMTN_SCHEMA
Views for the SQL/MM Still Image Standard
Expired and locked
SYSMAN
Oracle Enterprise Manager
Open
TSMSYS
transparent session migration (TSM)
Expired and locked
WK_TEST
Oracle Ultra Search
Expired and locked
WKSYS
Ultra Search database super-user
Expired and locked
WKPROXY
Oracle9i Application Server Ultra Search
Expired and locked
WMSYS
Oracle XML DB data and metadata
Expired and locked
BI
Default Sample Schema
Expired and locked
HR
Default Sample Schema
Expired and locked
OE
Default Sample Schema
Expired and locked
PM
Default Sample Schema
Expired and locked
IX
Default Sample Schema
Expired and locked
SH
Default Sample Schema
Expired and locked
SYSTEM
資料庫管理帳號SYSPOER
Open
SYS
資料庫管理帳號SYSDBA
Open


查詢Oracle帳號方法如下:
As Oracle User
sqlplus "/ as sysdba"

SQL>

col username for a25
col account_status for a8
col default_tablespace for a10
select username , account_status , created , default_tablespace from dba_users where account_status not like '%LOCKED%' order by username;


USERNAME                  ACCOUNT_ CREATED            DEFAULT_TA
------------------------- -------- ------------------ ----------
DBSNMP                    OPEN     04-FEB-10          SYSAUX  => 資料庫Oracle OEM (內部使用)
HR                        OPEN     22-APR-11          USERS
RPT                       OPEN     25-JUL-12          USERS
SYS                       OPEN     04-FEB-10          SYSTEM    => 資料庫管理帳號 SYSDBA
SYSMAN                    OPEN     04-FEB-10          SYSAUX   => 資料庫管理帳號 SYSOPER
SYSTEM                    OPEN     04-FEB-10          SYSTEM
TEST                      OPEN     20-JUL-11          USERS

7 rows selected.

排除預設帳號, 黃字部分為有使用的三個Oracle帳號:

HR, RPT, TEST

若確定TEST帳號沒在使用, 可以將其LOCKED
SQL>  
alter user test account lock;

User altered.

查詢TEST帳號, 可以發現TEST帳號已經停止使用(LOCKED)
col username for a25
col account_status for a8
col default_tablespace for a10
select username , account_status , created , default_tablespace from dba_users where username='TEST';


星期五, 3月 22, 2013

Oracle 10g/11g RAC Service names ---to avoid dead lock

提供service_name : crmsrv 以避免deadlock 情形:

orcl1 active , orcl2standby instance for Service

srvctl add service -d orcl -s service_test -r orcl1 -a orcl2
srvctl start service -d orcl -s service_test


----------------------------------------------------------
順道一提~ 如果2 node Oracle RAC只要提供一個instance service :

設定方法如下

Oracle RAC (2 nodes) supports active-passive mode enabling 1 node to "do the work"
whilst node 2 remains comparatively idle.
During a failure of the active database instance, users failover to the passive instance.
This feature can be configured by setting the following database initialisation
parameter to 1 on both instances:

active_instance_count = 1 

星期四, 3月 21, 2013

Oracle 10g RAC -- node 1 毀損重新加入之步驟

0.Prerequisite:
 Configure /etc/hosts
 Configure ssh : 設定ssh 對等性
 Install OCFS rpm
 Configure /etc/fstab : OCFS filesystem
 Configure IP/Network : 網卡bonding ... etc
 Configure OS kernel : /etc/sysctl.conf

1.Create user , group
2.Verify if db1 env is ok
  執行cluvfy 工具
  ./cluvfy stage -pre -n db1 -r 10gR2 -verbose
3.如果有ASM,刪除ASM instance,
  $srvctl remove asm -n db1;
4.移除clusterware resource
   srvctl stop nodeapps -n db1
   srvctl remove nodeapps -n db1
5.db2上執行updateNodeList script 更新DB資訊
  /oracle/db102/oui/bin/runInstaller -updateNodeList -noClusterEnabled ORACLE_HOME=/oracle/db102 CLUSTER_NODES=db2 CRS=false "INVENTORY_LOCATION=/oracle/oraInventory" LOCAL_NODE=db2

6.db2上執行updateNodeList script更新CRS資訊
/oracle/crs102/oui/bin/runInstaller -updateNodeList -noClusterEnabled ORACLE_HOME=/oracle/crs102 "CLUSTER_NODES=db2" CRS=TRUE "INVENTORY_LOCATION=/oracle/oraInventory" LOCAL_NODE=db2

7.db2上執行rootdeletenode.sh script
  /oracle/crs102/bin/olsnodes -n -i
  As root :
      /oracle/crs102/install/rootdeletenode.sh db1,1;

8.檢查是否已刪除Clusterware resource
  As root:
  [root@db2 bin]# ./crs_stat  |grep -i db1
  NAME=ora.db1.LISTENER_db1.lsnr
  NAME=ora.db1.vip
  [root@db2 bin]# ./crs_unregister ora.db1.LISTENER_db1.lsnr
  [root@db2 bin]# ./crs_unregister ora.db1.vip
  [root@db2 bin]# ./crs_stat  |grep -i db1

  檢查DB節點資訊
  As root:
  /oracle/crs102/bin/olsnodes -n

9.在任意保留節點中執行racgons命令,刪除ONS設定:
  [oracle@db2 orcl]$ /oracle/crs102/bin/racgons remove_config db1:6200
  racgons: Existing key value on db1 = 6200.
  racgons: db1:6200 removed from OCR.

10.Clone CRS HOME
   db2,oracle用戶進入$CRS_HOME/oui/bin目錄,執行addNode.sh
  
12.Configure the New ONS
  cd /oracle/crs102/bin
  ./racgons add_config db1:6200 db2:6200

13.Clone ORA_HOME
  db2,oracle用戶進入$ORACLE_HOME/oui/bin目錄,執行addNode.sh

14.新增db1 listener
  db1上運行netca,選擇cluster database,按步驟設定

15.db2上新增新的instance
  先選擇Cluster database...然後instance management然後add an instance然後...

最後檢查
[oracle@db1 log]$ olsnodes -n
db2  2
db1  3

As Oracle:
crs_stat -t 查詢resource 狀態 , 確定皆已online.

LinkWithin-相關文件

Related Posts Plugin for WordPress, Blogger...