SQL> show parameter recovery
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string +RAC_DISK
db_recovery_file_dest_size big integer 2G
recovery_parallelism integer 0
SQL> create pfile='/home/oracle/initRACDB.ora.pfile' from spfile;
File created.
文件名必须加 single quotation marks
SQL> create pfile=/home/oracle/initRACDB.ora.pfile from spfile;
create pfile=/home/oracle/initRACDB.ora.pfile from spfile
ERROR at line 1:
ORA-02236: invalid file name
查看 spfile的内容。
[oracle@rac1 ~]$ cat initRACDB.ora.pfile
RACDB1.__db_cache_size=155189248
RACDB2.__db_cache_size=75497472
RACDB1.__java_pool_size=4194304
RACDB2.__java_pool_size=4194304
RACDB1.__large_pool_size=4194304
RACDB2.__large_pool_size=4194304
RACDB1.__shared_pool_size=71303168
RACDB2.__shared_pool_size=150994944
RACDB1.__streams_pool_size=0
RACDB2.__streams_pool_size=0
*.audit_file_dest='/opt/ora10g/admin/RACDB/adump'
*.background_dump_dest='/opt/ora10g/admin/RACDB/bdump'
*.cluster_database_instances=2
*.cluster_database=true
*.compatible='10.2.0.1.0'
*.control_files='+RAC_DISK/racdb/controlfile/current.256.738883677','+RAC_DISK/racdb/controlfile/current.257.738883683'
*.core_dump_dest='/opt/ora10g/admin/RACDB/cdump'
*.db_block_size=8192
*.db_create_file_dest='+RAC_DISK'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='RACDB'
*.db_recovery_file_dest='+RAC_DISK'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=RACDBXDB)'
RACDB2.instance_number=2
RACDB1.instance_number=1
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=79691776
*.processes=150
*.remote_listener='LISTENERS_RACDB'
*.remote_login_passwordfile='exclusive'
*.sga_target=240123904
RACDB2.thread=2
RACDB1.thread=3
*.undo_management='AUTO'
RACDB2.undo_tablespace='UNDOTBS2'
RACDB1.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/opt/ora10g/admin/RACDB/udump'
[oracle@rac1 bin]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....B1.inst application ONLINE ONLINE rac1
ora....B2.inst application ONLINE ONLINE rac2
ora.RACDB.db application ONLINE ONLINE rac2
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> !
[oracle@rac1 bin]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....B1.inst application OFFLINE OFFLINE
ora....B2.inst application ONLINE ONLINE rac2
ora.RACDB.db application ONLINE ONLINE rac2
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
RACDB1:
SQL> startup mount
ORACLE instance started.
Database mounted.
SQL> ALTER DATABASE archivelog;
Database altered.
RACDB2: Attention, shutdown all the other nodes not start mount them!
SQL> shutdown immediate;
Finally:
RACDB1:
SQL> alter database flashback on;
Database altered.
SQL> alter database open;
Database altered.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 1
Next log sequence to archive 2
Current log sequence 2
Then open the database and startup other intances.
View the FALSHBACK Recovery area directory in ASM diskgroup
[oracle@rac2 bin]$ export ORACLE_SID=+ASM2
[oracle@rac2 bin]$ asmcmd
ASMCMD> ls
CONTROLFILE/
DATAFILE/
FLASHBACK/ -- 新增加的目录通过 alter database flashback on;
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
spfileRACDB.ora
ASMCMD> cd FLASHBACK
ASMCMD> ls -l
Type Redund Striped Time Sys Name
FLASHBACK UNPROT FINE JAN 06 14:00:00 Y log_1.277.739720983
ASMCMD> pwd
+RAC_DISK/RACDB/FLASHBACK (this diretory is created automatically ,don't create it yourself)
--------------------------------------------------------------------------------------------------------------------------------
Some useful error message when set flashback=on
database must set to archive log mode before performing the step
SQL> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38707: Media recovery is not enabled
All the othe instances should be shutdown
SQL> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38777: database must not be started in any other instance.
Database must be mounted and not opened if set to archivlog mode。
SQL> ALTER DATABASE archivelog;
ALTER DATABASE archivelog
*
ERROR at line 1:
ORA-01126: database must be mounted in this instance and not open in any
instance
Database must be mounted and not opened if set flashback on 。
SQL> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-01126: database must be mounted in this instance and not open in any
instance
RACDB1 : instance1 Total System Global Area 243269632 bytes Fixed Size 1218724 bytes Variable Size 109053788 bytes Database Buffers 125829120 bytes Redo Buffers 7168000 bytes | RACDB2 : instance2 SQL> show sga; Total System Global Area 243269632 bytes Fixed Size 1218724 bytes Variable Size 176162652 bytes Database Buffers 58720256 bytes Redo Buffers 7168000 bytes
|
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24933693/viewspace-683370/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/24933693/viewspace-683370/