Routine Oracle database check methods and procedures

Source: Internet
Author: User

Routine Oracle database check methods and steps 1. Check the partition information <! -- [If! SupportLists] --> 1. <! -- [Endif] --> check which tables have partitions

Select * from user_tables where partitioned=’YES’;

 

2. Check and list all secondary partitions in the current table
select * from user_tab_subpartitions t where t.table_name = upper('tablename');

 

3. Check and list all partitions in the current table
select * from user_tab_partitions t where t.table_name = upper('tablename');

 

Ii. Methods for viewing and modifying character sets 1. Viewing character sets
select userenv('language') from dual;

 

<! -- [If! SupportLists] --> 2. <! -- [Endif] --> bytes used by Chinese Characters
Select lengthb ('you') from dual;

 

3. Character Set Modification
Oralce code conn/as sysdba shutdown immediate; startup mount; alter system enable restricted session; alter system set JOB_QUEUE_PROCESSES = 0; alter system set AQ_TM_PROCESSES = 0; alter database open; alter database character set ZHS16GBK; select * from v $ nls_parameters; select userenv ('language') from dual; shutdown immediate; startup

 

Note: When you execute alter database character set ZHS16GBK, the system prompts our character set: the new character set must be the superset of the old character set. In this case, we can skip the superset check and make changes:
SQL> ALTER DATABASE character set INTERNAL_USE ZHS16GBK; 

 

-- We can see that this process is exactly the same as the internal process of the alter database character set operation. That is to say, the help provided by INTERNAL_USE is that the Oracle DATABASE bypasses the validation of the subset and superset. iii. Table space usage 1. view the current table space usage
Oracle code select. tablespace_name,. bytes/1024/1024 "Sum MB", (. bytes-B. bytes)/1024/1024 "used MB", B. bytes/1024/1024 "free MB", round (. bytes-B. bytes)/. bytes) * 100, 2) "percent_used" from (select tablespace_name, sum (bytes) bytes from dba_data_files group by tablespace_name) a, (select tablespace_name, sum (bytes) bytes, max (bytes) largest from dba_free_space group by tablespace_name) B where. tablespace_name = B. tablespace_name order by (. bytes-B. bytes)/. bytes) desc

 


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.