Oracle module install and uninstall
1 我们已经在备份服务器上建立了一个catalog库,具体的操作过程如下:
1)查询现在的数据库
# sqlplus /nolog
SQL*Plus: Release 9.2.0.1.0 - Production on Wed Dec 3 23:41:33 2003
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL>; connect / as sysdba;
Connected.
SQL>; select * from v$tablespace;
TS# NAME INC
---------- ------------------- ---
0 SYSTEM YES
1 UNDOTBS1 YES
2 TEMP YES
3 CWMLITE YES
4 INDX YES
5 TOOLS YES
6 USERS YES
7 XDB YES
8 rows selected.
SQL>; sellect name,bytes,status from v$datafile;
NAME-------------BYTES STATUS----------
/oracle/product/9.2.0.1/oradata/legato/system01.dbf 5242880 SYSTEM
/oracle/oradata/legato/system01.dbf 262144000 SYSTEM
/oracle/product/9.2.0.1/oradata/legato/undotbs01.dbf 5242880 ONLINE
NAME------------ BYTES STATUS----------
/oracle/oradata/legato/undotbs01.dbf 209715200 ONLINE
/oracle/product/9.2.0.1/oradata/legato/cwmlite01.dbf 5242880 ONLINE
/oracle/oradata/legato/cwmlite01.dbf 20971520 ONLINE
NAME--------------BYTES STATUS- -------
/oracle/product/9.2.0.1/oradata/legato/indx01.dbf 5242880 ONLINE
/oracle/oradata/legato/indx01.dbf 26214400 ONLINE
/oracle/product/9.2.0.1/oradata/legato/tools01.dbf 5242880 ONLINE
NAME------------- BYTES STATUS-------
/oracle/oradata/legato/tools01.dbf 10485760 ONLINE
/oracle/product/9.2.0.1/oradata/legato/users01.dbf 5242880 ONLINE
/oracle/oradata/legato/users01.dbf 26214400 ONLINE
NAME---------------BYTES STATUS----------
/oracle/product/9.2.0.1/oradata/legato/xdb01.dbf 5242880 ONLINE
/oracle/oradata/legato/xdb01.dbf 20971520 ONLINE
14 rows selected.
SQL>; select INSTANCE_NAME,HOST_NAME,VERSION from v$instance;
INSTANCE_NAME---------HOST_NAME--------VERSION-------
legato
l2000a
9.2.0.1.0
SQL>; select username from dba_users;
USERNAME--------------
SYS
SYSTEM
DBSNMP
OUTLN
OLAPSYS
WMSYS
6 rows selected.
2)创建表空间和rman用户,并授权。
SQL>; create tablespace rman_ts datafile '/oracle/oradata/legato/rman_ts01.dbf' size 200M default storage (initial 100K next 100K pctincrease 0);
Tablespace created.
SQL>; alter tablespace rman_ts online;
Tablespace altered.
SQL>; select * from v$tablespace;
TS# NAME INC
---------- ------------------ ---
0 SYSTEM YES
1 UNDOTBS1 YES
2 TEMP YES
3 CWMLITE YES
4 INDX YES
5 TOOLS YES
6 USERS YES
7 XDB YES
8 RMAN_TS YES
9 rows selected.
SQL>; create user rman identified by oracle9i default tablespace rman_ts quota unlimited on rman_ts;
User created.
SQL>; grant recovery_catalog_owner to rman;
Grant succeeded.
SQL>; grant connect ,resource to rman;
Grant succeeded.
SQL>; select username from dba_users;
USERNAME-----------------
SYS
SYSTEM
RMAN
DBSNMP
OUTLN
OLAPSYS
WMSYS
7 rows selected.
3) 创建recover catalog 。
l2000a:/oracle #rman catalog rman/oracle9i@legato;
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;
recovery catalog created
RMAN>; exit
Recovery Manager complete.
l2000a:/oracle #exit
script done on Thu Dec 4 00:02:43 2003
2 今天需要做的工作
0) 判断系统中是否存在nsr进程:
# ps –ef|grep nsr
如果存在,先运行如下命令:
# nsr_shutdown
看是否存在/nsr和/opt/networker文件夹,如果存在,运行如下命令:
# mv /nsr /var/legato
# mv /opt/networker /var/legato
# mv /sbin/init.d/networker /sbin/init.d/networker.old
# mv /sbin/rc2.d/S900networker /sbin/rc2.d/S900networker.old
1) Install Legato Networker client
将相关的文件ftp上传到/var/legato文件夹下;
要求/opt要有大于100M的硬盘空间。
1运行swinstall & 选择安装legato NetWorker的client 和man。
2 编辑需要安装软件的服务器的 /etc/hosts 文件,增加如下内容:
136.5.9.63 l2000a
3 在备份服务器(l2000a)上 vi /etc/hosts ,增加如下内容:
136.5.196.100 xxxx
4 编辑需要安装软件的服务器的 /nsr/res/servers 文件,增加如下内容:
l2000a
5 编辑服务器root用户的profile文件,在PATH环境变量中增加如下部分:
/opt/networker/bin
6 运行一次 #. ./.profile
7 手工启动networker的进程:
# /sbin/init.d/networker start
8 检验进程是否正常启动:
# ps –ef|grep nsr
如果有 nsrd和nsrexed则说明正常。
9 在备份服务器上增加如下客户端:
xxxx
10 在新安装软件的机器上运行如下命令:
# nwbackup &
手工指定 /etc/hosts文件测试文件备份是否正常。
2) Install NetWorker Module for oracle
1运行swinstall & 选择安装networker module for oracle
2 做数据库的链接
# su - oracle
$ cd $ORACLE_HOME/lib
$ mv libobk.sl libobk.sl.bak (该目录下没有libobk.sl 文件)
$ ln –s /usr/lib/libnwora.sl libobk.sl
3) Open target database Archivelog 模式(该步骤由oracle工程师来做)
# su – oracle
$ vi /u01/app/oracle/admin/cqyp/pfile/initora8i.ora
然后根据客户的实际情况修改下面几行:
log_archive_start = true
log_archive_dest_1 = "location=/redo_log"
log_archive_format = arch_%t_%s.arc
将前面的几个#注释掉。
4) Open target database archive log模式(该步骤由oracle工程师来做)
# su – oracle
$ sqlplus /nolog
>;connect / as sysdba;
>;startup mount;
>;archive log start;
>;alter database archivelog;
>;alter database open;
>;archive log list;
>;exit
5) 在target库上建立一个dbbackup用户。该用户具备sysdba权限。(该步骤由oracle工程师来做。)
create user dbbackup identified by oracle9i default tablespace tools;
grant sysdba to dbbackup;
6) 修改数据库的tnsnames.ora。
在target数据库的tnsnames.ora上增加如下内容:
LEGATO =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = l2000a)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = legato)
)
)
在备份服务器catalog数据库的tnsnames.ora上增加如下内容:
ORA7 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = cq112)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora7)
)
)
7) 在target服务器上register catalog database;
$ rman catalog rman/oracle9i@legato target sys/password@ora7;
RMAN>;register database;
8) 修改/opt/networker/bin下的nsrnmo
注意修改以下内容:
ORACLE_HOME= /u01/app/oracle/product/8.1.7
PATH=/usr/local/sbin:/usr/ccs/bin:/usr/sbin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/bin:/usr/ucb:/usr/local/bin:/oracle/app/oracle8/product/817/bin
NSR_RMAN_ARGUMENTS="catalog msglog '/nsr/applogs/msglog.log' append"
NSR_SB_DEBUG_FILE=/nsr/applogs/nsrnmostart.log
ORACLE_SID=ora8i
9) 测试备份教本。
1 Online_db_full
connect target sys/password@XXXX;
connect catalog rman/oracle9i@legato;
run {
allocate channel t1 type 'SBT_TAPE' parms 'ENV=(NSR_SERVER=l2000a,NSR_DATA_VOLUME_POOL=Default)';
allocate channel t2 type 'SBT_TAPE' parms 'ENV=(NSR_SERVER=l2000a,NSR_DATA_VOLUME_POOL=Default)';
allocate channel t3 type 'SBT_TAPE' parms 'ENV=(NSR_SERVER=l2000a,NSR_DATA_VOLUME_POOL=Default)';
allocate channel t4 type 'SBT_TAPE' parms 'ENV=(NSR_SERVER=l2000a,NSR_DATA_VOLUME_POOL=Default)';
backup full filesperset 4
format 'Default_%s_%p_%u'
(database include current controlfile);
release channel t1;
release channel t2;
release channel t3;
release channel t4;
}
2 online_archivelog
connect target sys/password@XXXX;
connect catalog rman/oracle9i@legato;
run{
allocate channel t1 type 'SBT_TAPE' parms 'ENV=(NSR_SERVER=l2000a,NSR_DATA_VOLUME_POOL=Default)';
allocate channel t2 type 'SBT_TAPE' parms 'ENV=(NSR_SERVER=l2000a,NSR_DATA_VOLUME_POOL=Default)';
sql 'alter system switch logfile';
backup filesperset 4
format 'archive_%s_%p_%u'
(archivelog until time 'SYSDATE' delete input);
release channel t1;
release channel t2;
}
阅读(377) | 评论(0) | 转发(0) |