<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>https://noname.com.ua/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Oracle_FAQ</id>
	<title>Oracle FAQ - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://noname.com.ua/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Oracle_FAQ"/>
	<link rel="alternate" type="text/html" href="https://noname.com.ua/mediawiki/index.php?title=Oracle_FAQ&amp;action=history"/>
	<updated>2026-04-09T16:09:03Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://noname.com.ua/mediawiki/index.php?title=Oracle_FAQ&amp;diff=3667&amp;oldid=prev</id>
		<title>Sirmax в 12:14, 15 июля 2011</title>
		<link rel="alternate" type="text/html" href="https://noname.com.ua/mediawiki/index.php?title=Oracle_FAQ&amp;diff=3667&amp;oldid=prev"/>
		<updated>2011-07-15T12:14:00Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия 12:14, 15 июля 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 1:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 1:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;+&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:Oracle]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Oracle database]] FAQ:&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Oracle database]] FAQ:&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sirmax</name></author>
	</entry>
	<entry>
		<id>https://noname.com.ua/mediawiki/index.php?title=Oracle_FAQ&amp;diff=3445&amp;oldid=prev</id>
		<title>94.179.16.104: Новая: Oracle database FAQ:  ==How does one create a new database?== One can create and modify Oracle databases using  the Oracle DBCA (Database Configuration Assistant) utility. The db...</title>
		<link rel="alternate" type="text/html" href="https://noname.com.ua/mediawiki/index.php?title=Oracle_FAQ&amp;diff=3445&amp;oldid=prev"/>
		<updated>2011-06-29T10:13:52Z</updated>

		<summary type="html">&lt;p&gt;Новая: &lt;a href=&quot;/mediawiki/index.php?title=Oracle_database&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Oracle database (страница не существует)&quot;&gt;Oracle database&lt;/a&gt; FAQ:  ==How does one create a new database?== One can create and modify Oracle databases using  the Oracle &lt;a href=&quot;/mediawiki/index.php?title=DBCA&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;DBCA (страница не существует)&quot;&gt;DBCA&lt;/a&gt; (Database Configuration Assistant) utility. The db...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Oracle database]] FAQ:&lt;br /&gt;
&lt;br /&gt;
==How does one create a new database?==&lt;br /&gt;
One can create and modify Oracle databases using  the Oracle [[DBCA]] (Database Configuration Assistant) utility. The dbca utility is located in the $[[ORACLE_HOME]]/bin directory. The Oracle Universal Installer (oui) normally starts it after installing the database server software to create the starter database.&lt;br /&gt;
&lt;br /&gt;
One can also create databases manually using scripts. This option, however, is falling out of fashion as it is quite involved and error prone. Look at this example for creating an Oracle 9i or higher database:&lt;br /&gt;
&lt;br /&gt;
 CONNECT SYS AS SYSDBA&lt;br /&gt;
 ALTER SYSTEM SET DB_CREATE_FILE_DEST='/u01/oradata/';&lt;br /&gt;
 ALTER SYSTEM SET DB_CREATE_ONLINE_LOG_DEST_1='/u02/oradata/';&lt;br /&gt;
 ALTER SYSTEM SET DB_CREATE_ONLINE_LOG_DEST_2='/u03/oradata/';&lt;br /&gt;
 CREATE DATABASE;&lt;br /&gt;
