Saturday, June 22, 2013

How to start TSM client schedule in Linux environment?

1.    Change to the Tivoli Storage Manager Installation directory and enter the following command:
           $ dsmc schedule

Note : When you start the client scheduler, it runs continuously until you close the window, end the process, or log off your system.

2.    If the Tivoli Storage Manager client executable directory is not in your PATH environment variable, change to the installation directory and enter the following command:
           $ ./dsmc schedule

3.    To run the schedule command in the background and to keep the client scheduler running, even if you log off your system, enter the following:

$ nohup dsmc schedule 2> /dev/null &
 

Friday, June 21, 2013

How take DB2 database backup, setup in Linux environment?

Check DB directory list

[db2inst1@nodexxxx ~]$ db2 list db directory
System Database Directory
Number of entries in the directory = 1
Database 1 entry:
 Database alias                       = DBXXX
 Database name                        = DBXXX
 Local database directory             = /home/db2inst1
 Database release level               = b.00
 Comment                              =
 Directory entry type                 = Indirect
 Catalog database partition number    = 0
 Alternate server hostname            =
 Alternate server port number         =

[db2inst1@nodexxxx ~]$ ls -l
drwxr-xr-x  2 db2inst1 db2grp1 4096 Feb 15 15:35 backup_store

[db2inst1@nodexxxx ~]$ cd backup_store/

[db2inst1@nodexxxx backup_store]$ db2 backup db DBXXX compress
SQL1035N  The database is currently in use.  SQLSTATE=57019

[db2inst1@nodexxxx backup_store]$ db2 force application all
DB20000I  The FORCE APPLICATION command completed successfully.
DB21024I  This command is asynchronous and may not be effective immediately.

[db2inst1@nodexxxx backup_store]$ db2 backup db DBXXX compress
Backup successful. The timestamp for this backup image is : 20130218184329

[db2inst1@nodexxxx backup_store]$ ls -l
total 353652
-rw-r----- 1 db2inst1 db2grp1 361779200 Feb 18 18:46 DBXXX.0.db2inst1.NODE0000.CATN0000.20130218184329.001

 

Thursday, June 20, 2013

How to define daily/weekly schedule in Tivoli Storage Manager 6.3?

Define selective schedule (win-test-bkp) backup to take WEEKLY backup of windows base BA client:
tsm: SRV1>DEF SCH STANDARD win-test-bkp TYPE=CLIENT ACTION=SELECTIVE OBJECTS="c:\bkptest\*" OPTIONS=-subdir=yes STARTDATE=06/18/2013 STARTTIME=22:30:00 DAYOFWEEK=SAT PRIORITY=5 DURATION=15 DURUNITS=MINUTES

Define incremental schedule (daily_increment_bkp) backup to take DAILY backup of Linux base BA client:
tsm: SRV1>DEFINE SCHEDULE STANDARD daily_increment_bkp TYPE=CLIENT ACTION=INCREMENTAL OBJECTS="/xyz/*" OPTIONS=-subdir=yes SCHEDSTYLE=ENHANCED STARTDATE=06/17/2013 STARTTIME=23:40:00 DAYOFWEEK=TUE,WED,THU,FRI,SAT PRIORITY=5 DURATION=15 DURUNITS=MINUTES

Define association of schedule (win-test-bkp) backup with specific client node (baclxxxx):
tsm: SRV1>DEFINE ASSOCIATION STANDARD win-test-bkp baclxxxx

Update schedule (daily_increment_bkp) start date & time:
tsm: SRV1>UPDATE SCHEDULE STANDARD daily_increment_bkp STARTDATE=06/18/2013 STARTTIME=00:00:00

Check schedule (win-test-bkp) status:
tsm: SRV1>QUERY EVENT * *
tsm: SRV1>QUERY SCHEDULE STANDARD f=d
tsm: SRV1>QUERY ASSOCIATION
tsm: SRV1>QUERY ASSOCIATION STANDARD win-test-bkp

