ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 单节点主库、逻辑备库升级为RAC、物理备库、逻辑备库(3)

单节点主库、逻辑备库升级为RAC、物理备库、逻辑备库(3)

原创 Linux操作系统 作者:aaqwsh 时间:2010-12-15 21:23:33 0 删除 编辑
 

拷贝密码文件:

cp orapwhellodb /data/oracle/product/10205/db1/dbs/

 

B  恢复:

export ORACLE_SID=hellodb

rman target /

startup nomount;

restore controlfile   from '/data/backup/stdctl_hellodb.ctl';

 

根据

output filename=/data/oracle/oradata/hellodb/controlhellodb01.ctl

修改

control_files = /data/oracle/oradata/hellodb/controlhellodb01.ctl

 

startup mount;

 

catalog start with '/data/backup';

 

在备库恢复数据库

run{

allocate channel d1 type disk;

allocate channel d2 type disk;

allocate channel d3 type disk;

allocate channel d4 type disk;

 restore database;

 release channel d1;

 release channel d2;

 release channel d3;

 release channel d4;

 }

 

 

C 打开恢复进程(如果没有STANDBY LOGFILE ,应该增加):

ALTER DATABASE ADD STANDBY  LOGFILE THREAD 1 GROUP 4 ('/data/oracle/oradata/hellodb/stdlog_5_1.log') SIZE 50M;

ALTER DATABASE ADD STANDBY  LOGFILE THREAD 1 GROUP 5 ('/data/oracle/oradata/hellodb/stdlog_6_1.log') SIZE 50M;

ALTER DATABASE ADD STANDBY  LOGFILE THREAD 1 GROUP 6('/data/oracle/oradata/hellodb/stdlog_7_1.log') SIZE 50M;

 

shutdown immediate

startup mount

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

 

D 转逻辑备库

02 先停止

alter database recover managed standby database cancel;

 

52 执行

SQL> exec dbms_logstdby.build;

 

PL/SQL procedure successfully completed.

 

SQL> alter system archive log current;

 

System altered.

 

02  执行

SQL> ALTER DATABASE RECOVER TO LOGICAL STANDBY hellodb;

ALTER DATABASE RECOVER TO LOGICAL STANDBY hellodb

*

ERROR at line 1:

ORA-16254: change db_name to HELLODB in the client-side parameter file (pfile)

ORA-27037: unable to obtain file status

Linux-x86_64 Error: 2: No such file or directory

Additional information: 3

 

shutdown immediate

startup mount

alter database open resetlogs;

 

alter database start logical standby apply immediate;

 

52 执行(如果日志没有传过来,该操作会立即激活传输)

shutdown immediate

startup

 

02 看到类似,表示成功了

Indexes of table  SYSTEM.LOGMNR_ATTRCOL$ have been rebuilt and are now usable

Indexes of table  SYSTEM.LOGMNR_ATTRIBUTE$ have been rebuilt and are now usable

……

Indexes of table  SYSTEM.LOGMNR_USER$ have been rebuilt and are now usable

LSP2 started with pid=27, OS id=21614

Thu Dec 09 18:26:16 CST 2010

LOGMINER: Begin mining logfile for session 1 thread 1 sequence 21, /data/oracle/oradata/hellodb/arch/1_21_737312896.dbf

Thu Dec 09 18:26:16 CST 2010

LOGMINER: Turning ON Log Auto Delete

LOGSTDBY Analyzer process P003 started with pid=27 OS id=21616

LOGSTDBY Apply process P004 started with pid=28 OS id=21618

LOGSTDBY Apply process P006 started with pid=30 OS id=21622

LOGSTDBY Apply process P005 started with pid=29 OS id=21620

LOGSTDBY Apply process P008 started with pid=32 OS id=21626

LOGSTDBY Apply process P007 started with pid=31 OS id=21624

Thu Dec 09 18:26:17 CST 2010

LOGMINER: End mining logfile: /data/oracle/oradata/hellodb/arch/1_21_737312896.dbf

Thu Dec 09 18:26:17 CST 2010

LOGMINER: Begin mining logfile for session 1 thread 1 sequence 22, /data/oracle/oradata/hellodb/arch/1_22_737312896.dbf

Thu Dec 09 18:26:17 CST 2010

LOGMINER: End mining logfile: /data/oracle/oradata/hellodb/arch/1_22_737312896.dbf

 

52 测试

create user testuser

identified by "test123"

default tablespace system

temporary tablespace TEMP

 profile DEFAULT;

grant dba to testuser;

create table testuser.test(a int);

insert into testuser.test values(1);

commit;

 

02 查看结果

 

SQL> select * from testuser.test;

 

         A

----------

         1

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/758322/viewspace-681930/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-11-24

  • 博文量
    132
  • 访问量
    287979