Some minor knowledge in Oracle Applications

Source: Internet
Author: User

Some minor knowledge in Oracle Applications 1. how Does oracle view the SQL statement running in the background select. program, B. spid, c. SQL _text from v $ session a, v $ process B, v $ sqlarea c where. paddr = B. addr and. SQL _hash_value = c. hash_value and. username is not null; 2. unlock the database. (1 ). query the deadlock process select t2.username, t2.sid, t2.serial #, t2.logon _ time from v $ locked_object t1, v $ session t2 where t1.session _ id = t2.sid; (2 ). kill process SID, SERIAL # alter system kill session '201801040'; 3. run SQL in the background. create a xxx. SQL script, run sqlplus username/password @ TNS <xxx. SQL & 4. sqlalter table table_name add (column name 1 Data Type 1, column name 2 Data Type 2 ...); you can also use the process to implement declare vstr_ SQL varchar2 (2000): = 'alter table your_table add (column1 col_type1, clumn2 col_type2 ...) '; begin execute immediate vstr_ SQL; end; MODIFY the Data Type of a single column: ALTER TABLE table_name MODIFY column Name Data Type MODIFY multiple column data type: ALTER TABLE table_name MODIFY (column name 1 Data Type 1, COLUMN name 2 Data Type 2) delete a single COLUMN: alter table table_name drop column name Delete multiple columns: alter table table_name DROP (COLUMN name 1, COLUMN name 2)

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.