注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

涅槃

文档收藏

 
 
 

日志

 
 
 
 

【转载】Oracle 11gR2 ASM管理 - 学习  

2014-04-08 12:08:24|  分类: oracle_rac |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
                 环境按装好了,总归要学习下,虽然公司现在是不用ASM(泰国那边有用,中国这边应该也会考虑用的吧)
参考书籍-  Oracle 文档 Part Number E18951-02 Oracle? Automatic Storage Management Administrator's Guide 11g Release 2 (11.2)
目录如下,大致看了下,了解个基本概念,真正用到时再参考咯。

·  Introduction to Oracle Automatic Storage Management

·  Considerations for Oracle ASM Storage

·  Administering Oracle ASM Instances

·  Administering Oracle ASM Disk Groups

·  Introduction to Oracle ACFS

·  Using Views to Display Information

·  Administering Oracle ASM Files, Directories, and Templates

·  Performing Oracle ASM Data Migration with RMAN

·  Administering Oracle ASM with Oracle Enterprise Manager

·  Administering Oracle ACFS with Oracle Enterprise Manager

·  Oracle ASM Configuration Assistant

·  Oracle ASM Command-Line Utility

·  Oracle ACFS Command-Line Tools

·  Creating Database Files in Oracle ASM Using SQL*Plus

·  Oracle ACFS Advanced Topics


1. 管理Oracle ASM实例

1) 配置参数
2) 管理实例: Server Control Utility (SRVCTL) , Oracle Restart, 开启和关闭, Upgrading/Downgrading
3) ASM滚动升级
4) 给ASM实例打补丁
5) 授权访问实例
6) 移植数据库到ASM


练习如下:

[grid@suzdrdfst01 dbs]$ ls -lrt

total 40

-rw-r--r--  1 grid dba 2851 May 15  2009 init.ora

-rw-rw----  1 grid dba 1544 Dec 30 13:54 hc_+ASM.dat

-rw-rw----  1 grid dba 1869 Dec 30 13:55 ab_+ASM.dat

-rw-r-----  1 grid dba 1536 Dec 30 13:55 orapw+ASM

-rw-r--r--  1 grid dba  138 Dec 30 14:06 init+ASM.ora

[grid@suzdrdfst01 dbs]$ cat init+ASM.ora

*.asm_power_limit=1

*.diagnostic_dest='/u01/app/grid'

*.instance_type='asm'

*.large_pool_size=12M

*.remote_login_passwordfile='EXCLUSIVE'

[grid@suzdrdfst01 ~]$ sqlplus '/ as sysasm'

SQL*Plus: Release 11.2.0.2.0 Production on Wed Jan 4 15:46:14 2012

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production

With the Automatic Storage Management option

SQL> show parameter spfile;

NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

spfile                                                          string                +DATA/asm/asmparameterfile/reg

                                                                                                 istry.253.771256507

SQL>  create spfile='$ORACLE_HOME/dbs/spfile+ASM.ora' from pfile;    

 File created. 


-rw-r--r--  1 grid dba  138 Dec 30 14:06 init+ASM.ora

-rw-r-----  1 grid dba 1536 Jan  4 15:48 spfile+ASM.ora

 SQL> show parameter memory_max_target;

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

memory_max_target                         big integer 272M

SQL> show parameter sga_target;

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

sga_target                                               big integer 0

SQL> show parameter memory_target;

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

memory_target                                                     big integer 272M

SQL> alter system set memory_target=0;

 System altered.

 SQL> show parameter memory_target;

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

memory_target                                                     big integer 0

SQL> show parameter asm_diskgroups

NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

asm_diskgroups                                                    string

SQL> show parameter asm_diskstring

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

asm_diskstring                                       string

SQL> show parameter asm_power_limit

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

asm_power_limit                                 integer            1

SQL> show parameter asm_preferred_read_failure_groups

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

asm_preferred_read_failure_groups    string

SQL> show parameter db_cache_size

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