&lt;br /&gt;
Also see [[Creating a New Database]].&lt;br /&gt;
&lt;br /&gt;
==What database block size should I use?==&lt;br /&gt;
Oracle recommends that your database block size match, or be multiples of your operating system block size. One can use smaller block sizes, but the performance cost is significant. Your choice should depend on the type of application you are running. If you have many small transactions as with OLTP, use a smaller block size. With fewer but larger transactions, as with a DSS application, use a larger block size.&lt;br /&gt;
&lt;br /&gt;
If you are using a volume manager, consider your &amp;quot;operating system block size&amp;quot; to be 8K. This is because volume manager products use 8K blocks (and this is not configurable).&lt;br /&gt;
&lt;br /&gt;
==What database aspects should be monitored?==&lt;br /&gt;
One should implement a monitoring system to constantly monitor the following aspects of a database. This can be achieved by writing custom scripts, implementing Oracle's Enterprise Manager, or buying a [[:Category:Third-party products|third-party monitoring product]]. If an alarm is triggered, the system should automatically notify the DBA (e-mail, text, etc.) to take appropriate action.&lt;br /&gt;
&lt;br /&gt;
'''Infrastructure availability:'''&lt;br /&gt;
* Is the database up and responding to requests&lt;br /&gt;
* Are the listeners up and responding to requests&lt;br /&gt;
* Are the Oracle Names and LDAP Servers up and responding to requests&lt;br /&gt;
* Are the Application Servers up and responding to requests  &lt;br /&gt;
* Etc.&lt;br /&gt;
&lt;br /&gt;
'''Things that can cause service outages:'''&lt;br /&gt;
* Is the archive log destination filling up?&lt;br /&gt;
* Objects getting close to their max extents&lt;br /&gt;
* Tablespaces running low on free space / Objects that would not be able to extend&lt;br /&gt;
* User and process limits reached &lt;br /&gt;
* Etc.&lt;br /&gt;
&lt;br /&gt;
==How does one rename a database?==&lt;br /&gt;
Follow these steps to rename a database:&lt;br /&gt;
&lt;br /&gt;
* Start by making a full database backup of your database (in case you need to restore if this procedure is not working). &lt;br /&gt;
&lt;br /&gt;
* Execute this command from sqlplus while connected to 'SYS AS SYSDBA':&lt;br /&gt;
 ALTER DATABASE BACKUP CONTROLFILE TO TRACE RESETLOGS;&lt;br /&gt;
&lt;br /&gt;
* Locate the latest dump file in your USER_DUMP_DEST directory (show parameter USER_DUMP_DEST) - rename it to something like dbrename.sql.&lt;br /&gt;
&lt;br /&gt;
* Edit dbrename.sql, remove all headers and comments, and change the database's name. Also change &amp;quot;CREATE CONTROLFILE REUSE ...&amp;quot; to &amp;quot;CREATE CONTROLFILE SET ...&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* Shutdown the database (use SHUTDOWN NORMAL or IMMEDIATE, don't ABORT!) and run dbrename.sql.&lt;br /&gt;
&lt;br /&gt;
* Rename the database's global name:&lt;br /&gt;
 ALTER DATABASE RENAME GLOBAL_NAME TO new_db_name;&lt;br /&gt;
&lt;br /&gt;
==Can one rename a database user (schema)?==&lt;br /&gt;
No, this is listed as Enhancement Request 158508. Workaround:&lt;br /&gt;
* Do a user-level export of user A&lt;br /&gt;
* create new user B&lt;br /&gt;
* import system/manager fromuser=A touser=B&lt;br /&gt;
* drop user A&lt;br /&gt;
&lt;br /&gt;
==Can one rename a tablespace?==&lt;br /&gt;
From [[Oracle 10g]] Release 1, users can rename tablespaces. Example:&lt;br /&gt;
 ALTER TABLESPACE ts1 RENAME TO ts2;&lt;br /&gt;
&lt;br /&gt;
However, you must adhere to the following restrictions:&lt;br /&gt;
* COMPATIBILITY must be set to at least 10.0.1&lt;br /&gt;
* Cannot rename SYSTEM or SYSAUX&lt;br /&gt;
* Cannot rename an offline tablespace&lt;br /&gt;
* Cannot rename a tablespace that contains offline datafiles&lt;br /&gt;
&lt;br /&gt;
For older releases, use the following workaround: &lt;br /&gt;
* Export all of the objects from the tablespace&lt;br /&gt;
* Drop the tablespace including contents&lt;br /&gt;
* Recreate the tablespace&lt;br /&gt;
* Import the objects&lt;br /&gt;
&lt;br /&gt;
==How does one see the uptime for a database?==&lt;br /&gt;
Look at the following SQL query:&lt;br /&gt;
 SELECT to_char(startup_time,'DD-MON-YYYY HH24:MI:SS') &amp;quot;DB Startup Time&amp;quot;&lt;br /&gt;
 FROM   sys.v_$instance;&lt;br /&gt;
&lt;br /&gt;
==Can one resize tablespaces and data files?==&lt;br /&gt;
'''Add more files to tablespaces'''&lt;br /&gt;
&lt;br /&gt;
To add more space to a tablespace, one can simply add another file to it. Example:&lt;br /&gt;
 ALTER TABLESPACE USERS ADD DATAFILE '/oradata/orcl/users1.dbf' SIZE 100M;&lt;br /&gt;
