Sie sind auf Seite 1von 3

DATABASE NAME: db2test INSTANCE NAME: DB2INST1 USER: RAJNI,NEERAJ citi - singapore.customer.service@citi.

com --- permanent increase --permanent in creaw anz - sg.consumerbank@anz.com "Attention To Credit Authorization" uob -- card.centre@uobgroup.com UOB Preferred Platinum Visa Card Your application for ANZ Switch Platinum Credit Card has been successfully submi tted. Your reference number for the application is CPA0012621 [root@r5o11asm ~]# useradd -g sysctl -d /db2/neeraj neeraj [root@r5o11asm ~]# cd /db2/rajni/ [root@r5o11asm rajni]# ls db2query.txt [root@r5o11asm rajni]# cp .bash_profile /db2/neeraj cp: overwrite `/db2/neeraj/.bash_profile'? y [root@r5o11asm rajni]# passwd neeraj Changing password for user neeraj. New UNIX password: BAD PASSWORD: it is based on a dictionary word Retype new UNIX password: passwd: all authentication tokens updated successfully. [neeraj@r5o11asm ~]$ db2 attach to db2inst1 Instance Attachment Information Instance server Authorization ID Local instance alias = DB2/LINUX 9.5.0 = NEERAJ = DB2INST1

[rajni@r5o11asm ~]$ db2 update dbm cfg using SYSCTRL_GROUP sysctl [rajni@r5o11asm ~]$ db2 get dbm cfg | grep -i sys [neeraj@r5o11asm ~]$ db2 attach to db2inst1 [neeraj@r5o11asm ~]$ db2 list active databases [neeraj@r5o11asm ~]$ db2 "create table neeraj.test (id integer)"; [neeraj@r5o11asm ~]$ db2 "create table neeraj.test (id integer)"; [neeraj@r5o11asm ~]$ db2 "select * from test WITH UR"; [neeraj@r5o11asm ~]$ db2 get db cfg |grep -i log First log archive method (LOGARCHMETH1) = OFF ****************TAKE DB2 DATABASE IN ARCHIVE LOG MODE:************************** ****** db2 "backup db db2test to /db2/archive" db2 update db cfg for db2test using LOGARCHMETH1 DISK:/db2/archive db2 "ARCHIVE LOG FOR DATABASE db2test" TAKE BACKUP: 1> Before backing up a database, make sure to have one of the following authorit

ies on DB2: SYSADM SYSCTRL SYSMAINT 2>connect to the database . make sure no other applications are connected to th e database when performing an offline backup or you will receive an SQL1035N error message . DB2 "list applications" and DB2 "force applications all" are useful commands for this task TYPES OF BACKUPS: 1> The first is an offline database backup:This type of backup requires an excl usive connection to the database since all tablespaces in the database will be bac ked up. 2> The second type is an online database backup. Note: If performing an online backup, make sure the rollforward recovery paramet er logretain = on or userexit** is enabled in the database configuration file. If it is not, you will receive an SQL2413N error and will need to perform the following commands: db2 "update database configuration for [database name] using logretain on" > db2 stop > db2start

db2 "get database configuration for DB2TEST" DB2 "GET DB CFG FOR DB2TEST"

[neeraj@r5o11asm ~]$ db2 list active databases Active Databases Database name Applications connected currently Database path 00001/ = DB2TEST = 0 = /db2/database/db2inst1/NODE0000/SQL

[neeraj@r5o11asm ~]$ db2 force application(13) SELECT * FROM sysibmadm.tbsp_utilization WITH ur CREATE TABLESPACE NEERAJ MANAGED BY DATABASE USING (FILE '/db2/database/db2inst1/NODE0000/DB2TEST/' 10M) /db2/database/db2inst1/NODE0000/DB2TEST/T0000004/C0000000.UTM *************VIEWS

SELECT * FROM sysibmadm.ADMINTABINFO WITH ur: =DBA_SEGMENTS TABNAME TABSCHEMA TABTYPE DATAPARTITION_ID SELECT * FROM sysibmadm.CONTAINER_UTILIZATION /SNAPCONTAINER WITH ur : IS USED T O CHECK TABLESPACE NAME : TBSP_NAME DATAFILE(CONTAINER LOC) : CONTAINER_NAME SELECT * FROM sysibmadm.TBSP_UTILIZATION WHERE TBSP_ID=5 WITH ur

db2look -d db2test -e -a -o db2look_db2test.sql db2look -d db2test -z neeraj -e -a -o db2look_db2test_neeraj.sql db2look -d db2test -z neeraj -t test1 -e -a -o db2look_db2test_neeraj_test1.sql [rajni@r5o11asm ~]$ db2 " grant load on database to user neeraj"; db2 backup database db2test user neeraj using neeraj tablespace neeraj online to '/dev/null' Backup successful. The timestamp for this backup image is : 20130802171630 [neeraj@r5o11asm ~]$ db2 backup database db2test tablespace neeraj online to '/ dev/null' db2 "create database db2saan"

Das könnte Ihnen auch gefallen