db_cache_size                                       big integer 0

SQL> show parameter diagnostic_dest

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

diagnostic_dest                                     string                /u01/app/grid

SQL> show parameter instance_type

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

instance_type                                        string                asm

SQL> show parameter large_pool_size

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

large_pool_size                                     big integer 12M

SQL> show parameter processes

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

processes                                                 integer            100

SQL> show parameter remote_login_passwordfile

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

remote_login_passwordfile             string                EXCLUSIVE

SQL> show parameter shared_pool_size

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

shared_pool_size                                 big integer 0

[grid@suzdrdfst01 dbs]$ crs_stat -t

Name           Type           Target    State     Host       

------------------------------------------------------------

ora.DATA.dg    ora....up.type ONLINE    ONLINE    suzdrdfst01

ora.asm        ora.asm.type   ONLINE    ONLINE    suzdrdfst01

ora.cssd       ora.cssd.type  ONLINE    ONLINE    suzdrdfst01

ora.dfsdc.db   ora....se.type ONLINE    ONLINE    suzdrdfst01

ora.diskmon    ora....on.type ONLINE    ONLINE    suzdrdfst01

ora.evmd       ora.evm.type   ONLINE    ONLINE    suzdrdfst01

ora.ons        ora.ons.type   OFFLINE   OFFLINE

[oracle@suzdrdfst01 ~]$ sqlplus '/ as sysdba'

 SQL*Plus: Release 11.2.0.2.0 Production on Wed Jan 4 16:25:55 2012

 Copyright (c) 1982, 2010, Oracle.  All rights reserved.

 Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

 SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

[oracle@suzdrdfst01 ~]$ ps -ef|grep -i oracle

