且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

[20140627]rman下catalog的使用.txt

更新时间:2022-09-10 15:57:47

[20140627]rman下catalog的使用.txt

前几天有人问rman的catalog的使用问题,主要是后面的/.自己做一些记录:

--我建立一个目录testtes

# ls -l | grep testtes
drwxr-x---  2 root      root      4096 2014-06-26 02:14:28 testtes
drwxr-xr-x  3 oracle11g oinstall 20480 2014-06-26 02:04:51 testtest

RMAN> catalog start with '/data/testtes/';

searching for all files that match the pattern /data/testtes/
no files found to be unknown to the database

--因为没有权限,没有文件发现.

# chmod 755 testtes
# cp /etc/passwd testtes
# chmod 640 testtes/passwd
# ls -l testtes
total 4
-rw-r-----  1 root root 2874 2014-06-26 02:19:55 passwd

RMAN> catalog start with '/data/testtes/';

searching for all files that match the pattern /data/testtes/
no files found to be unknown to the database

--这个时候是文件passwd没有读权限.

# chmod 644 testtes/passwd
RMAN> catalog start with '/data/testtes/';

searching for all files that match the pattern /data/testtes/

List of Files Unknown to the Database
=====================================
File Name: /data/testtes/passwd

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
no files cataloged

List of Files Which Where Not Cataloged
=======================================
File Name: /data/testtes/passwd
  RMAN-07517: Reason: The file header is corrupted

--我感觉奇怪的是passwd文件根本不是rman能管理的文件,难道在catalog前不检查吗?仅仅在开始catalog时才检查.

--尝试不使用后面的斜线/

RMAN> catalog start with '/data/testtes';

searching for all files that match the pattern /data/testtes

List of Files Unknown to the Database
=====================================
File Name: /data/testtes/passwd
File Name: /data/testtest/test/sysaux01.dbf
File Name: /data/testtest/test/system01.dbf
File Name: /data/testtest/test/redo03.log
File Name: /data/testtest/test/users01.dbf
File Name: /data/testtest/test/redostb01.log
File Name: /data/testtest/test/redostb04.log
File Name: /data/testtest/test/tools01.dbf
File Name: /data/testtest/test/redo02.log
File Name: /data/testtest/test/testmssm01.dbf
File Name: /data/testtest/test/redostb03.log
File Name: /data/testtest/test/redo01.log
File Name: /data/testtest/test/test01.dbf
File Name: /data/testtest/test/rman01.dbf
File Name: /data/testtest/test/temp01.dbf
File Name: /data/testtest/test/redostb02.log
File Name: /data/testtest/test/example01.dbf
File Name: /data/testtest/test/undotbs02.dbf
File Name: /data/testtest/test/control01.ctl
File Name: /data/testtest/test/control02.ctl
File Name: /data/testtest/test/undotbs01.dbf
File Name: /data/testtest/test.tgz
File Name: /data/testtest/test01.dbf
File Name: /data/testtest/test01.dbf_2
File Name: /data/testtest/users01.dbf

Do you really want to catalog the above files (enter YES or NO)? no

--可以发现执行catalog start with '/data/testtes';实际上找匹配"/data/testtes*"的文件.
--自己做一个记录,加强理解这个问题.