oracle 11g dg 部署完全过程

发布时间:2020-08-02 22:56:10 作者:xingzhehxiang
来源:网络 阅读:534

[root@oraclep ~]# hostnamectl set-hostname oraclep

[root@oraclep ~]# vim /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.56.118 oraclep

[root@oraclep ~]# su - oracle

上一次登录:二 7月  2 15:20:31 CST 2019pts/1 上

[oracle@oraclep ~]$ sqlplus  / as sysdba


SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 3 14:54:02 2019


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


Connected to an idle instance.


SQL> startup mount

ORACLE instance started.


Total System Global Area  768294912 bytes

Fixed Size                  2232312 bytes

Variable Size             452984840 bytes

Database Buffers          310378496 bytes

Redo Buffers                2699264 bytes

Database mounted.

SQL> alter database archivelog;

alter database archivelog

*

ERROR at line 1:

ORA-00265: instance recovery required, cannot set ARCHIVELOG mode



SQL> alter database open;


Database altered.


SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount

ORACLE instance started.


Total System Global Area  768294912 bytes

Fixed Size                  2232312 bytes

Variable Size             452984840 bytes

Database Buffers          310378496 bytes

Redo Buffers                2699264 bytes

Database mounted.

SQL> alter database archivelog;


Database altered.


SQL> alter database force logging;


Database altered.


SQL> alter database open;


Database altered.


SQL> archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     4

Next log sequence to archive   6

Current log sequence           6

SQL> select force_logging from v$database;


FOR

---

YES


SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@oraclep ~]$ exit

[root@oraclep ~]# su - oracle

上一次登录:三 7月  3 15:00:08 CST 2019pts/0 上

[oracle@oraclep ~]$ select * from v$logfile;

