星期三, 4月 19, 2017

Windows 7/8 可以連VPN, 但Windows 10無法連接的問題(已解決)

Windows 7/8 可以連VPN, Windows 10無法連接的問題(已解決)

1.VPN連接刪掉

2.進入到裝置管理員,

 

WAN Miniport (IP), Wan Miniport(IPv6) and Wan Miniport (PPTP)

這三個卸載

 

3.新增VPN連線(按照市聯醫文件), 只使用IPV4

4.進入到裝置管理員, 重新掃描所有硬體, 把上面三個元件掃描回來

5.連線成功!

 

ref:

https://answers.microsoft.com/zh-hans/windows/forum/windows_10-networking/vpn%E5%8F%88%E6%97%A0%E6%B3%95%E8%BF%9E%E6%8E%A5/2ff93543-2184-4d3a-9716-f2d483825df8

星期三, 4月 12, 2017

[Exadata] 在Exadata的DB node上如何重啟OS Watcher

[Exadata] ExadataDB node上如何重啟OS Watcher

 

ref: https://docs.oracle.com/cd/E50790_01/doc/doc.121/e51951/db_server.htm#DBMMN21590

 

關閉:

OS Watcher (releases earlier than 11.2.3.3.0)

# /opt/oracle.oswatcher/osw/stopOSW.sh

 

ExaWatcher (release 11.2.3.3.0 and later)

# /opt/oracle.ExaWatcher/ExaWatcher.sh --stop

 

啟動:

OS Watcher (releases earlier than release 11.2.3.3.0)

# /opt/oracle.cellos/vldrun -script oswatcher

ExaWatcher (release 11.2.3.3.0 and later)

# /opt/oracle.ExaWatcher/ExaWatcher.sh

星期一, 4月 10, 2017

Linux 如何鎖定/ 解鎖root account

Ref:



 To lock the password
# passwd -l user1
Locking password for user user1.
passwd: Success

To unlock the password
# passwd -u user1
Unlocking password for user user1.
passwd: Success

星期四, 3月 30, 2017

LC SC 光纖線 Gbic 的一些簡單解釋

Ciscx 網路設備Gbic接頭 : 10GBASE-SR

 

用於短距離傳輸的多模光纖規格(SRShort Reach之意),採用波長850nm的雷射光源,依使用的光纖纜線等級不同,

最大傳輸距離可達26公尺(FDDI-grade 62.5μm)、

33公尺(OM1-橘色光纖線 62.5μm)、

82公尺(OM2-橘色光纖線 50μm)、

300公尺(OM3-藍色光纖線)或400公尺(OM4)。

LC : 小頭  LC接頭主要應用企業網路環境中,用來取代SC接頭的,它的尺寸比較小。

SC : 大頭

 

