星期五, 3月 24, 2017

[轉載] Oracle Goldengate 當某個table的column超過32個欄位的時候, 對表格的處理方法

Ref: http://www.itpub.net/thread-1751245-1-1.html

add trandata user.table的含義
有兩層含義:
第一層含義: tablePK or UK ,則目標端能準確依據PK or UK,從而找到源端DML更新的資料,從而在目標端同步。
第二層含義: table沒有PK or UK,則目標端只能依據該table的所有列,從而找到源端DML更新的資料,從而在目標端同步。

還有一種語法和add trandata作用相同,如下:
alter table user.table add  supplemental log group ggs_table_1 (PK or UK) always;   ---和第一層含義等效(有主鍵或唯一建)。
alter table user.table add  supplemental log group ggs_table_1 (all column) always;  ---和第二層含義等效(沒有主鍵或唯一建)。

延伸一下:

當某個tablecolumn超過32個欄位的時候,使用add trandata就會報錯:
WARNING OGG-00706 Failed to add supplemental log group on table user.table due to ORA-02257: maximum number of columns exceeded ......
這個時候,就要使用
alter table user.table add  supplemental log .....這種方式才可。
這個時候,要分兩種情況:
第一情況是,列超過32個,但是有主鍵或唯一建
第二情況是,列超過32個,沒有主鍵或唯一建

對於第一張情況,如下解決:

alter table user.table add  supplemental log group ggs_table_1 (PK or UK) always;

對於第二種情況,要複雜一些:

alter table user.table add  supplemental log group ggs_table_1 (all column <32) always;

alter table user.table add  supplemental log group ggs_table_2 (all colum >32) always;

在延伸一下:
還有一種情況是,使用add trandata的時候,但table沒有UK,PK的時候,又不允許把所有的列當做關鍵列來同步資料,這時候,怎麼辦?

這個問題,解決起來,比較複雜:
可以參考這個連結:

或是我在blogger寫的另一篇文章
  alter table <table_name> add OGG_KEY_ID raw(16);
 .
 .
alter table

[轉載] Restore 9i backupset to 10g DB_HOME

主要是讓新版的資料庫軟體(10g) 讀取舊版本的RMAN Backupset(9i), 並進行還原動作。

Ref: http://nadvi.blogspot.tw/2010/08/is-it-possible-to-restore-oracle-92.html

 

-

Is it possible to restore Oracle 9.2 RMAN backup with 10.2.0.4 version?

 

Actually, this is possible because RMAN can read from backupset files written by older versions. The same is true for patchset differences, 10.2.0.2 backupset can be used for a restore with RMAN 10.2.0.4. We can also restore 32-bit database backup set with 64-bit version. Of course, keep in mind that simply restoring older database with newer version doesn't give you "instant" upgraded database - 

 

