db2move copy schema to other schema in another database

[db2admin@db2server dbdata]$ db2move dbvm COPY -sn db2admin -co target_db VPCGD schema_map "((DB2ADMIN,USRVM))" -u db2admin -p db2admin

Application code page not determined, using ANSI codepage 1208

*****  DB2MOVE  *****

Action:  COPY

Start time:  Tue Sep 12 17:59:09 2017


All schema names matching:  DB2ADMIN;

Connecting to database DBVM ... successful!  Server : DB2 Common Server V11.1.1

Copy schema DB2ADMIN to USRVM on the target database VPCGD

Create DMT :  "SYSTOOLS"."DMT_59b7bdfdba232"

Binding package automatically ... /home/db2admin/sqllib/bnd/db2move.bnd ... successful!

Start Load Phase :


db2move finished successfully



Files generated:
-----------------
COPYSCHEMA.20170912175909.msg
LOADTABLE.20170912175909.MSG

Please delete these files when they are no longer needed.


End time:  Tue Sep 12 18:09:14 2017
[db2admin@db2server dbdata]$ ls

DB2 : Create Nickname & Setup Federated Database

[db2admin@db2server ~]$ db2 create wrapper drda
DB20000I  The SQL command completed successfully.

[db2admin@db2server ~]$ db2 "create server sevcvm type DB2/UDB version '11.1' wrapper drda authorization \"db2admin\" PASSWORD \"db2admin\" options( add dbname 'dbvm')"
DB20000I  The SQL command completed successfully.

[db2admin@db2server ~]$ db2 "CREATE USER MAPPING FOR db2admin SERVER sevcvm OPTIONS (REMOTE_AUTHID 'db2admin', REMOTE_PASSWORD 'db2admin')"
DB20000I  The SQL command completed successfully.

[db2admin@db2server ~]$ db2 CREATE NICKNAME db2admin.VM_T5_DELIVERY_RECEIVED FOR sevcvm.db2admin.PROMISE_CM_T5_DELIVERY_RECEIVED
DB20000I  The SQL command completed successfully.

[db2admin@db2server ~]$ db2 CREATE NICKNAME db2admin.VM_T5_DELIVERY_RECEIVED_JASA FOR sevcvm.db2admin.PROMISE_CM_T5_DELIVERY_RECEIVED_JASA
DB20000I  The SQL command completed successfully.

[db2admin@db2server ~]$ db2 CREATE NICKNAME db2admin.VM_T5_DELIVERY_RECEIVED_MATERIAL FOR sevcvm.db2admin.PROMISE_CM_T5_DELIVERY_RECEIVED_MATERIAL
DB20000I  The SQL command completed successfully.

[db2admin@db2server ~]$ db2 CREATE NICKNAME db2admin.VM_T4_F_SRVC FOR sevcvm.db2admin.PROMISE_CM_T4_F_SRVC
DB20000I  The SQL command completed successfully.

[db2admin@db2server ~]$ db2 CREATE NICKNAME db2admin.VM_T4_F_ITEM FOR sevcvm.db2admin.PROMISE_CM_T4_F_ITEM
DB20000I  The SQL command completed successfully.

[db2admin@db2server ~]$ db2 CREATE NICKNAME db2admin.VM_T4_F_PAYMENT_TERM FOR sevcvm.db2admin.PROMISE_CM_T4_F_PAYMENT_TERM
DB20000I  The SQL command completed successfully.

[db2admin@db2server ~]$ db2 CREATE NICKNAME db2admin.VM_T4_F_CONTRACT FOR sevcvm.db2admin.PROMISE_CM_T4_F_CONTRACT
DB20000I  The SQL command completed successfully.

Example Trigger on Database DB2

Here it's simple example trigger on DB2. This trigger copy data from one table to another table

CREATE TRIGGER INS_LOG
      AFTER INSERT ON PROMISE_LOG
      REFERENCING NEW AS NROW
      FOR EACH ROW MODE DB2SQL
      BEGIN ATOMIC
        INSERT INTO DB2ADMIN.PROMISE_LOG_TRIG(LOG_ID, DATE, IP, METHOD, PARAM, REQ, RESP, STATUS_CODE, TOKEN)
        VALUES(NROW.LOG_ID, NROW.DATE, NROW.IP, NROW.METHOD, NROW.PARAM, NROW.REQ, NROW.RESP, NROW.STATUS_CODE, NROW.TOKEN);
      END

reference :
https://www.ibm.com/support/knowledgecenter/en/SSEPEK_10.0.0/sqlref/src/tpc/db2z_sql_createtrigger.html

DB2 Error Set Tablespace Container : SQL0968C The File System is Full


Error Set Tablespace Container : SQL0968C The File System is Full

We can solve this problem by using automatic management :

before
SET TABLESPACE CONTAINERS FOR 11 USING
  (File '/plnhr/new/TSLOB0101' 786432,
   File '/plnhr/new/TSLOB0102' 786432,
   File '/plnhr/new/TSLOB0103' 786432,
   File '/plnhr/new/TSLOB0104' 786432,
   File '/plnhr/new/TSLOB0105' 786432,
   File '/plnhr/new/TSLOB0106' 786432) ;

after
SET TABLESPACE CONTAINERS FOR 11 USING AUTOMATIC STORAGE

Error Install SQL Server 2014 An error occurred during the installation assembly.

I found this error when install SQL Server 2014 :


 I choose cancel, and installation still running. But when finished, Database Engine & Management Tools not installed.

To fix the problem, We need to download System Update Readiness Tool from :
https://support.microsoft.com/en-hk/help/947821/fix-windows-update-errors-by-using-the-dism-or-system-update-readiness#

Click Install, and our windows will install updates.
http://mintywhite.com/windows-7/7maintenance/trouble-installing-windows-updates-system-update-readiness-tool-windows/

db2 restore : SQL0970N The system attempted to write to a read-only file. SQLSTATE=55009

bash-4.2$ cd /db2data
bash-4.2$ ls
QAGAL28.0.db2qa.DBPART000.20170715091643.001  db2qa
bash-4.2$ db2 restore database QAGAL28 taken at 20170715091643
SQL0970N  The system attempted to write to a read-only file.  SQLSTATE=55009

When we facing error like this, we can solve this problem by :
bash-4.2$ ls
QAGAL28.0.db2qa.DBPART000.20170715091643.001  db2qa
bash-4.2$ pwd
/db2data
bash-4.2$ db2 restore database QAGAL28 from /db2data on /db2data
SQL2555I  The database was restored and then successfully upgraded to the
current DB2 release where you issued the RESTORE DATABASE command.
bash-4.2$ db2 list db directory

 System Database Directory

 Number of entries in the directory = 1

Database 1 entry:

 Database alias                       = QAGAL28
 Database name                        = QAGAL28
 Local database directory             = /db2data
 Database release level               = 14.00
 Comment                              =
 Directory entry type                 = Indirect
 Catalog database partition number    = 0
 Alternate server hostname            =
 Alternate server port number         =

Database Oracle : Increase Capacity Temporary Tablespace

We can increase capacity temporary tablespace by using command :

ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/gg1/temp03.dbf' SIZE 25M AUTOEXTEND ON;

it's different with datafile :
alter tablespace PRD_SOAINFRA add datafile '/u01/app/oracle/oradata/orcl4p2b/PRD_SOAINFRA2.dbf' size 32000M autoextend on;

when increasing temporary, we using word : TEMPFILE not DATAFILE