catlog

创建catalog数据库

编辑.profile,SID设为catdb

ORACLE_BASE=/home/oracle;    export ORACLE_BASE
ORACLE_HOME=/home/oracle/app/oracle/product/9.2.0;  export ORACLE_HOME
ORACLE_SID=catdb;   export ORACLE_SID
ORACLE_TERM=ansi;  export ORACLE_TERM

ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data;  export ORA_NLS33

LD_LIBRARY_PATH=.:/usr/libORACLE_HOME/lib;export LD_LIBRARY_PATH

LIBPATH=$ORACLE_HOME/lib;   export LIBPATH

ORACLE_PATH=.ORACLE_HOME/binORACLE_HOME/obackup/bin:/usr/sbin:/usr/lbin:/usr
/bin:/usr/ccs/bin:/usr/lib:/usr/ccs/libORACLE_HOME/precomp/public;export ORACL
E_PATH

NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;  export NLS_LANG

PATH=$ORACLE_HOME/bin:/usr/bin:/usr/ccs/bin:/etc:/usr/sbin:/usr/lpp/ssp/bin/:/et
c:/usr/sbin:/usr/lib:/usr/ccs/lib:.
export PATH

TMPDIR=/home/oracle/tmp;   export TMPDIR


编辑 initcatdb.ora

*.aq_tm_processes=1
*.background_dump_dest='/home/oracle/admin/catdb/bdump'
*.compatible='9.2.0.0.0'
*.control_files='/gisdata/catdb/control01.ctl','/gisdata/catdb/control02.ctl','/
gisdata/catdb/control03.ctl'
*.core_dump_dest='/home/oracle/admin/catdb/cdump'
*.cursor_sharing='SIMILAR'
*.db_block_size=8192
*.db_cache_size=788529152
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_keep_cache_size=50331648
*.db_name='catdb'
*.db_writer_processes=2
#*.dispatchers='(PROTOCOL=TCP)'
*.dml_locks=10000
*.fast_start_mttr_target=300
*.hash_join_enabled=TRUE
*.instance_name='catdb'
*.java_pool_size=157286400
*.job_queue_processes=10
*.large_pool_size=125829120
*.log_archive_start=true
*.log_archive_dest='/gisdata/catdb/arch'
*.log_buffer=2097152
*.log_checkpoint_interval=1000
*.log_checkpoint_timeout=0
#*.max_shared_servers=40
#*.mts_servers=0
*.open_cursors=1024
*.parallel_automatic_tuning=TRUE
*.pga_aggregate_target=209715200
*.processes=400
*.query_rewrite_enabled='FALSE'
*.remote_login_passwordfile='EXCLUSIVE'
*.shared_pool_reserved_size=63753420
*.shared_pool_size=367001600
#*.shared_servers=20
*.sort_area_size=524288
*.star_transformation_enabled='FALSE'
*.timed_statistics=TRUE
*.undo_management='AUTO'
*.undo_retention=10800
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/home/oracle/admin/catdb/udump'
*.sga_max_size=3221225472



创建密码文件

   orapwd file=orapwcatdb password=hxx entries=2

创建catalog数据库catdb

  数据库创建脚本如下:
# cat createdb.sh
       CREATE DATABASE catdb
       USER SYS IDENTIFIED BY hxx
       USER SYSTEM IDENTIFIED BY hxx
       LOGFILE GROUP 1 ('/gisdata/catdb/redo01.log') SIZE 1M,
               GROUP 2 ('/gisdata/catdb/redo02.log') SIZE 1M,
               GROUP 3 ('/gisdata/catdb/redo03.log') SIZE 1M
       MAXLOGFILES 5
       MAXLOGMEMBERS 5
       MAXLOGHISTORY 1
       MAXDATAFILES 100
       MAXINSTANCES 1
       CHARACTER SET ZHS16GBK
       NATIONAL CHARACTER SET AL16UTF16
       DATAFILE '/gisdata/catdb/system01.dbf' SIZE 400M REUSE
       EXTENT MANAGEMENT LOCAL
       DEFAULT TEMPORARY TABLESPACE temptbs1
         TEMPFILE '/gisdata/catdb/temp01.dbf'
         SIZE 5M REUSE EXTENT MANAGEMENT LOCAL
       UNDO TABLESPACE undotbs1
         DATAFILE '/gisdata/catdb/undotbs01.dbf'
         SIZE 5M REUSE AUTOEXTEND ON NEXT 5M MAXSIZE UNLIMITED;

#sqlplus /nolog
SQL> connect / as sysDBA
SQL> startup nomout
SQL> @/gisdata/catdb/createdb.sh
     Database created.

SQL>@$ORACLE_HOME/rdbms/admin/catalog.sql;
SQL>@$ORACLE_HOME/rdbms/admin/catproc.sql;


创建catalog恢复目录

创建恢复目录使用的表空间

SQL> create tablespace catalogtbs datafile '/gisdata/catdb/catalog.dbf' size 100M;

Tablespace created.

创建RMAN用户并授权

SQL> create user rman identified by hxx default tablespace catalogtbs temporary
tablespace temptbs1 quota unlimited on catalogtbs;

User created.

SQL> grant recovery_catalog_owner to rman;
Grant succeeded.

SQL> grant connect, resource to rman;
Grant succeeded.

