Cancel Oracle shutdown
You might want to cancel a shutdown if you issued the wrong command when there were connected users.
If you try to shutdown immediate from another session, you’ll get this:
SQL> shutdown IMMEDIATE ORA-24324: service handle NOT initialized ORA-24323: VALUE NOT allowed ORA-01089: IMMEDIATE shutdown IN progress - no operations are permitted
When you issue a shutdown, only the SYS/SYSTEM user will be able to connect, so open another SQL*Plus session and type this:
CONNECT /AS sysdba startup force
Backing up an Oracle database without RMAN
If you aren’t using RMAN for your backups (and are using something like Netapp’s snapshots, or the simple copy-command) (in Oracle 9i this can only be done when the Database is in mounted-mode, not opened), you can do this:
Note: Archivelog must be enabled for this to work.
ALTER DATABASE BEGIN BACKUP;
At this point, you can begin copying/taking snapshots. When you’re done:
ALTER DATABASE END BACKUP;
In older databases, you’ll have to use (run for every tablespace):
ALTER TABLESPACE tablespace_name BEGIN BACKUP; ALTER TABLESPACE tablespace_name END BACKUP;
Quote from ‘Kafka on the Shore’ – Murakami
I love how random Haruki Murakami gets:
"Are you really Colonel Sanders?"
Colonel Sanders cleared his throat. "Not really. I'm just taking on his appearance for a time."
"That's what I thought," Hoshino said. "So what are you really?"
"I don't have a name."
"How do you get along without one?"
"No problem. Basically I don't have a name or a shape"
"So you're kind of like a fart."
"You could say that."
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; /

