你好,游客 登录 注册 搜索
背景:
阅读新闻

Oracle 数据库冷备份及RMAN简单使用

[日期:2012-12-14] 来源:Linux社区  作者:cswggod [字体:大 中 小]

2.冷·备份
 
前提:有两台服务器,一台是Oracle数据库服务器SERVER130 ip=192.168.5.130,另一台是新机 Server128=192.168.5.128
 
现在冷备份数据库将Server130中的TEST迁移至Server128
 
#-------------------其中SERVER130 数据库重命名过,原名ORCL,所以按照数据库安装时生成的/app/oracle/admin/orcl/pfile/
 
init.ora.[num]中db_name=安装数据库时的ORCL;迁移次文件,生成的数据库是ORCL
 


1.SERVER1 上BITC实例关闭,监听关闭

[oracle@h1 ~]$ sqlplus "/as SYSDBA"
 
SQL*Plus: Release 11.2.0.1.0 Production on Mon Nov 12 14:42:08 2012
 
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
 

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 

SQL> show parameter instance;

NAME                                            TYPE        VALUE
------------------------------------ ----------- ------------------------------
instance_name                            string      bitc

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@h1 ~]$ lsnrctl stop bitc
 
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 12-NOV-2012 14:44:23
 
Copyright (c) 1991, 2009, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.5.130)(PORT=1522)))
The command completed successfully
[oracle@h1 ~]$


2.转移参数文件
SERVER130上下载参数文件

[oracle@h1 oracle]$ cd /app/oracle/admin/orcl/pfile
[oracle@h1 pfile]$ ls
init.ora.103201271612
 
[oracle@h1 pfile]$ sz *
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring init.ora.103201271612...
  100%      1 KB    1 KB/s 00:00:01      0 Errors
 
-----------------------------------------------
SERVER128上传参数

[root@instructor app]# mkdir  -p /app/oracle/admin/orcl/pfile
[root@instructor app]# mkdir  -p /app/oracle/admin/orcl/adump
[root@instructor app]# mkdir  -p /app/oracle/admin/orcl/dpdump
------安装lrzsz
[root@instructor app]# yum install lrzsz

[root@instructor pfile]# cd /app/oracle/admin/orcl/pfile
[root@instructor pfile]# rz
rz waiting to receive.
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring init.ora.103201271612...
  100%      1 KB    1 KB/s 00:00:01      0 Errors
 
[root@instructor pfile]# ls
init.ora.103201271612
 
[root@instructor pfile]# more  init.ora.103201271612
 
查看得知
 
* db_name=ORCL
 
*control_files=("/app/oracle/oradata/orcl/control01.ctl", "/app/oracle/flash_recovery_area/orcl/control02.ctl"
)
db_recovery_file_dest=/app/oracle/flash_recovery_area
db_recovery_file_dest_size=260612736
 
*local_listener=LISTENER_ORCL
 
*processes=300
 
*audit_file_dest=/app/oracle/admin/orcl/adump
 
#因此:数据库db_name=orcl
 
-----------------------------------------------
 
[root@instructor app]# mkdir -p /app/oracle/flash_recovery_area
--------------------------------------

[root@instructor pfile]# mkdir -p /app/oracle/oradata/orcl

[root@instructor pfile]# cp init.ora.103201271612 /app/oracle/product/11.2.0/dbhome_1/dbs/initbitc.ora
[root@instructor pfile]# cd /app/oracle/product/11.2.0/dbhome_1/dbs/
[root@instructor dbs]# ls
hc_DBUA0.dat  hc_orcl.dat  initbitc.ora  init.ora
[root@instructor dbs]#


3.转移dbf和ctl文件
在SERVER130上


[oracle@h1 dbs]$ cd /app/oracle/oradata/
[oracle@h1 oradata]$ ls
orcl  test
[oracle@h1 oradata]$ cd /app/oracle/oradata/orcl
[oracle@h1 orcl]$ ls
control01.ctl  redo01.log  redo03.log    system01.dbf  undotbs01.dbf
example01.dbf  redo02.log  sysaux01.dbf  temp01.dbf    users01.dbf
[oracle@h1 orcl]$ sz *
rz
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring control01.ctl...
  100%    9520 KB 9520 KB/s 00:00:01      0 Errors
Transferring example01.dbf...
  100%  102408 KB 4876 KB/s 00:00:21      0 Errors
Transferring redo01.log...
  100%  51200 KB 3200 KB/s 00:00:16      0 Errors
Transferring redo02.log...
  100%  51200 KB 2844 KB/s 00:00:18      0 Errors
Transferring redo03.log...
  100%  51200 KB 4266 KB/s 00:00:12      0 Errors
Transferring sysaux01.dbf...
  100%  563208 KB 3181 KB/s 00:02:57      0 Errors
Transferring system01.dbf...
  100%  696328 KB 9162 KB/s 00:01:16      0 Errors
Transferring temp01.dbf...
  100%  29704 KB 9901 KB/s 00:00:03      0 Errors
Transferring undotbs01.dbf...
  100%  102408 KB 10240 KB/s 00:00:10      0 Errors
Transferring users01.dbf...
  100%    5128 KB 5128 KB/s 00:00:01      0 Errors

-----------------------------------------------------------------
在SERVER128上
[root@instructor dbs]# mkdir -p /app/oracle/oradata/orcl

[root@instructor dbs]# cd /app/oracle/oradata/orcl


[root@instructor orcl]# rz
rz waiting to receive.
Starting zmodem transfer.  Press Ctrl+C to cancel.
 
?[root@instructor orcl]# rz
rz waiting to receive.
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring control01.ctl...
  100%    9520 KB 3173 KB/s 00:00:03      0 Errors
Transferring example01.dbf...
  100%  102408 KB 2438 KB/s 00:00:42      0 Errors
Transferring redo01.log...
  100%  51200 KB 2226 KB/s 00:00:23      0 Errors
Transferring redo02.log...
  100%  51200 KB 1651 KB/s 00:00:31      0 Errors
Transferring redo03.log...
  100%  51200 KB 4266 KB/s 00:00:12      0 Errors
Transferring sysaux01.dbf...
  100%  563208 KB 4365 KB/s 00:02:09      0 Errors
Transferring system01.dbf...
  100%  696328 KB 11231 KB/s 00:01:02      0 Errors
Transferring temp01.dbf...
  100%  29704 KB 9901 KB/s 00:00:03      0 Errorss
Transferring undotbs01.dbf...
  100%  102408 KB 10240 KB/s 00:00:10      0 Errors
Transferring users01.dbf...
  100%    5128 KB 5128 KB/s 00:00:01      0 Errors

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款