&lt;br /&gt;
'''Resize datafiles'''&lt;br /&gt;
&lt;br /&gt;
One can manually increase or decrease the size of a datafile from Oracle 7.2 using the following command:&lt;br /&gt;
 ALTER DATABASE DATAFILE 'filename2' RESIZE 100M;&lt;br /&gt;
&lt;br /&gt;
Because you can change the sizes of datafiles, you can add more space to your database without adding more datafiles. This is beneficial if you are concerned about reaching the maximum number of datafiles allowed in your database.&lt;br /&gt;
&lt;br /&gt;
Manually reducing the sizes of datafiles allows you to reclaim unused space in the database. This is useful for correcting errors in estimations of space requirements.&lt;br /&gt;
&lt;br /&gt;
'''Extend datafiles'''&lt;br /&gt;
&lt;br /&gt;
Also, datafiles can be allowed to automatically extend if more space is required. Look at the following commands:&lt;br /&gt;
 CREATE TABLESPACE pcs_data_ts&lt;br /&gt;
        DATAFILE 'c:ora_appspcspcsdata1.dbf' SIZE 3M&lt;br /&gt;
                 AUTOEXTEND ON NEXT 1M  MAXSIZE UNLIMITED&lt;br /&gt;
        DEFAULT STORAGE (  INITIAL 10240&lt;br /&gt;
                           NEXT 10240&lt;br /&gt;
                           MINEXTENTS 1&lt;br /&gt;
                           MAXEXTENTS UNLIMITED&lt;br /&gt;
                           PCTINCREASE 0)&lt;br /&gt;
        ONLINE&lt;br /&gt;
        PERMANENT;&lt;br /&gt;
&lt;br /&gt;
 ALTER DATABASE DATAFILE 1 AUTOEXTEND ON NEXT 1M  MAXSIZE UNLIMITED;&lt;br /&gt;
&lt;br /&gt;
==How do I find the overall database size?==&lt;br /&gt;
The biggest portion of a database's size comes from the datafiles. To find out how many megabytes are allocated to ALL datafiles:&lt;br /&gt;
 select sum(bytes)/1024/1024 &amp;quot;Meg&amp;quot; from dba_data_files;&lt;br /&gt;
&lt;br /&gt;
To get the size of all TEMP files:&lt;br /&gt;
 select nvl(sum(bytes),0)/1024/1024 &amp;quot;Meg&amp;quot; from dba_temp_files;&lt;br /&gt;
&lt;br /&gt;
To get the size of the on-line redo-logs:&lt;br /&gt;
 select sum(bytes)/1024/1024 &amp;quot;Meg&amp;quot; from sys.v_$log;&lt;br /&gt;
&lt;br /&gt;
Putting it all together into a single query:&lt;br /&gt;
 select a.data_size+b.temp_size+c.redo_size &amp;quot;total_size&amp;quot;&lt;br /&gt;
 from ( select sum(bytes) data_size&lt;br /&gt;
          from dba_data_files ) a,&lt;br /&gt;
      ( select nvl(sum(bytes),0) temp_size&lt;br /&gt;
          from dba_temp_files ) b,&lt;br /&gt;
      ( select sum(bytes) redo_size&lt;br /&gt;
          from sys.v_$log ) c;&lt;br /&gt;
&lt;br /&gt;
Another query (&amp;quot;Free space&amp;quot; reports data files free space):&lt;br /&gt;
 col &amp;quot;Database Size&amp;quot; format a20 &lt;br /&gt;
 col &amp;quot;Free space&amp;quot; format a20 &lt;br /&gt;
 select round(sum(used.bytes) / 1024 / 1024 ) || ' MB' &amp;quot;Database Size&amp;quot; &lt;br /&gt;
 ,      round(free.p / 1024 / 1024) || ' MB' &amp;quot;Free space&amp;quot; &lt;br /&gt;
 from (select bytes from v$datafile &lt;br /&gt;
       union all &lt;br /&gt;
       select bytes from v$tempfile &lt;br /&gt;
       union all &lt;br /&gt;
       select bytes from v$log) used &lt;br /&gt;
 ,    (select sum(bytes) as p from dba_free_space) free &lt;br /&gt;
 group by free.p &lt;br /&gt;
 /&lt;br /&gt;
