Professional Documents
Culture Documents
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 and Oracle 9i or higer database:
CREATE DATABASE;
2. Locate the latest dump file in your USER_DUMP_DEST directory (show parameter
USER_DUMP_DEST) - rename it to something like dbrename.sql.
3. Edit dbrename.sql, remove all headers and comments, and change the database's name. Also
change "CREATE CONTROLFILE REUSE ..." to "CREATE CONTROLFILE SET ...".
4. Shutdown the database (use SHUTDOWN NORMAL or IMMEDIATE, don't ABORT!) and run
dbrename.sql.
5. Rename the database's global name:
Where can one find the high water mark for a table?
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:
SELECT BLOCKS
FROM DBA_SEGMENTS
SELECT EMPTY_BLOCKS
FROM DBA_TABLES
drop user A
command.
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.
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.
Also, datafiles can be allowed to automatically extend if more space is required. Look at the
following command:
NEXT 10240
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0)
ONLINE
PERMANENT;
On systems prior to Oracle 8i, write a job to copy archived redo log files from the primary
database to the standby system, and apply the redo log files to the standby database (pipe it).
Remember the database is recovering and will prompt you for the next log file to apply.
Oracle 8i onwards provide an "Automated Standby Database" feature which will send archived
log files to the remote site via NET8, and apply then to the standby database.
When one needs to activate the standby database, stop the recovery process and activate it:
_trace_files_public = true
Include this in your INIT.ORA file and bounce your database for it to take effect.
Thanks to Erlie Flynn
Back to top of file
FROM sys.v_$instance;
FROM sys.v_$session
Users still running on Oracle 7 can try one of the following queries:
select C.INSTANCE,
to_date(JUL.VALUE, 'J')
|| to_char(floor(SEC.VALUE/3600), '09' )
|| ':'
|| '.'
SYS.V_$INSTANCE SEC,
SYS.V_$THREAD C
SYS.V_$INSTANCE SEC
V$INSTANCE SEC
FROM V$temp_space_header
GROUP BY tablespace_name;
sum(u.blocks)*vp.value/1024 sort_size