Update schedule (daily_increment_bkp) backup:
tsm: SRV1>UPDATE SCHEDULE STANDARD daily_increment_bkp SCHEDSTYLE=CLASSIC PERIOD=1 PERUNITS=days DAYOFWEEK=ANY
tsm: SRV1>UPDATE SCHEDULE STANDARD daily_increment_bkp SCHEDSTYLE=ENHANCED DAYOFWEEK=MON,TUE,WED,THU,FRI WEEKOFMONTH=ANY MONTH=ANY

Delete schedule (win-test-bkp):
tsm: SRV1>DELETE SCHEDULE STANDARD win-test-bkp

Wednesday, June 19, 2013

Backup-Archive (BA) & Oracle Tivoli Data Protection (TDP) Configuration on Linux 5.x base OS


Software details:
OS - Redhat Linux 5.3  64 bits
DB - Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit
BA - TIVsm-BA-6.3.0-0
API - TIVsm-API64-6.3.0-0
TDP - TDP-Oracle-5.5.1-0


For BA configuration

[root@oraxxxx ~]# ls -l /opt/tivoli/tsm/client/ba/bin/
-rw-r--r-- 1 root root        20 Feb 14 16:54 dsm.opt
-rw-r--r-- 1 root root       381 Jun 14 17:34 dsm.sys

 [root@oraxxxx ~]# cat /opt/tivoli/tsm/client/ba/bin/dsm.opt
SERVERNAME ORAXXXX

[root@oraxxxx ~]# cat /opt/tivoli/tsm/client/ba/bin/dsm.sys
SERVERNAME oraxxxx
   COMMMethod         TCPip
   TCPPort            1500
   NODENAME         oraxxxx
   TCPSERVERADDRESS tsmservx.abctest.com
   passwordaccess       generate

SERVERNAME oraxxxxtsm
   COMMMethod         TCPip
   TCPPort            1500
   NODENAME         oraxxxx_tdp
   TCPSERVERADDRESS tsmservx.abctest.com
   passworddir  /home/oracle
   passwordaccess       generate
 

For API Configuration

[root@oraxxxx ~]# ls -l /opt/tivoli/tsm/client/api/bin64/
-r--r--r-- 1 root root       809 Feb 19 16:11 dsm.opt
-rw-r--r-- 1 root root       388 Feb 19 16:12 dsm.sys


[root@oraxxxx ~]# cat /opt/tivoli/tsm/client/api/bin64/dsm.opt
SErvername     oraxxxxtsm

[root@oraxxxx ~]# cat /opt/tivoli/tsm/client/api/bin64/dsm.sys
SERVERNAME oraxxxxtsm
   COMMMethod         TCPip
   TCPPort            1500
   NODENAME         oraxxxx_tdp
   TCPSERVERADDRESS tsmservx.abctest.com
   passworddir  /home/oracle

 

For TDP Configuration

[root@oraxxxx ~]# ls -l /opt/tivoli/tsm/client/oracle/bin64/
-r--r--r-- 1 oracle root    808 Feb 12 16:34 dsm.opt
-r--r--r-- 1 oracle root    968 Feb 12 16:11 dsm.sys
-rwxr-xr-x 1 root   root 507072 Mar 28  2008 tdpoconf
-rwxr-xr-x 1 oracle root    707 Feb 18 17:02 tdpo.opt


[root@oraxxxx ~]# cat /opt/tivoli/tsm/client/oracle/bin64/dsm.opt
SErvername     oraxxxxtsm

[root@oraxxxx ~]# cat /opt/tivoli/tsm/client/oracle/bin64/dsm.sys
SErvername      oraxxxx
   COMMMethod         TCPip
   TCPPort            1500
   TCPServeraddress   tsmservx.abctest.com

[root@oraxxxx ~]# cat /opt/tivoli/tsm/client/oracle/bin64/tdpo.opt
DSMI_ORC_CONFIG    /opt/tivoli/tsm/client/oracle/bin64/dsm.opt
DSMI_LOG           /opt/tivoli/tsm/client/oracle/bin64

TDPO_FS            /adsmorc
TDPO_NODE          oraxxxx_tdp
TDPO_OWNER         oracle
TDPO_PSWDPATH      /opt/tivoli/tsm/client/oracle/bin64

TDPO_DATE_FMT      1
TDPO_NUM_FMT       1
TDPO_TIME_FMT      1

