In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The oracle decode function, which is executed regardless of whether the result of the query satisfies the select statement in the 'PRIMARY', parameter, is known by looking at the execution plan
Set autotrace traceonly
Select decode (database_role, 'PRIMARY', (selecttrunc ((size_MB-free_MB) * 100/maxsize_MB) "retvalue" from (selecttablespace_name,case when sum (decode (autoextensible,'YES',1,0)) > 0 then' YES'else 'NO' end ext,trunc (sum (bytes) / 1024x1024) SIZE_MB,trunc (sum (case when autoextensible='YES' then maxbytes else bytesend) / 1024lap 1024) MAXSIZE_MBfrom dba_data_filesgroup by tablespace_name) T1, (selecttablespace_name Trunc (sum (bytes) / 1024ax 1024) FREE_MBfrom dba_free_spacegroup by tablespace_name) T2, (select tablespace_namefrom dba_tablespaceswhere contents='PERMANENT') t3where t1.tablespace_name=t2.tablespace_name and t3.tablespace_name=t1.tablespace_name and t3.tablespaceroomnameplate systems), 0) as retvalue from v$database
The decode function is equivalent to the cash when statement, but when there are more conditions, the decode function is simpler to write.
Select case when database_role = 'PRIMARY' then (select tname from tab where rownum=1) else' 0' end as retvalue from v$database
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.