Set pagesize 999 linesize777 Col member for a65 SQL> select l.group#,l.thread#, bytes/1024.1024, a.member from v$log l, v$logfile a wherel.group#=a.group#; GROUP# THREAD# BYTES/1024.1024 MEMBER ---------- ---------------------------------------------------------------------------------------------------- 1 1 51194.8805 /data/app/oracle/oradata/redo01.log 1 1 51194.8805 /data/app/oracle/oradata/redo01a.log 2 1 51194.8805 /data/app/oracle/oradata/redo02.log 2 1 51194.8805 /data/app/oracle/oradata/redo02a.log 3 2 51194.8805/data/app/oracle/oradata/redo03.log 3 2 51194.8805 /data/app/oracle/oradata/redo03a.log 4 2 51194.8805 /data/app/oracle/oradata/redo04.log 4 2 51194.8805 /data/app/oracle/oradata/redo04a.log 恢复成功后的后续处理 setpagesize 999 linesize 777 col member for a76 select l.group#,thread#,l.status, member,bytes/1024/1024 from v$log l, v$logfile f wherel.group#=f.group# order by group#; { 删除redo log组 如果删不掉 switch SQL> alterdatabase drop logfile group 5; SQL> alterdatabase drop logfile group 6; 添加logfile组 使用OMF方式管理的 ALTER DATABASEADD LOGFILE THREAD 2 GROUP 7 size 500M; ALTER DATABASEADD LOGFILE THREAD 2 GROUP 8 size 500M ALTER DATABASEADD LOGFILE THREAD 2 GROUP 5 size 500M; ALTER DATABASEADD LOGFILE THREAD 2 GROUP 6 size 500M } 重点 重点 重点 重点 重点 关闭节点1数据库 SQL>shutdown immediate Databaseclosed. Databasedismounted. ORACLEinstance shut down. 在节点1上修改initHCMPRD1.ora文件;位置在$ORACLE_HOME/dbs其最后内容为: HCMPRD1.__oracle_base=‘/u01/app/oracle‘#ORACLE_BASEset from environment HCMPRD2.__oracle_base=‘/u01/app/oracle‘#ORACLE_BASEset from environment *.audit_file_dest=‘/u01/app/oracle/admin/HCMPRD/adump‘ *.audit_trail=‘db‘ *.compatible=‘11.2.0.0.0‘ *.control_files=‘+RACDB_DATA/HCMPRD/controlfile/current.256.806770117‘,‘+GRIDCRS/HCMPRD/controlfile/current.256.806770117‘ *.db_create_file_dest=‘+RACDB_DATA‘ *.db_recovery_file_dest=‘+GRIDCRS‘ *.db_block_size=8192 *.db_domain=‘‘ *.db_name=‘HCMPRD‘ *.dispatchers=‘(PROTOCOL=TCP)(SERVICE=HCMPRDXDB)‘ *.nls_language=‘SIMPLIFIEDCHINESE‘ *.nls_territory=‘CHINA‘ *.open_cursors=300 *.diagnostic_dest=‘/u01/app/oracle/diag‘ *.log_archive_dest_1=‘LOCATION=+GRIDCRS/HCMPRD/archivelog/‘ *.log_archive_format=‘%t_%s_%r.arc‘ *.processes=150 *.db_recovery_file_dest_size=42950000000 *.remote_login_passwordfile=‘exclusive‘ *.memory_target=1210612736 HCMPRD2.thread=2 HCMPRD1.thread=1 HCMPRD2.undo_tablespace=‘UNDOTBS2‘ HCMPRD1.undo_tablespace=‘PSUNDOTS‘ remote_listener=‘rac-scan.tony.cn:1521‘ HCMPRD1.instance_number=1 HCMPRD2.instance_number=2 *.cluster_database=TRUE *.db_file_name_convert=(‘/u02/oradata/HCMPRD/datafile‘,‘+RACDB_DATA/HCMPRD/datafile‘) *.db_file_name_convert=(‘/u02/oradata/HCMPRD//tempfile‘,‘+RACDB_DATA/HCMPRD/tempfile‘) 在节点2上创建initHCMPRD2.ora文件 使用initHCMPRD1.ora启动节点1数据库,使用initHCMPRD2.ora启动节点2数据库 SQL> startupmount pfile=‘/u01/app/oracle/product/11.2.3/db_1/dbs/initHCMPRD11.ora‘; SQL> startupmount pfile=‘/u01/app/oracle/product/11.2.3/db_1/dbs/initHCMPRD21.ora‘; 然后怎么样让两个节点公用一个spfile文件?创建到ASM共享存储上:操作如下: [oracle@rac01~]$ cd $ORACLE_HOME/dbs [oracle@rac01dbs]$ pwd /u01/app/oracle/product/11.2.3/db_1/dbs **一个节点执行 即可 使用initHCMPRD1.ora文件 SQL> createspfile=‘+RACDB_DATA/HCMPRD/spfileHCMPRD.ora‘ from pfile=‘/u01/app/oracle/product/11.2.3/db_1/dbs/initHCMPRD1.ora‘; 然后编辑vi initHCMPRD1.ora其内容为: SPFILE=‘+RACDB_DATA/HCMPRD/spfileHCMPRD.ora‘ 其节点2 initHCMPRD2.ora内容一样; 在两个节点上启动数据库: SQL>startup mount pfile=‘/u01/app/oracle/product/11.2.3/db_1/dbs/initHCMPRD1.ora‘; SQL>startup mount pfile=‘/u01/app/oracle/product/11.2.3/db_1/dbs/initHCMPRD2.ora‘; 然后打开两个数据库。 监听: [oracle@RAC01 admin]$ morelistener.ora LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =IP)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY =EXTPROC1521)) ) ) 数据库总大小 SQL> select round(sum(space)) all_space_m from (select sum(bytes) / 1024 / 1024 space from dba_data_files union all select nvl(sum(bytes) / 1024 / 1024, 0) space from dba_temp_files union all select sum(bytes) / 1024 / 1024space from v$log); 表空间检查; set pagesize 888 linesize 666 col tablespace_name format a35 SELECT UPPER(F.TABLESPACE_NAME)"tablespace_name", D.TOT_GROOTTE_MB "sum_space(M)", D.TOT_GROOTTE_MB-F.TOTAL_BYTES "use_space(M)", TO_CHAR(ROUND((D.TOT_GROOTTE_MB-F.TOTAL_BYTES)/D.TOT_GROOTTE_MB*100,2),‘990.99‘)"use rate%", F.TOTAL_BYTES "free_space(M)" FROM (SELECT TABLESPACE_NAME, ROUND(SUM(BYTES)/1024/1024) TOTAL_BYTES, ROUND(MAX(BYTES)/(1024*1024),2) MAX_BYTES FROM SYS.DBA_FREE_SPACE GROUP BY TABLESPACE_NAME) F, (SELECT DD.TABLESPACE_NAME, ROUND(SUM(BYTES)/1024/1024) TOT_GROOTTE_MB FROM SYS.DBA_DATA_FILES DD GROUP BY DD.TABLESPACE_NAME) D WHERE D.TABLESPACE_NAME=F.TABLESPACE_NAME ORDER BY 2 DESC; |