TDPO_MGMT_CLASS_2   mgmtclass2
TDPO_MGMT_CLASS_3   mgmtclass3
TDPO_MGMT_CLASS_4   mgmtclass4


[root@oraxxxx ~]# /opt/tivoli/tsm/client/oracle/bin64/tdpoconf password

IBM Tivoli Storage Manager for Databases:
Data Protection for Oracle
Version 5, Release 5, Level 1.0
(C) Copyright IBM Corporation 1997, 2008. All rights reserved.
 

***************************************************************
*   IBM Tivoli Storage Manager for Databases Utility
*   Password file initialization/update program
***************************************************************


Please enter current password:


Please enter new password:


Please reenter new password for verification:

ANU0260I Password successfully changed.

[root@oraxxxx ~]# /opt/tivoli/tsm/client/oracle/bin64/tdpoconf showenv
IBM Tivoli Storage Manager for Databases:
Data Protection for Oracle
Version 5, Release 5, Level 1.0
(C) Copyright IBM Corporation 1997, 2008. All rights reserved.


Data Protection for Oracle Information
 Version:              5
 Release:              5
 Level:                1
 Sublevel:             0
 Platform:             64bit TDPO LinuxAMD64

Tivoli Storage Manager Server Information
 Server Name:          ORAXXXXTSM
 Server Address:       TSMSERVX.ABCTEST.COM
 Server Type:          Windows
 Server Port:          1500
 Communication Method: TCP/IP

Session Information
 Owner Name:           oracle
 Node Name:            oraxxxx_tdp
 Node Type:            TDPO LinuxAMD64
 DSMI_DIR:             /opt/tivoli/tsm/client/api/bin64
 DSMI_ORC_CONFIG:      /opt/tivoli/tsm/client/oracle/bin64/dsm.opt
 TDPO_OPTFILE:         /opt/tivoli/tsm/client/oracle/bin64/tdpo.opt
 Password Directory:   /opt/tivoli/tsm/client/oracle/bin64
Compression:          FALSE

 License Information:  License file exists and contains valid license data.

Check above configuration

[root@oraxxxx ~]# dsmc
IBM Tivoli Storage Manager
Command Line Backup-Archive Client Interface
  Client Version 6, Release 3, Level 0.0
  Client date/time: 06/17/2013 14:39:31
(c) Copyright by IBM Corporation and other(s) 1990, 2011. All Rights Reserved.

Node Name: ORAXXXX
Session established with server SMBACKPHY01_SERVER1: Windows
  Server Version 6, Release 3, Level 0.0
  Server date/time: 06/17/2013 02:28:02  Last access: 06/14/2013 05:45:12
tsm> quit

[root@oraxxxx ~]# dsmc -servername=oraxxxxtsm
IBM Tivoli Storage Manager
Command Line Backup-Archive Client Interface
  Client Version 6, Release 3, Level 0.0
  Client date/time: 06/17/2013 14:40:30
(c) Copyright by IBM Corporation and other(s) 1990, 2011. All Rights Reserved.

Node Name: ORAXXXX_TDP
Session established with server SMBACKPHY01_SERVER1: Windows
Server Version 6, Release 3, Level 0.0
Server date/time: 06/17/2013 02:29:01  Last access: 06/17/2013 02:20:43
tsm> quit

Tuesday, June 18, 2013

ANS1126E (RC27) The file space cannot be deleted because this node does not have permission to delete archived or backed up data.


Problem:

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of delete command on sbt1 channel at 06/17/2013 16:40:49
ORA-19509: failed to delete sequential file, handle="/orcl/bk_152_1_818350547", parms=""
ORA-27027: sbtremove2 returned error
ORA-19511: Error received from media manager layer, error text:
ANS1126E (RC27)   The file space cannot be deleted because this node does not have permission to delete archived or backed up data.

Solution:

Check output of node details on TSM Server:

tsm:SRV1>q node oraxxxx_tdp f=d
Backup Delete Allowed?: No

Update backup Delete option ‘yes’:

tsm: SRV1>update node oraxxxx_tdp backdelete=yes
ANR2063I Node ORAXXXX_TDP updated.

Again check output of node option:

