| | How to enable autoextend on tablespaces and datafiles
-- Create tablespace with a datafile that will be auto extended to 10Gb
create tablespace TABLESPACE_NAME datafile '/path/to/datafile.dbf' size 2000M AUTOEXTEND ON MAXSIZE 10000M extent management local uniform size 5M segment space management auto;
If you want to enable autoextend on a smallfile tablespace (if you are trying to alter tablespace to ... | |  More... 06/04/08 | | | | |
|
|
|
| | How to find out character set for a database
SQL> select * from v$nls_parameters;
PARAMETER
----------------------------------------------------------------
VALUE
----------------------------------------------------------------
NLS_CHARACTERSET
US7ASCII
...
| |  More... 10/25/07 | | | | |
|
| | Syntax to create database link
Syntax for creating db link in Oracle database:
create database link LINKNAME connect to USERNAME identified by "PASSWORD" using 'DBNAME';
| |  More... 03/08/06 | | | | |
|
| | Select random row from Oracle table
Use this query to select a random record from Oracle table. This works from TOAD as well as sqlplus:
SELECT col_name
FROM
(SELECT col_name
FROM table_name
ORDER BY dbms_random.value)
WHERE rownum = 1;
| |  More... 02/16/06 | | | | |
|
| | Kill Oracle sessions from OS level
When shutdown immediate does not work this command may help (replace DBNAME with ORACLE_SID of database you are trying to shutdown):
kill -9 `ps -ef | grep DBNAME | grep 'LOCAL=' | awk '{printf("%s ", $2);}'` | |  More... 12/04/05 | | | | |
|
| | Database copy / restore - skipping tablespaces
Sometimes you want to copy (refresh) database without some tablespaces i.e. due to space restrictions. These are general guidlines for skipping tablespaces when copying a database (the same with RMAN restore, restore from cold backup or copy from a standby database).
1. Once the datafiles have been copied / restored
SQLPLUS> startup ... | |  More... 11/14/05 | | | | |
|
| | Scripts to backup Oracle database on Windows NT
Here's a set of scripts to do database export, full database backup (putting tablespaces in backup mode, not using RMAN) and scan the backup logs on Windows NT. The datafiles are first copied to another filesystem using ocopy and then backuped with ntbackup. You can also see some examples of ... | |  More... 11/03/05 | | | | |
|
| | Put tablespaces in backup mode
--
-- Sample script to generate start backup and end backup scripts
-- for all tablespaces in the database
--
set pagesize echo off feedback off verify off
spool BEGIN_BACKUP.sql
SELECT 'spool BEGIN_BACKUP.log'
FROM dual;
SELECT 'ALTER SYSTEM SWITCH LOGFILE;'
FROM dual;
SELECT 'ALTER TABLESPACE ' || tablespace_name || ' BEGIN BACKUP;'
FROM dba_tablespaces;
SELECT 'ALTER DATABASE BACKUP CONTROLFILE TO ... | | More... 10/26/05 | | | | |
|
<< 1 | Page 2 | 3 >> |