&lt;br /&gt;
==How do I find the used space within the database size?==&lt;br /&gt;
Select from the DBA_SEGMENTS or DBA_EXTENTS views to find the used space of a database. Example:&lt;br /&gt;
 SELECT SUM(bytes)/1024/1024 &amp;quot;Meg&amp;quot; FROM dba_segments;&lt;br /&gt;
&lt;br /&gt;
==Where can one find the high water mark for a table?==&lt;br /&gt;
There is no single system table which contains the high water mark (HWM) for a table. A table's HWM can be calculated using the results from the following SQL statements:&lt;br /&gt;
 SELECT BLOCKS&lt;br /&gt;
 FROM   DBA_SEGMENTS&lt;br /&gt;
 WHERE  OWNER=UPPER(owner) AND SEGMENT_NAME = UPPER(table);&lt;br /&gt;
 &lt;br /&gt;
 ANALYZE TABLE owner.table ESTIMATE STATISTICS;&lt;br /&gt;
 &lt;br /&gt;
 SELECT EMPTY_BLOCKS&lt;br /&gt;
 FROM   DBA_TABLES&lt;br /&gt;
 WHERE  OWNER=UPPER(owner) AND TABLE_NAME = UPPER(table);&lt;br /&gt;
&lt;br /&gt;
Thus, the tables' HWM = (query result 1) - (query result 2) - 1&lt;br /&gt;
&lt;br /&gt;
NOTE: You can also use the [[DBMS_SPACE]] package and calculate the HWM = TOTAL_BLOCKS - UNUSED_BLOCKS - 1.&lt;br /&gt;
&lt;br /&gt;
==How do I find used/free space in a TEMPORARY tablespace?==&lt;br /&gt;
Unlike normal tablespaces, true temporary tablespace information is not listed in DBA_FREE_SPACE. Instead use the V$TEMP_SPACE_HEADER view:&lt;br /&gt;
 SELECT tablespace_name, SUM(bytes_used), SUM(bytes_free)&lt;br /&gt;
 FROM   V$temp_space_header&lt;br /&gt;
 GROUP  BY tablespace_name;&lt;br /&gt;
&lt;br /&gt;
To report true free space within the used portion of the TEMPFILE:&lt;br /&gt;
 SELECT   A.tablespace_name tablespace, D.mb_total,&lt;br /&gt;
          SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_used,&lt;br /&gt;
          D.mb_total - SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_free&lt;br /&gt;
 FROM     v$sort_segment A,&lt;br /&gt;
          (&lt;br /&gt;
          SELECT   B.name, C.block_size, SUM (C.bytes) / 1024 / 1024 mb_total&lt;br /&gt;
          FROM     v$tablespace B, v$tempfile C&lt;br /&gt;
          WHERE    B.ts#= C.ts#&lt;br /&gt;
          GROUP BY B.name, C.block_size&lt;br /&gt;
          ) D&lt;br /&gt;
 WHERE    A.tablespace_name = D.name&lt;br /&gt;
 GROUP by A.tablespace_name, D.mb_total;&lt;br /&gt;
&lt;br /&gt;
==How can one see who is using a temporary segment?==&lt;br /&gt;
For every user using temporary space, there is an entry in SYS.V_$LOCK with type 'TS'.&lt;br /&gt;
&lt;br /&gt;
All temporary segments are named 'ffff.bbbb' where 'ffff' is the file it is in and 'bbbb' is first block of the segment.&lt;br /&gt;
&lt;br /&gt;
If your temporary tablespace is set to TEMPORARY, all sorts are done in one large temporary segment. For usage stats, see SYS.V_$SORT_SEGMENT&lt;br /&gt;
&lt;br /&gt;
From [[Oracle 8]], one can just query SYS.v$sort_usage. Look at these examples:&lt;br /&gt;
 select s.username, u.&amp;quot;USER&amp;quot;, u.tablespace, u.contents, u.extents, u.blocks&lt;br /&gt;
 from   sys.v_$session s, sys.v_$sort_usage u&lt;br /&gt;
 where  s.saddr = u.session_addr&lt;br /&gt;
 /&lt;br /&gt;
 &lt;br /&gt;
 select s.osuser, s.process, s.username, s.serial#,&lt;br /&gt;
        sum(u.blocks)*vp.value/1024 sort_size&lt;br /&gt;
 from   sys.v_$session s, sys.v_$sort_usage u, sys.v_$parameter vp&lt;br /&gt;
 where  s.saddr = u.session_addr&lt;br /&gt;
   and  vp.name = 'db_block_size'&lt;br /&gt;
   and  s.osuser like '&amp;amp;1'&lt;br /&gt;
 group  by s.osuser, s.process, s.username, s.serial#, vp.value&lt;br /&gt;
 /&lt;br /&gt;