All upgrade steps must be performed after a restore (yes, you'll have to read that manual, after all)

 

 

Refer to Metalink Note:369644.1 "Answers To FAQ For Restoring Or Duplicating Between Different Versions And Platforms". 

 

I tested 9.2->10.2 scenario by restoring 9.2.0.8 backupset with 10.2.0.4 RMAN.

 

-- Connecting to Oracle 9.2.0.8 (noarchivelog) database

Recovery Manager: Release 9.2.0.8.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.

 

connected to target database: ORA9 (DBID=422058228)

using target database controlfile instead of recovery catalog

 

D:\Oracle>rman target / nocatalog

-- -------------------------------------

-- Clean shutdown

-- -------------------------------------

RMAN> shutdown

 

database closed

database dismounted

Oracle instance shut down

 

 

-- ------------------------------------

Mount the database.for the sake of simplicity I left 9i db in noarchivelog mode

-- ------------------------------------

 

RMAN> startup mount

 

connected to target database (not started)

Oracle instance started

database mounted

 

Total System Global Area     705765992 bytes

 

Fixed Size                      455272 bytes

Variable Size                301989888 bytes

Database Buffers             402653184 bytes

Redo Buffers                    667648 bytes

 

 

-- --------------------------------------

-- Backup 9i database with 9i RMAN

-- --------------------------------------

 

RMAN> run {

2>  allocate channel d1 type disk;

3>  backup format 'D:\ORADATA\ORA9\BACKUP\%d_%t_%s_%p.bak' database;

4>  backup current controlfile format 'D:\ORADATA\ORA9\BACKUP\ctrl_%d_%u_%s.bak';

5>  release channel d1;

6> }

 

allocated channel: d1

channel d1: sid=11 devtype=DISK

 

Starting backup at 05.06.08

channel d1: starting full datafile backupset

channel d1: specifying datafile(s) in backupset

input datafile fno=00001 name=D:\ORADATA\ORA9\SYSTEM01.DBF

input datafile fno=00002 name=D:\ORADATA\ORA9\UNDOTBS01.DBF

input datafile fno=00007 name=D:\ORADATA\ORA9\XDB01.DBF

input datafile fno=00006 name=D:\ORADATA\ORA9\USERS01.DBF

input datafile fno=00004 name=D:\ORADATA\ORA9\INDX01.DBF

input datafile fno=00003 name=D:\ORADATA\ORA9\DRSYS01.DBF

input datafile fno=00005 name=D:\ORADATA\ORA9\TOOLS01.DBF

channel d1: starting piece 1 at 05.06.08

channel d1: finished piece 1 at 05.06.08

piece handle=D:\ORADATA\ORA9\BACKUP\ORA9_656636859_7_1.BAK comment=NONE

channel d1: backup set complete, elapsed time: 00:01:15

Finished backup at 05.06.08

Starting backup at 05.06.08

channel d1: starting full datafile backupset

channel d1: specifying datafile(s) in backupset

including current controlfile in backupset

channel d1: starting piece 1 at 05.06.08

channel d1: finished piece 1 at 05.06.08

piece handle=D:\ORADATA\ORA9\BACKUP\CTRL_ORA9_08JI6V06_8.BAK comment=NONE

channel d1: backup set complete, elapsed time: 00:00:01

Finished backup at 05.06.08

Starting Control File and SPFILE Autobackup at 05.06.08

piece handle=D:\ORACLE\ORA9\DATABASE\C-422058228-20080605-02 comment=NONE

Finished Control File and SPFILE Autobackup at 05.06.08

 

released channel: d1

 

-- ---------------------

-- Shutdown 9i instance

-- ---------------------

 

RMAN> shutdown

 

database dismounted

Oracle instance shut down

-- -----------------------------------------

-- Prepare 10g instance with which you'll

-- restore 9i backup (this step is out of

-- the scope of this note!)

-- -----------------------------------------

 

Prior to excecuting restore of 9i RMAN backup with 10g RMAN I took backup of 9i files and deleted them from original location. As shown below, there are no datafile in directory D:\ORADATA\ORA9 directory.

 

D:\ORADATA\ORA9>dir

Volume in drive D is SW

Volume Serial Number is 408C-7E40

 

Directory of D:\ORADATA\ORA9

05.06.2008  23:24  

         .

05.06.2008  23:24  

          ..

05.06.2008  23:08  

          BACKUP

05.06.2008  23:23  

          BACKUP9_ORIGINAL

               0 File(s)              0 bytes

 

And the RMAN backup directory contains:

 

D:\ORADATA\ORA9\BACKUP>dir

Volume in drive D is SW

Volume Serial Number is 408C-7E40

 

Directory of D:\ORADATA\ORA9\BACKUP

 

05.06.2008  23:08  

          .

05.06.2008  23:08  

          ..

05.06.2008  23:08         1.638.400 CTRL_ORA9_08JI6V06_8.BAK

05.06.2008  23:08       517.414.912 ORA9_656636859_7_1.BAK

               2 File(s)    519.053.312 bytes

               2 Dir(s)   4.094.455.808 bytes free

 

-- -----------------------------------------

Restore 9i backupset with 10g  (Note: I used 9i pfile to start 10g instance  that's what caused some warnings about obsolete parameters.)

-- -----------------------------------------

 

D:\Oracle>rman target / nocatalog

Recovery Manager: Release 10.2.0.4.0 - Production on Cet Jun 5 23:29:08 2008

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

connected to target database (not started)

 

RMAN> startup nomount

Oracle instance started

Total System Global Area     683671552 bytes

Fixed Size                     1298592 bytes

Variable Size                276828000 bytes

Database Buffers             402653184 bytes

Redo Buffers                   2891776 bytes

 

-- -----------------------

-- Restore control file...

-- -----------------------

 

RMAN> run {

2>  allocate channel d1 type disk;

3>  restore controlfile from 'D:\ORADATA\ORA9\BACKUP\CTRL_ORA9_08JI6V06_8.BAK';

4>  release channel d1;

5> }

 

allocated channel: d1

channel d1: sid=157 devtype=DISK

 

Starting restore at 05.06.08

 

channel d1: restoring control file

channel d1: restore complete, elapsed time: 00:00:03

output filename=D:\ORADATA\ORA9\CONTROL01.CTL

output filename=D:\ORADATA\ORA9\CONTROL02.CTL

output filename=D:\ORADATA\ORA9\CONTROL03.CTL

Finished restore at 05.06.08

 

released channel: d1

-- ------------------------

-- Mount database...

-- ------------------------

RMAN> alter database mount;

database mounted

 

-- ------------------------

-- Restore database...

-- ------------------------

 

RMAN> run {

2>  allocate channel d1 type disk;

3>  restore database;

4> }

 

allocated channel: d1

channel d1: sid=157 devtype=DISK

 

Starting restore at 05.06.08

 

channel d1: starting datafile backupset restore

channel d1: specifying datafile(s) to restore from backup set

restoring datafile 00001 to D:\ORADATA\ORA9\SYSTEM01.DBF

restoring datafile 00002 to D:\ORADATA\ORA9\UNDOTBS01.DBF

restoring datafile 00003 to D:\ORADATA\ORA9\DRSYS01.DBF

restoring datafile 00004 to D:\ORADATA\ORA9\INDX01.DBF

restoring datafile 00005 to D:\ORADATA\ORA9\TOOLS01.DBF

restoring datafile 00006 to D:\ORADATA\ORA9\USERS01.DBF

restoring datafile 00007 to D:\ORADATA\ORA9\XDB01.DBF

channel d1: reading from backup piece D:\ORADATA\ORA9\BACKUP\ORA9_656636859_7_1.BAK

channel d1: restored backup piece 1

piece handle=D:\ORADATA\ORA9\BACKUP\ORA9_656636859_7_1.BAK tag=TAG20080605T230738

channel d1: restore complete, elapsed time: 00:01:25

Finished restore at 05.06.08

released channel: d1

 

-- ----------------------------

-- Open database with resetlogs

-- ----------------------------

 

RMAN> alter database open resetlogs;

 

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of alter db command at 06/05/2008 23:41:57

ORA-01092: ORACLE instance terminated. Disconnection forced

ORA-00704: bootstrap process failure

ORA-39700: database must be opened with UPGRADE option

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

ORA-03114: not connected to ORACLE

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of alter db command at 06/05/2008 23:41:57

ORA-01092: ORACLE instance terminated. Disconnection forced

ORA-00704: bootstrap process failure

ORA-39700: database must be opened with UPGRADE option

 

This error is normal, since we're now running 9i database with 10g binaries,

so we'll still have to upgrade 9i to 10g...

 

-- ---------------------------------

-- Startup database in upgrade mode

-- ---------------------------------

 

D:\Oracle>sqlplus /nolog

 

SQL*Plus: Release 10.2.0.4.0 - Production on Cet Jun 5 23:42:53 2008

 

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

 

SQL> connect / as sysdba

Connected to an idle instance.

 

SQL> startup upgrade;

ORA-32004: obsolete and/or deprecated parameter(s) specified

ORACLE instance started.

 

Total System Global Area  683671552 bytes

Fixed Size                  1298592 bytes

Variable Size             276828000 bytes

Database Buffers          402653184 bytes

Redo Buffers                2891776 bytes

Database mounted.

Database opened.

 

-- ------------------------------------------

-- from here on you have to follow instructions from Oracle Upgrade Guide. Ie,

1.    Shut down the database as follows:

    SQL> SHUTDOWN IMMEDIATE

 

2.    Restart the database in UPGRADE mode:

    SQL> STARTUP UPGRADE

 

3.    Set the system to spool results to a log file for later verification of success:

    SQL> SPOOL upgrade.log

 

4.    Rerun catupgrd.sql:

    SQL> @catupgrd.sql

  

    5.  Rerun utlu112s.sql:

    SQL> @utlu112s.sql

 

如何安裝Oracle Enterprise Manager 13c 與新增instance 到OEM納管

如何安裝Oracle Enterprise Manager 13c 與新增instance OEM納管

 

Oracle Enterprise Manager Cloud Control 13c Release 1 (13.1.0.0) Installation on Oracle Linux 6 and 7

https://oracle-base.com/articles/13c/cloud-control-13cr1-installation-on-oracle-linux-6-and-7

 

Adding Targets in Enterprise Manager 13c

http://dbakevlar.com/2016/01/adding-targets-in-enterprise-manager-13c/

 

星期五, 3月 03, 2017

Windows 10 多國語言字型問題 (補充字型安裝) 顯示方塊 JRE

Ref:

http://blog.dino9021.com/2017/02/windows-10.html

 

Windows 10 多國語言字型問題

Windows 10 對多國語言的支援比較完善了
不過只安裝語言包對於使用非 Unicode 撰寫的程式仍然顯示不良
因為預設沒有諸如 Big5GB2312 等的地區字型
所以還必須要再安裝補充字型 (Language Capabilities) 才行

首先必須確定你的 Windows 10 電腦能連到 Microsoft Update

再進 Settings -> System -> Apps & features -> Manage Optional Fetures 裡面
確認將各語言的補充字型 (Supplemental Fonts) 手動選取安裝進去

或者你也可以使用 PowerShell
以下列出常用的: 繁體中文、簡體中文及日文的補充字型安裝 Powershell Command

Add-WindowsCapability -Name "Language.Basic~~~zh-TW~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.Handwriting~~~zh-TW~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.OCR~~~zh-TW~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.Speech~~~zh-TW~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.TextToSpeech~~~zh-TW~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.Fonts.Hant~~~und-HANT~0.0.1.0" -Online
Add-WindowsCapability -Name "International.Locale.Taiwan~~~zh-TW~0.0.1.0" -Online

Add-WindowsCapability -Name "Language.Basic~~~zh-CN~0.0.1.0" -Online

Add-WindowsCapability -Name "Language.Handwriting~~~zh-CN~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.OCR~~~zh-CN~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.Speech~~~zh-CN~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.TextToSpeech~~~zh-CN~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.Fonts.Hans~~~und-HANS~0.0.1.0" -Online

Add-WindowsCapability -Name "Language.Basic~~~ja-JP~0.0.1.0" -Online

Add-WindowsCapability -Name "Language.OCR~~~ja-JP~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.Handwriting~~~ja-JP~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.TextToSpeech~~~ja-JP~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.Speech~~~ja-JP~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.Fonts.Jpan~~~und-JPAN~0.0.1.0" -Online

 

LinkWithin-相關文件

Related Posts Plugin for WordPress, Blogger...