6 数据库的启动与关闭_第1页
6 数据库的启动与关闭_第2页
6 数据库的启动与关闭_第3页
6 数据库的启动与关闭_第4页
6 数据库的启动与关闭_第5页
已阅读5页,还剩19页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、数据库的启动与关闭1数据库的体系结构DatabaseInstanceSGARedo logbufferData buffercacheShared poolData dict.cacheLibrarycache PMON DBW0SMON LGWRCKPTOthersUserprocessServerprocessPGAControl filesData files Redo logfilesArchived log filesParameterfilePasswordfile2 The Initialization Parameter FileControl_files参数与SGA设置有关的

2、参数initU15.oraSQL CONNECT / AS SYSDBASQL STARTUP PInstanceSGARedo logbufferData buffercacheShared poolData dict.cacheLibrarycache PMON DBWRSMON LGWRCKPTARCH3UNIX 和 NT下 的定位及默认名Default Name initSID.oratext fileUNIX $ORACLE_HOME/dbsNT%ORACLE_HOMEora81database and Point to%ORACLE_HOMEadminsidpfile4控制文件控制

3、文件:二进制文件,存储有关 数据库状态的信息。包括:数据库名表空间信息所有数据文件的名字和位置所有日志文件的名字和位置当前的日志序列号检查点信息等注意:不能用操作系统命令更改控制文件 内容,只能用ORACLE命令!5Initialization Parameter FilesEntries are specific to the instance being startedTwo types of parameters:Explicit: Having an entry in the fileImplicit: No entry within the file, but assuming th

4、e Oracle default valuesMultiple initialization parameter files can existChanges to entries in the effect based on the type of initialization parameter :Static parameter file, PFILE Persistent server parameter file, SPFILE6PFILEinitSID.oraText fileModified with an operating system editorModifications

5、 made manuallyChanges take effect on the next start upOnly opened during instance start upDefault location is $ORACLE_HOME/dbs $ORACLE_HOME/DATABASE7Creating a PFILECreated from a sample init.ora fileSample installed by the Oracle Universal InstallerCopy sample using operating system copy commandUni

6、quely identified by database SIDModify the initSID.oraEdit the parametersSpecific to database needscp init.ora $ORACLE_HOME/dbs/initdba01.ora8P# Initialization Parameter File: initdba01.oradb_name = dba01instance_name = dba01control_files = ( /home/dba01/ORADATA/u01/control01dba01.ctl,/home/dba01/OR

7、ADATA/u02/control01dba02.ctl)db_block_size = 4096db_cache_size = 4Mshared_pool_size = 50000000java_pool_size = 50000000 max_dump_ = 10240background_dump_dest = /home/dba01/ADMIN/BDUMPuser_dump_dest = /home/dba01/ADMIN/UDUMPcore_dump_dest = /home/dba01/ADMIN/CDUMPundo_management = AUTOundo_tablespace

8、 = UNDOTBS. . .9SPBinary fileMaintained by the Oracle serverAlways resides on the server sideAbility to make changes persistent across shut down and start upCan self-tune parameter valuesCan have Recovery Manager support backing up to the initialization parameter file10Creating an SPFILECreated from

9、 a PwhereSP: SP be createdP: P the SPFILECan be executed before or after instance start upCREATE SPFILE = $ORACLE_HOME/dbs/spFROM PFILE = $ORACLE_HOME/dbs/initDBA01.ora;11SP*.background_dump_dest= /home/dba01/ADMIN/BDUMP*.compatible=9.2.0*.control_files=/home/dba01/ORADATA/u01/ctrl01.ctl *.core_dump

10、_dest= /home/dba01/ADMIN/CDUMP*.db_block_size=4096*.db_name=dba01*.db_domain= world*.global_names=TRUE*.instance_name=dba01*.remote_login_passwordfile=exclusive*.java_pool_size=50000000*.shared_pool_size=50000000*.undo_management=AUTO*.undo_tablespace=UNDOTBS. . .12Modifying Parameters in SPFILEALTE

11、R SYSTEM SET undo_tablespace = UNDO2 SCOPE=BOTH|spfile|memory;Specifying temporary or persistent changesDeleting or resetting valuesALTER SYSTEM SET undo_tablespace = UNDO2;ALTER SYSTEM SET undo_tablespace = UNDO2 SCOPE=BOTH;ALTER SYSTEM RESET undo_suppress_errors SCOPE=BOTH SID=*;13STARTUP CommandO

12、rder of precedence:spDefault SPFILEinitSID.oraDefault PFILESpecified P override precedence.P indicate to use SPFILE.STARTUP PFILE = $ORACLE_HOME/dbs/initDBA1.oraSPFILE = /database/startup/sp14Starting Up a DatabaseNOMOUNTOPENMOUNTNOMOUNTSHUTDOWNInstance startedSTARTUPSHUTDOWN15Starting Up a Database

13、MOUNTOPENMOUNTNOMOUNTSHUTDOWNControl for this instanceInstance startedSTARTUPSHUTDOWN16Starting Up a DatabaseOPENOPENMOUNTNOMOUNTSHUTDOWNAll files opened as described by the control this instanceControl for this instanceInstance startedSTARTUPSHUTDOWN17STARTUP CommandStart up the instance and open t

14、he database:STARTUP FORCE RESTRICT POPEN RECOVERdatabase|MOUNT|NOMOUNTSTARTUPSTARTUP PFILE=$ORACLE_HOME/dbs/initdb01.ora18ALTER DATABASE CommandTo move the database from the NOMOUNT to a MOUNT stage or from the MOUNT to an OPEN stage:ALTER DATABASE MOUNT | OPEN Open the database as a read-only datab

15、ase:ALTER DATABASE db01 MOUNT;ALTER DATABASE db01 OPEN READ ONLY;ALTER DATABASE OPEN READ WRITE| READ ONLY;19Opening a Database in Restricted ModeUse the STARTUP command to restrict access to a database:Use the ALTER SYSTEM command to place an instance in restricted mode:STARTUP RESTRICTALTER SYSTEM

16、 ENABLE RESTRICTED SESSION;20Opening a Database in Read-Only ModeOpening a database in read-only mode:Can be used to:Execute queriesExecute disk sorts using locally managed tablespacesTake data files offline and online, but not tablespacesPerform recovery of offline data files and tablespacesSTARTUP MOUNTALTER DATABASE OPEN READ ONLY;21Shutting Down the DatabaseShutdown mode:A = ABORTI = IMMEDIATET = TRANSACTIONALN = NORMALANoNoNoNoTNoNoYesYesINoNoNoYesShutdown ModeAllow new connectionsWait until current sessions end Wait until c

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论