-bash: 未预期的符号 `from' 附近有语法错误

[oracle@oraclep ~]$ exit

登出

[root@oraclep ~]# rz

rz waiting to receive.

 zmodem trl+C ȡ


  100%     119 KB  119 KB/s 00:00:01       0 Errors64.rpm...


[root@oraclep ~]# yum -y localinstall rlwrap-0.43-2.el7.x86_64.rpm 

已加载插件:fastestmirror

正在检查 rlwrap-0.43-2.el7.x86_64.rpm: rlwrap-0.43-2.el7.x86_64

rlwrap-0.43-2.el7.x86_64.rpm 将被安装

正在解决依赖关系

--> 正在检查事务

---> 软件包 rlwrap.x86_64.0.0.43-2.el7 将被 安装

--> 正在处理依赖关系 /usr/bin/python3.6,它被软件包 rlwrap-0.43-2.el7.x86_64 需要

Loading mirror speeds from cached hostfile

epel/x86_64/metalink                                                                                                                                                          | 4.5 kB  00:00:00     

 * base: mirror.jdcloud.com

 * epel: mirrors.yun-idc.com

 * extras: mirror.jdcloud.com

 * updates: mirrors.tuna.tsinghua.edu.cn

base                                                                                                                                                                          | 3.6 kB  00:00:00     

epel                                                                                                                                                                          | 5.3 kB  00:00:00     

extras                                                                                                                                                                        | 3.4 kB  00:00:00     

updates                                                                                                                                                                       | 3.4 kB  00:00:00     

--> 正在处理依赖关系 perl(Data::Dumper),它被软件包 rlwrap-0.43-2.el7.x86_64 需要

--> 正在检查事务

---> 软件包 perl-Data-Dumper.x86_64.0.2.145-3.el7 将被 安装

---> 软件包 python36.x86_64.0.3.6.8-1.el7 将被 安装

--> 正在处理依赖关系 python36-libs(x86-64) = 3.6.8-1.el7,它被软件包 python36-3.6.8-1.el7.x86_64 需要

--> 正在处理依赖关系 libpython3.6m.so.1.0()(64bit),它被软件包 python36-3.6.8-1.el7.x86_64 需要

--> 正在检查事务

---> 软件包 python36-libs.x86_64.0.3.6.8-1.el7 将被 安装

--> 解决依赖关系完成


依赖关系解决


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

 Package                                          架构                                   版本                                        源                                                         大小

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

正在安装:

 rlwrap                                           x86_64                                 0.43-2.el7                                  /rlwrap-0.43-2.el7.x86_64                                 281 k

为依赖而安装:

 perl-Data-Dumper                                 x86_64                                 2.145-3.el7                                 base                                                       47 k

 python36                                         x86_64                                 3.6.8-1.el7                                 epel                                                       67 k

 python36-libs                                    x86_64                                 3.6.8-1.el7                                 epel                                                      8.6 M


事务概要

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

安装  1 软件包 (+3 依赖软件包)


总计:9.0 M

总下载量:8.7 M

安装大小:37 M

Downloading packages:

python36-libs-3.6.8-1.el7.x86_ FAILED                                                0% [                                                                          ]  0.0 B/s |    0 B  --:--:-- ETA 

http://fedora.cs.nctu.edu.tw/epel/7/x86_64/Packages/p/python36-libs-3.6.8-1.el7.x86_64.rpm: [Errno 14] HTTP Error 404 - Not Found                                  ]  0.0 B/s |    0 B  --:--:-- ETA 

正在尝试其它镜像。

To address this issue please refer to the below wiki article 


https://wiki.centos.org/yum-errors


If above article doesn't help to resolve this issue please use https://bugs.centos.org/.


(1/3): perl-Data-Dumper-2.145-3.el7.x86_64.rpm                                                                                                                                |  47 kB  00:00:00     

warning: /var/cache/yum/x86_64/7/epel/packages/python36-3.6.8-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY

python36-3.6.8-1.el7.x86_64.rpm 的公钥尚未安装

(2/3): python36-3.6.8-1.el7.x86_64.rpm                                                                                                                                        |  67 kB  00:00:00     

(3/3): python36-libs-3.6.8-1.el7.x86_64.rpm                                                                                                                                   | 8.6 MB  00:00:19     

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

总计                                                                                                                                                                 439 kB/s | 8.7 MB  00:00:20     

从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 检索密钥

导入 GPG key 0x352C64E5:

 用户ID     : "Fedora EPEL (7) <epel@fedoraproject.org>"

 指纹       : 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5

 软件包     : epel-release-7-11.noarch (@extras)

 来自       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  正在安装    : python36-libs-3.6.8-1.el7.x86_64                                                                                                                                                 1/4 

  正在安装    : python36-3.6.8-1.el7.x86_64                                                                                                                                                      2/4 

  正在安装    : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                                                                              3/4 

  正在安装    : rlwrap-0.43-2.el7.x86_64                                                                                                                                                         4/4 

  验证中      : python36-3.6.8-1.el7.x86_64                                                                                                                                                      1/4 

  验证中      : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                                                                              2/4 

  验证中      : python36-libs-3.6.8-1.el7.x86_64                                                                                                                                                 3/4 

  验证中      : rlwrap-0.43-2.el7.x86_64                                                                                                                                                         4/4 


已安装:

  rlwrap.x86_64 0:0.43-2.el7                                                                                                                                                                         


作为依赖被安装:

  perl-Data-Dumper.x86_64 0:2.145-3.el7                                python36.x86_64 0:3.6.8-1.el7                                python36-libs.x86_64 0:3.6.8-1.el7                               


完毕!

[root@oraclep ~]# scp rlwrap-0.43-2.el7.x86_64.rpm 192.168.56.117:~

root@192.168.56.117's password: 

rlwrap-0.43-2.el7.x86_64.rpm                                                                                                                                       100%  119KB  12.8MB/s   00:00    

[root@oraclep ~]# ssh 192.168.56.117

root@192.168.56.117's password: 

Last login: Wed Jul  3 15:00:48 2019 from 192.168.56.118

[root@oracles ~]# yum -y localinstall rlwrap-0.43-2.el7.x86_64.rpm 

已加载插件:fastestmirror

正在检查 rlwrap-0.43-2.el7.x86_64.rpm: rlwrap-0.43-2.el7.x86_64

rlwrap-0.43-2.el7.x86_64.rpm 将被安装

正在解决依赖关系

--> 正在检查事务

---> 软件包 rlwrap.x86_64.0.0.43-2.el7 将被 安装

--> 正在处理依赖关系 /usr/bin/python3.6,它被软件包 rlwrap-0.43-2.el7.x86_64 需要

Loading mirror speeds from cached hostfile

epel/x86_64/metalink                                                                                                                                                          | 4.5 kB  00:00:00     

 * base: mirrors.tuna.tsinghua.edu.cn

 * epel: mirrors.tuna.tsinghua.edu.cn

 * extras: mirrors.tuna.tsinghua.edu.cn

 * updates: mirrors.tuna.tsinghua.edu.cn

base                                                                                                                                                                          | 3.6 kB  00:00:00     

epel                                                                                                                                                                          | 5.3 kB  00:00:00     

extras                                                                                                                                                                        | 3.4 kB  00:00:00     

updates                                                                                                                                                                       | 3.4 kB  00:00:00     

--> 正在处理依赖关系 perl(Data::Dumper),它被软件包 rlwrap-0.43-2.el7.x86_64 需要

--> 正在检查事务

---> 软件包 perl-Data-Dumper.x86_64.0.2.145-3.el7 将被 安装

---> 软件包 python36.x86_64.0.3.6.8-1.el7 将被 安装

--> 正在处理依赖关系 python36-libs(x86-64) = 3.6.8-1.el7,它被软件包 python36-3.6.8-1.el7.x86_64 需要

--> 正在处理依赖关系 libpython3.6m.so.1.0()(64bit),它被软件包 python36-3.6.8-1.el7.x86_64 需要

--> 正在检查事务

---> 软件包 python36-libs.x86_64.0.3.6.8-1.el7 将被 安装

--> 解决依赖关系完成


依赖关系解决


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

 Package                                          架构                                   版本                                        源                                                         大小

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

正在安装:

 rlwrap                                           x86_64                                 0.43-2.el7                                  /rlwrap-0.43-2.el7.x86_64                                 281 k

为依赖而安装:

 perl-Data-Dumper                                 x86_64                                 2.145-3.el7                                 base                                                       47 k

 python36                                         x86_64                                 3.6.8-1.el7                                 epel                                                       67 k

 python36-libs                                    x86_64                                 3.6.8-1.el7                                 epel                                                      8.6 M


事务概要

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

安装  1 软件包 (+3 依赖软件包)


总计:9.0 M

总下载量:8.7 M

安装大小:37 M

Downloading packages:

python36-libs-3.6.8-1.el7.x86_ FAILED                                                0% [                                                                          ]  0.0 B/s |    0 B  --:--:-- ETA 

http://fedora.cs.nctu.edu.tw/epel/7/x86_64/Packages/p/python36-libs-3.6.8-1.el7.x86_64.rpm: [Errno 14] HTTP Error 404 - Not Found                                  ]  0.0 B/s |    0 B  --:--:-- ETA 

正在尝试其它镜像。

To address this issue please refer to the below wiki article 


https://wiki.centos.org/yum-errors


If above article doesn't help to resolve this issue please use https://bugs.centos.org/.


警告:/var/cache/yum/x86_64/7/epel/packages/python36-3.6.8-1.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID 352c64e5: NOKEY

python36-3.6.8-1.el7.x86_64.rpm 的公钥尚未安装

(1/3): python36-3.6.8-1.el7.x86_64.rpm                                                                                                                                        |  67 kB  00:00:00     

(2/3): perl-Data-Dumper-2.145-3.el7.x86_64.rpm                                                                                                                                |  47 kB  00:00:01     

(3/3): python36-libs-3.6.8-1.el7.x86_64.rpm                                                                                                                                   | 8.6 MB  00:00:19     

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

总计                                                                                                                                                                 431 kB/s | 8.7 MB  00:00:20     

从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 检索密钥

导入 GPG key 0x352C64E5:

 用户ID     : "Fedora EPEL (7) <epel@fedoraproject.org>"

 指纹       : 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5

 软件包     : epel-release-7-11.noarch (@extras)

 来自       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  正在安装    : python36-libs-3.6.8-1.el7.x86_64                                                                                                                                                 1/4 

  正在安装    : python36-3.6.8-1.el7.x86_64                                                                                                                                                      2/4 

  正在安装    : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                                                                              3/4 

  正在安装    : rlwrap-0.43-2.el7.x86_64                                                                                                                                                         4/4 

  验证中      : python36-3.6.8-1.el7.x86_64                                                                                                                                                      1/4 

  验证中      : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                                                                              2/4 

  验证中      : python36-libs-3.6.8-1.el7.x86_64                                                                                                                                                 3/4 

  验证中      : rlwrap-0.43-2.el7.x86_64                                                                                                                                                         4/4 


已安装:

  rlwrap.x86_64 0:0.43-2.el7                                                                                                                                                                         


作为依赖被安装:

  perl-Data-Dumper.x86_64 0:2.145-3.el7                                python36.x86_64 0:3.6.8-1.el7                                python36-libs.x86_64 0:3.6.8-1.el7                               


完毕!

[root@oracles ~]# cat<<EOF >> /home/oracle/.bash_profile

> alias sqlplus='rlwrap sqlplus'

> alias rman='rlwrap rman'

> EOF

[root@oracles ~]# exit

登出

Connection to 192.168.56.117 closed.

[root@oraclep ~]# cat<<EOF >> /home/oracle/.bash_profile

> alias sqlplus='rlwrap sqlplus'

> alias rman='rlwrap rman'

> EOF

[root@oraclep ~]# su - oracle

上一次登录:三 7月  3 15:04:23 CST 2019pts/0 上

[oracle@oraclep ~]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 3 15:13:37 2019


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



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> select * from v$logfile;


    GROUP# STATUS  TYPE

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

MEMBER

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

IS_

---

         3         ONLINE

/u01/app/oradata/yunhaip/redo03.log

NO


         2         ONLINE

/u01/app/oradata/yunhaip/redo02.log

NO


    GROUP# STATUS  TYPE

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

MEMBER

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

IS_

---


         1         ONLINE

/u01/app/oradata/yunhaip/redo01.log

NO



SQL> set linesize 200;

SQL> set pagesize 50;

SQL> select * from v$logfile;


    GROUP# STATUS  TYPE

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

MEMBER

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

IS_

---

         3         ONLINE

/u01/app/oradata/yunhaip/redo03.log

NO


         2         ONLINE

/u01/app/oradata/yunhaip/redo02.log

NO


         1         ONLINE

/u01/app/oradata/yunhaip/redo01.log

NO



SQL> select member from v$logfile;


MEMBER

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

/u01/app/oradata/yunhaip/redo03.log

/u01/app/oradata/yunhaip/redo02.log

/u01/app/oradata/yunhaip/redo01.log


SQL> select * from v$log;


    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIME   NEXT_CHANGE# NEXT_TIME

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

         1          1          4   52428800        512          1 YES INACTIVE               1022663 02-JUL-19         1036922 02-JUL-19

         2          1          5   52428800        512          1 YES INACTIVE               1036922 02-JUL-19         1058279 03-JUL-19

         3          1          6   52428800        512          1 NO  CURRENT                1058279 03-JUL-19      2.8147E+14


SQL>  alter database add standby logfile group 21 '/u01/app/oradata/yunhaip/standby21.log' size 50M;


Database altered.


SQL>  alter database add standby logfile group 22 '/u01/app/oradata/yunhaip/standby22.log' size 50M;


Database altered.


SQL>  alter database add standby logfile group 23 '/u01/app/oradata/yunhaip/standby23.log' size 50M;


Database altered.


SQL>  alter database add standby logfile group 24 '/u01/app/oradata/yunhaip/standby24.log' size 50M;


Database altered.


SQL> create pfile from spfile;


File created.


SQL> host

[oracle@oraclep ~]$ cd $ORACLE_HOME/dbs

[oracle@oraclep dbs]$ pwd

/u01/app/oracle/product/11.2.0/db_1/dbs

[oracle@oraclep dbs]$ scp inityunhaip.ora 192.168.56.117:/u01/app/oracle/product/11.2.0/db_1/dbs/

The authenticity of host '192.168.56.117 (192.168.56.117)' can't be established.

ECDSA key fingerprint is SHA256:MZlavdM0myCuuIkRXJhhutLZufmC7UmAk4/308p+WG0.

ECDSA key fingerprint is MD5:a3:d1:78:7c:60:c7:48:2a:7d:fb:4c:50:12:d5:93:8c.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '192.168.56.117' (ECDSA) to the list of known hosts.

oracle@192.168.56.117's password: 

inityunhaip.ora                                                                                                                                                    100%  909     1.1MB/s   00:00    

[oracle@oraclep dbs]$ cat >> /u01/app/oracle/product/11.2.0/db_1/dbs/inityunhaip.ora << "EOF"

> *.db_unique_name='yunhaip'

> *.fal_server='yunhais'

> *.log_archive_config='dg_config=(yunhaip,yunhais)'

> *.log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles, all_roles) db_unique_name=yunhaip'

> *.log_archive_dest_2='service=yunhais lgwr async valid_for=(online_logfile,primary_role) db_unique_name=yunhais'

> *.log_archive_dest_state_1=ENABLE

> *.log_archive_dest_state_2=ENABLE

> *.standby_file_management='AUTO'

> *.db_file_name_convert='/u01/app/oradata/yunhaip','/u01/app/oradata/yunhaip'

> *.log_file_name_convert='/u01/app/oradata/yunhaip','/u01/app/oradata/yunhaip'

> EOF

[oracle@oraclep dbs]$ cat >> /u01/app/oracle/product/11.2.0/db_1/dbs/inityunhaip.ora << "EOF"

*.db_unique_name='yunhaip'

*.fal_server='yunhais'

*.log_archive_config='dg_config=(yunhaip,yunhais)'

*.log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles, all_roles) db_unique_name=yunhaip'

*.log_archive_dest_2='service=yunhais lgwr async valid_for=(online_logfile,primary_role) db_unique_name=yunhais'

*.log_archive_dest_state_1=ENABLE

*.log_archive_dest_state_2=ENABLE

*.standby_file_management='AUTO'

*.db_file_name_convert='/u01/app/oradata/yunhaip','/u01/app/oradata/yunhaip'

*.log_file_name_convert='/u01/app/oradata/yunhaip','/u01/app/oradata/yunhaip'

EOF

[oracle@oraclep dbs]$ vim inityunhaip.ora 

yunhaip.__db_cache_size=310378496

yunhaip.__java_pool_size=4194304

yunhaip.__large_pool_size=4194304

yunhaip.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment

yunhaip.__pga_aggregate_target=310378496

yunhaip.__sga_target=461373440

yunhaip.__shared_io_pool_size=0

yunhaip.__shared_pool_size=134217728

yunhaip.__streams_pool_size=0

*.audit_file_dest='/u01/app/admin/yunhaip/adump'

*.audit_trail='db'

*.compatible='11.2.0.0.0'

*.control_files='/u01/app/oradata/yunhaip/control01.ctl','/u01/app/fast_recovery_area/yunhaip/control02.ctl'

*.db_block_size=8192

*.db_domain=''

*.db_name='yunhaip'

*.db_recovery_file_dest='/u01/app/fast_recovery_area'

*.db_recovery_file_dest_size=4322230272

*.diagnostic_dest='/u01/app'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=yunhaipXDB)'

*.memory_target=769654784

*.open_cursors=300

*.processes=150

*.remote_login_passwordfile='EXCLUSIVE'

*.undo_tablespace='UNDOTBS1'

*.db_unique_name='yunhaip'

*.fal_server='yunhais'

*.log_archive_config='dg_config=(yunhaip,yunhais)'

*.log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles, all_roles) db_unique_name=yunhaip'

*.log_archive_dest_2='service=yunhais lgwr async valid_for=(online_logfile,primary_role) db_unique_name=yunhais'

*.log_archive_dest_state_1=ENABLE

*.log_archive_dest_state_2=ENABLE

*.standby_file_management='AUTO'

*.db_file_name_convert='/u01/app/oradata/yunhaip','/u01/app/oradata/yunhaip'

*.log_file_name_convert='/u01/app/oradata/yunhaip','/u01/app/oradata/yunhaip'

[oracle@oraclep dbs]$ cat inityunhaip.ora 

yunhaip.__db_cache_size=310378496

yunhaip.__java_pool_size=4194304

yunhaip.__large_pool_size=4194304

yunhaip.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment

yunhaip.__pga_aggregate_target=310378496

yunhaip.__sga_target=461373440

yunhaip.__shared_io_pool_size=0

yunhaip.__shared_pool_size=134217728

yunhaip.__streams_pool_size=0

*.audit_file_dest='/u01/app/admin/yunhaip/adump'

*.audit_trail='db'

*.compatible='11.2.0.0.0'

*.control_files='/u01/app/oradata/yunhaip/control01.ctl','/u01/app/fast_recovery_area/yunhaip/control02.ctl'

*.db_block_size=8192

*.db_domain=''

*.db_name='yunhaip'

*.db_recovery_file_dest='/u01/app/fast_recovery_area'

*.db_recovery_file_dest_size=4322230272

*.diagnostic_dest='/u01/app'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=yunhaipXDB)'

*.memory_target=769654784

*.open_cursors=300

*.processes=150

*.remote_login_passwordfile='EXCLUSIVE'

*.undo_tablespace='UNDOTBS1'

*.db_unique_name='yunhaip'

*.fal_server='yunhais'

*.log_archive_config='dg_config=(yunhaip,yunhais)'

*.log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles, all_roles) db_unique_name=yunhaip'

*.log_archive_dest_2='service=yunhais lgwr async valid_for=(online_logfile,primary_role) db_unique_name=yunhais'

*.log_archive_dest_state_1=ENABLE

*.log_archive_dest_state_2=ENABLE

*.standby_file_management='AUTO'

*.db_file_name_convert='/u01/app/oradata/yunhaip','/u01/app/oradata/yunhaip'

*.log_file_name_convert='/u01/app/oradata/yunhaip','/u01/app/oradata/yunhaip'

[oracle@oraclep dbs]$ sqlplus / as sysdba 


SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 3 15:22:47 2019


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



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> create spfile from pfile;


File created.


SQL> startup

ORACLE instance started.


Total System Global Area  768294912 bytes

Fixed Size                  2232312 bytes

Variable Size             452984840 bytes

Database Buffers          310378496 bytes

Redo Buffers                2699264 bytes

Database mounted.

Database opened.

SQL> ALTER USER SYS IDENTIFIED BY sys;


User altered.


SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@oraclep dbs]$ ssh 192.168.56.117

oracle@192.168.56.117's password: 

Last login: Tue Jul  2 16:19:01 2019

[oracle@oracles ~]$ cd $ORACLE_HOME/dbs 

[oracle@oracles dbs]$ cat >> /u01/app/oracle/product/11.2.0/db_1/dbs/inityunhaip.ora << "EOF"

> *.db_unique_name='yunhais'

> *.fal_server='yunhaip'

> *.log_archive_config='dg_config=(yunhaip,yunhais)'

> *.log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles, all_roles) db_unique_name=yunhais'

> *.log_archive_dest_2='service=yunhaip lgwr async valid_for=(online_logfile,primary_role) db_unique_name=yunhaip'

> *.log_archive_dest_state_1=ENABLE

> *.log_archive_dest_state_2=ENABLE

> *.standby_file_management='AUTO'

> *.db_file_name_convert='/u01/app/oradata/yunhaip','/u01/app/oradata/yunhaip'

> *.log_file_name_convert='/u01/app/oradata/yunhaip','/u01/app/oradata/yunhaip'

> EOF

[oracle@oracles dbs]$ cat inityunhaip.ora 

yunhaip.__db_cache_size=310378496

yunhaip.__java_pool_size=4194304

yunhaip.__large_pool_size=4194304

yunhaip.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment

yunhaip.__pga_aggregate_target=310378496

yunhaip.__sga_target=461373440

yunhaip.__shared_io_pool_size=0

yunhaip.__shared_pool_size=134217728

yunhaip.__streams_pool_size=0

*.audit_file_dest='/u01/app/admin/yunhaip/adump'

*.audit_trail='db'

*.compatible='11.2.0.0.0'

*.control_files='/u01/app/oradata/yunhaip/control01.ctl','/u01/app/fast_recovery_area/yunhaip/control02.ctl'

*.db_block_size=8192

*.db_domain=''

*.db_name='yunhaip'

*.db_recovery_file_dest='/u01/app/fast_recovery_area'

*.db_recovery_file_dest_size=4322230272

*.diagnostic_dest='/u01/app'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=yunhaipXDB)'

*.memory_target=769654784

*.open_cursors=300

*.processes=150

*.remote_login_passwordfile='EXCLUSIVE'

*.undo_tablespace='UNDOTBS1'

*.db_unique_name='yunhais'

*.fal_server='yunhaip'

*.log_archive_config='dg_config=(yunhaip,yunhais)'

*.log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles, all_roles) db_unique_name=yunhais'

*.log_archive_dest_2='service=yunhaip lgwr async valid_for=(online_logfile,primary_role) db_unique_name=yunhaip'

*.log_archive_dest_state_1=ENABLE

*.log_archive_dest_state_2=ENABLE

*.standby_file_management='AUTO'

*.db_file_name_convert='/u01/app/oradata/yunhaip','/u01/app/oradata/yunhaip'

*.log_file_name_convert='/u01/app/oradata/yunhaip','/u01/app/oradata/yunhaip'

[oracle@oracles dbs]$ exit

登出

Connection to 192.168.56.117 closed.

[oracle@oraclep dbs]$ pwd

/u01/app/oracle/product/11.2.0/db_1/dbs

[oracle@oraclep dbs]$ scp orapwyunhaip 192.168.56.117:/u01/app/oracle/product/11.2.0/db_1/dbs/     

oracle@192.168.56.117's password: 

orapwyunhaip                                                                                                                                                       100% 1536     1.4MB/s   00:00    

[oracle@oraclep dbs]$ strings spfileyunhaip.ora 

yunhaip.__db_cache_size=310378496

yunhaip.__java_pool_size=4194304

yunhaip.__large_pool_size=4194304

yunhaip.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment

yunhaip.__pga_aggregate_target=310378496

yunhaip.__sga_target=461373440

yunhaip.__shared_io_pool_size=0

yunhaip.__shared_pool_size=134217728

yunhaip.__streams_pool_size=0

*.audit_file_dest='/u01/app/admin/yunhaip/adump'

*.audit_trail='db'

*.compatible='11.2.0.0.0'

*.control_files='/u01/app/oradata/yunhaip/control

01.ctl','/u01/app/fast_recovery_area/yunhaip/control02.ctl'

*.db_block_size=8192

*.db_domain=''

*.db_file_name_convert='/u01/app/oradata/yunhaip','/u01/app/oradata/yunhaip'

*.db_name='yunhaip'

*.db_recovery_file_dest='/u01/app/fast_recovery_area'

*.db_recovery_file_dest_size=4322230272

*.db_unique_name='yunhaip'

*.diagnostic_dest='/u01/app'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=yunhaipXDB)'

*.fal_server='yunhais'

*.log_archive_config='dg_config=(yunhaip,yunhais)'

*.log_archive_dest_

1='location=use_db_recovery_file_dest valid_for=(all_logfiles, all_roles) db_unique_name=yunhaip'

*.log_archive_dest_2='service=yunhais lgwr async valid_for=(online_logfile,primary_role) db_unique_name=yunhais'

*.log_archive_dest_state_1='ENABLE'

*.log_archive_dest_state_2='ENABLE'

*.log_file_name_convert='/u01/app/oradata/yunhaip','/u01/app/oradata/yunhaip'

*.memory_target=769654784

*.open_cursors=300

*.processes=150

*.remote_login_passwordfile='EXCLUSIVE'

*.standby_file_management=

'AUTO'

*.undo_tablespace='UNDOTBS1'

01.ctl','/u01/app/fast_recovery_area/yunhaip

oracle@192.168.56.117's password: 

Last login: Wed Jul  3 15:26:24 2019 from 192.168.56.118

[oracle@oracles ~]$ cd $ORACLE_HOME/dbs 

[oracle@oracles dbs]$ mkdir -p /u01/app/oracle 

[oracle@oracles dbs]$ mkdir -p /u01/app/admin/yunhaip/{a,b,c,d,u}dump

[oracle@oracles dbs]$ mkdir -p /u01/app/oradata/yunhaip/

[oracle@oracles dbs]$ mkdir -p /u01/app/fast_recovery_area/yunhaip/

[oracle@oracles dbs]$ exit

登出

Connection to 192.168.56.117 closed.

[oracle@oraclep dbs]$ cd ../network/admin/

[oracle@oraclep admin]$ ls

listener1907023下午2038.bak  listener.ora  samples  shrept.lst  sqlnet1907023下午2038.bak  sqlnet.ora

[oracle@oraclep admin]$ cat listener.ora 

# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

# Generated by Oracle configuration tools.


LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

      (ADDRESS = (PROTOCOL = TCP)(HOST = oracles)(PORT = 1521))

    )

  )


ADR_BASE_LISTENER = /u01/app


[oracle@oraclep admin]$ vim listener.ora 

# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

# Generated by Oracle configuration tools.


LISTENER =

  (DESCRIPTION_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = oracles)(PORT = 1521))

    )

  )


ADR_BASE_LISTENER = /u01/app


"listener.ora" 13L, 361C 已写入                                                                                                                                                    

"listener.ora" 13L, 361C 已写入

# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

# Generated by Oracle configuration tools.


LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

      (ADDRESS = (PROTOCOL = TCP)(HOST = oraclep)(PORT = 1521))

    )

  )


ADR_BASE_LISTENER = /u01/app


 

[oracle@oraclep admin]$ pwd

/u01/app/oracle/product/11.2.0/db_1/network/admin

[oracle@oraclep admin]$ cat >> /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora << "EOF"

> yunhaip =

>    (DESCRIPTION =

>      (ADDRESS_LIST =

>        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.118)(PORT = 1521))

>      )

>      (CONNECT_DATA =

>        (SERVICE_NAME = yunhaip)

>      )

>    )

>  

> yunhais =

>    (DESCRIPTION =

>      (ADDRESS_LIST =

>        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.117)(PORT = 1521))

>      )

>      (CONNECT_DATA =

>        (SERVICE_NAME = yunhais)

>      )

>    )

> EOF

[oracle@oraclep admin]$ cat tnsnames.ora 

yunhaip =

   (DESCRIPTION =

     (ADDRESS_LIST =

       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.118)(PORT = 1521))

     )

     (CONNECT_DATA =

       (SERVICE_NAME = yunhaip)

     )

   )

 

yunhais =

   (DESCRIPTION =

     (ADDRESS_LIST =

       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.117)(PORT = 1521))

     )

     (CONNECT_DATA =

       (SERVICE_NAME = yunhais)

     )

   )

[oracle@oraclep admin]$ ssh 192.168.56.117

oracle@192.168.56.117's password: 

Last login: Wed Jul  3 15:32:36 2019 from 192.168.56.118

[oracle@oracles ~]$ cd /u01/app/oracle/product/11.2.0/db_1/network/admin

[oracle@oracles admin]$ cat >> /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora << "EOF"

> yunhaip =

>    (DESCRIPTION =

>      (ADDRESS_LIST =

>        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.118)(PORT = 1521))

>      )

>      (CONNECT_DATA =

>        (SERVICE_NAME = yunhaip)

>      )

>    )

>  

> yunhais =

>    (DESCRIPTION =

>      (ADDRESS_LIST =

>        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.117)(PORT = 1521))

>      )

>      (CONNECT_DATA =

>        (SERVICE_NAME = yunhais)

>      )

>    )

> EOF

[oracle@oracles admin]$ cat tnsnames.ora 

yunhaip =

   (DESCRIPTION =

     (ADDRESS_LIST =

       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.118)(PORT = 1521))

     )

     (CONNECT_DATA =

       (SERVICE_NAME = yunhaip)

     )

   )

 

yunhais =

   (DESCRIPTION =

     (ADDRESS_LIST =

       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.117)(PORT = 1521))

     )

     (CONNECT_DATA =

       (SERVICE_NAME = yunhais)

     )

   )

[oracle@oracles admin]$ cd ../../dbs/

[oracle@oracles dbs]$ ls

init.ora  inityunhaip.ora  orapwyunhaip

[oracle@oracles dbs]$ sqlplus  / as sysdba


SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 3 15:39:48 2019


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


Connected to an idle instance.


SQL> create spfile from pfile;


File created.


SQL> startup nomount

ORACLE instance started.


Total System Global Area  768294912 bytes

Fixed Size                  2232312 bytes

Variable Size             452984840 bytes

Database Buffers          310378496 bytes

Redo Buffers                2699264 bytes

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@oracles dbs]$ exit

登出

Connection to 192.168.56.117 closed.

[oracle@oraclep admin]$ lsnrctl start


LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 03-JUL-2019 15:40:37


Copyright (c) 1991, 2011, Oracle.  All rights reserved.


Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...


TNSLSNR for Linux: Version 11.2.0.3.0 - Production

System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

Log messages written to /u01/app/diag/tnslsnr/oraclep/listener/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oraclep)(PORT=1521)))


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))

STATUS of the LISTENER

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

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production

Start Date                03-JUL-2019 15:40:39

Uptime                    0 days 0 hr. 0 min. 0 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

Listener Log File         /u01/app/diag/tnslsnr/oraclep/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oraclep)(PORT=1521)))

The listener supports no services

The command completed successfully

[oracle@oraclep admin]$ ssh 192.168.56.117

oracle@192.168.56.117's password: 

Last login: Wed Jul  3 15:38:10 2019 from 192.168.56.118

[oracle@oracles ~]$ ls

ls        lsattr    lsblk     lscpu     lshw      lsinitrd  lsipc     lslocks   lslogins  lsmem     lsmod     lsnodes   lsnrctl   lsnrctl0  lsns      lsscsi    

[oracle@oracles ~]$ lsnrctl start


LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 03-JUL-2019 15:40:59


Copyright (c) 1991, 2011, Oracle.  All rights reserved.


Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...


TNSLSNR for Linux: Version 11.2.0.3.0 - Production

System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

Log messages written to /u01/app/oracle/diag/tnslsnr/oracles/listener/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracles)(PORT=1521)))


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))

STATUS of the LISTENER

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

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production

Start Date                03-JUL-2019 15:41:01

Uptime                    0 days 0 hr. 0 min. 0 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

Listener Log File         /u01/app/oracle/diag/tnslsnr/oracles/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracles)(PORT=1521)))

The listener supports no services

The command completed successfully

[oracle@oracles ~]$ tnsping yunhais


TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 03-JUL-2019 15:41:30


Copyright (c) 1997, 2011, Oracle.  All rights reserved.


Used parameter files:

/u01/app/oracle/product/11.2.0/db_1/network/admin/sqlnet.ora



Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.117)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = yunhais)))

OK (0 msec)

[oracle@oracles ~]$ tnsping yunhaip


TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 03-JUL-2019 15:41:35


Copyright (c) 1997, 2011, Oracle.  All rights reserved.


Used parameter files:

/u01/app/oracle/product/11.2.0/db_1/network/admin/sqlnet.ora



Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.118)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = yunhaip)))

OK (0 msec)

[oracle@oracles ~]$ rman target sys/sys@yunhaip auxiliary sys/sys@yunhais


Recovery Manager: Release 11.2.0.3.0 - Production on Wed Jul 3 15:43:07 2019


Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


connected to target database: YUNHAIP (DBID=665781658)

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

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

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

RMAN-00554: initialization of internal recovery manager package failed

RMAN-04006: error from auxiliary database: ORA-12528: TNS:listener: all appropriate instances are blocking new connections

[oracle@oracles ~]$ rman target sys/sys@yunhaip auxiliary /


Recovery Manager: Release 11.2.0.3.0 - Production on Wed Jul 3 15:43:58 2019


Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


connected to target database: YUNHAIP (DBID=665781658)

connected to auxiliary database: YUNHAIP (not mounted)


RMAN> exit



Recovery Manager complete.

[oracle@oracles ~]$ cd $ORACLE_HOME/network 

[oracle@oracles network]$ cd admin/

[oracle@oracles admin]$ pwd

/u01/app/oracle/product/11.2.0/db_1/network/admin

[oracle@oracles admin]$ ls

listener.ora  samples  shrept.lst  sqlnet.ora  tnsnames.ora

[oracle@oracles admin]$ cat >> /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora << "EOF"

> SID_LIST_LISTENER =

>   (SID_LIST =

>     (SID_DESC =

>      (GLOBAL_DBNAME = yunhais)

>       (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)

>       (SID_NAME = yunhaip)

>     )

>   )

> EOF

[oracle@oracles admin]$ cat listener.ora 

# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

# Generated by Oracle configuration tools.


LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

      (ADDRESS = (PROTOCOL = TCP)(HOST = oracles)(PORT = 1521))

    )

  )


ADR_BASE_LISTENER = /u01/app/oracle


SID_LIST_LISTENER =

  (SID_LIST =

    (SID_DESC =

     (GLOBAL_DBNAME = yunhais)

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

      (SID_NAME = yunhaip)

    )

  )


[oracle@oracles admin]$ lsn

lsnodes   lsnrctl   lsnrctl0  lsns      

[oracle@oracles admin]$ lsnrctl stop


LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 03-JUL-2019 15:46:16


Copyright (c) 1991, 2011, Oracle.  All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))

The command completed successfully

[oracle@oracles admin]$ lsnrctl start


LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 03-JUL-2019 15:46:25


Copyright (c) 1991, 2011, Oracle.  All rights reserved.


Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...


TNSLSNR for Linux: Version 11.2.0.3.0 - Production

System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

Log messages written to /u01/app/oracle/diag/tnslsnr/oracles/listener/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracles)(PORT=1521)))


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))

STATUS of the LISTENER

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

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production

Start Date                03-JUL-2019 15:46:25

Uptime                    0 days 0 hr. 0 min. 0 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

Listener Log File         /u01/app/oracle/diag/tnslsnr/oracles/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracles)(PORT=1521)))

Services Summary...

Service "yunhais" has 1 instance(s).

  Instance "yunhaip", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully

[oracle@oracles admin]$ cat >> /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora << "EOF"

SID_LIST_LISTENER =

  (SID_LIST =

    (SID_DESC =

     (GLOBAL_DBNAME = yunhais)

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

      (SID_NAME = yunhaip)

    )

  )


EOF

[oracle@oracles admin]$ rman target sys/sys@yunhaip auxiliary sys/sys@yunhais


Recovery Manager: Release 11.2.0.3.0 - Production on Wed Jul 3 15:46:35 2019


Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


connected to target database: YUNHAIP (DBID=665781658)

connected to auxiliary database: YUNHAIP (not mounted)


RMAN> duplicate target database for standby from active database nofilenamecheck;


Starting Duplicate Db at 03-JUL-19

using target database control file instead of recovery catalog

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=19 device type=DISK


contents of Memory Script:

{

   backup as copy reuse

   targetfile  '/u01/app/oracle/product/11.2.0/db_1/dbs/orapwyunhaip' auxiliary format 

 '/u01/app/oracle/product/11.2.0/db_1/dbs/orapwyunhaip'   ;

}

executing Memory Script


Starting backup at 03-JUL-19

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=40 device type=DISK

Finished backup at 03-JUL-19


contents of Memory Script:

{

   backup as copy current controlfile for standby auxiliary format  '/u01/app/oradata/yunhaip/control01.ctl';

   restore clone controlfile to  '/u01/app/fast_recovery_area/yunhaip/control02.ctl' from 

 '/u01/app/oradata/yunhaip/control01.ctl';

}

executing Memory Script


Starting backup at 03-JUL-19

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile copy

copying standby control file

output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_yunhaip.f tag=TAG20190703T154737 RECID=1 STAMP=1012664859

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07

Finished backup at 03-JUL-19


Starting restore at 03-JUL-19

using channel ORA_AUX_DISK_1


channel ORA_AUX_DISK_1: copied control file copy

Finished restore at 03-JUL-19


contents of Memory Script:

{

   sql clone 'alter database mount standby database';

}

executing Memory Script


sql statement: alter database mount standby database


contents of Memory Script:

{

   set newname for tempfile  1 to 

 "/u01/app/oradata/yunhaip/temp01.dbf";

   switch clone tempfile all;

   set newname for datafile  1 to 

 "/u01/app/oradata/yunhaip/system01.dbf";

   set newname for datafile  2 to 

 "/u01/app/oradata/yunhaip/sysaux01.dbf";

   set newname for datafile  3 to 

 "/u01/app/oradata/yunhaip/undotbs01.dbf";

   set newname for datafile  4 to 

 "/u01/app/oradata/yunhaip/users01.dbf";

   backup as copy reuse

   datafile  1 auxiliary format 

 "/u01/app/oradata/yunhaip/system01.dbf"   datafile 

 2 auxiliary format 

 "/u01/app/oradata/yunhaip/sysaux01.dbf"   datafile 

 3 auxiliary format 

 "/u01/app/oradata/yunhaip/undotbs01.dbf"   datafile 

 4 auxiliary format 

 "/u01/app/oradata/yunhaip/users01.dbf"   ;

   sql 'alter system archive log current';

}

executing Memory Script


executing command: SET NEWNAME


renamed tempfile 1 to /u01/app/oradata/yunhaip/temp01.dbf in control file


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


Starting backup at 03-JUL-19

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile copy

input datafile file number=00001 name=/u01/app/oradata/yunhaip/system01.dbf

output file name=/u01/app/oradata/yunhaip/system01.dbf tag=TAG20190703T154752

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:35

channel ORA_DISK_1: starting datafile copy

input datafile file number=00002 name=/u01/app/oradata/yunhaip/sysaux01.dbf

output file name=/u01/app/oradata/yunhaip/sysaux01.dbf tag=TAG20190703T154752

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:15

channel ORA_DISK_1: starting datafile copy

input datafile file number=00003 name=/u01/app/oradata/yunhaip/undotbs01.dbf

output file name=/u01/app/oradata/yunhaip/undotbs01.dbf tag=TAG20190703T154752

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15

channel ORA_DISK_1: starting datafile copy

input datafile file number=00004 name=/u01/app/oradata/yunhaip/users01.dbf

output file name=/u01/app/oradata/yunhaip/users01.dbf tag=TAG20190703T154752

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03

Finished backup at 03-JUL-19


sql statement: alter system archive log current


contents of Memory Script:

{

   switch clone datafile all;

}

executing Memory Script


datafile 1 switched to datafile copy

input datafile copy RECID=1 STAMP=1012665062 file name=/u01/app/oradata/yunhaip/system01.dbf

datafile 2 switched to datafile copy

input datafile copy RECID=2 STAMP=1012665062 file name=/u01/app/oradata/yunhaip/sysaux01.dbf

datafile 3 switched to datafile copy

input datafile copy RECID=3 STAMP=1012665063 file name=/u01/app/oradata/yunhaip/undotbs01.dbf

datafile 4 switched to datafile copy

input datafile copy RECID=4 STAMP=1012665063 file name=/u01/app/oradata/yunhaip/users01.dbf

Finished Duplicate Db at 03-JUL-19


RMAN> exit



Recovery Manager complete.

[oracle@oracles admin]$ cat >> /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora << "EOF"

SID_LIST_LISTENER =

  (SID_LIST =

    (SID_DESC =

     (GLOBAL_DBNAME = yunhais)

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

      (SID_NAME = yunhaip)

    )

  )


EOF

[oracle@oracles admin]$ ls











[oracle@oracles admin]$ sqlplus  / as sysdba


SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 3 15:51:57 2019


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



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> select status from v$instance;


STATUS

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

MOUNTED


SQL> alter database open;

alter database open

*

ERROR at line 1:

ORA-10458: standby database requires recovery

ORA-01152: file 2 was not restored from a sufficiently old backup

ORA-01110: data file 2: '/u01/app/oradata/yunhaip/sysaux01.dbf'



SQL>  alter database recover managed standby database using current logfile disconnect from session;


Database altered.


SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@oracles admin]$ exit

登出

Connection to 192.168.56.117 closed.

[oracle@oraclep admin]$ cd /u01/app/diag/

rdbms/   tnslsnr/ 

[oracle@oraclep admin]$ cd /u01/app/diag/rdbms/

[oracle@oraclep rdbms]$ ls

yunhaip

[oracle@oraclep rdbms]$ cd yunhaip/

[oracle@oraclep yunhaip]$ ll

总用量 0

-rw-r-----  1 oracle oinstall   0 7月   2 15:13 i_1.mif

drwxr-x--- 15 oracle oinstall 188 7月   2 15:13 yunhaip

[oracle@oraclep yunhaip]$ cd yunhaip/trace/

[oracle@oraclep trace]$ vim alert_yunhaip.log

Tue Jul 02 15:13:36 2019

Starting ORACLE instance (normal)

LICENSE_MAX_SESSION = 0

LICENSE_SESSIONS_WARNING = 0

Shared memory segment for instance monitoring created

Picked latch-free SCN scheme 3

Using LOG_ARCHIVE_DEST_1 parameter default value as USE_DB_RECOVERY_FILE_DEST

Autotune of undo retention is turned on.

IMODE=BR

ILAT =27

LICENSE_MAX_USERS = 0

SYS auditing is disabled

Starting up:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options.

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

System name:    Linux

Node name:      oracles

Release:        3.10.0-957.el7.x86_64

Version:        #1 SMP Thu Nov 8 23:39:32 UTC 2018

Machine:        x86_64

Using parameter settings in client-side pfile /u01/app/admin/yunhaip/pfile/init.ora on machine oracles

System parameters with non-default values:

  processes                = 150

  memory_target            = 736M

  control_files            = "/u01/app/oradata/yunhaip/control01.ctl"

  control_files            = "/u01/app/fast_recovery_area/yunhaip/control02.ctl"

  db_block_size            = 8192

  compatible               = "11.2.0.0.0"

  db_recovery_file_dest    = "/u01/app/fast_recovery_area"

  db_recovery_file_dest_size= 4122M

  undo_tablespace          = "UNDOTBS1"

  remote_login_passwordfile= "EXCLUSIVE"

  db_domain                = ""

  dispatchers              = "(PROTOCOL=TCP) (SERVICE=yunhaipXDB)"

  audit_file_dest          = "/u01/app/admin/yunhaip/adump"

  audit_trail              = "DB"

  db_name                  = "yunhaip"

  open_cursors             = 300

  diagnostic_dest          = "/u01/app"

Tue Jul 02 15:13:38 2019

PMON started with pid=2, OS id=10079

Tue Jul 02 15:13:38 2019

PSP0 started with pid=3, OS id=10081

Tue Jul 02 15:13:39 2019

VKTM started with pid=4, OS id=10084 at elevated priority

VKTM running at (1)millisec precision with DBRM quantum (100)ms

Tue Jul 02 15:13:39 2019

GEN0 started with pid=5, OS id=10088

Tue Jul 02 15:13:39 2019

DIAG started with pid=6, OS id=10090

Tue Jul 02 15:13:39 2019

DBRM started with pid=7, OS id=10092

Tue Jul 02 15:13:39 2019

DIA0 started with pid=8, OS id=10094

PING[ARC2]: Heartbeat failed to connect to standby 'yunhais'. Error is 12154.

Wed Jul 03 15:47:53 2019

Thread 1 advanced to log sequence 9 (LGWR switch)

  Current log# 3 seq# 9 mem# 0: /u01/app/oradata/yunhaip/redo03.log

Wed Jul 03 15:47:54 2019

Archived Log entry 3 added for thread 1 sequence 8 ID 0x27aeb09a dest 1:

Wed Jul 03 15:51:01 2019

ALTER SYSTEM ARCHIVE LOG

Wed Jul 03 15:51:01 2019

Thread 1 advanced to log sequence 10 (LGWR switch)

  Current log# 1 seq# 10 mem# 0: /u01/app/oradata/yunhaip/redo01.log

Wed Jul 03 15:51:01 2019

Archived Log entry 4 added for thread 1 sequence 9 ID 0x27aeb09a dest 1:

Wed Jul 03 15:52:36 2019

Error 12154 received logging on to the standby

FAL[server, ARC3]: Error 12154 creating remote archivelog file 'yunhais'

FAL[server, ARC3]: FAL archive failed, see trace file.

ARCH: FAL archive failed. Archiver continuing

ORACLE Instance yunhaip - Archival Error. Archiver continuing.

Wed Jul 03 15:52:57 2019

Error 12154 received logging on to the standby

FAL[server, ARC3]: Error 12154 creating remote archivelog file 'yunhais'

FAL[server, ARC3]: FAL archive failed, see trace file.

ARCH: FAL archive failed. Archiver continuing

ORACLE Instance yunhaip - Archival Error. Archiver continuing.

Wed Jul 03 15:53:17 2019

Error 12154 received logging on to the standby

Suppressing further error logging of LOG_ARCHIVE_DEST_2.

FAL[server, ARC3]: FAL archive failed, see trace file.

ARCH: FAL archive failed. Archiver continuing

ORACLE Instance yunhaip - Archival Error. Archiver continuing.

Wed Jul 03 15:53:37 2019

Error 12154 received logging on to the standby

FAL[server, ARC3]: FAL archive failed, see trace file.

ARCH: FAL archive failed. Archiver continuing

ORACLE Instance yunhaip - Archival Error. Archiver continuing.

Wed Jul 03 15:54:26 2019

Error 12154 received logging on to the standby

FAL[server, ARC3]: FAL archive failed, see trace file.

ARCH: FAL archive failed. Archiver continuing

ORACLE Instance yunhaip - Archival Error. Archiver continuing.

Wed Jul 03 15:54:46 2019

Error 12154 received logging on to the standby

FAL[server, ARC3]: FAL archive failed, see trace file.

ARCH: FAL archive failed. Archiver continuing

ORACLE Instance yunhaip - Archival Error. Archiver continuing.

Wed Jul 03 15:55:06 2019

Error 12154 received logging on to the standby

FAL[server, ARC3]: FAL archive failed, see trace file.

ARCH: FAL archive failed. Archiver continuing

ORACLE Instance yunhaip - Archival Error. Archiver continuing.

Wed Jul 03 15:55:26 2019

Error 12154 received logging on to the standby

FAL[server, ARC3]: FAL archive failed, see trace file.

ARCH: FAL archive failed. Archiver continuing

[oracle@oraclep trace]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 3 15:55:59 2019


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



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup;

ORACLE instance started.


Total System Global Area  768294912 bytes

Fixed Size                  2232312 bytes

Variable Size             452984840 bytes

Database Buffers          310378496 bytes

Redo Buffers                2699264 bytes

Database mounted.

Database opened.

SQL> select switchover_status,database_role from v$database;


SWITCHOVER_STATUS    DATABASE_ROLE

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

TO STANDBY           PRIMARY


SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@oraclep trace]$ ssh 192.168.56.117     

oracle@192.168.56.117's password: 

Last login: Wed Jul  3 15:40:46 2019 from 192.168.56.118

[oracle@oracles ~]$ sqlplus  / as sysdba


SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 3 15:57:37 2019


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



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> select status from v$instance;


STATUS

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

MOUNTED


SQL> select switchover_status,database_role from v$database;


SWITCHOVER_STATUS    DATABASE_ROLE

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

NOT ALLOWED          PHYSICAL STANDBY


SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@oracles ~]$ sqlplus  / as sysdba


SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 3 15:58:17 2019


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



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     10

Next log sequence to archive   0

Current log sequence           12

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@oracles ~]$ exit

登出

Connection to 192.168.56.117 closed.

[oracle@oraclep trace]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 3 15:58:28 2019


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



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     10

Next log sequence to archive   12

Current log sequence           12

SQL> alter database switch logs;

alter database switch logs

                      *

ERROR at line 1:

ORA-02000: missing ALL keyword



SQL> alter system switch logfile;


System altered.


SQL> archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     11

Next log sequence to archive   13

Current log sequence           13

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@oraclep trace]$ ssh 192.168.56.117 

oracle@192.168.56.117's password: 

Last login: Wed Jul  3 15:57:34 2019 from 192.168.56.118

[oracle@oracles ~]$ sqlplus  / as sysdba


SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 3 15:59:12 2019


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



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     11

Next log sequence to archive   0

Current log sequence           13

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@oracles ~]$ sqlplus  / as sysdba


SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 3 15:59:46 2019


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



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> alter database recover managed standby database cancel;


Database altered.


SQL> alter database open;


Database altered.


SQL> alter database recover managed standby database using current logfile disconnect ; 


Database altered.


SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@oracles ~]$ exit

登出

Connection to 192.168.56.117 closed.

[oracle@oraclep trace]$ sqlplus test/test


SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 3 16:00:39 2019


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



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> create table test(id int ,nums int);


Table created.



SQL> insert into test values(1,2);


1 row created.


SQL> commit;


Commit complete.


SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@oraclep trace]$ ssh 192.168.56.117

oracle@192.168.56.117's password: 

Last login: Wed Jul  3 15:59:09 2019 from 192.168.56.118

[oracle@oracles ~]$ sqlplus test/test


SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 3 16:01:59 2019


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



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> select * from test;


        ID       NUMS

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

         1          2


SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@oracles ~]$ exit

登出

Connection to 192.168.56.117 closed.

[oracle@oraclep trace]$ sqlplus test/test 


SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 3 16:02:19 2019


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



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> insert into test values(2,2);


1 row created.


SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@oraclep trace]$ ssh 192.168.56.117

oracle@192.168.56.117's password: 

Last login: Wed Jul  3 16:01:52 2019 from 192.168.56.118

[oracle@oracles ~]$ sqlplus test/test


SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 3 16:02:36 2019


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



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> select * from test;


        ID       NUMS

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

         1          2

         2          2



推荐阅读:
  1. oracle 11g dg 部署rman方式要点记录
  2. Oracle Dg配置过程

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

dataguard oracle 11g %d acle

上一篇:大数据flume日志采集系统详解

下一篇:netstat:查询端口和进程信息

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》