LC接頭有時候稱為小(Little接頭。

SC接頭可用"方形接頭"(Square Connector來記憶,並且有人認為這才是它的正確名稱,因為接頭本身是方形的。另一記憶方法是(Stick and Click)。

 

LC to LC(Multimode)

 

LC to SC

 

--

10GBASE-LR

 

10GBASE-LR是用於長距離傳輸的單模光纖(LRLong Reach之意),採用波長1310nm的雷射光源,傳輸距離為10公里。

 

ref:

http://www.ithome.com.tw/tech/90786

 

星期二, 3月 28, 2017

Oracle Linux 7 Install Oracle Database 11.2.0.4 方法

ref:

https://docs.oracle.com/database/122/CWLIN/disabling-transparent-hugepages.htm

 

Transparent HugePages memory is disabled by default in UEK2 and later UEK kernels.

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

Quick Reference to Patch Numbers for Database/GI PSU, SPU(CPU), Bundle Patches and Patchsets (Doc ID 1454618.1)

 

Patch 13390677: 11.2.0.4.0 PATCH SET FOR ORACLE DATABASE SERVER

Currently, the Oracle Database 11.2.0.4 files are not available to download from the usual Oracle Technology Network (OTN) area, instead you have to log into My Oracle Support (MOS) and search for patch number '13390677'.  It's probably worth mentioning at this point, that the 'patch' is a full install, despite the reference – so you don't need to download Oracle Database 11.2.0.2 files in addition here 😉

 

Once you've searched for the 'patch', select the link appropriate to your platform, in this case 'Linux x86-64'.  When you click download, there will be a total of 7 zip files available.  For a standard installation, you only need zip parts 1 and 2…

 

p13390677_112040_platform_1of7.zip (Oracle Database, including Oracle RAC components)

p13390677_112040_platform_2of7.zip (Oracle Database, including Oracle RAC components)

p13390677_112040_platform_3of7.zip (Oracle Grid Infrastructure, includes: Oracle ASM, Oracle Clusterware, Oracle Restart)

p13390677_112040_platform_4of7.zip (Oracle Database Client)

p13390677_112040_platform_5of7.zip (Oracle Gateways)

p13390677_112040_platform_6of7.zip (Oracle Examples)

p13390677_112040_platform_7of7.zip (Deinstall)

 

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

 

 

[root@testdb11g source]#

#Hyper-V mount iso 好像怪怪的 所以直接把OEL 7.2 iso copy/source去進行掛載

 

mount -t iso9660 -o loop /source/V100082-01.iso /media/rhel7

 

ref: https://access.redhat.com/solutions/23016

cd /media/rhel7/Packages

 

[root@testdb11g Packages]# yum install createrepo

Loaded plugins: langpacks, ulninfo

Resolving Dependencies

--> Running transaction check

---> Package createrepo.noarch 0:0.9.9-23.el7 will be updated

---> Package createrepo.noarch 0:0.9.9-26.el7 will be an update

--> Finished Dependency Resolution

 

Dependencies Resolved

 

=====================================================================================================

Package                 Arch                Version                   Repository               Size

=====================================================================================================

Updating:

createrepo              noarch              0.9.9-26.el7              ol7_latest               92 k

 

Transaction Summary

=====================================================================================================

Upgrade  1 Package

 

Total size: 92 k

Is this ok [y/d/N]: y

Downloading packages:

warning: /var/cache/yum/x86_64/7Server/ol7_latest/packages/createrepo-0.9.9-26.el7.noarch.rpm: Header

V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

Importing GPG key 0xEC551F03:

Userid     : "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"

Fingerprint: 4214 4123 fecf c55b 9086 313d 72f9 7b74 ec55 1f03

Package    : 7:oraclelinux-release-7.2-1.0.5.el7.x86_64 (@anaconda/7.2)

From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

Is this ok [y/N]: y

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Updating   : createrepo-0.9.9-26.el7.noarch                                                    1/2

  Cleanup    : createrepo-0.9.9-23.el7.noarch                                                    2/2

  Verifying  : createrepo-0.9.9-26.el7.noarch                                                    1/2

  Verifying  : createrepo-0.9.9-23.el7.noarch                                                    2/2

 

Updated:

  createrepo.noarch 0:0.9.9-26.el7                                                                   

 

Complete!

 

cd  /etc/yum.repos.d

mv public-yum-ol7.repo public-yum-ol7.orig

vi local.repo

 

[local]

name=local

gpgcheck=0

baseurl=file:///media/rhel7

 

yum list

 

yum install compat-libstdc++* -y

yum install binutils -y

yum install compat-libcap* -y

yum install gcc-4.8.5 -y

yum install glibc -y

yum install glibc-devel -y

yum install ksh -y

yum install libaio -y

yum install libaio-devel -y

yum install libgcc -y

yum install libstdc++ -y

yum install libstdc++-devel -y

yum install libXi -y

yum install libXtst -y

yum install make -y

yum install sysstat -y

yum install elfutils -y

yum install elfutils-libelf-devel -y

yum install xorg-x11-apps -y

 

[root@testdb11g source]# yum install oracle-rdbms-server-12cR1-preinstall.x86_64   or yum install oracle-rdbms-server-11gR2-preinstall.x86_64

Loaded plugins: langpacks, ulninfo

Resolving Dependencies

--> Running transaction check

---> Package oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-4.el7 will be installed

--> Processing Dependency: gcc-c++ for package: oracle-rdbms-server-12cR1-preinstall-1.0-4.el7.x86_64

--> Running transaction check

---> Package gcc-c++.x86_64 0:4.8.5-4.el7 will be installed

--> Finished Dependency Resolution

 

Dependencies Resolved

 

===============================================================================================================================================================================================

Package                                                            Arch                                 Version                                     Repository                           Size

===============================================================================================================================================================================================

Installing:

oracle-rdbms-server-12cR1-preinstall                               x86_64                               1.0-4.el7                                   local                                18 k

Installing for dependencies:

gcc-c++                                                            x86_64                               4.8.5-4.el7                                 local                               7.2 M

 

Transaction Summary

===============================================================================================================================================================================================

Install  1 Package (+1 Dependent package)

 

Total download size: 7.2 M

Installed size: 16 M

Is this ok [y/d/N]: y

Downloading packages:

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

Total                                                                                                                                                          107 MB/s | 7.2 MB  00:00:00    

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : gcc-c++-4.8.5-4.el7.x86_64                                                                                                                                                  1/2

  Installing : oracle-rdbms-server-12cR1-preinstall-1.0-4.el7.x86_64                                                                                                                       2/2

  Verifying  : oracle-rdbms-server-12cR1-preinstall-1.0-4.el7.x86_64                                                                                                                       1/2

  Verifying  : gcc-c++-4.8.5-4.el7.x86_64                                                                                                                                                  2/2

 

Installed:

  oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-4.el7                                                                                                                                     

 

Dependency Installed:

  gcc-c++.x86_64 0:4.8.5-4.el7                                                                                                                                                                 

 

Complete!

 

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

if OS is Redhat Enterprise Linux 6/ Redhat Enterprise Linux 7 :

Ref https://blacksaildivision.com/how-to-disable-transparent-huge-pages-on-centos

 

How to disable THP manually?

 

Append followings in /etc/rc.local:

 

if test -f /sys/kernel/mm/transparent_hugepage/enabled; then

    echo never > /sys/kernel/mm/transparent_hugepage/enabled

fi

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

 

https://oracle-base.com/articles/11g/oracle-db-11gr2-installation-on-oracle-linux-6

 

Add or amend the following lines in the "/etc/sysctl.conf" file.

 

fs.suid_dumpable = 1

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmall = 2097152

kernel.shmmax = 536870912

kernel.shmmni = 4096

# semaphores: semmsl, semmns, semopm, semmni

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default=262144

net.core.rmem_max=4194304

net.core.wmem_default=262144

net.core.wmem_max=1048586

 

Create the new groups and users.

 

groupadd -g 501 oinstall

groupadd -g 502 dba

#groupadd -g 503 oper

#groupadd -g 504 asmadmin

#groupadd -g 506 asmdba

#groupadd -g 505 asmoper

 

#useradd -u 502 -g oinstall -G dba,asmdba,oper oracle

#useradd -u 502 -g oinstall -G dba oracle

[root@testdb11g kernel]# passwd oracle

Changing password for user oracle.

New password: welcome1

BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word

Retype new password: welcome1

passwd: all authentication tokens updated successfully.

[root@testdb11g kernel]#

 

vi /etc/security/limits.d/20-nproc.conf

# Default limit for number of user's processes to prevent

# accidental fork bombs.

# See rhbz #432903 for reasoning.

 

*          soft    nproc     4096 ->16384

root       soft    nproc     unlimited

 

Set secure Linux to permissive by editing the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows.

 

SELINUX=permissive

 

 

mkdir -p /u01/app/oracle/product/11.2.0/db_1

chown -R oracle:oinstall /u01

chmod -R 775 /u01

 

Login as the oracle user and add the following lines at the end of the ".bash_profile" file.

 

# Oracle Settings

TMP=/tmp; export TMP

TMPDIR=$TMP; export TMPDIR

 

ORACLE_HOSTNAME=ol6-112.localdomain; export ORACLE_HOSTNAME

ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME

ORACLE_SID=DB11G; export ORACLE_SID

 

PATH=/usr/sbin:$PATH; export PATH

PATH=$ORACLE_HOME/bin:$PATH; export PATH

 

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

 

 

chown -R oracle:oinstall /source

 

Log in as oracle user "

/source/database/runInstaller

 

 

#ref https://oracle-base.com/articles/11g/oracle-db-11gr2-installation-on-oracle-linux-7

During the link phase you will encounter an error invoking the "ins_emagent.mk" file. To fix this, edit the "$ORACLE_HOME/sysman/lib/ins_emagent.mk", doing a search and replace for the line shown below.

 

FROM:

$(MK_EMAGENT_NMECTL)

TO  :

$(MK_EMAGENT_NMECTL) -lnnz11

 

Click the "Retry" button.

 

 

[root@testdb11g ~]# /u01/app/oraInventory/orainstRoot.sh

Changing permissions of /u01/app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.

 

Changing groupname of /u01/app/oraInventory to oinstall.

The execution of the script is complete.

[root@testdb11g ~]# /u01/app/oracle/product/11.2.0/db_1/root.sh

Running Oracle 11g root script...

 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/app/oracle/product/11.2.0/db_1

 

Enter the full pathname of the local bin directory: [/usr/local/bin]:

   Copying dbhome to /usr/local/bin ...

   Copying oraenv to /usr/local/bin ...

   Copying coraenv to /usr/local/bin ...

 

 

Creating /etc/oratab file...

Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.

Finished product-specific root actions.

[root@testdb11g ~]#

 

 

星期一, 3月 27, 2017

CentOS 7 如何沿用舊的iptables服務 (Disable firewalld Service)

Ref:

https://www.phpini.com/linux/rhel-centos-disable-firewalld-use-iptables

 

1.Disable firewalld service

[root@testdb11g ~]# systemctl stop firewlald

Failed to stop firewlald.service: Unit firewlald.service not loaded.

[root@testdb11g ~]# systemctl stop firewalld

[root@testdb11g ~]# systemctl disable firewalld

Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.

[root@testdb11g ~]# yum install iptables-services

Loaded plugins: langpacks, ulninfo

ol7_UEKR3/x86_64/primary                                                      |  25 MB  00:00:02    

ol7_UEKR3                                                                                    588/588

 

ol7_latest                                                                               18642/18642

Resolving Dependencies

--> Running transaction check

---> Package iptables-services.x86_64 0:1.4.21-17.el7 will be installed

--> Processing Dependency: iptables = 1.4.21-17.el7 for package: iptables-services-1.4.21-17.el7.x86_

64

--> Running transaction check

---> Package iptables.x86_64 0:1.4.21-16.el7 will be updated

---> Package iptables.x86_64 0:1.4.21-17.el7 will be an update

--> Finished Dependency Resolution

 

Dependencies Resolved

 

=====================================================================================================

Package                      Arch              Version                  Repository             Size

=====================================================================================================

Installing:

iptables-services            x86_64            1.4.21-17.el7            ol7_latest             50 k

Updating for dependencies:

iptables                     x86_64            1.4.21-17.el7            ol7_latest            424 k

 

Transaction Summary

=====================================================================================================

Install  1 Package

Upgrade             ( 1 Dependent package)

 

Total download size: 474 k

Is this ok [y/d/N]: y

Downloading packages:

No Presto metadata available for ol7_latest

warning: /var/cache/yum/x86_64/7Server/ol7_latest/packages/iptables-services-1.4.21-17.el7.x86_64.rpm

: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY

Public key for iptables-services-1.4.21-17.el7.x86_64.rpm is not installed

(1/2): iptables-services-1.4.21-17.el7.x86_64.rpm                             |  50 kB  00:00:00    

(2/2): iptables-1.4.21-17.el7.x86_64.rpm                                      | 424 kB  00:00:00    

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

Total                                                                1.8 MB/s | 474 kB  00:00:00    

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

Importing GPG key 0xEC551F03:

Userid     : "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"

Fingerprint: 4214 4123 fecf c55b 9086 313d 72f9 7b74 ec55 1f03

Package    : 7:oraclelinux-release-7.2-1.0.5.el7.x86_64 (@anaconda/7.2)

From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

Is this ok [y/N]: y

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

 Updating   : iptables-1.4.21-17.el7.x86_64                                                     1/3

  Installing : iptables-services-1.4.21-17.el7.x86_64                                            2/3

  Cleanup    : iptables-1.4.21-16.el7.x86_64                                                     3/3

  Verifying  : iptables-services-1.4.21-17.el7.x86_64                                            1/3

  Verifying  : iptables-1.4.21-17.el7.x86_64                                                     2/3

  Verifying  : iptables-1.4.21-16.el7.x86_64                                                     3/3

 

Installed:

  iptables-services.x86_64 0:1.4.21-17.el7                                                          

 

Dependency Updated:

  iptables.x86_64 0:1.4.21-17.el7                                                                   

 

Complete!

 

3. 啟動及設定開機執行 iptables

 

[root@testdb11g ~]# systemctl enable iptables

Created symlink from /etc/systemd/system/basic.target.wants/iptables.service to /usr/lib/systemd/syst

em/iptables.service.

[root@testdb11g ~]# systemctl start iptables

[root@testdb11g ~]#

[轉載]11G ving the Database Audit Trail to a Different Tablespace

 

[轉載]11G ving the Database Audit Trail to a Different Tablespace

ref: https://oracle-base.com/articles/11g/auditing-enhancements-11gr2

 

CONN / AS SYSDBA

 

SELECT table_name, tablespace_name

FROM   dba_tables

WHERE  table_name IN ('AUD$', 'FGA_LOG$')

ORDER BY table_name;

 

TABLE_NAME                     TABLESPACE_NAME

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

AUD$                           SYSTEM

FGA_LOG$                       SYSTEM

 

SQL>

 

Next, create a new tablespace to hold the audit trail.

 

CREATE TABLESPACE audit_aux

  DATAFILE '/u01/app/oracle/oradata/DB11G/audit_aux01.dbf'

  SIZE 1M AUTOEXTEND ON NEXT 1M;

 

Then we move the standard audit trail to the new tablespace.

 

BEGIN

  DBMS_AUDIT_MGMT.set_audit_trail_location(

    audit_trail_type           => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD,

    audit_trail_location_value => 'AUDIT_AUX');

END;

/

 

PL/SQL procedure successfully completed.

 

SQL>

 

-- Check locations.

SELECT table_name, tablespace_name

FROM   dba_tables

WHERE  table_name IN ('AUD$', 'FGA_LOG$')

ORDER BY table_name;

 

TABLE_NAME                     TABLESPACE_NAME

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

AUD$                           AUDIT_AUX

FGA_LOG$                       SYSTEM

 

SQL>

Next we move the fine-grained audit trail.

 

BEGIN

  DBMS_AUDIT_MGMT.set_audit_trail_location(

    audit_trail_type           => DBMS_AUDIT_MGMT.AUDIT_TRAIL_FGA_STD,

    audit_trail_location_value => 'AUDIT_AUX');

END;

/

 

PL/SQL procedure successfully completed.

 

SQL>

 

-- Check locations.

SELECT table_name, tablespace_name

FROM   dba_tables

WHERE  table_name IN ('AUD$', 'FGA_LOG$')

ORDER BY table_name;

 

TABLE_NAME                     TABLESPACE_NAME

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

AUD$                           AUDIT_AUX

FGA_LOG$                       AUDIT_AUX

 

SQL>

 

星期五, 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 default sys_guid();

[轉載] 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

 

LinkWithin-相關文件

Related Posts Plugin for WordPress, Blogger...