Article From:https://www.cnblogs.com/watcsgg/p/9969012.html
1.View Oracle Character Set
–database server
select * from nls_database_parameters;
–Client character set
select * from nls_instance_parameters;
–Session (instance character set)
select * from nls_session_parameters;
–oracle serverEnd character set
select userenv(‘language’) from dual;
 
–dmpFiles (the character sets of Oracle server, Oracle client and DMP files are all consistent in order to import them correctly)
The DMP file exported by the exp tool of Oracle also contains the character set information. The second and third bytes of the DMP file record the character set of the DMP file. If the DMP file is small, such as only a few or several dozen M, you can open it with UltraEdit (in hexadecimal mode).Look at the content of the second and third byte, such as 0354, and then use the following SQL to find out its corresponding character set:
SQL> select nls_charset_name(to_number(‘0354′,’xxxx’)) from dual;
ZHS16GBK
If the DMP file is large, such as over 2G (which is also the most common case), it can be opened very slowly or completely with a text editor, using the following commands (on the UNIX host): uuuuuuuuuu
cat exp.dmp |od -x|head -1|awk ‘{print $2 $3}’|cut -c 3-6
Then the corresponding character set can be obtained by using the above SQL.
 
2.Related view
v$parameter:oracleparameter
  select value from v$parameter where name =’processes’;  –Maximum number of connections allowed in the database
  alter system set processes = 1000 scope = spfile;  –Modify the maximum number of connections:
  select value from v$parameter where name =’sessions’;  –Maximum number of sessions allowed in the database
  alter system set sessions= 1528 scope = spfile;  –Modify the maximum number of connections:
 
v$process:oracleService process (server)
  Database-related processes are not commonly used
v$session:oracleConnection information (client side)
  select count(*) from v$session;  –Current session connections
  select count(*) from v$session v where v.STATUS=’ACTIVE’ –Concurrent connection number
 
3.Analysis tables and indexes
analyze table tablename compute statistics;
 
4.Table records are locked by another user

select Distinct ‘alter system kill session ‘||chr(39)||b.sid||’,’||b.serial#||chr(39)||’;’
As cmd,b.username,b.logon_time
from v$locked_object a,v$session b
where a.session_id=b.sid;

 
 
Link of this Article: Oracle Common Query Classes

Leave a Reply

Your email address will not be published. Required fields are marked *