Issue: In the DB2 database, if you modify the structure of the table, you need to do a reorg operation on the table to get the table state back to normal.
A: There are 4 kinds of operations, you need to do reorg operation of the table
1.) SET DATA TYPE Altered-data-type
How
Student.rowid rd,student1.name, Student1.id from Student1,student where student1.int_id =student.int_id) tmp where STUDENT.ROWID=TMP.RD) ; commit; 3. Update Test_a a set (a.name,a.age) = (select B.name,b.age from Test_b b where a.id = b.ID) where exists (SELECT * from Test _b C where c.id=a.id) 4. UPDATE t_a SET djrq= (SELECT djrq from t_b WHERE t_a.id = t_b.id wher E ROWNUM = 1) where t_a.id in (SELECT ID from t_b WHERE jwh= ' xx village ') 5. Update TBL1 a set (A.col1, a.col2) = (select B.co
Oliver_01 VALUES (5, 'C', 100000000, 'OINSERT into Oliver_01 VALUES (6, 'A1', NULL, 'OINSERT into Oliver_01 VALUES (7, 'A2', NULL, 'OINSERT into oliver_01 VALUES (8, 'B1', NULL, 'OINSERT into Oliver_01 VALUES (9, 'B2', NULL, 'OINSERT into Oliver_01 VALUES (10, 'A1', 30000001, 'O‘);Third Step: Query resultsSelect T.*, (select RES from Oliver_map awhere (A.com_type was null or A.com_type=t.com_type) and (a.sr_up is null or A.SR_UP >=T.SR) and (A.sr_lim is NULL OR a.sr_limOLIVER_01
[]". " Tm_seat_condition_seq "to ROLE" r_updseat_[] ";GRANT USAGE on SEQUENCE "seat_[]". " Tm_seat_condition_seq "to ROLE" r_selseat_[] ";COMMENT on COLUMN seat_[]. Tm_seat_condition. CON_ID is ' primary key ';COMMENT on COLUMN seat_[]. Tm_seat_condition. AIRLINE is ' airline ';COMMENT on COLUMN seat_[]. Tm_seat_condition. Flt_reg is ' aircraft registration number ';COMMENT on COLUMN seat_[]. Tm_seat_condition. Seats is ' bad seat number, separated by commas ';COMMENT on COLUMN seat_[]. Tm_seat_
The tablespace is the logical layer between the database and the tables stored in the database. Create a tablespace in the database and a table in the tablespace.
One obvious advantage of using tablespaces is that data can be reasonably distributed and stored on different disks or in different locations on disks, which helps improve data access efficiency.
DB2 tablespaces are managed in two ways: System Man
Tags: Lin class oat border cell order rom char maxsizeDB2 table Space Practical information is stored in the view "Sysibmadm.tbsp_utilization". DBA authority is required to execute. SQL is as follows:
select tbsp_id, varchar(tbsp_name,30), tbsp_used_size_kb/1024as"usedsize(MB)", tbsp_max_size/1024/1024as"maxsize(MB)", dec(cast(tbsp_used_size_kbasfloat)*1024/tbsp_max_size*100,15,3) from sysibmadm.tbsp_utilization where tbsp_max_size>0
DB2 contains the Import and Export abstract of BLOB field table data: after the Toad tool is connected, execute the statement either in the control center or in the folder without other files. After the Toad tool is connected, execute the statement either in the control center or in the folder without other files.
Import from D: \ lnwq_blob_report \ records of del lobs from d: \ lnwq_blob_report \ modified
1. How to know whether an index is a partitioned index or a non-partitioned index.2. Must have a non-partitioned index on the partition table.Sycat.indexes and Syscat.indexpartitions 1. Create table 1). First execute the following command with root privileges
TOUCH/TMP/TBSP01
touch/tmp/tbsp02
touch/tmp/tbsp03
chown ba5oltp1/tmp/tbsp*
2). Create a partition to use the Tablespace
[BA5OLTP1@DB2CLS02 ~]$ DB2
.
K
control-call statement.
L
bad-the Statement has some allowable error. The BIND continues but the statement cannot is executed.
M
parsed-statement references a table that's qualified with SESSION and were not bound because
DB2 Recover a deleted table test: (Test Platform: RHEL 5.4 DB2 V9.7.0)
-Haha, rookie one! Just watch Cow Master's book, did an example, mixed face ripe, by the way to show off their own vanity!
--Here's an example of a dropped table recovery.--* (1) Perform a full database tutorial backup, needing attention to the ti
Tags: blog for ar Art div log ad sqlDB2 = CREATE TABLE Test (name char (8) NOT null primary key,depid smallint,pay bigint) db20000i SQL command completed successfully. DB2 = CREATE TABLE test1 (name char (8) NOT NULL primary key,depid smallint references Department (DEPID), pay bigint) DB The 20000I SQL command completed successfully.
Brief introduction
This series of articles is made up of two parts. This article (part 1th) describes how to create a global temporary table CGTT model for database DB2 for z/Os 10 (new feature mode) and DB2 for Linux, UNIX, and Windows 9.7, and how to use Infosphere Data A Rchitect V8.5 performs the following tasks.
Create a physical data model using CGTT for
DB2 backing up and importing single table operationsCmd→db2adminDB2 Connect to DatabaseName User login using login password >DB2 export to T1.IXF of IXF select * FROM table name >DB2 import from T1. IXF of IXF INSERT into target table
Operation:1. Export data from DB2 to TXT2. Change the delimiter in the file to ":"3. Create a new table in hive (you need to set a delimiter when building a table)4. Import data--------1. Export data from DB2 to TXTDb2-x "Select Col1,col2,col3 from tbl_name where xxx with ur" >filename.txt2. Change the delimiter in the
I. Dynamic execution of SQLPREPARE from ' Delete from Test ' ; EXECUTE S1;Second, using cursorsDECLARE CURSOR for SELECT from FJDC. V_i_dg_dm_zy_wl_zbhz_attr T; OPEN V_cursor; FETCH into V_deletesql,v_insertsql; CLOSE V_cursor;Third, while loop while true -do expression ENDwhile;Iv. DB2 query table data, generate dynamic SQL, and execute1 CREATE PROCEDURE" TEST". " TEST "()2 BEGIN3
Tags: io ar art SP on c ad Size EF--Buffer poolCREATE Bufferpool Emp_buf_poolIMMEDIATE All DbpartitionnumsSIZE 250Numblockpages 0PAGESIZE K;--Temporary table spaceCREATE Temporary tablespace emp_tmpIn DATABASE PARTITION GROUP ibmtempgroupPAGESIZE 32KMANAGED by DATABASEUSING (File '/home/db2inst1/db2inst1/node0000/ng2_app8/t0000000/emp_tmp/hefei.dat ' 2G)Extentsize 32Prefetchsize AUTOMATIC Bufferpool Emp_buf_poolOVERHEAD 7.50Transferrate 0.06DROPPED
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.