Enabling Trace
The TRACE_ENABLED parameter allows you to trace the execution history of Oracle. It should be set to TRUE by default.
The information gathered is stored in the following locations:
#User: /usr/oracle/admin/sid/udump #Background: /usr/oracle/admin/sid/bdump #Core: /usr/oracle/admin/sid/cdump
These locations could be different depending on what’s set in your PFILE.
Check if trace is enabled:
SHOW parameter trace_enabled;
Sample output:
SQL> show parameter trace_enabled; NAME TYPE VALUE ------------------------- -------- -------------- trace_enabled BOOLEAN TRUE
And if it isn’t enabled, enable it using:
ALTER SYSTEM SET trace_enabled = TRUE;
Note: Prior to version Oracle 9i, this parameter was: _trace_enabled
Starting, stopping, and Status of Oracle Enterprise Manager (EM)
To start the Oracle Enterprise Manager Database Control (from the command-line):
emctl start dbconsole
To get the status:
emctl status dbconsole
To stop the dbconsole
emctl stop dbconsole
To access the EM (with default settings):
http://hostname:5500/em
Update statistics on all objects in a database
This helps Oracle choose the best execution plan for queries:
BEGIN dbms_stats.gather_database_stats(options=> 'GATHER AUTO'); END; /
Turning Archive-log mode on and off
You can check what mode the database is in with:
1 | SELECT LOG_MODE FROM SYS.V$DATABASE; |
If you do not specify an archive-log location, it will end up going to a directory like $ORACLE_HOME/dbs - which can be quite a mess.
Check where it's going:
1 | SHOW PARAMETER log_archive_dest; |
It would be good practice to set the location if it doesn’t show one.
To turn archive-log-mode on or off:
shutdown database:
1 2 3 | SHUTDOWN IMMEDIATE
STARTUP RESTRICT
SHUTDOWN |
Mount the database:
1 | ALTER DATABASE MOUNT; |
Then issue one of the following:
1 2 | ALTER DATABASE NOARCHIVELOG; ALTER DATABASE ARCHIVELOG; |
If the location hasn’t been set yet:
1 | ALTER SYSTEM SET LOG_ARCHIVE_DEST = "/ARC_LOCATION"; |
Then open the database:
1 | ALTER DATABASE OPEN; |
There might also be archivelog related entries in your PFILE, which you should also make changes to.
Listing key Oracle Database files
To get a list of all datafiles, redo-log files and control-files, run the following in SQL*Plus (database must be mounted):
1 2 3 | SELECT MEMBER FROM V$LOGFILE; SELECT NAME FROM V$DATAFILE; SELECT VALUE FROM V$PARAMETER WHERE NAME = 'control_files'; |
An easier way of displaying your control-files is:
1 | SHOW PARAMETER control_files; |
Stop WordPress from adding p and br tags
Even without the visual-editor, WordPress has a habit of adding <p> and <br/> tags
Add this to your templates/pages/whatever and it should take care of the problem.
<?php remove_filter('the_content', 'wpautop'); ?>
Create bevelled text
I might be superfluous in my method here, but it works well for me