Oracle questions, 10 questions every day (5)

Source: Internet
Author: User

41. How do I add comments to tables and columns?

SQL> comment on table is 'table annotation'; the comment has been created.

SQL> comment on column table. The column is 'column annotation'; the comment has been created.

SQL> select * From user_tab_comments where comments is not null;

42. How can I view the disk usage of each tablespace?

SQL> Col tablespace format A20

SQL> select

B. ID of the file_id file,

B. tablespace_name: name of the tablespace,

B. bytes,

(B. bytes-sum (nvl (A. bytes, 0) already in use,

Sum (nvl (A. bytes, 0) remaining space,

Sum (nvl (A. bytes, 0)/(B. bytes) * 100 percentage remaining

From dba_free_space A, dba_data_files B

Where a. file_id = B. file_id

Group by B. tablespace_name, B. file_id, B. bytes

Order by B. file_id

43. If Oracle is set to MTS or dedicated mode?

# Dispatchers = "(Protocol = TCP) (Service = sidxdb)" with MTS, annotation is the dedicated mode, and Sid is your instance name.

44. How can I know the current SCN Number of the system?

Select max (ktuxescnw * power (2, 32) + ktuxescnb) from x $ ktuxe;

45. How can I retrieve milliseconds in Oracle?

Not Supported before 9i, 9i starts to have timestamp.

9i can use select distinct imestamp from dual;

46. How do I add a carriage return to the string?

Select 'Welcome to visit' | CHR (10) | 'www. csdn. net' from dual;

47. How is Chinese sorted?

Before Oracle9i, Chinese characters were sorted by binary encoding.

The sorting by pinyin, radical, and stroke function is added to Oracle9i. Set the nls_sort Value

Schinese_radical_m is sorted by the beginning (first order) and strokes (Second Order ).

Schinese_stroke_m is sorted by strokes (first order) and heads (Second Order ).

Schinese_pinyin_m is sorted by pinyin

48. Can the object name in Oracle8i be in Chinese?

Yes

49. How to change the SQL * Plus startup option in win?

You can set SQL * Plus options in $ ORACLE_HOME/sqlplus/admin/glogin. SQL.

50. How do I modify the default date of the replicel database?

Alter session set nls_date_format = 'yyyymmddhh24miss ';

Or

You can add a line in init. ora.

Nls_date_format = 'yyyymmddhh24miss'

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.