Mysql replication Error "Slave_SQL_Running:No"
[
2009/09/15 13:20 | by askwan ]
2009/09/15 13:20 | by askwan ]
mysql> show slave status\G
......
Slave_IO_Running: Yes
Slave_SQL_Running: No
......
首先定位同步不成功的原因
查数据库日志
若是从主机重启,事物回滚,则
其他网络故障,则
go to master :
go to slave ,manual replication
then done !
mysql> show slave status\G
......
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
......
another example:
first stop slave replication:
change master host info:
last step ,start replication:
check all right or not :
.......
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
.......
......
Slave_IO_Running: Yes
Slave_SQL_Running: No
......
首先定位同步不成功的原因
查数据库日志
若是从主机重启,事物回滚,则
mysql> slave stop;
mysql> set GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
mysql> slave start;
mysql> set GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
mysql> slave start;
其他网络故障,则
go to master :
mysql> show master status;
+------------------+-----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+-----------+--------------+------------------+
| mysql-bin.000004 | 244274056 | cada_w | |
+------------------+-----------+--------------+------------------+
1 row in set (0.00 sec)
go to slave ,manual replication
mysql>salve stop
mysql> change master to
> master_host='192.168.0.50',
> master_user='askwan',
> master_password='askwan.com',
> master_port=3306,
> master_log_file=localhost-bin.000004',
> master_log_pos=244274056 ;
1 row in set (0.00 sec)
mysql> slave start;
1 row in set (0.00 sec)
mysql> change master to
> master_host='192.168.0.50',
> master_user='askwan',
> master_password='askwan.com',
> master_port=3306,
> master_log_file=localhost-bin.000004',
> master_log_pos=244274056 ;
1 row in set (0.00 sec)
mysql> slave start;
1 row in set (0.00 sec)
then done !
mysql> show slave status\G
......
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
......
another example:
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.100.88
Master_User: slave
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000097
Read_Master_Log_Pos: 84519125
Relay_Log_File: HK1-relay-bin.001040
Relay_Log_Pos: 8880267
Relay_Master_Log_File: mysql-bin.000097
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB: askwan.com
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
Skip_Counter: 0
Exec_Master_Log_Pos: 67663733
Relay_Log_Space: 30399576
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
1 row in set (0.00 sec)
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.100.88
Master_User: slave
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000097
Read_Master_Log_Pos: 84519125
Relay_Log_File: HK1-relay-bin.001040
Relay_Log_Pos: 8880267
Relay_Master_Log_File: mysql-bin.000097
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB: askwan.com
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
Skip_Counter: 0
Exec_Master_Log_Pos: 67663733
Relay_Log_Space: 30399576
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
1 row in set (0.00 sec)
first stop slave replication:
mysql> stop slave;
Query OK, 0 rows affected (0.04 sec)
Query OK, 0 rows affected (0.04 sec)
change master host info:
mysql> change master to master_host='192.168.100.88',master_user='slave',master_password='askwan.com',master_port=3306,master_log_file='mysql-bin.000097',master_log_pos=67663733;
last step ,start replication:
mysql> start slave;
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
check all right or not :
mysql> show slave status\G
.......
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
.......
use DBD::Oracle connect oracle database
[
2009/09/10 20:40 | by askwan ]
2009/09/10 20:40 | by askwan ]
the first way:
the second way:
----------END-----------
the second way:
----------END-----------
oracle temporary tablespace boom unexpectedly
[
2009/09/07 08:38 | by askwan ]
2009/09/07 08:38 | by askwan ]
临时表空间用途:
INDEX CREATE ,INDEX REBUILD,ORDER BY ,GROUP BY, DISTINCT,Analyze,UNION, Sort-Merge etc..
上面这些操作均会用到临时表空间
临时表空间重建步骤:
比如临时表空间一直增大,导致系统磁盘空间吃紧,考虑重建
1 定位当前临时表空间位置
2 创建临时表空间TEMP02
review:
3 改变缺省临时表空间为TEMP02
4 .删除原缺省表空间temp
5.创建新表空间temp
6. 改变缺省表空间
7.删除中间过程表空间TEMP02
8.重新指定用户临时表空间
涉及临时文件相关操作
eg.
alter database tempfile '/u01/oracle/oradata/askwan/temp.dbf' autoextend off;
alter database tempfile '/u01/oracle/oradata/askwan/temp.dbf' resize 300M;
alter database tempfile ''/u01/oracle/oradata/askwan/temp.dbf' autoextend on;
INDEX CREATE ,INDEX REBUILD,ORDER BY ,GROUP BY, DISTINCT,Analyze,UNION, Sort-Merge etc..
上面这些操作均会用到临时表空间
临时表空间重建步骤:
比如临时表空间一直增大,导致系统磁盘空间吃紧,考虑重建
1 定位当前临时表空间位置
Quotation
SQL> SELECT FILE_NAME,TABLESPACE_NAME FROM DBA_TEMP_FILES;
FILE_NAME TABLESPACE_NAME
-------------------------------------------------------------------------------- ------------------------------
/u01/oracle/oradata/askwan/temp01.dbf TEMP
FILE_NAME TABLESPACE_NAME
-------------------------------------------------------------------------------- ------------------------------
/u01/oracle/oradata/askwan/temp01.dbf TEMP
2 创建临时表空间TEMP02
Quotation
SQL> CREATE TEMPORARY TABLESPACE TEMP02 TEMPFILE '/u01/oracle/oradata/askwan/temp02.dbf'
SIZE 100M REUSE AUTOEXTEND ON NEXT 512K MAXSIZE UNLIMITED;
Tablespace created
SIZE 100M REUSE AUTOEXTEND ON NEXT 512K MAXSIZE UNLIMITED;
Tablespace created
review:
Quotation
SQL> SELECT FILE_NAME,TABLESPACE_NAME FROM DBA_TEMP_FILES;
FILE_NAME TABLESPACE_NAME
-------------------------------------------------------------------------------- ------------------------------
/u01/oracle/oradata/askwan/temp01.dbf TEMP
/u01/oracle/oradata/askwan/temp02.dbf TEMP02
have created successfull.
FILE_NAME TABLESPACE_NAME
-------------------------------------------------------------------------------- ------------------------------
/u01/oracle/oradata/askwan/temp01.dbf TEMP
/u01/oracle/oradata/askwan/temp02.dbf TEMP02
have created successfull.
3 改变缺省临时表空间为TEMP02
Quotation
SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP02;
Database altered
Database altered
4 .删除原缺省表空间temp
Quotation
SQL> drop tablespace temp including contents and datafiles;
Tablespace dropped
Tablespace dropped
5.创建新表空间temp
Quotation
SQL> CREATE TEMPORARY TABLESPACE TEMP TEMPFILE '/u01/oracle/oradata/askwan/temp.dbf'
SIZE 100M REUSE AUTOEXTEND ON NEXT 512K MAXSIZE UNLIMITED;
Tablespace created
SIZE 100M REUSE AUTOEXTEND ON NEXT 512K MAXSIZE UNLIMITED;
Tablespace created
6. 改变缺省表空间
Quotation
SQL> alter database default temporary tablespace temp;
Database altered
Database altered
7.删除中间过程表空间TEMP02
Quotation
SQL> drop tablespace temp02 including contents and datafiles;
Tablespace dropped
Tablespace dropped
8.重新指定用户临时表空间
Quotation
SQL> alter user ASKWAN temporary tablespace temp;
User altered
User altered
涉及临时文件相关操作
eg.
alter database tempfile '/u01/oracle/oradata/askwan/temp.dbf' autoextend off;
alter database tempfile '/u01/oracle/oradata/askwan/temp.dbf' resize 300M;
alter database tempfile ''/u01/oracle/oradata/askwan/temp.dbf' autoextend on;