&lt;br /&gt;
==Who is using which UNDO or TEMP segment?==&lt;br /&gt;
Execute the following query to determine who is using a particular UNDO or Rollback Segment:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; SELECT TO_CHAR(s.sid)||','||TO_CHAR(s.serial#) sid_serial,&lt;br /&gt;
   2         NVL(s.username, 'None') orauser,&lt;br /&gt;
   3         s.program,&lt;br /&gt;
   4         r.name undoseg,&lt;br /&gt;
   5         t.used_ublk * TO_NUMBER(x.value)/1024||'K' &amp;quot;Undo&amp;quot;&lt;br /&gt;
   6    FROM sys.v_$rollname    r,&lt;br /&gt;
   7         sys.v_$session     s,&lt;br /&gt;
   8         sys.v_$transaction t,&lt;br /&gt;
   9         sys.v_$parameter   x&lt;br /&gt;
  10   WHERE s.taddr = t.addr&lt;br /&gt;
  11     AND r.usn   = t.xidusn(+)&lt;br /&gt;
  12     AND x.name  = 'db_block_size'&lt;br /&gt;
 &lt;br /&gt;
 SID_SERIAL ORAUSER    PROGRAM                        UNDOSEG         Undo&lt;br /&gt;
 ---------- ---------- ------------------------------ --------------- -------&lt;br /&gt;
 260,7      SCOTT      sqlplus@localhost.localdomain  _SYSSMU4$       8K&lt;br /&gt;
                       (TNS V1-V3)&lt;br /&gt;
&lt;br /&gt;
Execute the following query to determine who is using a TEMP Segment:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; SELECT b.tablespace,&lt;br /&gt;
   2         ROUND(((b.blocks*p.value)/1024/1024),2)||'M' &amp;quot;SIZE&amp;quot;,&lt;br /&gt;
   3         a.sid||','||a.serial# SID_SERIAL,&lt;br /&gt;
   4         a.username,&lt;br /&gt;
   5         a.program&lt;br /&gt;
   6    FROM sys.v_$session a,&lt;br /&gt;
   7         sys.v_$sort_usage b,&lt;br /&gt;
   8         sys.v_$parameter p&lt;br /&gt;
   9   WHERE p.name  = 'db_block_size'&lt;br /&gt;
  10     AND a.saddr = b.session_addr&lt;br /&gt;
  11  ORDER BY b.tablespace, b.blocks; &lt;br /&gt;
 &lt;br /&gt;
 TABLESPACE SIZE    SID_SERIAL USERNAME PROGRAM&lt;br /&gt;
 ---------- ------- ---------- -------- ------------------------------&lt;br /&gt;
 TEMP       24M     260,7      SCOTT    sqlplus@localhost.localdomain&lt;br /&gt;
                                        (TNS V1-V3)&lt;br /&gt;
&lt;br /&gt;
==How does one get the view definition of fixed views/tables?==&lt;br /&gt;
Query v$fixed_view_definition. Example:&lt;br /&gt;
 SELECT * FROM v$fixed_view_definition WHERE view_name='V$SESSION';&lt;br /&gt;
&lt;br /&gt;
==How full is the current redo log file?==&lt;br /&gt;
Here is a query that can tell you how full the current redo log file is. Handy for when you need to predict when the next log file will be archived out.&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; SELECT le.leseq                  &amp;quot;Current log sequence No&amp;quot;,&lt;br /&gt;
   2         100*cp.cpodr_bno/le.lesiz &amp;quot;Percent Full&amp;quot;,&lt;br /&gt;
   3         cp.cpodr_bno              &amp;quot;Current Block No&amp;quot;,&lt;br /&gt;
   4         le.lesiz                  &amp;quot;Size of Log in Blocks&amp;quot;&lt;br /&gt;
   5    FROM x$kcccp cp, x$kccle le&lt;br /&gt;
   6   WHERE le.leseq =CP.cpodr_seq&lt;br /&gt;
   7     AND bitand(le.leflg,24) = 8&lt;br /&gt;
   8  /&lt;br /&gt;
 Current log sequence No Percent Full Current Block No Size of Log in Blocks&lt;br /&gt;
 ----------------------- ------------ ---------------- ---------------------&lt;br /&gt;
                     416   48.6669922            49835                102400&lt;br /&gt;
&lt;br /&gt;
==Tired of typing sqlplus '/as sysdba' every time you want to do something?==&lt;br /&gt;
If you are tired of typing '''sqlplus &amp;quot;/as sysdba&amp;quot;''' every time you want to perform some DBA task, implement the following shortcut:&lt;br /&gt;
&lt;br /&gt;
'''On Unix/Linux systems:'''&lt;br /&gt;
&lt;br /&gt;
Add the following alias to your .profile or .bash_profile file:&lt;br /&gt;
 alias sss='sqlplus &amp;quot;/as sysdba&amp;quot;'&lt;br /&gt;
&lt;br /&gt;
'''On Windows systems:'''&lt;br /&gt;
&lt;br /&gt;
Create a batch file, sss.bat, add the command to it, and place it somewhere in your PATH. Whenever you now want to start sqlplus as sysdba, just type &amp;quot;sss&amp;quot;. Much less typing for ya lazy DBA's.&lt;br /&gt;
&lt;br /&gt;
Note: From [[Oracle 10g]] you don't need to put the &amp;quot;/AS SYSDBA&amp;quot; in quotes anymore.&lt;br /&gt;
&lt;br /&gt;
==What patches are installed within an Oracle Home?==&lt;br /&gt;
DBA's often do not document the patches they install. This may lead to situations where a feature works on machine X, but not on machine Y. This FAQ will show how you can list and compare the patches installed within your Oracle Homes.&lt;br /&gt;
&lt;br /&gt;
All patches that are installed with Oracle's [[OPatch]] Utility (Oracle's Interim Patch Installer) can be listed by invoking the ''opatch'' command with the ''lsinventory'' option. Here is an example:&lt;br /&gt;
&lt;br /&gt;
 $ cd $ORACLE_HOME/OPatch&lt;br /&gt;
 &lt;br /&gt;
 $ opatch lsinventory&lt;br /&gt;
 Invoking OPatch 10.2.0.1.0&lt;br /&gt;
 &lt;br /&gt;
 Oracle interim Patch Installer version 10.2.0.1.0&lt;br /&gt;
 Copyright (c) 2005, Oracle Corporation.  All rights reserved..&lt;br /&gt;
 ...&lt;br /&gt;
 Installed Top-level Products (1):&lt;br /&gt;
 &lt;br /&gt;
 Oracle Database 10g                                           10.2.0.1.0&lt;br /&gt;
 There are 1 products installed in this Oracle Home.&lt;br /&gt;
&lt;br /&gt;
 There are no Interim patches installed in this Oracle Home.&lt;br /&gt;
 &lt;br /&gt;
 OPatch succeeded.&lt;br /&gt;
&lt;br /&gt;
NOTE: If OPatch is not installed into your Oracle Home ($ORACLE_HOME/OPatch), you may need to download it from Metalink and install it yourself.&lt;br /&gt;
&lt;br /&gt;
==How does one give developers access to trace files (required as input to tkprof)?==&lt;br /&gt;
The ''alter session set sql_trace=true'' command generates trace files in USER_DUMP_DEST that can be used by developers as input to tkprof. On Unix the default file mask for these files are &amp;quot;rwx r-- ---&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
There is an undocumented [[INIT.ORA]] parameter that will allow everyone to read (rwx r-- r--) these trace files:&lt;br /&gt;
 _trace_files_public = true&lt;br /&gt;
&lt;br /&gt;
Include this in your INIT.ORA file and [[bounce]] your database for it to take effect.&lt;br /&gt;
&lt;br /&gt;
FAQ contributed by [mailto:ERLIE.FLYNN@NBNZ.CO.NZ Erlie Flynn]&lt;/div&gt;</summary>
		<author><name>94.179.16.104</name></author>
	</entry>
</feed>