September 2007 Archives

Some tips about awk

| | Comments (0) | TrackBacks (0)

Get the sum of single column
cat a.txt
26.2578125
126.023438
705.6875
6000
7849.08594
15260
35243.3125
88700
378483
Usage: cat a.txt|awk '{(tot+=$1)};END{ print tot}'

Get the sum of each column
cat b.txt
111781888     2564208
111781888     21437296
39077120      21338848
111781888     3138160
111781888     17370216
111781888     9237336
111781888     3484016
111781888     3068568
Usage: cat b.txt| awk '{(tot+=$1) (tot2+=$2)};END{print tot, tot2}'

Version: Oracle 10g (10203) Enterprise on Sun Sparc 64bit Solaris8

Capture of the error info from alert log:

Media Recovery Start
Managed Standby Recovery not using Real Time Apply
parallel recovery started with 10 processes
Sat Jun 30 02:25:01 2007
Media Recovery Log /oracle/TEST/archive/TEST_6.arc
Expanded controlfile section 4 from 30 to 60 records
Requested to grow by 30 records; added 1 blocks of records
Sat Jun 30 02:25:01 2007 Errors in file /oracle/TEST/home/admin/udump/test_ora_27380.trc:
ORA-00600: internal error code, arguments: [25016], [31], [4], [], [], [], [], []
Some recovered datafiles maybe left media fuzzy Media recovery may continue but open resetlogs may fail
Sat Jun 30 02:25:04 2007 Media Recovery failed with error 600 

Background:

The primary database was upgraded from 9205 to 10203, I added around 30 datafiles on primary, when the standby applied the archived log, it got the ORA 600 error as described above.

Root Cause:

When 10g standby expands the controlfile, it triggers Oracle Bug '6157529'.

Solution:

  1. Apply Oracle patch '3569503'
  2. Refresh the controlfile, and then try to recover. But you may get the ORA600 error again when standby expands controlfile next time.
  3. Change the compatible parameter in init.ora configuration file: Change from: compatible = 9.2.0.5 to 10.2.0.3 (This change is dangerous in production environment! You may have trouble to downgrade.)
  4. Upgrade to the last Oracle 10g Enterprise version.

Click here to get more details about this bug from Metalink.

In MySQL server side(assuming the MySQL server IP is 192.168.1.1), create a user and grant the remote access privilege to the new created user.

mysql> use mysql;
mysql> GRANT ALL ON *.* TO admin@'%' IDENTIFIED BY 'adminpwd' WITH GRANT OPTION;


Comments:
Here, admin@'%' means allow user 'admin' to connect with this MySQL from any IP address remotely.

Then we can try to connect to MySQL server 192.168.1.1 from any MySQL client.
mysql -h192.168.1.1 -uadmin -padminpwd