emca -repos create |
emca -repos recreate |
emca -repos drop |
emca -config dbcontrol db |
emca -deconfig dbcontrol db |
emca -reconfig ports emca -reconfig ports -dbcontrol_http_port 1160 emca -reconfig ports -agent_port 3940 |
emctl start dbconsole |
emctl stop dbconsole |
emctl status dbconsole |
emca -repos create emca -config dbcontrol db emctl start dbconsole |
emca -repos drop emca -repos create emca -config dbcontrol db emctl start dbconsole |
SQL> select GROUP#,MEMBERS,BYTES/1024/1024 from v\$log; ---------- ---------- --------------- ---------- ---------------------------------------- |
SQL> create pfile='/oracle/orcl.ora' from spfile;File created.orcl.__db_cache_size=79691776 orcl.__java_pool_size=4194304 orcl.__large_pool_size=4194304 orcl.__shared_pool_size=71303168 orcl.__streams_pool_size=0 *.audit_file_dest='/oracle/admin/orcl/adump' *.background_dump_dest='/oracle/admin/orcl/bdump' *.compatible='10.2.0.1.0' *.control_files='/oracle/oradata/orcl/control01.ctl','/oracle/oradata/orcl/control02.ctl','/oracle/oradata/orcl/control03.ctl' *.core_dump_dest='/oracle/admin/orcl/cdump' *.db_block_size=8192 *.db_domain='' *.db_file_multiblock_read_count=16 *.db_name='orcl' *.db_recovery_file_dest='/oracle/flash_recovery_area' *.db_recovery_file_dest_size=2147483648 *.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)' *.job_queue_processes=10 *.DB_UNIQUE_NAME='orclpri' *.log_archive_config='DG_CONFIG=(orclpri,orclstandby)' *.log_archive_dest_1='LOCATION=/arch1/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES)' DB_UNIQUE_NAME='orclpri' *.LOG_ARCHIVE_DEST_2='SERVICE=orclstandby arch ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orclstandby' *.LOG_ARCHIVE_DEST_STATE_1=ENABLE *.LOG_ARCHIVE_DEST_STATE_2=ENABLE *.FAL_SERVER=orclstandby *.FAL_CLIENT=orclpri *.open_cursors=300 *.pga_aggregate_target=16777216 *.processes=150 *.remote_login_passwordfile='EXCLUSIVE' *.sga_target=167772160 *.undo_management='AUTO' *.undo_tablespace='UNDOTBS1' *.user_dump_dest='/oracle/admin/orcl/udump' *.STANDBY_FILE_MANAGEMENT=AUTO |
SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup pfile='/oracle/orcl.ora' ORACLE instance started.Total System Global Area Fixed Size Variable Size Database Buffers Redo Buffers Database mounted. Database opened. SQL> |
[oracle@node2 oracle]\$ orapwd file='/oracle/product/10.2.0/db_1/dbs/orapworcl.ora' password=oracle entries=10SQL> ALTER DATABASE CREATE STANDBY CONTROLFILE AS |
主库ORCL = orclpri = orclstandby = 监听信息如下SID_LIST_LISTENER = |
orcl.__db_cache_size=79691776 orcl.__java_pool_size=4194304 orcl.__large_pool_size=4194304 orcl.__shared_pool_size=71303168 orcl.__streams_pool_size=0 *.audit_file_dest='/oracle/admin/orcl/adump' *.background_dump_dest='/oracle/admin/orcl/bdump' *.compatible='10.2.0.1.0' *.control_files='/oracle/oradata/orcl/control01.ctl','/oracle/oradata/orcl/control02.ctl','/oracle/oradata/orcl/control03.ctl' *.core_dump_dest='/oracle/admin/orcl/cdump' *.db_block_size=8192 *.db_domain='' *.db_file_multiblock_read_count=16 *.db_name='orcl' *.db_recovery_file_dest='/oracle/flash_recovery_area' *.db_recovery_file_dest_size=2147483648 *.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)' *.job_queue_processes=10*.DB_UNIQUE_NAME='orclstandby' *.log_archive_config='DG_CONFIG=(orclpri,orclstandby)' *.log_archive_dest_1='LOCATION=/arch1/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES)' DB_UNIQUE_NAME='orclstandby' *.LOG_ARCHIVE_DEST_2='SERVICE=orclpri arch ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orclpri' *.LOG_ARCHIVE_DEST_STATE_1=ENABLE *.LOG_ARCHIVE_DEST_STATE_2=ENABLE *.FAL_SERVER=orclstandby *.FAL_CLIENT=orclpri *.open_cursors=300 *.pga_aggregate_target=16777216 *.processes=150 *.remote_login_passwordfile='EXCLUSIVE' *.sga_target=167772160 *.undo_management='AUTO' *.undo_tablespace='UNDOTBS1' *.user_dump_dest='/oracle/admin/orcl/udump' *.STANDBY_FILE_MANAGEMENT=AUTO |
*.control_files='/oracle/oradata/orcl/control01.ctl','/oracle/oradata/orcl/control02.ctl','/oracle/oradata/orcl/control03.ctl' 为: *.control_files='/oracle/oradata/orcl/standby.ctl' ##在主机上生成的那个控制文件,也可以多放几份 |
备库ORCL = orclpri = orclstandby = 监听信息如下SID_LIST_LISTENER = |
SQL> startup pfile='/oracle/orclstandby.ora' nomount; ORACLE instance started.Total System Global Area Fixed Size Variable Size Database Buffers Redo Buffers |
SQL> alter database recover managed standby database disconnect from session;Database altered. |
ALTER SYSTEM SET log_archive_dest_state_2='DEFER' SCOPE=MEMORY; ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=MEMORY; |
select switchover_stats from v\$database; |
ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY; |
ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;shutdown immediate; startup nomount; alter database mount standby database; |
SELECT SWITCHOVER_STATUS FROM V\$DATABASE; |
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY; |
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN;shutdown immediate; startup; |