Pages: 5/46 First page Previous page 1 2 3 4 5 6 7 8 9 10 Next page Final page [ View by Articles | List ]
mysql> show slave status\G
......
Slave_IO_Running: Yes
Slave_SQL_Running: No
......

首先定位同步不成功的原因
查数据库日志

    若是从主机重启,事物回滚,则
mysql> slave stop;
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)


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)


first stop slave replication:
mysql> stop slave;
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)


check all right or not :
mysql> show slave status\G  

.......
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
.......

Tags: , ,
the first way:


the second way:


----------END-----------
Tags: , ,
临时表空间用途:
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


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


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.


3 改变缺省临时表空间为TEMP02
Quotation
SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP02;

Database altered


4 .删除原缺省表空间temp
Quotation
SQL> drop tablespace temp including contents and datafiles;

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


6. 改变缺省表空间
Quotation
SQL> alter database default temporary tablespace temp;

Database altered


7.删除中间过程表空间TEMP02
Quotation
SQL> drop tablespace temp02 including contents and datafiles;

Tablespace dropped


8.重新指定用户临时表空间
Quotation
SQL> alter user ASKWAN temporary tablespace temp;

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;


usage and output:
./parse_apache.pl   [APACHE LOGFILE]
# perl parse_apache.pl access_askwan_com_log
Client IPs              Num Of Visits
192.168.11.8            1794924
192.168.11.60           80887
192.168.11.9            34403
192.168.11.50           18026
192.168.11.196          8379
192.168.11.201          1353
192.168.11.155          1041
192.168.21.156          449
192.168.21.161          163
192.168.12.2            84

-------------end--------------
Tags: , ,
Pages: 5/46 First page Previous page 1 2 3 4 5 6 7 8 9 10 Next page Final page [ View by Articles | List ]