tsm:SRV1>q node oraxxxx_tdp f=d
Backup Delete Allowed?: Yes

Now start RMAN script to take backup of Oracle Database through TSM Server on DB Server

[oracle@oraxxxx ~]$ ./rman.sh
piece handle=/orcl/bk_164_1_818356487 tag=TAG20130617T171447 comment=API Version 2.0,MMS
piece handle=/orcl/bk_165_1_818356974 tag=TAG20130617T171447 comment=API Version 2.0,MMS
piece handle=/orcl/al_166_1_818356993 tag=TAG20130617T172313 comment=API Version 2.0,MMS
piece handle=/orcl/al_167_1_818357109 tag=TAG20130617T172313 comment=API Version 2.0,MMS
piece handle=/orcl/cntrl_168_1_818357204 tag=TAG20130617T172644 comment=API Version 2.0,MMS
released channel: sbt1
Recovery Manager complete.

[oracle@oraxxxx ~]$

Check Oracle DB backup status on TSM Server

tsm:SRV1>q cont E:\TIVOLI\TSM\SERVER1\DISK1.DSM node=oraxxxx_tdp
Node Name        Type  Filespace   FSID  Client's Name for File
                             Name
---------------  ----  ----------  ----  --------------------------------------
ORAXXXX_TDP     Bkup  /adsmorc       1  ///orcl/bk_164_1_818356487
ORAXXXX_TDP     Bkup  /adsmorc       1  ///orcl/bk_165_1_818356974
ORAXXXX_TDP     Bkup  /adsmorc       1  ///orcl/al_166_1_818356993
ORAXXXX_TDP     Bkup  /adsmorc       1  ///orcl/al_167_1_818357109
ORAXXXX_TDP     Bkup  /adsmorc       1  ///orcl/cntrl_168_1_818357204
tsm:SRV1>

tsm:SRV1>q occupancy oraxxxx_tdp
Node Name  Type Filespace  FSID Storage      Number of    Physical     Logical
                Name            Pool Name        Files       Space       Space
                                                         Occupied    Occupied
                                                              (MB)        (MB)
---------- ---- ---------- ---- ---------- ----------- ----------- -----------
ORAXXXX_- Bkup /adsmorc      1 DISKPOOL            17   10,104.37   10,104.37
TDP
tsm:SRV1>quit

Monday, June 17, 2013

RMAN Script for taking backup of Oracle Database through TSM 6.x

[oracle@oraxxxx ~]$ ls -l
-rwxr--r-- 1 oracle oinstall   460 Feb 18 16:03 rman_bkp.sh
-rwxr-xr-x 1 oracle oinstall   106 Feb 13 16:49 rman.sh

[oracle@oraxxxx ~]$ cat rman.sh
export ORACLE_BASE=/u01/app/oracle/product/11.2.0/db_1
export ORACLE_SID=orcl
rman target / @rman_bkp.sh

[oracle@oraxxxx ~]$ cat rman_bkp.sh
run
{
allocate channel sbt1 type sbt parms 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
crosscheck archivelog all;
BACKUP FORMAT '/orcl/bk_%s_%p_%t'
    DATABASE;
    sql 'alter system archive log current';
BACKUP
    filesperset 20
   FORMAT '/orcl/al_%s_%p_%t'
   ARCHIVELOG ALL;
BACKUP
    FORMAT '/orcl/cntrl_%s_%p_%t'
    CURRENT CONTROLFILE;
delete noprompt expired archivelog all;
delete noprompt obsolete;
RELEASE CHANNEL sbt1;
}

[oracle@oraxxxx ~]$ ./rman.sh
            :
          :
sql statement: alter system archive log current
released channel: sbt1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 06/17/2013 15:39:20
RMAN-11003: failure during parse/execution of SQL statement: alter system archive log current
ORA-01109: database not open

Note: Database is not open. Check & Correct as below.

[oracle@oraxxxx ~]$ sqlplus "/ as sysdba"
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> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.

SQL> startup
ORACLE instance started.
Total System Global Area 1052233728 bytes
Fixed Size                  2220032 bytes
Variable Size             792723456 bytes
Database Buffers          251658240 bytes
Redo Buffers                5632000 bytes
Database mounted.
Database opened.