创建恢复目录

#rman catalog rman/hxx

Recovery Manager: Release 9.2.0.1.0 - 64bit Production
Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.
connected to recovery catalog database
recovery catalog is not installed

RMAN> create catalog tablespace catalogtbs;
recovery catalog created
RMAN> exit;


注册目标数据库

配置目标数据库的tnsnames.ora

。。。。。。
catdb =
(DESCRIPTION =
   (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.9.108)(PORT = 1521))
   )
   (CONNECT_DATA =
     (SID = catdb)
   )
)
。。。。。。

注册目标数据库

#rman target / catalog rman/hxx@catdb

Recovery Manager: Release 9.2.0.1.0 - 64bit Production
Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.
connected to target database: GIS (DBID=3464721388)
connected to recovery catalog database
RMAN> register database ;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

显示目标数据库注册信息

RMAN> report schema ;

Report of database schema
File K-bytes    Tablespace           RB segs Datafile Name
---- ---------- -------------------- ------- -------------------
1        307200 SYSTEM               YES     /gisdata/datafile/system01.dbf
2        143360 UNDOTBS1             YES     /gisdata/datafile/undotbs01.dbf
3       2048000 GISDTS               NO      /gisdata/datafile/gisdts01.dbf
4       2560000 GISITS               NO      /gisdata/datafile/gisits01.dbf
5          2048 TOOLS                NO      /gisdata/datafile/tools01.dbf
6       2048000 GISITS               NO      /gisdata/datafile/gisits02.dbf
7       2048000 GISDTS               NO      /gisdata/datafile/gisdts02.dbf
8        112640 PERFSTAT             NO      /gisdata/datafile/perfstat.dbf
9       2048000 GISITS               NO      /gisdata/datafile/gisits03.dbf
10      2048000 GISDTS               NO      /gisdata/datafile/gisdts03.dbf


备份目标数据库

备份目标数据库

RMAN> run{
2> allocate channel ch00 type disk;
3> backup database format '/gisdata/backup/bk_%s_%p_%t';
4> release channel ch00;
5> }

allocated channel: ch00
channel ch00: sid=16 devtype=DISK

Starting backup at 26-MAR-06
channel ch00: starting full datafile backupset
channel ch00: specifying datafile(s) in backupset
including current controlfile in backupset
input datafile fno=00004 name=/gisdata/datafile/gisits01.dbf
input datafile fno=00003 name=/gisdata/datafile/gisdts01.dbf
input datafile fno=00006 name=/gisdata/datafile/gisits02.dbf
input datafile fno=00007 name=/gisdata/datafile/gisdts02.dbf
input datafile fno=00009 name=/gisdata/datafile/gisits03.dbf
input datafile fno=00010 name=/gisdata/datafile/gisdts03.dbf
input datafile fno=00001 name=/gisdata/datafile/system01.dbf
input datafile fno=00002 name=/gisdata/datafile/undotbs01.dbf
input datafile fno=00008 name=/gisdata/datafile/perfstat.dbf
input datafile fno=00005 name=/gisdata/datafile/tools01.dbf
channel ch00: starting piece 1 at 26-MAR-06
channel ch00: finished piece 1 at 26-MAR-06
piece handle=/gisdata/backup/bk_1_1_586123407 comment=NONE
channel ch00: backup set complete, elapsed time: 00:11:45
Finished backup at 26-MAR-06
released channel: ch00

显示备份信息

RMAN> list backup;

List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
7       Full    9G         DISK        00:11:35     26-MAR-06
        BP Key: 8   Status: AVAILABLE   Tag: TAG20060326T200326
        Piece Name: /gisdata/backup/bk_1_1_586123407
  Controlfile Included: Ckp SCN: 7791561862659   Ckp time: 26-MAR-06
  List of Datafiles in backup set 7
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 7791561862660 26-MAR-06 /gisdata/datafile/system01.dbf
  2       Full 7791561862660 26-MAR-06 /gisdata/datafile/undotbs01.dbf
  3       Full 7791561862660 26-MAR-06 /gisdata/datafile/gisdts01.dbf
  4       Full 7791561862660 26-MAR-06 /gisdata/datafile/gisits01.dbf
  5       Full 7791561862660 26-MAR-06 /gisdata/datafile/tools01.dbf
  6       Full 7791561862660 26-MAR-06 /gisdata/datafile/gisits02.dbf
  7       Full 7791561862660 26-MAR-06 /gisdata/datafile/gisdts02.dbf
  8       Full 7791561862660 26-MAR-06 /gisdata/datafile/perfstat.dbf
  9       Full 7791561862660 26-MAR-06 /gisdata/datafile/gisits03.dbf
  10      Full 7791561862660 26-MAR-06 /gisdata/datafile/gisdts03.dbf

评分

参与人数 1贡献 +1 收起 理由
iidba + 1 把“禁用表情”勾选上,代码就不会被转义了.

查看全部评分

标签: 暂无标签
Capricorn

写了 8 篇文章,拥有财富 66,被 3 人关注

转播转播 分享分享 分享淘帖
回复

使用道具

P4 | 发表于 2013-10-27 10:27:12
不知道在那里改,我刚进来才几天。。。
回复

使用道具

您需要登录后才可以回帖 登录 | 加入社区

本版积分规则

意见
反馈