Manager will also attempt to save space by requesting a table lock for the application that made the lock request and releasing the row lock.
• Lock upgrades can degrade the concurrency performance of OLTP applications, but release locks to occupy memory and increase memory space for available locks.
Lock escalation is a possibility of failure, for example, an application now has an IX lock on one table, an X lock on some rows in the table, another application to request an IS lock on the table
' and jobtp= ' 02 '"
DB2 "Update svmmst set prtlines=0 where jobtp= ' or jobtp= ' 03 '"
Vi. joining the database
Copy Code code as follows:
DB2 Connect to Btpdbs
Vii. Clear Database joins
DB2 Connect Reset Disconnect DatabaseDB2 Terminate Disconnect DatabaseDB2 force applications All disconnect all database connections
Viii. Backup Database
1. DB2 Backup DB Btpdbs2, Db2move Btpdbs Export
Copy Code code as follows:
db2look-d btpdbs-e-X [-a]-o crttbl.s
(field_name VARCHAR2 (100));
Change the big line, change the small no (unless all is empty)
93. How to query the data of a day?
SELECT * FROM table_name where trunc (date field) =to_date (' 2003-05-02 ', ' yyyy-mm-
DD ');
How does the SQL statement insert a full year date?
CREATE TABLE Bsyear (d date);
INSERT INTO Bsyear
Select To_date (' 20030101 ', ' YYYYMMDD ') +rownum-1
From All_objects
where RowNum 95. What if you modify the table name?
ALTER TABLE Old_table_name Rename to New_table_name;
How to detect a similar sqlerrm against a single key
There is a process to update the user Information table dailyOriginally used in the merge to do, but some people think it slow, suggest to use delete insert to doI first delete userinfo wehre logtime > Trunc (sysdate)-15; CommitINSERT INTO UserInfoSELECT * from T_cache_userinfo a,t_cache_usertype b,t_cache_expuserinfo Cwhere a.ui_usertype=b.ut_idand A.ui_username=c.ui_usernameand C.ui_lasttime > Trunc (sysdate)-15;
ORA-00001: Violating UNIQUE
table_loop into V_tablename;
EXIT when Table_loop%notfound;
--Opens the second cursor open col_loop (v_tablename);
LOOP FETCH col_loop into V_tablenamecol;
EXIT when Col_loop%notfound; --To determine if the field name is consistent if (V_tablenamecol = UPPER (v_col)) THEN EXECUTE IMMEDIATE ' Delete From ' | | v_tablename| | ' WHERE ' | | v_col| | ' ='||
Del_tag;
End IF;
End LOOP;
Which command does the 10.AIX use to install the DB2?
INSTALLP command
11. Can you install multiple DB2 databases under the same operating system?
OK
12. How do I stop an instance?
Db2stop
13. How do I start the instance?
Db2start
14. How do I modify the value of a registered entry?
Db2set can modify
Such as:
Sets a parameter for the current instance
Db2setparameter=value
Set the parameters of a global level
Db2setparameter=value-g (lowercase)
View a list of all var
MIN minextents minus minvalue Mislabel MOD MODE
NATURAL naturaln NEW nextval noaudit nocompress nologging not nowait NULL number number_base
of OFFLINE on ONLINE OPEN OPTION OR order others out
PACKAGE PARTITION PCTFREE pctused pls_integer POSITIVE positiven PRAGMA PRIOR PRIVATE Privileges PROCEDURE Public
RAISE RANGE RAW Real record REF release Remr RENAME RESOURCE return REVERSE REVOKE ROLLBACK ROW ROWID rowlabel ROWS RowType RUN
SavePoint SCHEMA SELECT Separate SEQUENCE session SET SHAR
CloseHandle () function.
Categories of SQL statements for 114.DB2
DCL: A Data Control language that provides access to database objects.
DDL: Data definition language, creating, modifying, and deleting database objects.
DML: A data manipulation language used to insert, update, and delete data.
What are the 115.DCL permissions?
CONTROL permission: If a user creates an object, the user is able to access the object completely.
The GRANT statement grants permissions to the user.
The REVOKE st
(1024);
begin DELETE from dept where deptno = V_deptno;
commit; Exception Others then NB Sp
rollback;
v_errcode:= SQLCODE;
v_errmsg:= SQLERRM; INSERT into errorlog values (seq_Errorlog_id.nextval, V_errcode,v_errmsg, sysdate);
commit; END;
The key cursor (cursor) and pointer concepts in the pl/sql are almost
Declare CURSORC is select * fro
Author: Xingda Computer technology company (www.study01job.com) Guo Baoli
There are several reasons for standardizing error handling and status monitoring procedures:
L to be treated uniformly throughout the application;
• Reduce the likelihood of accidental leakage of unique processing;
• Reduce unnecessary hassle in future software maintenance.
The following aspects of the inspection can be considered in a standard way to deal with:
L coupling error;
L Database access error;
L Data ent
Error Case:
Create a tablespace with a size of 20G in the DB2 database of the AIX system, with the following specific SQL:
create REGULAR TABLESPACE HTDC_DATA PAGESIZE 8 K MANAGED BY DATABASE USING ( FILE ’/db2_tag/TABLE_SPACES/HTDC_DATA/HTDC_DATA.dat’ 20G) EXTENTSIZE 16 OVERHEAD 10.67 PREFETCHSIZE 16 TRANSFERRATE 0.04 BUFFERPOOL BPHTDC dropPED TABLE RECOVERY OFF
Error code: SQLCODE 0968C
Error message: File System is full. (File system is full)
then populated with an INSERT statement with a subquery.
7 Use the REORG Table command to reorganize tables (note that InPlace REORG table is not allowed for tables in the REORG pending state).
8 Complete the unit of work and then issue the command again.
Sqlcode:-668
sqlstate:57007
-------------------------------------------------------
Solution:
Execute the following commands on the server-side CLP:
SET INTEGRITY for Db2admin. Alarmtarget I
previous level, the exception is caught. As in the following code:DECLAREcode number;Msg VARCHAR2 (500);BEGININSERT into salary (employee_id, amount) VALUES (2, 5000);EXCEPTIONWhen OTHERS ThenCode: = SQLCODE;msg: = substr (SQLERRM, 1, 500);Dbms_output.put_line (code);Dbms_output.put_line (msg);END;After execution, the following information is seen in output or in the Sqlplus window:-20000ORA-20000: Pay exceeds limitORA-06512: In "SCOTT." Salary_rai "
;EndBeginFor k in 1..10 LoopDbms_output.put_line (k);End Loop;For k in reverse 1..10 loopDbms_output.put_line (k);End Loop;End--Error handling[SQL] View plaincopyDeclareV_temp number (4);BeginSelect Empno to V_temp from emp where deptno = 10;exceptionWhen Too_many_rows ThenDbms_output.putline (' Too many Records ');When others thenDbms_output.put_line (' error ');EndDeclareV_temp number (4);BeginSelect Empno to V_temp from emp where empno = 2222;exceptionWhen No_data_found ThenDbms_output.put_li
= ' 907020000 ' and oprid= ' 0001 '"DB2 "Select OPRID,OPRNM,BRHID,PASSWD from Btpoper"Iv. Delete data from the table:DB2 "Delete from Btpoper"DB2 "Delete from Btpoper where brhid= ' 907020000 ' or brhid= ' 907010000 '"Five, modify the table data:DB2 "Update svmmst set prtlines=0 where brhid= ' 907010000 ' and jobtp= ' 02 '"DB2 "Update svmmst set prtlines=0 where jobtp= ' or jobtp= ' 03 '"Vi. joining the databaseDB2 Connect to BtpdbsVII. Clearing Database joinsDB2 Connect reset Disconnects the da
)RETURN numberIsEmpno_remaining EXCEPTION;PRAGMA Exception_init (empno_remaining,-1);/*-1 is an error code that violates UNIQUE constraints */BEGININSERT into Dept VALUES (Dept_no, dept_name, location);IF Sql%found ThenRETURN 1;END IF;EXCEPTIONWhen Empno_remaining ThenRETURN 0;When OTHERS ThenRETURN-1;END add_dept; -function definition function remove_dept (dept_no number) RETURN number is BEGIN DELETE from DEP T WHERE Deptno=dept_no; IF Sql%found then RETURN 1; ELSE RETURN
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.