oracle    4657     1  0 16:26 ?        00:00:00 oracledfsdc (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

grid      9911     1  0 Jan01 ?        00:00:00 oracle+ASM (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

[grid@suzdrdfst01 dbs]$ crs_stat -t

Name           Type           Target    State     Host       

------------------------------------------------------------

ora.DATA.dg    ora....up.type ONLINE    ONLINE    suzdrdfst01

ora.asm        ora.asm.type   ONLINE    ONLINE    suzdrdfst01

ora.cssd       ora.cssd.type  ONLINE    ONLINE    suzdrdfst01

ora.dfsdc.db   ora....se.type OFFLINE   OFFLINE               

ora.diskmon    ora....on.type ONLINE    ONLINE    suzdrdfst01

ora.evmd       ora.evm.type   ONLINE    ONLINE    suzdrdfst01

ora.ons        ora.ons.type   OFFLINE   OFFLINE

[grid@suzdrdfst01 dbs]$ crs_stop -all

CRS-2500: Cannot stop resource 'ora.dfsdc.db' as it is not running

CRS-2500: Cannot stop resource 'ora.ons' as it is not running

Attempting to stop `ora.DATA.dg` on member `suzdrdfst01`

Attempting to stop `ora.diskmon` on member `suzdrdfst01`

Attempting to stop `ora.evmd` on member `suzdrdfst01`

Stop of `ora.DATA.dg` on member `suzdrdfst01` succeeded.

Attempting to stop `ora.asm` on member `suzdrdfst01`

Stop of `ora.evmd` on member `suzdrdfst01` succeeded.

Stop of `ora.diskmon` on member `suzdrdfst01` succeeded.

Stop of `ora.asm` on member `suzdrdfst01` succeeded.

Attempting to stop `ora.cssd` on member `suzdrdfst01`

Stop of `ora.cssd` on member `suzdrdfst01` succeeded.

CRS-0216: Could not stop resource 'ora.dfsdc.db'.

 CRS-0216: Could not stop resource 'ora.ons'.

[grid@suzdrdfst01 dbs]$ crs_stat -t

Name           Type           Target    State     Host       

------------------------------------------------------------

ora.DATA.dg    ora....up.type OFFLINE   OFFLINE               

ora.asm        ora.asm.type   OFFLINE   OFFLINE              

ora.cssd       ora.cssd.type  OFFLINE   OFFLINE              

ora.dfsdc.db   ora....se.type OFFLINE   OFFLINE              

ora.diskmon    ora....on.type OFFLINE   OFFLINE               

ora.evmd       ora.evm.type   OFFLINE   OFFLINE              

ora.ons        ora.ons.type   OFFLINE   OFFLINE

[grid@suzdrdfst01 dbs]$ ps -eaf|grep -i grid

grid      9873     1  1 Jan01 ?        01:05:08 /u01/app/grid/product/11.2.0/grid/bin/oraagent.bin

grid     24620     1  0  2011 ?        00:00:00 /u01/app/grid/product/11.2.0/grid/bin/tnslsnr LISTENER -inherit

grid     25044     1  0  2011 ?        00:47:32 /u01/app/grid/product/11.2.0/grid/bin/ohasd.bin reboot

 [grid@suzdrdfst01 dbs]$ sqlplus '/ as sysdba'

 SQL*Plus: Release 11.2.0.2.0 Production on Wed Jan 4 16:35:43 2012

 Copyright (c) 1982, 2010, Oracle.  All rights reserved.

 Connected to an idle instance.

 SQL> startup

ORA-01078: failure in processing system parameters

ORA-29701: unable to connect to Cluster Synchronization Service

SQL> exit

Disconnected

[grid@suzdrdfst01 dbs]$ crs_start -all

CRS-2501: Resource 'ora.ons' is disabled

Attempting to start `ora.cssd` on member `suzdrdfst01`

Attempting to start `ora.diskmon` on member `suzdrdfst01`

Attempting to start `ora.evmd` on member `suzdrdfst01`

Start of `ora.evmd` on member `suzdrdfst01` succeeded.

Start of `ora.diskmon` on member `suzdrdfst01` succeeded.

Start of `ora.cssd` on member `suzdrdfst01` succeeded.

Attempting to start `ora.asm` on member `suzdrdfst01`

Start of `ora.asm` on member `suzdrdfst01` succeeded.

Attempting to start `ora.DATA.dg` on member `suzdrdfst01`

Start of `ora.DATA.dg` on member `suzdrdfst01` succeeded.

Attempting to start `ora.dfsdc.db` on member `suzdrdfst01`

CRS-5010: Update of configuration file "/u01/app/oracle/product/11.2.0/srvm/admin/oratab.bak.suzdrdfst01" failed: details at "(:CLSN00011:)" in "/u01/app/grid/product/11.2.0/grid/log/suzdrdfst01/agent/ohasd/oraagent_grid/oraagent_grid.log"

Start of `ora.dfsdc.db` on member `suzdrdfst01` succeeded.

CRS-2660: Resource 'ora.ons' or all of its instances are disabled

[grid@suzdrdfst01 dbs]$ crs_stat -t

Name           Type           Target    State     Host       

------------------------------------------------------------

ora.DATA.dg    ora....up.type ONLINE    ONLINE    suzdrdfst01

ora.asm        ora.asm.type   ONLINE    ONLINE    suzdrdfst01

ora.cssd       ora.cssd.type  ONLINE    ONLINE    suzdrdfst01

ora.dfsdc.db   ora....se.type ONLINE    ONLINE    suzdrdfst01

ora.diskmon    ora....on.type ONLINE    ONLINE    suzdrdfst01

ora.evmd       ora.evm.type   ONLINE    ONLINE    suzdrdfst01

ora.ons        ora.ons.type   OFFLINE   OFFLINE

[grid@suzdrdfst01 dbs]$ srvctl status

Usage: srvctl <command> <object> [<options>]

    commands: enable|disable|start|stop|status|add|remove|modify|getenv|setenv|unsetenv|config

    objects: database|service|asm|diskgroup|listener|home|ons

For detailed help on each command and object and its options use:

  srvctl <command> -h or

  srvctl <command> <object> -h

[grid@suzdrdfst01 dbs]$ srvctl status listneer

Usage: srvctl <command> <object> [<options>]

    commands: enable|disable|start|stop|status|add|remove|modify|getenv|setenv|unsetenv|config

    objects: database|service|asm|diskgroup|listener|home|ons

For detailed help on each command and object and its options use:

  srvctl <command> -h or

  srvctl <command> <object> -h

PRKO-2011 : Invalid object specified on command line: listneer

[grid@suzdrdfst01 dbs]$ srvctl status listener

PRCN-2044 : No listener exists

[grid@suzdrdfst01 dbs]$ srvctl status asm

ASM is running on suzdrdfst01

ldb@suztestldb:/u01/usr/ldb/sql>> sqlplus sys@dfsdc as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Wed Jan 4 16:47:21 2012

 Copyright (c) 1982, 2009, Oracle.  All rights reserved.

 Enter password:

 Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

 sys@DFSDC(10.40.102.137)> show user;

USER is "SYS"

ldb@suztestldb:/u01/usr/ldb/sql>> sqlplus sys@+asm as sysasm

 SQL*Plus: Release 11.2.0.1.0 Production on Wed Jan 4 16:49:41 2012

 Copyright (c) 1982, 2009, Oracle.  All rights reserved.

 Enter password:

 Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production

With the Automatic Storage Management option

 > show user;

USER is "SYS"

> @id

+ASM       suzdrdfst01

 

2. 操作Oracle ASM数据库实例

[grid@suzdrdfst01 ~]$ sqlplus '/ as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Thu Jan 5 09:26:53 2012
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Automatic Storage Management option

SQL> select name,header_status,path from v$asm_disk;

NAME                   HEADER_STATUS             PATH

--------------- --------------- --------------------

DATA_VOL1       MEMBER                             ORCL:DATA_VOL1

DATA_VOL2       MEMBER                             ORCL:DATA_VOL2

 SQL> show parameter db_create_file_dest

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

db_create_file_dest                           string                +DATA

SQL> select tablespace_name from dba_tablespaces;

 TABLESPACE_NAME

------------------------------

SYSTEM

SYSAUX

UNDOTBS1

TEMP

USERS

 SQL> create tablespace tools;

 Tablespace created.

SQL> select file_name,bytes/(1024*1024) from dba_data_files where tablespace_name='TOOLS';

 FILE_NAME                                                        BYTES/(1024*1024)

---------------------------------------- -----------------

+DATA/dfsdc/datafile/tools.266.771757605                100

SQL> select group#,thread#,bytes,status from v$log;

     GROUP#    THREAD#      BYTES STATUS

---------- ---------- ---------- ----------------

                 1                 1          52428800 CURRENT

                 2                 1          52428800 INACTIVE

                 3                 1          52428800 INACTIVE

SQL> select * from v$logfile

     GROUP# STATUS  TYPE    MEMBER                                                                             IS_

---------- ------- ------- -------------------------------------------------- ---

                 3                ONLINE  +DATA/dfsdc/onlinelog/group_3.263.771257687                NO

                 2                ONLINE  +DATA/dfsdc/onlinelog/group_2.262.771257683                NO

                 1                ONLINE  +DATA/dfsdc/onlinelog/group_1.261.771257681                NO

 SQL> show parameter db_create_online_log_dest

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

db_create_online_log_dest_1       string

db_create_online_log_dest_2       string

db_create_online_log_dest_3       string

db_create_online_log_dest_4       string

db_create_online_log_dest_5       string

SQL> alter database add logfile;

 Database altered.

常见出来的redo log大小是100M

SQL> select * from v$logfile;

     GROUP# STATUS  TYPE    MEMBER                                                                             IS_

---------- ------- ------- -------------------------------------------------- ---

                 3                ONLINE  +DATA/dfsdc/onlinelog/group_3.263.771257687                NO

                 2                ONLINE  +DATA/dfsdc/onlinelog/group_2.262.771257683                NO

                 1               ONLINE  +DATA/dfsdc/onlinelog/group_1.261.771257681                NO

                 4                ONLINE  +DATA/dfsdc/onlinelog/group_4.267.771757843                NO

SQL> alter database add logfile group 5 ('+DATA/dfsdc/onlinelog/group_5.log') size 50m;

 Database altered.

 SQL> select * from v$logfile;

     GROUP# STATUS  TYPE    MEMBER                                                                             IS_

---------- ------- ------- -------------------------------------------------- ---

                 3                ONLINE  +DATA/dfsdc/onlinelog/group_3.263.771257687                NO

                 2                ONLINE  +DATA/dfsdc/onlinelog/group_2.262.771257683                NO

                 1                ONLINE  +DATA/dfsdc/onlinelog/group_1.261.771257681                NO

                 4                ONLINE  +DATA/dfsdc/onlinelog/group_4.267.771757843                NO

                 5                ONLINE  +DATA/dfsdc/onlinelog/group_5.log                       NO

SQL> show parameter control_file;

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

control_file_record_keep_time                     integer            7

control_files                                            string                +DATA/dfsdc/controlfile/current.260.771257675

SQL> alter database backup controlfile to trace;

 Database altered.

SQL>  show parameter background_dump_dest

 NAME                                                        TYPE VALUE

------------------------------------ ----------- ------------------------------

background_dump_dest                                   string                /u01/app/oracle/diag/rdbms/dfsdc/dfsdc/trace

SQL> !ls -lrt /u01/app/oracle/diag/rdbms/dfsdc/dfsdc/trace |tail -2

-rw-r-----  1 oracle asmadmin   6978 Jan  5 09:15 dfsdc_ora_31989.trc

-rw-r-----  1 oracle asmadmin  39269 Jan  5 09:15 alert_dfsdc.log

SQL> !cat /u01/app/oracle/diag/rdbms/dfsdc/dfsdc/trace/dfsdc_ora_31989.trc

Trace file /u01/app/oracle/diag/rdbms/dfsdc/dfsdc/trace/dfsdc_ora_31989.trc

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

ORACLE_HOME = /u01/app/oracle/product/11.2.0

System name:   Linux

Node name:       suzdrdfst01

Release:               2.6.9-55.ELsmp

Version:               #1 SMP Wed May 2 14:28:44 EDT 2007

Machine:             i686

Instance name: dfsdc

Redo thread mounted by this instance: 1

Oracle process number: 30

Unix process pid: 31989, image: oracle@suzdrdfst01 (TNS V1-V3)

 

 

*** 2012-01-05 09:15:40.838

*** SESSION ID:(138.2661) 2012-01-05 09:15:40.838

*** CLIENT ID:() 2012-01-05 09:15:40.838

*** SERVICE NAME:(SYS$USERS) 2012-01-05 09:15:40.838

*** MODULE NAME:(sqlplus@suzdrdfst01 (TNS V1-V3)) 2012-01-05 09:15:40.838

*** ACTION NAME:() 2012-01-05 09:15:40.838

 

-- The following are current System-scope REDO Log Archival related

-- parameters and can be included in the database initialization file.

--

-- LOG_ARCHIVE_DEST=''

-- LOG_ARCHIVE_DUPLEX_DEST=''

--

-- LOG_ARCHIVE_FORMAT=%t_%s_%r.dbf

--

-- DB_UNIQUE_NAME="dfsdc"

--

-- LOG_ARCHIVE_CONFIG='SEND, RECEIVE, NODG_CONFIG'

-- LOG_ARCHIVE_MAX_PROCESSES=4

-- STANDBY_FILE_MANAGEMENT=MANUAL

-- STANDBY_ARCHIVE_DEST=?/dbs/arch

-- FAL_CLIENT=''

-- FAL_SERVER=''

--

-- LOG_ARCHIVE_DEST_1='LOCATION=/u01/app/oracle/product/11.2.0/dbs/arch'

-- LOG_ARCHIVE_DEST_1='MANDATORY NOREOPEN NODELAY'

-- LOG_ARCHIVE_DEST_1='ARCH NOAFFIRM EXPEDITE NOVERIFY SYNC'

-- LOG_ARCHIVE_DEST_1='NOREGISTER NOALTERNATE NODEPENDENCY'

-- LOG_ARCHIVE_DEST_1='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED NODB_UNIQUE_NAME'

-- LOG_ARCHIVE_DEST_1='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)'

-- LOG_ARCHIVE_DEST_STATE_1=ENABLE

--

-- Below are two sets of SQL statements, each of which creates a new

-- control file and uses it to open the database. The first set opens

-- the database with the NORESETLOGS option and should be used only if

-- the current versions of all online logs are available. The second

-- set opens the database with the RESETLOGS option and should be used

-- if online logs are unavailable.

-- The appropriate set of statements can be copied from the trace into

-- a script file, edited as necessary, and executed when there is a

-- need to re-create the control file.

--

--     Set #1. NORESETLOGS case

--

-- The following commands will create a new control file and use it

-- to open the database.

-- Data used by Recovery Manager will be lost.

-- Additional logs may be required for media recovery of offline

-- Use this only if the current versions of all online logs are

-- available.

-- After mounting the created controlfile, the following SQL

-- statement will place the database in the appropriate

-- protection mode:

--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE

STARTUP NOMOUNT

CREATE CONTROLFILE REUSE DATABASE "DFSDC" NORESETLOGS  NOARCHIVELOG

    MAXLOGFILES 16

    MAXLOGMEMBERS 3

    MAXDATAFILES 100

    MAXINSTANCES 8

    MAXLOGHISTORY 292

LOGFILE

  GROUP 1 '+DATA/dfsdc/onlinelog/group_1.261.771257681'  SIZE 50M BLOCKSIZE 512,

  GROUP 2 '+DATA/dfsdc/onlinelog/group_2.262.771257683'  SIZE 50M BLOCKSIZE 512,

  GROUP 3 '+DATA/dfsdc/onlinelog/group_3.263.771257687'  SIZE 50M BLOCKSIZE 512,

  GROUP 4 '+DATA/dfsdc/onlinelog/group_4.267.771757843'  SIZE 100M BLOCKSIZE 512,

  GROUP 5 '+DATA/dfsdc/onlinelog/group_5.log'  SIZE 50M BLOCKSIZE 512

-- STANDBY LOGFILE

DATAFILE

  '+DATA/dfsdc/datafile/system.256.771257539',

  '+DATA/dfsdc/datafile/sysaux.257.771257539',

  '+DATA/dfsdc/datafile/undotbs1.258.771257539',

  '+DATA/dfsdc/datafile/users.259.771257539',

  '+DATA/dfsdc/datafile/tools.266.771757605'

CHARACTER SET WE8MSWIN1252

;

-- Commands to re-create incarnation table

-- Below log names MUST be changed to existing filenames on

-- disk. Any one log file from each branch can be used to

-- re-create incarnation records.

-- ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/product/11.2.0/dbs/arch1_1_728926788.dbf';

-- ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/product/11.2.0/dbs/arch1_1_771257680.dbf';

-- Recovery is required if any of the datafiles are restored backups,

-- or if the last shutdown was not normal or immediate.

RECOVER DATABASE

-- Database can now be opened normally.

ALTER DATABASE OPEN;

-- Commands to add tempfiles to temporary tablespaces.

-- Online tempfiles have complete space information.

-- Other tempfiles may require adjustment.

ALTER TABLESPACE TEMP ADD TEMPFILE '+DATA/dfsdc/tempfile/temp.264.771257699'

     SIZE 20971520  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;

-- End of tempfile additions.

--

--     Set #2. RESETLOGS case

--

-- The following commands will create a new control file and use it

-- to open the database.

-- Data used by Recovery Manager will be lost.

-- The contents of online logs will be lost and all backups will

-- be invalidated. Use this only if online logs are damaged.

-- After mounting the created controlfile, the following SQL

-- statement will place the database in the appropriate

-- protection mode:

--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE

STARTUP NOMOUNT

CREATE CONTROLFILE REUSE DATABASE "DFSDC" RESETLOGS  NOARCHIVELOG

    MAXLOGFILES 16

    MAXLOGMEMBERS 3

    MAXDATAFILES 100

    MAXINSTANCES 8

    MAXLOGHISTORY 292

LOGFILE

  GROUP 1 '+DATA/dfsdc/onlinelog/group_1.261.771257681'  SIZE 50M BLOCKSIZE 512,

  GROUP 2 '+DATA/dfsdc/onlinelog/group_2.262.771257683'  SIZE 50M BLOCKSIZE 512,

  GROUP 3 '+DATA/dfsdc/onlinelog/group_3.263.771257687'  SIZE 50M BLOCKSIZE 512,

  GROUP 4 '+DATA/dfsdc/onlinelog/group_4.267.771757843'  SIZE 100M BLOCKSIZE 512,

  GROUP 5 '+DATA/dfsdc/onlinelog/group_5.log'  SIZE 50M BLOCKSIZE 512

-- STANDBY LOGFILE

DATAFILE

  '+DATA/dfsdc/datafile/system.256.771257539',

  '+DATA/dfsdc/datafile/sysaux.257.771257539',

  '+DATA/dfsdc/datafile/undotbs1.258.771257539',

  '+DATA/dfsdc/datafile/users.259.771257539',

  '+DATA/dfsdc/datafile/tools.266.771757605'

CHARACTER SET WE8MSWIN1252

;

-- Commands to re-create incarnation table

-- Below log names MUST be changed to existing filenames on

-- disk. Any one log file from each branch can be used to

-- re-create incarnation records.

-- ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/product/11.2.0/dbs/arch1_1_728926788.dbf';

-- ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/product/11.2.0/dbs/arch1_1_771257680.dbf';

-- Recovery is required if any of the datafiles are restored backups,

-- or if the last shutdown was not normal or immediate.

RECOVER DATABASE USING BACKUP CONTROLFILE

-- Database can now be opened zeroing the online logs.

ALTER DATABASE OPEN RESETLOGS;

-- Commands to add tempfiles to temporary tablespaces.

-- Online tempfiles have complete space information.

-- Other tempfiles may require adjustment.

ALTER TABLESPACE TEMP ADD TEMPFILE '+DATA/dfsdc/tempfile/temp.264.771257699'

     SIZE 20971520  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;

-- End of tempfile additi ons.

--

 [root@suzdrdfst01 usr]# /etc/init.d/oracleasm createdisk data_vol3 /dev/cciss/c0d0p8

Marking disk "data_vol3" as an ASM disk:                   [  OK  ]

[root@suzdrdfst01 usr]#  /etc/init.d/oracleasm createdisk data_vol4 /dev/cciss/c0d0p9

Marking disk "data_vol4" as an ASM disk:                   [  OK  ]

 [grid@suzdrdfst01 ~]$ export DISPLAY=10.40.33.67:0.0

[grid@suzdrdfst01 ~]$ asmca

Oracle 11gR2 ASM管理学习 - 香生 - 香生的世界
 

SQL> select name,header_status,path from v$asm_disk;

 NAME      HEADER_STATUS   PATH

---------- --------------- ------------------------------

                   PROVISIONED                   ORCL:DATA_VOL3

                   PROVISIONED                   ORCL:DATA_VOL4

DATA_VOL1  MEMBER      ORCL:DATA_VOL1

DATA_VOL2  MEMBER      ORCL:DATA_VOL2


  评论这张
 
阅读(816)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018