6数据库的启动与关闭

上传人:壹****1 文档编号:585058793 上传时间:2024-09-01 格式:PPT 页数:24 大小:190KB
返回 下载 相关 举报
6数据库的启动与关闭_第1页
第1页 / 共24页
6数据库的启动与关闭_第2页
第2页 / 共24页
6数据库的启动与关闭_第3页
第3页 / 共24页
6数据库的启动与关闭_第4页
第4页 / 共24页
6数据库的启动与关闭_第5页
第5页 / 共24页
点击查看更多>>
资源描述

《6数据库的启动与关闭》由会员分享,可在线阅读,更多相关《6数据库的启动与关闭(24页珍藏版)》请在金锄头文库上搜索。

1、数据库的数据库的启动与关闭启动与关闭1数据库的体系结构DatabaseInstanceSGARedo logbufferData buffercacheShared poolData dict.cacheLibrarycache PMON DBW0SMON LGWRCKPTOthersUserprocessServerprocessPGAControl filesData files Redo logfilesArchived log filesParameterfilePasswordfile2 TheInitializationParameterTheInitializationParam

2、eterFileFileControl_files参数与SGA设置有关的参数initU15.oraSQL CONNECT / AS SYSDBASQL STARTUP PInstanceSGARedo logbufferData buffercacheShared poolData dict.cacheLibrarycache PMON DBWRSMON LGWRCKPTARCH3UNIX和NT下的定位及默认名DefaultNameinitSID.oratextfileUNIX$ORACLE_HOME/dbsNT%ORACLE_HOMEora81databaseandPointto %ORAC

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

4、 within the file, but assuming the Oracle default valueslMultiple initialization parameter files can existlChanges to entries in the effect based on the type of initialization parameter :lStatic parameter file, PFILE lPersistent server parameter file, SPFILE6PFILEinitSID.oralText filelModified with

5、an operating system editorlModifications made manuallylChanges take effect on the next start uplOnly opened during instance start uplDefault location is $ORACLE_HOME/dbs $ORACLE_HOME/DATABASE7Creating a PFILElCreated from a sample init.ora filelSample installed by the Oracle Universal InstallerlCopy

6、 sample using operating system copy commandlUniquely identified by database SIDlModify the initSID.oralEdit the parameterslSpecific to database needscp init.ora $ORACLE_HOME/dbs/initdba01.ora8P# Initialization Parameter File: initdba01.oradb_name = dba01instance_name = dba01control_files = ( /home/d

7、ba01/ORADATA/u01/control01dba01.ctl,/home/dba01/ORADATA/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/dba0

8、1/ADMIN/CDUMPundo_management = AUTOundo_tablespace = UNDOTBS. . .9SPlBinary filelMaintained by the Oracle serverlAlways resides on the server sidelAbility to make changes persistent across shut down and start uplCan self-tune parameter valueslCan have Recovery Manager support backing up to the initi

9、alization parameter file10Creating an SPFILElCreated from a PwherelSP: SP be createdlP: P the SPFILElCan 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*.

10、control_files=/home/dba01/ORADATA/u01/ctrl01.ctl *.core_dump_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

11、_tablespace=UNDOTBS. . .12Modifying Parameters in SPFILEALTER SYSTEM SET undo_tablespace = UNDO2 SCOPE=BOTH|spfile|memory;lSpecifying temporary or persistent changeslDeleting or resetting valuesALTER SYSTEM SET undo_tablespace = UNDO2;ALTER SYSTEM SET undo_tablespace = UNDO2 SCOPE=BOTH;ALTER SYSTEM

12、RESET undo_suppress_errors SCOPE=BOTH SID=*;13STARTUP CommandlOrder of precedence:lsplDefault SPFILElinitSID.oralDefault PFILElSpecified P override precedence.lP indicate to use SPFILE.STARTUP PFILE = $ORACLE_HOME/dbs/initDBA1.oraSPFILE = /database/startup/sp14Starting Up a DatabaseNOMOUNTOPENMOUNTN

13、OMOUNTSHUTDOWNInstance startedSTARTUPSHUTDOWN15Starting Up a DatabaseMOUNTOPENMOUNTNOMOUNTSHUTDOWNControl for this instanceInstance startedSTARTUPSHUTDOWN16Starting Up a DatabaseOPENOPENMOUNTNOMOUNTSHUTDOWNAll files opened as described by the control this instanceControl for this instanceInstance st

14、artedSTARTUPSHUTDOWN17STARTUP CommandStart up the instance and open the database:STARTUP FORCE RESTRICT POPEN RECOVERdatabase|MOUNT|NOMOUNTSTARTUPSTARTUP PFILE=$ORACLE_HOME/dbs/initdb01.ora18ALTER DATABASE CommandlTo move the database from the NOMOUNT to a MOUNT stage or from the MOUNT to an OPEN st

15、age:lALTER DATABASE MOUNT | OPEN lOpen the database as a read-only database:ALTER DATABASE db01 MOUNT;ALTER DATABASE db01 OPEN READ ONLY;ALTER DATABASE OPEN READ WRITE| READ ONLY;19Opening a Database in Restricted ModelUse the STARTUP command to restrict access to a database:lUse the ALTER SYSTEM co

16、mmand to place an instance in restricted mode:STARTUP RESTRICTALTER SYSTEM ENABLE RESTRICTED SESSION;20Opening a Database in Read-Only ModelOpening a database in read-only mode:lCan be used to:lExecute querieslExecute disk sorts using locally managed tablespaceslTake data files offline and online, b

17、ut not tablespaceslPerform recovery of offline data files and tablespacesSTARTUP MOUNTALTER DATABASE OPEN READ ONLY;21Shutting Down the DatabaseShutdown mode:lA = ABORTlI = IMMEDIATElT = TRANSACTIONALlN = NORMALANoNoNoNoTNoNoYesYesINoNoNoYesShutdown ModeAllow new connectionsWait until current sessions end Wait until current transactions endForce a checkpoint and close filesNNoYesYesYes22ShuttingDowntheDatabaseShuttingDowntheDatabaseSHUTDOWNNORMAL|TRANSACTIONAL|IMMEDIATE|ABORT23与数据库启动有关的几个文件关闭 SHUTDOWN后台进程未运行数据库文件关闭未登陆 NOMOUNT进程运行没有数据库文件打开 打开 OPEN进程运行全部数据库文件打开 登陆 MOUNT 进程运行控制文件打开启动例程时读取参数文件24

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 建筑/环境 > 施工组织

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号