General
System
Privileges
Database
Properties
ALTERDATABASE
TospecifytheRECOVERclauserequiresSYSDBA
privileges
setlinesize131
colproperty_nameformata28
colproperty_valueformata28
coldescriptionformata70
SELECT*
FROMdatabase_properties
ORDERBY1;
Create Database
Syntax
CREATEDATABASE<database_name>
USERSYSIDENTIFIEDBY<password>
USERSYSTEMIDENTIFIEDBY<password>
CONTROLFILEREUSE
MAXDATAFILES<integer>
MAXINSTANCES<integer>
CHARACTERSET<character_set_name>
NATIONALCHARACTERSET<character_set_name>
SETDEFAULT<BIGFILE|SMALLFILE>TABLESPACE
LOGFILEGROUP<integer><file_specification>,
[GROUP<integer><file_specification>,]
[GROUP<integer><file_specification>]
MAXLOGFILES<integer>
MAXLOGMEMBERS<integer>
MAXLOGHISTORY<integer>
[<ARCHIVELOG|NOARCHIVELOG>]defaultis
NOARCHIVELOG
[FORCELOGGING]
EXTENTMANAGEMENTLOCAL
DATAFILE<system_file_specification>
SYSAUXDATAFILE<file_specification>
DEFAULTTABLESPACE<tablespace_name>
DATAFILE<file_specification>
EXTENTMANAGEMENTLOCAL
UNIFORMSIZE<integer><M|G|T|P|E>
<BIGFILE|SMALLFILE>DEFAULTTEMPORARYTABLESPACE
<tablespace_name>
TEMPFILE<file_specification>
EXTENTMANAGEMENTLOCAL
UNIFORMSIZESIZE<integer><M|G|T|P|E>
<BIGFILE|SMALLFILE>UNDOTABLESPACE
<tablespace_name>
DATAFILE<file_specification>
SETTIME_ZONE=<time_zone_region>;
Typical Create
11g Database
On Linux /
UNIX
$cd/app/oracle/product
$mkdirpadmin/orabase/adump
$cdadmin/orabase
$mkdirdpdump
$mkdirpfile
$mkdirwallet
$cd/app/oracle/product
$mkdirpflash_recovery_area/ORABASE/ARCHIVELOG
$cdflash_recovery_area/ORABASE
$mkdirFLASHBACK
$mkdirONLINELOG
$cd/app/oracle/product
$mkdirporadata/orabase
$touch
/app/oracle/product/admin/orabase/pfile/initorabase
.ora
$cd/app/oracle/product/admin/orabase/pfile
$viinitorabase.ora
###########################################
#CacheandI/O
###########################################
db_block_size=8192
###########################################
#CursorsandLibraryCache
###########################################
open_cursors=300
###########################################
#DatabaseIdentification
###########################################
db_domain=""
db_name=orabase
###########################################
#FileConfiguration
###########################################
control_files=(
"/app/oracle/product/oradata/orabase/control01.ctl"
,
"/app/oracle/product/oradata/orabase/control02.ctl"
,
"/app/oracle/product/oradata/orabase/control03.ctl"
)
db_recovery_file_dest=/app/oracle/product/flash_rec
overy_area
db_recovery_file_dest_size=10737418240
###########################################
#Miscellaneous
###########################################
compatible=11.1.0.0.0
diagnostic_dest=/app/oracle/product
memory_target=854589440
###########################################
#SecurityandAuditing
###########################################
audit_file_dest=/app/oracle/product/admin/orabase/a
dump
audit_trail=db
remote_login_passwordfile=EXCLUSIVE
###########################################
#ProcessesandSessions
###########################################
processes=150
###########################################
#SharedServer
###########################################
dispatchers="(PROTOCOL=TCP)(SERVICE=orabaseXDB)"
###########################################
#SystemManagedUndoandRollbackSegments
###########################################
undo_tablespace=UNDOTBS1
savethefileandexitvi
$cpinitorabase.ora
$ORACLE_HOME/dbs/initorabase.ora
$cd$HOME
$sqlplus/assysdba
SQL>spool$HOME/CreateDB.log
SQL>createspfilefrompfile;
SQL>startupnomount
SQL>define_editor=vi
SQL>commit;
SQL>ed
pastethefollowingintotheeditor,save,and
exit
CREATEDATABASEorabase
MAXINSTANCES8
MAXLOGHISTORY292
MAXLOGFILES16
MAXLOGMEMBERS3
MAXDATAFILES100
DATAFILE
'/app/oracle/product/oradata/orabase/system01.dbf'
SIZE750MREUSE
AUTOEXTENDONNEXT10240KMAXSIZEUNLIMITED
EXTENTMANAGEMENTLOCAL
SYSAUXDATAFILE
'/app/oracle/product/oradata/orabase/sysaux01.dbf'
SIZE1000MREUSE
AUTOEXTENDONNEXT10240KMAXSIZEUNLIMITED
DEFAULTTEMPORARYTABLESPACETEMP
TEMPFILE
'/app/oracle/product/oradata/orabase/temp01.dbf'
SIZE125MREUSE
AUTOEXTENDONNEXT10240KMAXSIZEUNLIMITED
UNDOTABLESPACE"UNDOTBS1"
DATAFILE
'/app/oracle/product/oradata/orabase/undotbs01.dbf'
SIZE500MREUSE
AUTOEXTENDONNEXT5120KMAXSIZEUNLIMITED
CHARACTERSETAL32UTF8
NATIONALCHARACTERSETAL16UTF16
LOGFILE
GROUP1(
'/home/oracle/redo01a.log',
'/home/oracle/redo01b.log',
'/home/oracle/redo01c.log')SIZE50M,
GROUP2(
'/app/oracle/product/oradata/orabase/redo02a.log',
'/app/oracle/product/oradata/orabase/redo02b.log',
'/app/oracle/product/oradata/orabase/redo02c.log')
SIZE50M,
GROUP3(
'/app/oracle/product/redo03a.log',
'/app/oracle/product/redo03b.log',
'/app/oracle/product/redo03c.log')SIZE50M
SETTIME_ZONE='+08:00'
USERsysIDENTIFIEDBY"&&sysPassword"
USERsystemIDENTIFIEDBY"&&systemPassword"
duringCREATEDATABASEthefollowingscriptsare
run
donotrunthemasecondtime.
$ORACLE_HOME/rdbms/admin/dcore.bsq
$ORACLE_HOME/rdbms/admin/dsqlddl.bsq
$ORACLE_HOME/rdbms/admin/dmanage.bsq
$ORACLE_HOME/rdbms/admin/dplsql.bsq
$ORACLE_HOME/rdbms/admin/dtxnspc.bsq
$ORACLE_HOME/rdbms/admin/dfmap.bsq
$ORACLE_HOME/rdbms/admin/denv.bsq
$ORACLE_HOME/rdbms/admin/drac.bsq
$ORACLE_HOME/rdbms/admin/dsec.bsq
$ORACLE_HOME/rdbms/admin/doptim.bsq
$ORACLE_HOME/rdbms/admin/dobj.bsq
$ORACLE_HOME/rdbms/admin/djava.bsq
$ORACLE_HOME/rdbms/admin/dpart.bsq
$ORACLE_HOME/rdbms/admin/drep.bsq
$ORACLE_HOME/rdbms/admin/daw.bsq
$ORACLE_HOME/rdbms/admin/dsummgt.bsq
$ORACLE_HOME/rdbms/admin/dtools.bsq
$ORACLE_HOME/rdbms/admin/dexttab.bsq
$ORACLE_HOME/rdbms/admin/ddm.bsq
$ORACLE_HOME/rdbms/admin/dlmnr.bsq
$ORACLE_HOME/rdbms/admin/daw.bsq
verifythingslookgoodsofar
SQL>descobj$
SQL>desctab$
continuebycreatingthedatadictionaryviews
SQL>@?/rdbms/admin/catalog.sql
SQL>@?/rdbms/admin/catproc.sql
SQL>@?/rdbms/admin/catactx.sql
SQL>@?/rdbms/admin/catadvtb.sql
SQL>@?/rdbms/admin/catptabs.sqlverify
SQL>@?/rdbms/admin/catprc.sqlverify
SQL>@?/rdbms/admin/catexp.sqlverify
SQL>@?/rdbms/admin/catdbsyn.sqlverify
SQL>@?/rdbms/admin/cataudit.sqlverify
SQL>@?/rdbms/admin/catodm.sqlverify
SQL>@?/rdbms/admin/catost.sqlverify
SQL>@?/rdbms/admin/catadv.sqlverify
SQL>@?/rdbms/admin/catsnap.sqlverify
SQL>@?/rdbms/admin/catmgrsv.sqlverify
SQL>@?/rdbms/admin/catxdbv.sqlverify
SQL>@?/rdbms/admin/cdcore.sqlverify
SQL>@?/rdbms/admin/cdpart.sqlverify
SQL>@?/rdbms/admin/dbmsrman.sqlverify
SQL>@?/rdbms/admin/c1101000.sqlpatching?
GRANTselectONgv_$reserved_wordsTOPUBLIC;
REVOKEexecuteONdbms_lobFROMpublic;
REVOKEexecuteONutl_fileFROMpublic;
REVOKEexecuteONutl_inaddrFROMpublic;
REVOKEexecuteONutl_smtpFROMpublic;
youwillwanttoaddmanymoretothislist
SELECTtable_name
FROMall_tab_privs_made
WHEREprivilege='EXECUTE'
ANDgrantee='PUBLIC'
AND(table_nameLIKE'DBMS%'OR
table_nameLIKE'UTL%')
ORDERBY1;
spooloff
Typical Create
10g Database
On Windows
connectSYS/&&sysPasswordasSYSDBA
spool
c:\oracle\product\admin\orabase\create\CreateDB.log
startupnomount
pfile="c:\oracle\product\admin\orabase\pfile\init.o
ra";
CREATEDATABASEoragrid
MAXINSTANCES1
MAXLOGHISTORY1
MAXLOGFILES12
MAXLOGMEMBERS3
MAXDATAFILES100
DATAFILE'c:\oragrid\system01.dbf'
SIZE540MREUSE
AUTOEXTENDONNEXT10240KMAXSIZEUNLIMITED
EXTENTMANAGEMENTLOCAL
SYSAUXDATAFILE'c:\oragrid\sysaux01.dbf'
SIZE350MREUSE
AUTOEXTENDONNEXT10240KMAXSIZEUNLIMITED
DEFAULTTEMPORARYTABLESPACETEMPTEMPFILE
'c:\oragridemp01.dbf'
SIZE25MREUSE
AUTOEXTENDONNEXT1024KMAXSIZEUNLIMITED
UNDOTABLESPACE"UNDOTBS1"
DATAFILE'c:\oragrid\undotbs01.dbf'
SIZE100MREUSE
AUTOEXTENDONNEXT5120KMAXSIZEUNLIMITED
CHARACTERSETWE8MSWIN1252
NATIONALCHARACTERSETUS7ASCII
LOGFILEGROUP1('c:\oragridedo01.log')SIZE5M
REUSE,
GROUP2('c:\oragridedo02.log')SIZE5M
REUSE,
GROUP3('c:\oragridedo03.log')SIZE5M
REUSE
USERSYSIDENTIFIEDBY"&&sysPassword"
USERSYSTEMIDENTIFIEDBY"&&systemPassword";
spooloff
Database
Creation For
UNIX Used By
Older Versions
of Oracle's EBusiness Suite
Applications
spool$HOME/CreateDB.log
CREATEDATABASEctl1102A
maxdatafiles1022
maxlogmembers4
characterset"WE8ISO8859P1"
DATAFILE'/u03/oradata/ctl1102A/system01.dbf'SIZE
540M
AUTOEXTENDon
NEXT25M
MAXSIZE1000M
LOGFILE
GROUP1
('/u05/oradata/redo01a.log','/u06/oradata/redo01b.l
og')
SIZE20M,
GROUP2
('/u05/oradata/redo02a.log','/u06/oradata/redo02b.l
og')
SIZE20M,
GROUP3
('/u05/oradata/redo03a.log','/u06/oradata/redo03b.l
og')
SIZE20M;
CREATETABLESPACEUSERS
DATAFILE'/u03/oradata/ctl1102A/users01.dbf'SIZE
5M
AUTOEXTENDONNEXT5MAXSIZE2000m;
CREATETABLESPACERBS
DATAFILE'/u07/oradata/ctl1102A/rbs01.dbf'SIZE
100M
AUTOEXTENDONNEXT5MAXSIZE2000m;
CREATETABLESPACETOOLS
DATAFILE'/u03/oradata/ctl1102A/tools01.dbf'SIZE
5M
AUTOEXTENDONNEXT5MAXSIZE2000m;
CREATETABLESPACECTXD
DATAFILE'/u13/oradata/ctl1102A/ctxd01.dbf'SIZE5M
AUTOEXTENDONNEXT5MAXSIZE2000M;
CREATETABLESPACETEMP
DATAFILE'/u04/oradata/ctl1102A/temp01.dbf'SIZE
100M
AUTOEXTENDONNEXT5MAXSIZE2000M;
CREATETABLESPACEAKD
DATAFILE'/u13/oradata/ctl1102A/akd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000M;
CREATETABLESPACEAKX
DATAFILE'/u14/oradata/ctl1102A/akx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEALRD
DATAFILE'/u16/oradata/ctl1102A/alrd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEALRX
DATAFILE'/u15/oradata/ctl1102A/alrx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEAPD
DATAFILE'/u13/oradata/ctl1102A/apd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEAPX
DATAFILE'/u14/oradata/ctl1102A/apx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEARD
DATAFILE'/u16/oradata/ctl1102A/ard01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEARX
DATAFILE'/u15/oradata/ctl1102A/arx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEASD
DATAFILE'/u13/oradata/ctl1102A/asd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEASX
DATAFILE'/u14/oradata/ctl1102A/asx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEAXD
DATAFILE'/u16/oradata/ctl1102A/axd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEAXX
DATAFILE'/u15/oradata/ctl1102A/axx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEAZD
DATAFILE'/u13/oradata/ctl1102A/azd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEAZX
DATAFILE'/u14/oradata/ctl1102A/azx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEBOMD
DATAFILE'/u16/oradata/ctl1102A/bomd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEBOMX
DATAFILE'/u15/oradata/ctl1102A/bomx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACECED
DATAFILE'/u13/oradata/ctl1102A/ced01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACECEX
DATAFILE'/u14/oradata/ctl1102A/cex01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACECHVD
DATAFILE'/u16/oradata/ctl1102A/chvd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACECHVX
DATAFILE'/u15/oradata/ctl1102A/chvx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACECND
DATAFILE'/u13/oradata/ctl1102A/cnd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACECNX
DATAFILE'/u14/oradata/ctl1102A/cnx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACECRPD
DATAFILE'/u16/oradata/ctl1102A/crpd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACECRPX
DATAFILE'/u15/oradata/ctl1102A/crpx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACECSD
DATAFILE'/u13/oradata/ctl1102A/csd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACECSX
DATAFILE'/u14/oradata/ctl1102A/csx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACECZD
DATAFILE'/u13/oradata/ctl1102A/czd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACECZX
DATAFILE'/u14/oradata/ctl1102A/czx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEECD
DATAFILE'/u16/oradata/ctl1102A/ecd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEECX
DATAFILE'/u15/oradata/ctl1102A/ecx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEENGD
DATAFILE'/u13/oradata/ctl1102A/engd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEENGX
DATAFILE'/u14/oradata/ctl1102A/engx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEFAD
DATAFILE'/u16/oradata/ctl1102A/fad01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEFAX
DATAFILE'/u15/oradata/ctl1102A/fax01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEFLMD
DATAFILE'/u13/oradata/ctl1102A/flmd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEFLMX
DATAFILE'/u14/oradata/ctl1102A/flmx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEFNDD
DATAFILE'/u16/oradata/ctl1102A/fndd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEFNDX
DATAFILE'/u15/oradata/ctl1102A/fndx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEGLD
DATAFILE'/u13/oradata/ctl1102A/gld01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEGLX
DATAFILE'/u14/oradata/ctl1102A/glx01.dbf'SIZE1M
aAUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEHRD
DATAFILE'/u13/oradata/ctl1102A/hrd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEHRX
DATAFILE'/u14/oradata/ctl1102A/hrx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEHXTD
DATAFILE'/u16/oradata/ctl1102A/hxtd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEHXTX
DATAFILE'/u15/oradata/ctl1102A/hxtx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEICXD
DATAFILE'/u13/oradata/ctl1102A/icxd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEICXX
DATAFILE'/u14/oradata/ctl1102A/icxx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEINVD
DATAFILE'/u16/oradata/ctl1102A/invd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEINVX
DATAFILE'/u15/oradata/ctl1102A/invx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEJAD
DATAFILE'/u13/oradata/ctl1102A/jad01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEJAX
DATAFILE'/u14/oradata/ctl1102A/jax01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEJED
DATAFILE'/u16/oradata/ctl1102A/jed01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEJEX
DATAFILE'/u15/oradata/ctl1102A/jex01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEJGD
DATAFILE'/u13/oradata/ctl1102A/jgd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEJGX
DATAFILE'/u14/oradata/ctl1102A/jgx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEJLD
DATAFILE'/u16/oradata/ctl1102A/jld01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEJLX
DATAFILE'/u15/oradata/ctl1102A/jlx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEMFGD
DATAFILE'/u13/oradata/ctl1102A/mfgd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEMFGX
DATAFILE'/u14/oradata/ctl1102A/mfgx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEMRPD
DATAFILE'/u13/oradata/ctl1102A/mrpd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEMRPX
DATAFILE'/u14/oradata/ctl1102A/mrpx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEMSCD
DATAFILE'/u13/oradata/ctl1102A/mscd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEMSCX
DATAFILE'/u14/oradata/ctl1102A/mscx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEOED
DATAFILE'/u16/oradata/ctl1102A/oed01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEOEX
DATAFILE'/u15/oradata/ctl1102A/oex01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEOSMD
DATAFILE'/u16/oradata/ctl1102A/osmd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEOSMX
DATAFILE'/u15/oradata/ctl1102A/osmx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEOTAD
DATAFILE'/u13/oradata/ctl1102A/otad01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEOTAX
DATAFILE'/u14/oradata/ctl1102A/otax01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEPAD
DATAFILE'/u16/oradata/ctl1102A/pad01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEPAX
DATAFILE'/u15/oradata/ctl1102A/pax01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEPJMD
DATAFILE'/u16/oradata/ctl1102A/pjmd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEPJMX
DATAFILE'/u15/oradata/ctl1102A/pjmx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEPOD
DATAFILE'/u13/oradata/ctl1102A/pod01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEPOX
DATAFILE'/u14/oradata/ctl1102A/pox01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEQAD
DATAFILE'/u16/oradata/ctl1102A/qad01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEQAX
DATAFILE'/u15/oradata/ctl1102A/qax01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACERGD
DATAFILE'/u13/oradata/ctl1102A/rgd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACERGX
DATAFILE'/u14/oradata/ctl1102A/rgx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACERLAD
DATAFILE'/u16/oradata/ctl1102A/rlad01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACERLAX
DATAFILE'/u15/oradata/ctl1102A/rlax01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACESSPD
DATAFILE'/u13/oradata/ctl1102A/sspd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACESSPX
DATAFILE'/u14/oradata/ctl1102A/sspx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEVEHD
DATAFILE'/u16/oradata/ctl1102A/vehd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEVEHX
DATAFILE'/u15/oradata/ctl1102A/vehx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000m;
CREATETABLESPACEWIPD
DATAFILE'/u13/oradata/ctl1102A/wipd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000M;
CREATETABLESPACEWIPX
DATAFILE'/u14/oradata/ctl1102A/wipx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000M;
CREATETABLESPACEWHD
DATAFILE'/u16/oradata/ctl1102A/whd01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000M;
CREATETABLESPACEWHX
DATAFILE'/u15/oradata/ctl1102A/whx01.dbf'SIZE1M
AUTOEXTENDONNEXT1MAXSIZE2000M;
spooloff
Alter Database Control File Clauses
See the Control Files page in the library: Link below
Alter Database Default Settings Clauses
Set Default
Tablespace
Type
Set Default
Tablespace
ALTERDATABASESETDEFAULT<BIGFILE|
SMALLFILE>TABLESPACE;
ALTERDATABASESETDEFAULTsmallfileTABLESPACE;
ALTERDATABASESETDEFAULTTABLESPACE
<tablespace_name>;
ALTERDATABASESETDEFAULTTABLESPACEuwdata;
Set Default
Temporary
Tablespace
Set Default
Temporary
Tablespace
Group
ALTERDATABASEDEFAULTTEMPORARYTABLESPACE
<group_name>;
ALTERDATABASEDEFAULTTEMPORARYTABLESPACEapp_grp
;
ALTERDATABASEDEFAULTTEMPORARYTABLESPACE
<tablespace_group_name>;
ALTERDATABASEDEFAULT
TEMPORARYTABLESPACEtemp_grp;
ALTERDATABASERENAMEGLOBAL_NAMETO<new_name>;
Rename
Global Name
verifyglobalname
SELECTvalue$
FROMprops$
WHEREname='GLOBAL_DB_NAME';
getdb_domainco
setlinesize121
colnameformata40
colvalueformata40
SELECTname,value
FROMgv$parameter
WHEREname='db_domain';
backupcontrolfile
ALTERDATABASEBACKUPCONTROLFILETOTRACE;
changethetracefileCREATECONTROLFILEcommand
to:
CREATECONTROLFILEREUSESETDATABASE
"NEW_SID_NAME"RESETLOGS;
SHUTDOWNIMMEDIATE;
modifythedb_nameparameterintheinitSID.ora
conn/assysdba
CREATEspfileFROMpfile='initSID.ora';
STARTUPNOMOUNT
executethecreatecontrolfilecommand
recoverdatabaseUSINGBACKUPCONTROLFILEuntil
cancel
CANCEL
openresetlogsthedatabaseand
ALTERDATABASERENAMEGLOBAL_NAMETOnew_sid_name;
Disable Block
Change
Tracking
Enable Block
Change
Tracking
ALTERDATABASEDISABLEBLOCKCHANGETRACKING;
ALTERDATABASEDISABLEBLOCKCHANGETRACKING;
ALTERDATABASEENABLEBLOCKCHANGETRACKING
USINGFILE<file_name>REUSE;
ALTERDATABASEENABLEBLOCKCHANGETRACKING
USINGFILE/u03/oracle/oradata/trackfile.logREUSE;
Flashback
Mode
ALTERDATABASEFLASHBACK<ON|OFF>
Set Time Zone
By Delta
ALTERDATABASESETTIME_ZONE<+|>HH:MI
Set Time Zone
By Name
ALTERDATABASESETTIME_ZONE<time_zone_region>
ALTERDATABASEFLASHBACKON;
ALTERDATABASESETTIME_ZONE'5:0';
ALTERDATABASESETTIME_ZONE'US/Eastern';
Alter Database Log File Clauses
See the Log Files page in the library: Link below
Clear A Log
File
ALTERDATABASECLEAR[UNARCHIVED]LOGFILE
<logfile_path_and_name>[UNRECOVERABLEDATAFILE];
ALTERDATABASECLEARLOGFILE'c:\oragrid
edo5c.log';
Stop Force
Logging
ALTERDATABASENOFORCELOGGING;
Start Archive
Logging
ALTERDATABASEARCHIVELOGMANUAL;
Stop Archive
Logging
ALTERDATABASENOARCHIVELOG;
Supplemental
DB Logging
ALTERDATABASENOFORCELOGGING;
ALTERDATABASEARCHIVELOGMANUAL;
ALTERDATABASENOARCHIVELOG;
ALTERDATABASE<ADD|DROP>SUPPLEMENTALLOGDATA
[(ALL|PRIMARYKEY|UNIQUE|FOREIGNKEY)
COLUMNS]
ALTERDATABASEADDSUPPLEMENTALLOGDATA(UNIQUE)
COLUMNS;
Alter Database Character Set Clauses
Set the
character set
Set the
national
character set
ALTERDATABASECHARACTERSETINTERNAL_CONVERT
<CHARACTERSET>;
ALTERDATABASECHARACTERSET
INTERNAL_CONVERTWE8MSWIN1252;
ALTERDATABASENATIONALCHARACTERSET
INTERNAL_CONVERT<CHARACTERSET>;
ALTERDATABASENATIONALCHARACTERSET
INTERNAL_CONVERTAL16UTF16;
Alter Database Recovery Clauses
Recovery clauses will be covered in the Backup-Recovery page when it is built
Alter Database Redo Thread Clauses (RAC)
Disable RAC
Thread
ALTERDATABASEDISABLETHREAD<integer>;
Enable RAC
Thread
ALTERDATABASEENABLEPUBLICTHREAD<integer>;
ALTERDATABASEDISABLETHREAD7;
ALTERDATABASEENABLEPUBLICTHREAD5;
Alter Database Security Clause
Guard: Prevent
data in the
database from
being altered
ALTERDATABASEGUARD<ALL|STANDBY|NONE>
ALTERDATABASEGUARDALL;
Alter Database Standby Database Clauses
Standby Database clauses will be covered in the DataGuard page when it is built
Alter Database Startup Clauses
Mount
database but
do not open
ALTERDATABASEMOUNT[<STANDBY|CLONE>DATABASE];
Open
Database
Read Only
ALTERDATABASEOPENREADONLY;
Open
Database
Read-Write
ALTERDATABASEMOUNT;
ALTERDATABASEOPENREADONLY;
ALTERDATABASEOPENREADWRITE<RESETLOGS|
NORESETLOGS>
[<UPGRADE|DOWNGRADE>];
ALTERDATABASEOPENREADWRITERESETLOGS;
Alter Database Storage Clauses
ALTERDATABASERENAMEFILE<current_file_name>TO
<new_file_name>;
Rename File
Create Datafile
ALTERDATABASERENAMEFILE
'c:\oracle\product\oradata\example.dbf'TO
'c:\oracle\product\oradata\demos.dbf';
ALTERDATABASECREATEDATAFILE<file_name|
file_number>
AS<file_specification|NEW>;
colfile_nameformata50
SELECTfile_name,file_id
FROMdba_data_files;
ALTERDATABASECREATEDATAFILE8ASNEW;
SELECTfile_name,file_id
FROMdba_data_files;
Alter Database Datafile
ALTERDATABASEDATAFILE<file_name|file_number>
Resize Datafile RESIZETO<integer><M|G|T>;
ALTERDATABASEDATAFILE8RESIZE15M;
Make Datafile
Not
Autoextensible
ALTERDATABASEDATAFILE<file_name|file_number>
AUTOEXTEND<OFF|ON[NEXT<integer><M|G>
MAXSIZE<UNLIMITED|<integer><M|G>]>
SELECTfile_name,autoextensible
FROMdba_data_files;
ALTERDATABASEDATAFILE8AUTOEXTENDOFF;
SELECTfile_name,autoextensible
FROMdba_data_files;
Make datafile
autoextensible
ALTERDATABASEDATAFILE<file_name|file_number>
AUTOEXTENDONNEXT<integer><M|G>
MAXSIZE<UNLIMITED|<integer><M|G>
SELECTfile_name,autoextensible
FROMdba_data_files;
ALTERDATABASEDATAFILE8AUTOEXTENDONNEXT10M
MAXSIZE100M;
SELECTfile_name,autoextensible
FROMdba_data_files;
ALTERDATABASEDATAFILE<file_name|file_number>
Take a datafile AUTOEXTENDONNEXT<integer><M|G>
offline or
MAXSIZE<UNLIMITED|<integer><M|G>
online: by
name
/*
To use this form of the ALTER DATABASE statement, the database must be in
ARCHIVELOG mode. This requirement prevents you from accidentally losing the
datafile, since taking the datafile offline while in NOARCHIVELOG mode is likely to
result in losing the file.
*/
SELECTfile_name,status
FROMdba_data_files;
ALTERDATABASEDATAFILE
'/u02/oracle/rbdb1/stuff01.dbf'OFFLINE;
SELECTfile_name,status
FROMdba_data_files;
ALTERDATABASEDATAFILE
'/u02/oracle/rbdb1/stuff01.dbf'ONLINE;
SELECTfile_name,status
FROMdba_data_files;
Take a datafile
offline or
online: by
number
ALTERDATABASE<file_name|file_number>OFFLINE;
colfile_nameformata50
SELECTfile_name,status
FROMdba_data_files;
ALTERDATABASE8OFFLINE;
SELECTfile_name,status
FROMdba_data_files;
ALTERDATABASE8ONLINE;
SELECTfile_name,status
FROMdba_data_files;
Offline and
drop datafile
ALTERDATABASE<file_name|file_number>OFFLINE
DROP;
-NOARCHIVEL
OG mode only
ALTERDATABASEDATAFILE
'/u02/oracle/rbdb1/users03.dbf'
OFFLINEDROP;
Alter Database Tempfile
ALTERDATABASETEMPFILE<file_name|file_number>
RESIZETO<integer><M|G|T>;
Resize
Tempfile
SELECTfile_name,file_id,tablespace_name,
(bytes/1024/1024)SIZE_IN_MB
FROMdba_temp_files;
ALTERDATABASETEMPFILE1RESIZE25M;
Change
ALTERDATABASETEMPFILE<file_name|file_number>
Tempfile
Autoextend
Specification
Drop Tempfile
AUTOEXTEND<OFF|ON[NEXT<integer><M|G>
MAXSIZE<UNLIMITED|<integer><M|G>]>;
ALTERDATABASETEMPFILEAUTOEXTENDON
NEXT10MMAXSIZE200M;
ALTERDATABASETEMPFILE<file_name|file_number>
DROP;
ALTERDATABASETEMPFILE1DROP;
Place Tempfile
Offline
ALTERDATABASETEMPFILE<file_name|file_number>
OFFLINE;
ALTERDATABASETEMPFILE1OFFLINE;
Place Tempfile
Online
ALTERDATABASETEMPFILE<file_name|file_number>
ONLINE;
ALTERDATABASETEMPFILE1ONLINE;
Drop Database
DROPDATABASE;
Do not try this
one for testing
as it does
exactly what it
says
SHUTDOWNABORT;
STARTUPMOUNTEXCLUSIVERESTRICT;
DROPDATABASE;
Database Related Queries
colparameterformata40
colvalueformata20
Options
Installed
SELECT*FROMgv$option;
colcomp_nameformata30
SELECTcomp_name,version,status
FROMdba_registry;
Properties
setpagesize0
setlinesize121
colvalue$formata40
colcomment$formata36
SELECT*
FROMprops$;