(1)启动数据库到 NOMOUNT 状态;(只是启动实例,尚未打开控制文件)
(2)启动数据库到 MOUNT 状态;(打开控制文件)
(3)启动数据库到 OPEN 状态。(执行控制文件)
shutdown→nomount过程:SQL> startup nomount;ORA-32004: obsolete or deprecatedparameter(s) specified for RDBMS instanceORACLE instance started.
Total System Global Area 790941696 bytesFixed Size 1367536 bytesVariable Size 490734096 bytesDatabase Buffers 293601280 bytesRedo Buffers 5238784 bytesnomount过程可以访问的动态性能视图:v$parameter,v$sga,v$option,v$process,v$version,v$instance
1、读初始参数文件
SQL> select * from v$ parameter;SQL> desc v$parameter;Name Null? Type----------------------------------------------------- -------- ------------------------------------NUM NUMBERNAME VARCHAR2(80)TYPE NUMBERVALUE VARCHAR2(4000)DISPLAY_VALUE VARCHAR2(4000)ISDEFAULT VARCHAR2(9)ISSES_MODIFIABLE VARCHAR2(5)ISSYS_MODIFIABLE VARCHAR2(9)ISINSTANCE_MODIFIABLE VARCHAR2(5)ISMODIFIED VARCHAR2(10)ISADJUSTED VARCHAR2(5)ISDEPRECATED VARCHAR2(5)ISBASIC VARCHAR2(5)DESCRIPTION VARCHAR2(255)UPDATE_COMMENT VARCHAR2(255)HASH NUMBER
2、分配物理内存SGA情况3、查看后台进程
SQL> select * from v$sga;NAME VALUE------------------------------ ---------------Fixed Size 1367536Variable Size 490734096Database Buffers 293601280Redo Buffers 5238784
SQL> desc v$process;Name Null? Type----------------------------------------------------- -------- ------------------------------------ADDR RAW(4)PID NUMBERSPID VARCHAR2(24)PNAME VARCHAR2(5)USERNAME VARCHAR2(15)SERIAL# NUMBERTERMINAL VARCHAR2(30)PROGRAM VARCHAR2(48)TRACEID VARCHAR2(255)TRACEFILE VARCHAR2(513)BACKGROUND VARCHAR2(1)LATCHWAIT VARCHAR2(8)LATCHSPIN VARCHAR2(8)PGA_USED_MEM NUMBERPGA_ALLOC_MEM NUMBERPGA_FREEABLE_MEM NUMBERPGA_MAX_MEM NUMBER
4、数据库安装情况5、查看版本信息
SQL> select * from v$option;PARAMETER VALUE---------------------------------------- --------------------Partitioning TRUEObjects TRUEReal Application Clusters FALSEAdvanced replication TRUEBit-mapped indexes TRUEConnection multiplexing TRUEConnection pooling TRUEDatabase queuing TRUEIncremental backup and recovery TRUEInstead-of triggers TRUEParallel backup and recovery TRUE
PARAMETER VALUE---------------------------------------- --------------------Parallel execution TRUEParallel load TRUEPoint-in-time tablespace recovery TRUEFine-grained access control TRUEProxy authentication/authorization TRUEChange Data Capture TRUEPlan Stability TRUEOnline Index Build TRUECoalesce Index TRUEManaged Standby TRUEMaterialized view rewrite TRUE
PARAMETER VALUE---------------------------------------- --------------------Database resource manager TRUESpatial TRUEAutomatic Storage Management FALSEExport transportable tablespaces TRUETransparent Application Failover TRUEFast-Start Fault Recovery TRUESample Scan TRUEDuplexed backups TRUEJava TRUEOLAP Window Functions TRUEBlock Media Recovery TRUE
PARAMETER VALUE---------------------------------------- --------------------Fine-grained Auditing TRUEApplication Role TRUEEnterprise User Security TRUEOracle Data Guard TRUEOracle Label Security FALSEOLAP TRUEBasic Compression TRUEJoin index TRUETrial Recovery TRUEData Mining TRUEOnline Redefinition TRUE
PARAMETER VALUE---------------------------------------- --------------------Streams Capture TRUEFile Mapping TRUEBlock Change Tracking TRUEFlashback Table TRUEFlashback Database TRUETransparent Data Encryption TRUEBackup Encryption TRUEUnused Block Compression TRUEOracle Database Vault FALSEResult Cache TRUESQL Plan Management TRUE
PARAMETER VALUE---------------------------------------- --------------------SecureFiles Encryption TRUEReal Application Testing TRUEFlashback Data Archive TRUEDICOM TRUEActive Data Guard TRUEServer Flash Cache TRUEAdvanced Compression TRUEXStream TRUEDeferred Segment Creation TRUEData Redaction TRUE65 rows selected.
SQL> select * from v$version;BANNER--------------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - ProductionPL/SQL Release 11.2.0.4.0 - ProductionCORE 11.2.0.4.0 ProductionTNS for Linux: Version 11.2.0.4.0 - ProductionNLSRTL Version 11.2.0.4.0 - Production
6、安装实例情况7、查看alert文件
SQL> desc v$instance;Name Null? Type----------------------------------------------------- -------- ------------------------------------INSTANCE_NUMBER NUMBERINSTANCE_NAME VARCHAR2(16)HOST_NAME VARCHAR2(64)VERSION VARCHAR2(17)STARTUP_TIME DATESTATUS VARCHAR2(12)PARALLEL VARCHAR2(3)THREAD# NUMBERARCHIVER VARCHAR2(7)LOG_SWITCH_WAIT VARCHAR2(15)LOGINS VARCHAR2(10)SHUTDOWN_PENDING VARCHAR2(3)DATABASE_STATUS VARCHAR2(17)INSTANCE_ROLE VARCHAR2(18)ACTIVE_STATE VARCHAR2(9)BLOCKED VARCHAR2(3)SQL> select INSTANCE_NAME,HOST_NAME,INSTANCE_NUMBER,ARCHIVER from v$instance;INSTANCE_NAME HOST_NAME INSTANCE_NUMBER ARCHIVE---------------- -------------------- --------------- -------oracle strong33 1 STOPPED
[oracle@strong33 trace]$ cd /u01/app/oracle/diag/rdbms/oracle/oracle/traceoracle@strong33 trace]$ ls alert*.logalert_oracle.log[oracle@strong33 trace]$ tail -500 alert_oracle.log |moreORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1System name: LinuxNode name: strong33Release: 2.6.32-358.el6.i686Version: #1 SMP Tue Jan 29 11:48:01 EST 2013Machine: i686VM name: VMWare Version: 6Using parameter settings in server-side spfile /u01/app/oracle/product/11.2.0/db_1/dbs/spfileoracle.oraSystem parameters with non-default values:processes = 150memory_target = 756Mcontrol_files = "/u01/app/oracle/oradata/oracle/control01.ctl"control_files = "/u01/app/oracle/fast_recovery_area/oracle/control02.ctl"db_block_size = 8192compatible = "11.2.0.4.0"log_archive_start = TRUEdb_recovery_file_dest = "/u01/app/oracle/fast_recovery_area"db_recovery_file_dest_size= 4152Mundo_tablespace = "UNDOTBS1"remote_login_passwordfile= "EXCLUSIVE"db_domain = ""dispatchers = "(PROTOCOL=TCP) (SERVICE=oracleXDB)"audit_file_dest = "/u01/app/oracle/admin/oracle/adump"audit_trail = "DB"db_name = "oracle"open_cursors = 300diagnostic_dest = "/u01/app/oracle"Deprecated system parameters with specified values:log_archive_startEnd of deprecated system parameter listingWed Jun 21 14:52:55 2017PMON started with pid=2, OS id=19825Wed Jun 21 14:52:55 2017PSP0 started with pid=3, OS id=19827Wed Jun 21 14:52:56 2017VKTM started with pid=4, OS id=19829VKTM running at (100ms) precisionWed Jun 21 14:52:56 2017GEN0 started with pid=5, OS id=19833Wed Jun 21 14:52:56 2017DIAG started with pid=6, OS id=19835Wed Jun 21 14:52:56 2017DBRM started with pid=7, OS id=19837Wed Jun 21 14:52:56 2017DIA0 started with pid=8, OS id=19839Wed Jun 21 14:52:56 2017MMAN started with pid=9, OS id=19841Wed Jun 21 14:52:56 2017DBW0 started with pid=10, OS id=19843Wed Jun 21 14:52:56 2017LGWR started with pid=11, OS id=19845Wed Jun 21 14:52:56 2017CKPT started with pid=12, OS id=19847Wed Jun 21 14:52:56 2017SMON started with pid=13, OS id=19849Wed Jun 21 14:52:56 2017RECO started with pid=14, OS id=19851Wed Jun 21 14:52:56 2017MMON started with pid=15, OS id=19853starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...Wed Jun 21 14:52:56 2017MMNL started with pid=16, OS id=19855starting up 1 shared server(s) ...Nomount状态下,不打开任何的控制文件及数据文件
SQL> select * from v$database;select * from v$database*ERROR at line 1:ORA-01507: database not mountedmount:读并打开控制文件,并确认到database的结构信息SQL> desc v$database;SP2-0565: Illegal identifier.
nomount→mount过程:
1、 打开控制文件
SQL> select * from v$controlfile;STATUS NAME IS_ BLOCK_SIZE FILE_SIZE_BLKS------- ------------------------------------------------------------ --- ---------- --------------/u01/app/oracle/oradata/oracle/control01.ctl NO 16384 594/u01/app/oracle/fast_recovery_area/oracle/control02.ctl NO 16384 594
2、 确认 database数据库的结构信息
SQL> desc v$database;Name Null? Type----------------------------------------------------- -------- ------------------------------------DBID NUMBERNAME VARCHAR2(9)CREATED DATERESETLOGS_CHANGE# NUMBERRESETLOGS_TIME DATEPRIOR_RESETLOGS_CHANGE# NUMBERPRIOR_RESETLOGS_TIME DATELOG_MODE VARCHAR2(12)CHECKPOINT_CHANGE# NUMBERARCHIVE_CHANGE# NUMBERCONTROLFILE_TYPE VARCHAR2(7)CONTROLFILE_CREATED DATECONTROLFILE_SEQUENCE# NUMBERCONTROLFILE_CHANGE# NUMBERCONTROLFILE_TIME DATEOPEN_RESETLOGS VARCHAR2(11)VERSION_TIME DATEOPEN_MODE VARCHAR2(20)PROTECTION_MODE VARCHAR2(20)PROTECTION_LEVEL VARCHAR2(20)REMOTE_ARCHIVE VARCHAR2(8)ACTIVATION# NUMBERSWITCHOVER# NUMBERDATABASE_ROLE VARCHAR2(16)ARCHIVELOG_CHANGE# NUMBERARCHIVELOG_COMPRESSION VARCHAR2(8)SWITCHOVER_STATUS VARCHAR2(20)DATAGUARD_BROKER VARCHAR2(8)GUARD_STATUS VARCHAR2(7)SUPPLEMENTAL_LOG_DATA_MIN VARCHAR2(8)SUPPLEMENTAL_LOG_DATA_PK VARCHAR2(3)SUPPLEMENTAL_LOG_DATA_UI VARCHAR2(3)FORCE_LOGGING VARCHAR2(3)PLATFORM_ID NUMBERPLATFORM_NAME VARCHAR2(101)RECOVERY_TARGET_INCARNATION# NUMBERLAST_OPEN_INCARNATION# NUMBERCURRENT_SCN NUMBERFLASHBACK_ON VARCHAR2(18)SUPPLEMENTAL_LOG_DATA_FK VARCHAR2(3)SUPPLEMENTAL_LOG_DATA_ALL VARCHAR2(3)DB_UNIQUE_NAME VARCHAR2(30)STANDBY_BECAME_PRIMARY_SCN NUMBERFS_FAILOVER_STATUS VARCHAR2(22)FS_FAILOVER_CURRENT_TARGET VARCHAR2(30)FS_FAILOVER_THRESHOLD NUMBERFS_FAILOVER_OBSERVER_PRESENT VARCHAR2(7)FS_FAILOVER_OBSERVER_HOST VARCHAR2(512)CONTROLFILE_CONVERTED VARCHAR2(3)PRIMARY_DB_UNIQUE_NAME VARCHAR2(30)SUPPLEMENTAL_LOG_DATA_PL VARCHAR2(3)MIN_REQUIRED_CAPTURE_CHANGE# NUMBER
mount过程可以访问的动态性能视图:v$thread,v$controlfile,v$database,v$datafile,v$datafile_header,v$logfile3、查看线程结构4、查看数据文件结构
SQL> desc v$thread;Name Null? Type----------------------------------------------------- -------- ------------------------------------THREAD# NUMBERSTATUS VARCHAR2(6)ENABLED VARCHAR2(8)GROUPS NUMBERINSTANCE VARCHAR2(80)OPEN_TIME DATECURRENT_GROUP# NUMBERSEQUENCE# NUMBERCHECKPOINT_CHANGE# NUMBERCHECKPOINT_TIME DATEENABLE_CHANGE# NUMBERENABLE_TIME DATEDISABLE_CHANGE# NUMBERDISABLE_TIME DATELAST_REDO_SEQUENCE# NUMBERLAST_REDO_BLOCK NUMBERLAST_REDO_CHANGE# NUMBERLAST_REDO_TIME DATE
SQL> desc v$datafile;Name Null? Type----------------------------------------------------- -------- ------------------------------------FILE# NUMBERCREATION_CHANGE# NUMBERCREATION_TIME DATETS# NUMBERRFILE# NUMBERSTATUS VARCHAR2(7)ENABLED VARCHAR2(10)CHECKPOINT_CHANGE# NUMBERCHECKPOINT_TIME DATEUNRECOVERABLE_CHANGE# NUMBERUNRECOVERABLE_TIME DATELAST_CHANGE# NUMBERLAST_TIME DATEOFFLINE_CHANGE# NUMBERONLINE_CHANGE# NUMBERONLINE_TIME DATEBYTES NUMBERBLOCKS NUMBERCREATE_BYTES NUMBERBLOCK_SIZE NUMBERNAME VARCHAR2(513)PLUGGED_IN NUMBERBLOCK1_OFFSET NUMBERAUX_NAME VARCHAR2(513)FIRST_NONLOGGED_SCN NUMBERFIRST_NONLOGGED_TIME DATEFOREIGN_DBID NUMBERFOREIGN_CREATION_CHANGE# NUMBERFOREIGN_CREATION_TIME DATEPLUGGED_READONLY VARCHAR2(3)PLUGIN_CHANGE# NUMBERPLUGIN_RESETLOGS_CHANGE# NUMBERPLUGIN_RESETLOGS_TIME DATE
5、日志文件
SQL> select * from v$logfile;GROUP# STATUS TYPE MEMBER IS_---------- ------- ------- -------------------------------------------------- ---3 ONLINE /u01/app/oracle/oradata/oracle/redo03.log NO2 ONLINE /u01/app/oracle/oradata/oracle/redo02.log NO1 ONLINE /u01/app/oracle/oradata/oracle/redo01.log NO
mount→open过程:一致性校验
SQL> select INSTANCE_NAME,STATUS from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
Oracle OPEN
当数据库 Open 之后,所有的动态性能视图和数据字典都可以被查询。
欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2