ta/orc
lstd, /u01/app/oracle/oradata/
orcl
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orclstd/system01.dbf
/u01/app/oracle/oradata/orclstd/undotbs01.dbf
/u01/app/oracle/oradata/orclstd/sysaux01.dbf
/u01/app/oracle/oradata/orclstd/users01.dbf
/u01/app/oracle/oradata/orclstd/example01.dbf
/u01/rec_catalog/rmantbs.dbf
6 rows selected.
接受归档文件:
******************
Pramary:
SQL> alter system set log_archive_dest_state_2=enable;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/arch_orcl
Oldest online log sequence 11
Next log sequence to archive 13
Current log sequence 13
Standby:
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/arch_orcl
Oldest online log sequence 11
Next log sequence to archive 13
Current log sequence 13
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@localhost admin]$ cd /u01/arch_orclstd/
[oracle@localhost arch_orclstd]$ ls
archive_1_10_842209949.arclog archive_1_4_842209949.arclog
archive_1_11_842209949.arclog archive_1_5_842209949.arclog
archive_1_12_842209949.arclog archive_1_6_842209949.arclog
archive_1_1_842209949.arclog archive_1_7_842209949.arclog
archive_1_2_842209949.arclog archive_1_8_842209949.arclog
archive_1_3_842209949.arclog archive_1_9_842209949.arclog
测试:
orclpre>conn sys/safe@orcl_192.168.1.222 as sysdba
Connected.
orclpre>select max(sequence#) from v$archived_log;
MAX(SEQUENCE#)
--------------
27
orclpre>conn sys/safe@orcls_192.168.1.223 as sysdba
Connected.
orclpre>select max(sequence#) from v$archived_log;
MAX(SEQUENCE#)
--------------
27
parmary:
SQL> conn test/oracle
Connected.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
DEPT TABLE
EMP TABLE
BONUS TABLE
SALGRADE TABLE
EXPFULL TABLE
BIN$8++Yu/zZ6sLgQAB/AQBXxQ==$0 TABLE
BIN$8++Yu/zc6sLgQAB/AQBXxQ==$0 TABLE
BIN$8++Yu/zd6sLgQAB/AQBXxQ==$0 TABLE
BIN$8++Yu/ze6sLgQAB/AQBXxQ==$0 TABLE
BIN$8++Yu/zi6sLgQAB/AQBXxQ==$0 TABLE
TEST TABLE
11 rows selected.
SQL> select * from test;
ID
----------
1
2
3
4
5555555555
SQL> insert into test values(666666);
1 row created.
SQL> commit;
Commit complete.
Standby:
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> alter database recover managed standby database cancel;
alter database recover managed standby database cancel
*
ERROR at line 1:
ORA-16136: Managed Standby Recovery not active
针对这个错误,网上有不同的解决方案,但是没有我想要的,网上的可能有不同的出错原因,具体情况具体分析,于是查看日志:
cat alert_orclstd.log
Thu Mar 20 00:07:25 2014
ORA-16136 signalled during: alter database recover managed standby database cancel...
Thu Mar 20 00:13:33 2014
db_recovery_file_dest_size of 2048 MB is 0.00% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Thu Mar 20 00:15:50 2014
alter database open
Thu Mar 20 00:15:50 2014
Errors in file /u01/app/oracle/admin/orclstd/