SQL> quit

Enable/Disable Archive Log Mode of Oracle 11g DB on Linux 5.x

Enable Archive Log Mode

[oracle@oraxxxx ~]$ echo $ORACLE_BASE
/u01/app/oracle

[oracle@oraxxxx ~]$ echo $ORACLE_SID
DB11G

[oracle@oraxxxx ~]$ export ORACLE_BASE=/u01/app/oracle/product/11.2.0/db_1
[oracle@oraxxxx ~]$ export ORACLE_SID=orcl
[oracle@oraxxxx ~]$ echo $ORACLE_BASE
/u01/app/oracle/product/11.2.0/db_1

[oracle@oraxxxx ~]$ echo $ORACLE_SID
orcl

[oracle@oraxxxx ~]$ sqlplus "/ as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 17 11:05:30 2013
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1052233728 bytes
Fixed Size                  2220032 bytes
Variable Size             792723456 bytes
Database Buffers          251658240 bytes
Redo Buffers                5632000 bytes
Database mounted.

Database opened.

SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     25
Current log sequence           27

SQL>

The log mode is No Archive Mode. Note that Archive destination is USE_DB_RECOVERY_FILE_DEST. You can determine the path by looking at the parameter RECOVERY_FILE_DEST.

SQL> show parameter recovery_file_dest
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /u01/app/oracle/flash_recovery_area
db_recovery_file_dest_size           big integer 3852M

SQL>

By default, archive logs will be written to the flash recovery area. If you do not want to write archive logs to the flash recovery area you can set the parameter LOG_ARCHIVE_DEST_n to the location in which you wish to write archive logs.

Open other terminal and run blow command:

# mkdir /u01/app/oracle/oradata/orcl/arch
# chown oracle:oinstall /u01/app/oracle/oradata/orcl/arch
# ls –l /u01/app/oracle/oradata/orcl

Change back oracle user terminal

SQL> alter system set log_archive_dest_1='LOCATION=/u01/app/oracle/oradata/orcl/arch' scope = both;
System altered.

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /u01/app/oracle/oradata/orcl/arch
Oldest online log sequence     25
Current log sequence           27

SQL>

Now we shutdown the database and bring it backup in mount mode.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount
ORACLE instance started.

Total System Global Area 1052233728 bytes
Fixed Size                  2220032 bytes
Variable Size             792723456 bytes
Database Buffers          251658240 bytes
Redo Buffers                5632000 bytes
Database mounted.
Database opened.

SQL>

Lastly all that is needed it set archive log mode and open the database.

SQL> alter database archivelog;
Database altered.

SQL> alter database open;
Database altered.

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/app/oracle/oradata/orcl/arch
Oldest online log sequence     224
Next log sequence to archive   226
Current log sequence           226

SQL>

We can now see that archive log mode is enabled.

You can switch to the log file to see that an archive is written to archive log location.

SQL> alter system switch logfile;
System altered.

SQL> host 
[oracle@oraxxxx ~]$ ls /u01/app/oracle/oradata/orcl/arch
1_27_711369564.dbf

[oracle@ora1 ~]$ exit
exit

SQL>

 

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

 
Disable Archive Log Mode

[oracle@oraxxxx ~]$ sqlplus "/ as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 17 12:25:39 2013
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> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/app/oracle/oradata/orcl/arch
Oldest online log sequence     224
Next log sequence to archive   226
Current log sequence           226

SQL>

The Database log mode is Archive mode. Next we shut down the database and bring up back up in mount mode.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount
ORACLE instance started.
 
Total System Global Area 1052233728 bytes
Fixed Size                  2220032 bytes
Variable Size             792723456 bytes
Database Buffers          251658240 bytes
Redo Buffers                5632000 bytes
Database mounted.

SQL>

All that is left is to disable archive log mode and open the database.

SQL> alter database noarchivelog;
Database altered.

SQL> alter database open;
Database altered.

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /u01/app/oracle/oradata/orcl/arch
Oldest online log sequence     26
Current log sequence           28

SQL>

Now you can see, ARCHIVELOG mode has been disabled.