天天看點

rman catalog database 使用

1、DBCA建立資料庫

2、配置監聽檔案listener.ora(伺服器端建立)

3、配置遠端連接配接字元串tnames.ora(用戶端建立)

4、在資料庫中建立表空間

create tablespace rmanca datafile '/u01/app/oracle/oradata/orclca/rmanca.dbf' size 10M;

5、建立使用者并制定使用者權限

create user rcuser identified by rcuser default tablespace rmanca temporary tablespace temp;

grant connect,resource,recovery_catalog_owner to rcuser;

6、建立catalog

[[email protected] admin]$ rman catalog rcuser/rcuser

Recovery Manager: Release 11.2.0.4.0 - Production on Sat Mar 30 18:15:23 2019

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to recovery catalog database

RMAN> create catalog tablespace rmanca;

recovery catalog created

7、rman同時連接配接兩個庫,注冊目标資料庫

rman target sys/ziqiyuan catalog rcuser/[email protected]

[[email protected] ~]$ rman target sys/ziqiyuan catalog rcuser/[email protected]

Recovery Manager: Release 11.2.0.4.0 - Production on Sat Mar 30 18:21:16 2019

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: ORCL (DBID=1516158697)

connected to recovery catalog database

RMAN> register database;

database registered in recovery catalog

starting full resync of recovery catalog

RMAN> report schema;

Report of database schema for database with db_unique_name SORCL

List of Permanent Datafiles

===========================

File Size(MB) Tablespace RB segs Datafile Name

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

1 760 SYSTEM YES /u01/app/oracle/oradata/orcl/system01.dbf

2 610 SYSAUX NO /u01/app/oracle/oradata/orcl/sysaux01.dbf

3 330 UNDOTBS1 YES /u01/app/oracle/oradata/orcl/undotbs01.dbf

4 5 USERS NO /u01/app/oracle/oradata/orcl/users01.dbf

5 10 RMAN NO /u01/app/oracle/oradata/orcl/rman01.dbf

6 136 OGG NO /u01/app/oracle/oradata/orcl/OGG.DBF

List of Temporary Files

=======================

File Size(MB) Tablespace Maxsize(MB) Tempfile Name

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

1 22 TEMP 32767 /u01/app/oracle/oradata/orcl/temp01.dbf

8、建立備份腳本

RMAN> create script rmsc01

{allocate channel d1 device type disk;

backup incremental level 1 database ;

release channel d1;

}

created script rmsc01

RMAN> run {

execute script rmsc01;

};

繼續閱讀