1. 首页
  2. IT资讯

oracle 11g手工建库

工作环境: ORE 6.5

手工建库是作为dba必须掌握的一个基本技能,它使清楚的认识oracle的目录结构、oracle所必需的文件、理解表空间、认证方式等概念。

1.设置环境变量

[oracle@ENMOEDU~]$vi.bash_profile

#.bash_profile

#Getthealiasesandfunctions

if[-f~/.bashrc];then

.~/.bashrc

fi

#Userspecificenvironmentandstartupprograms

PATH=$PATH:$HOME/bin

exportPATH

exportORACLE_BASE=/u01/app/oracle

exportORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

exportORACLE_SID=ENMOEDU

exportPATH=$ORACLE_HOME/bin:$PATH

exportLD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/libi

~

~

~

~

“.bash_profile”[readonly]19L,385C1,1All

[oracle@ENMOEDU~]$source.bash_profile

2.准备密码文件及初始化参数文件和创建数据库脚本

[oracle@ENMOEDU~]$cd$ORACLE_BASE

[oracle@ENMOEDUoracle]$ls

cfgtoollogscheckpointsdiagproduct

[oracle@ENMOEDUoracle]$cd$ORACLE_HOME/dbs

[oracle@ENMOEDUdbs]$ls

init.ora

[oracle@ENMOEDUdbs]$orapwdfile=orapwdENMOEDUpassword=oracleentries=30

[oracle@ENMOEDUdbs]$catinit.ora|grep-v^$|grep-v^#>initENMOEDU.ora

[oracle@ENMOEDUdbs]$viinitENMOEDU.ora

diagnostic_dest=/u01/app/oracle

db_name=’ENMOEDU

memory_target=1G

processes=150

audit_file_dest=’/u01/app/oracle/admin/ENMOEDU/adump

audit_trail=’db’

db_block_size=8192

db_domain=”

db_recovery_file_dest=’/u01/app/oracle/flash_recovery_area

db_recovery_file_dest_size=2G

diagnostic_dest=’/u01/app/oracle

open_cursors=300

remote_login_passwordfile=’EXCLUSIVE’

undo_tablespace=’UNDOTBS1′

control_files=(/u01/app/oracle/oradata/ENMOEDU/control01.ctl,/u01/app/oracle/oradata/ENMOEDU/control02.ctl)

compatible=’11.2.0′

~

~

~

~

~

~

~

“initENMOEDU.ora”15L,493Cwritten

3.准备创建数据库需要的相关目录

[oracle@ENMOEDUoracle]$cd/u01/app/oracle/

[oracle@ENMOEDUoracle]$mkdir-padmin/ENMOEDU/audmp

[oracle@ENMOEDUoracle]$mkdir-pflash_recovery_area

[oracle@ENMOEDUoracle]$ls

admincfgtoollogscheckpointsdiagflash_recovery_areaproduct

4.开始手工建库

[oracle@ENMOEDUENMOEDU]$sqlplus/assysdba

SQL*Plus:Release11.2.0.3.0ProductiononMonFeb1000:39:102014

Copyright(c)1982,2011,Oracle.Allrightsreserved.

Connectedto:

OracleDatabase11gEnterpriseEditionRelease11.2.0.3.0-Production

WiththePartitioning,OLAP,DataMiningandRealApplicationTestingoptions

SQL>startupnomount

ORACLEinstancestarted.

TotalSystemGlobalArea1071333376bytes

FixedSize1349732bytes

VariableSize620758940bytes

DatabaseBuffers444596224bytes

RedoBuffers4628480bytes

[oracle@ENMOEDU~]$vicreate_db.sql

CREATEDATABASEENMOEDU

USERSYSIDENTIFIEDBYoracle

USERSYSTEMIDENTIFIEDBYoracle

LOGFILEGROUP1(/u01/app/oracle/oradata/ENMOEDU/redo01a.log’,’/u01/app/oracle/oradata/ENMOEDU/redo01b.log’)SIZE100MBLOCKSIZE512,

GROUP2(/u01/app/oracle/oradata/ENMOEDU/redo02a.log’,’/u01/app/oracle/oradata/ENMOEDU/redo02b.log’)SIZE100MBLOCKSIZE512,

GROUP3(/u01/app/oracle/oradata/ENMOEDU/redo03a.log’,’/u01/app/oracle/oradata/ENMOEDU/redo03b.log’)SIZE100MBLOCKSIZE512

MAXLOGFILES5

MAXLOGMEMBERS5

MAXLOGHISTORY1

MAXDATAFILES100

CHARACTERSETAL32UTF8

NATIONALCHARACTERSETAL16UTF16

EXTENTMANAGEMENTLOCAL

DATAFILE/u01/app/oracle/oradata/ENMOEDU/system01.dbfSIZE325MREUSE

SYSAUXDATAFILE’/u01/app/oracle/oradata/ENMOEDU/sysaux01.dbfSIZE325MREUSE

DEFAULTTABLESPACEusers

DATAFILE/u01/app/oracle/oradata/ENMOEDU/users01.dbf

SIZE500MREUSEAUTOEXTENDONMAXSIZEUNLIMITED

DEFAULTTEMPORARYTABLESPACEtempts1

TEMPFILE/u01/app/oracle/oradata/ENMOEDU/temp01.dbf

SIZE20MREUSE

UNDOTABLESPACEundotbs1

DATAFILE/u01/app/oracle/oradata/ENMOEDU/undotbs01.dbf’

SIZE200MREUSEAUTOEXTENDONMAXSIZEUNLIMITED;

“create_db.sql”24L,1237Cwritten

[oracle@ENMOEDU~]$cd/u01/app/oracle

[oracle@ENMOEDUoracle]$ls

admincfgtoollogscheckpointsdiagflash_recovery_areaproduct

[oracle@ENMOEDUoracle]$mkdir-poradata/ENMOEDU

[oracle@ENMOEDUoracle]$cd/u01/app/oracle/diag/rdbms/enmoedu/ENMOEDU/trace/

[oracle@ENMOEDUtrace]$tail-100falert_ENMOEDU.log

SQL>@/home/oracle/create_db.sql

Databasecreated.

SQL>@?/rdbms/admin/catalog.sql

……

PL/SQLproceduresuccessfullycompleted.

TIMESTAMP

——————————————————————————–

COMP_TIMESTAMPCATALOG2014-02-1001:12:14

SQL>@?/rdbms/admin/catproc.sql

……

SQL>

SQL>SELECTdbms_registry_sys.time_stamp(‘CATPROC’)AStimestampFROMDUAL;

TIMESTAMP

——————————————————————————–

COMP_TIMESTAMPCATPROC2014-02-1001:25:21

1rowselected.

SQL>

SQL>SETSERVEROUTPUTOFF

SQL>

SQL>

SQL>selectstatusfromv$instance;

STATUS

————

OPEN

1rowselected.

SQL>quit

DisconnectedfromOracleDatabase11gEnterpriseEditionRelease11.2.0.3.0-Production

WiththePartitioning,OLAP,DataMiningandRealApplicationTestingoptions

[oracle@ENMOEDUENMOEDU]$

5.完成手工建库

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29578568/viewspace-2152722/,如需转载,请注明出处,否则将追究法律责任。

主题测试文章,只做测试使用。发布者:布吉卡,转转请注明出处:http://www.cxybcw.com/195328.html

联系我们

13687733322

在线咨询:点击这里给我发消息

邮件:1877088071@qq.com

工作时间:周一至周五,9:30-18:30,节假日休息

QR code