Monday 19 October 2015

1129 error connecting to master


mysql> show slave status \G;
*************************** 1. row ***************************
               Slave_IO_State: Connecting to master
                  Master_Host: 000.000.000.100
                  Master_User: rep_user
                  Master_Port: 3300
                Connect_Retry: 60
              Master_Log_File: mysql-bin.017008
          Read_Master_Log_Pos: 6004
               Relay_Log_File: relay-bin.000001
                Relay_Log_Pos: 4
        Relay_Master_Log_File: mysql-bin.017008
             Slave_IO_Running: Connecting
            Slave_SQL_Running: Yes
          Master_SSL_Key:
        Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 1129
                Last_IO_Error: error connecting to master 'rep_user@000.000.000.100:3300' - retry-time: 60  retries: 1074
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 0
                  Master_UUID: de4-1fa393-90303b
             Master_Info_File: /test01/master.info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it
           Master_Retry_Count: 86400
                  Master_Bind:

[testserver]$ telnet 000.000.000.100 3300 
Trying 000.000.000.100... 
Connected to 000.000.000.100. 
Escape character is '^]'. 
mHost '000.000.000.100' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'Connection closed by foreign host. 

solution :--

>'000.000.000.100' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'Connection closed by foreign host. 

After more than max_connect_errors unsuccessful tries, the ip will be blocked by the master's instance. 

To solve this problem you could execute 'mysqladmin flush-host' to unblock all blocked ip or 

execute FLUSH HOSTS on the master. 

The link below explains the issue in detail. 
https://dev.mysql.com/doc/refman/5.6/en/blocked-host.html 

Master server :-
mysqladmin -u username -ppasswd flush-hosts

Slave server:-

stop slave;
start slave;

show slave status \G;

Once the blocked host is flush the slave should be able to connect to the master. 

Try stopping the slave and starting the slave again after executing the FLUSH HOSTS 

For more information on FLUSH HOST please refer the link below. 
https://dev.mysql.com/doc/refman/5.6/en/flush.html 

To start or stop the slave you can use the START/STOP SLAVE command. 
https://dev.mysql.com/doc/refman/5.6/en/start-slave.html 
https://dev.mysql.com/doc/refman/5.6/en/stop-slave.html 

Thank you.

Thursday 23 April 2015

ORA-00265: instance recovery required, cannot set ARCHIVELOG mode

Today, I face below error while converting database into archive log mode. 
ORA-00265: instance recovery required, cannot set ARCHIVELOG mode

This error usually come when database crashed unfortunately or we shutdown database with the help of database shutdown command as: 
shutdown abort, startup force mount or shutdown abort. 
These types of command will required instance recovery in next startup. 
In short it need clean database startup.

shutdown abort
Database closed.
Database dismounted.
ORACLE instance shut down.

startup mount
ORACLE instance started.

Total System Global Area 1.0693E+10 bytes
Fixed Size                  2157504 bytes
Variable Size            5972694080 bytes
Database Buffers         4664066048 bytes
Redo Buffers               53747712 bytes
Database mounted.


alter database archivelog;
alter database archivelog
*
ERROR at line 1:
ORA-00265: instance recovery required, cannot set ARCHIVELOG mode



// Solution:--

shut immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.

startup mount;
ORACLE instance started.

Total System Global Area 1.0693E+10 bytes
Fixed Size                  2157504 bytes
Variable Size            7113544768 bytes
Database Buffers         3523215360 bytes
Redo Buffers               53747712 bytes
Database mounted.

recover database;
Media recovery complete.

alter database open;
Database altered.

shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 1.0693E+10 bytes
Fixed Size                  2157504 bytes
Variable Size            7147099200 bytes
Database Buffers         3489660928 bytes
Redo Buffers               53747712 bytes
Database mounted.
SQL>
SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

Friday 13 March 2015

MySQL Documentation: MySQL Reference Manuals


MySQL Documentation: MySQL Reference Manuals :-

Please use below link for MySQL details.

http://dev.mysql.com/doc/ 


Monday 2 March 2015

ORA-27054: NFS file system where the file is created or resides is not mounted with correct options


I have been getting 
ORA-27054: NFS file system not mounted with correct options error when running an EXPDP backup to a NFS mount point. 

The system administrator has not been successful in identifying the cause as it shows that the correct mount point options are being used.

Error :--

ORA-39000: bad dump file specification
ORA-31641: unable to create dump file "/expdir/expdp_backup/possit_fulldb_02032015.dmp"
ORA-27054: NFS file system where the file is created or resides is not mounted with correct options
Additional information: 6

Metalink Doc ID 1518979.1 sets the event 10298, by-passing this check and allows writing to the mount point.

sqlplus / as sysdba

alter system set events '10298 trace name context forever, level 32';

Wednesday 18 February 2015

parameter _TRACE_FILES_PUBLIC in Oracle


Generally all trace files have read and write permission for Oracle software owner and group of Oracle installation has permission of read only. Other users don’t have privilege of read.

$cd /oradump/diag/rdbms/ABCPROD1/trace
$ls -lrt
-rw-r----- 1 ora11g dba      156 Feb 18 13:35 ABCPROD1_lmhb_37332.trm
-rw-r----- 1 ora11g dba     1892 Feb 18 13:35 ABCPROD1_lmhb_37332.trc
-rw-r----- 1 ora11g dba    72499 Feb 18 13:39 ABCPROD1_lms0_37322.trm
-rw-r----- 1 ora11g dba   448097 Feb 18 13:39 ABCPROD1_lms0_37322.trc
-rw-r----- 1 ora11g dba    71272 Feb 18 13:40 ABCPROD1_mmon_37350.trm

Because trace files may have some important information about database security or may have some sensitive details of data. 
Oracle applies this permission using hidden parameter called _TRACE_FILES_PUBLIC. 
Default value of _TRACE_FILES_PUBLIC is FALSE. Due to this parameter trace files don’t have read permission to other users or public. It is not recommended to change value of this parameter because it is security risk. But in some scenario it has needed to change permission to make it readable trace files to other users or PUBLIC.

We can change this parameter using parameter file or spfile and make it TRUE.

select value from v$parameter where name = '_trace_files_public';

VALUE
----------
FALSE

For modifing this parameter login as SYSDBA and execute ALTER SYSTEM command as follows.

SQL> ALTER SYSTEM SET “_trace_files_public” = TRUE SCOPE=SPFILE;

After changing _TRACE_FILES_PUBLIC parameter to TRUE. Newly generated trace has readable permission to other users and public too.

select value from v$parameter where name = '_trace_files_public';

VALUE
----------
TRUE

$cd /oradump/diag/rdbms/ABCPROD1/trace
$ls -lrt
-rw-r--r-- 1 ora11g dba     2247 Feb 18 13:48 ABCPROD1_lmhb_1907.trc
-rw-r--r-- 1 ora11g dba      156 Feb 18 13:48 ABCPROD1_dbrm_1885.trm
-rw-r--r-- 1 ora11g dba     1496 Feb 18 13:48 ABCPROD1_dbrm_1885.trc