暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

回顾DataGuard-2

原创 章芋文 2012-08-31
963
[code]
[oracle@localhost pszx_db]$ ll -k
total 2545972
-rw-r----- 1 oracle dba 6896 Aug 27 14:38 control01.ctl
-rw-r----- 1 oracle dba 6896 Aug 27 14:38 control02.ctl
-rw-r----- 1 oracle dba 6896 Aug 27 14:38 control03.ctl
-rw-r----- 1 oracle dba 51201 Aug 27 13:17 redo01.log
-rw-r----- 1 oracle dba 51201 Aug 27 14:38 redo02.log
-rw-r----- 1 oracle dba 51201 Aug 27 11:20 redo03.log
-rw-r----- 1 oracle dba 245768 Aug 27 14:33 sysaux01.dbf
-rw-r----- 1 oracle dba 501768 Aug 27 14:33 system01.dbf
-rw-r----- 1 oracle dba 89096 Aug 27 11:13 temp01.dbf
-rw-r----- 1 oracle dba 71688 Aug 27 14:33 undotbs01.dbf
-rw-r----- 1 oracle dba 1461768 Aug 27 13:26 users01.dbf
[oracle@localhost pszx_db]$ ll -m
control01.ctl, control02.ctl, control03.ctl, redo01.log, redo02.log, redo03.log,
sysaux01.dbf, system01.dbf, temp01.dbf, undotbs01.dbf, users01.dbf
[oracle@localhost pszx_db]$ cp * ../pszx_by/
[oracle@localhost pszx_db]$ df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda2 ext3 12G 11G 73M 100% /
/dev/sda5 ext3 2.0G 36M 1.9G 2% /tmp
/dev/sda3 ext3 2.0G 40M 1.8G 3% /home
/dev/sda1 ext3 99M 12M 83M 12% /boot
tmpfs tmpfs 506M 0 506M 0% /dev/shm
[oracle@localhost pszx_db]$ cd ../pszx_by
[oracle@localhost pszx_by]$ ls
control01.ctl redo01.log sysaux01.dbf undotbs01.dbf
control02.ctl redo02.log system01.dbf users01.dbf
control03.ctl redo03.log temp01.dbf
[oracle@localhost pszx_by]$ ll
total 2545968
-rw-r----- 1 oracle dba 7061504 Aug 27 15:18 control01.ctl
-rw-r----- 1 oracle dba 7061504 Aug 27 15:18 control02.ctl
-rw-r----- 1 oracle dba 7061504 Aug 27 15:18 control03.ctl
-rw-r----- 1 oracle dba 52429312 Aug 27 15:18 redo01.log
-rw-r----- 1 oracle dba 52429312 Aug 27 15:19 redo02.log
-rw-r----- 1 oracle dba 52429312 Aug 27 15:19 redo03.log
-rw-r----- 1 oracle dba 251666432 Aug 27 15:19 sysaux01.dbf
-rw-r----- 1 oracle dba 513810432 Aug 27 15:20 system01.dbf
-rw-r----- 1 oracle dba 91234304 Aug 27 15:20 temp01.dbf
-rw-r----- 1 oracle dba 73408512 Aug 27 15:20 undotbs01.dbf
-rw-r----- 1 oracle dba 1496850432 Aug 27 15:22 users01.dbf
[oracle@localhost pszx_by]$

[oracle@localhost flash_recovery_area]$ mkdir PSZX_BY
[oracle@localhost flash_recovery_area]$ ls
PSZX_BY PSZX_DB

[oracle@localhost dbs]$ cd /oracle/admin/
[oracle@localhost admin]$ ls
pszx_db
[oracle@localhost admin]$ cd pszx_db
[oracle@localhost pszx_db]$ ls
adump bdump cdump dpdump pfile udump
[oracle@localhost pszx_db]$ cd ../
[oracle@localhost admin]$ cp -r pszx_db pszx_by
[oracle@localhost admin]$ cd pszx_by
[oracle@localhost pszx_by]$ ls
adump bdump cdump dpdump pfile udump

[oracle@localhost pfile]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Aug 27 15:41:53 2012

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

Connected to an idle instance.

SQL> create pfile ='/oracle/admin/pszx_by/initpszx_by.ora' from spfile;

File created.

SQL> exit
Disconnected
[oracle@localhost pfile]$ cd ../
[oracle@localhost pszx_by]$ ls
adump bdump cdump dpdump initpszx_by.ora pfile udump



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

SQL> shutdown abort
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 75499764 bytes
Database Buffers 88080384 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> alter database archivelog
2 ;
alter database archivelog
*
ERROR at line 1:
ORA-00265: instance recovery required, cannot set ARCHIVELOG mode


SQL> alter database open
2 ;

Database altered.

SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 75499764 bytes
Database Buffers 88080384 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> alter database force logging;

Database altered.

SQL> alter database create standby controlfile as '/oracle/admin/pszx_by/pszx_b y01.ctl';

Database altered.

SQL> create pfile ='/oracle/pszx.ora' from spfile;

File created.

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Pr oduction
With the Partitioning, OLAP and Data Mining options


----------------
NETMGR

[oracle@localhost oradata]$ tnsping pszx_by

TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 27-AUG-2012 16:42:10

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

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.223)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = pszx_by)))
OK (0 msec)
[oracle@localhost oradata]$ tnsping pszx_db

TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 27-AUG-2012 16:42:19

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

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = pszx_db)))
OK (40 msec)



-------------------------
[oracle@localhost oracle]$ orapwd file=/oracle/product/database/dbs/orapwpszx_by password=oracle entries=10


---------

SQL> create spfile from pfile='/oracle/admin/pszx_by/initpszx_by.ora';

File created.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 62916852 bytes
Database Buffers 100663296 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> alter database recover managed standby database disconnect from session;

Database altered.[/code]
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论