Thursday, July 16, 2009

SYS.DBMS_EXPORT_EXTENSION

Imp Par File Err

grants=n
buffer=1000000
log=vms4_qlac.log
userid=abc/pass
file=qlac.dmp
FROMUSER=vms4_qlac
FEEDBACK=1000


PLS-00201: identifier 'SYS.DBMS_EXPORT_EXTENSION' must be declared


Fix :

GRANT EXECUTE ON DBMS_EXPORT_EXTENSION to
or
GRANT EXECUTE ON DBMS_EXPORT_EXTENSION to PUBLIC

Wednesday, July 15, 2009

Delete Duplicate Rows From an Oracle Table

It's easy to introduce duplicate rows of data into Oracle tables by running a data load twice without the primary key or unique indexes created or enabled.
Here's how you remove the duplicate rows before the primary key or unique indexes can be created:

DELETE FROM our_table
WHERE rowid not in
(SELECT MIN(rowid)
FROM our_table
GROUP BY column1, column2, column3... ;
Here column1, column2, column3 constitute the identifying key for each record.
Be sure to replace our_table with the table name from which you want to remove the duplicate rows. The GROUP BY is used on the columns that make the primary key for the table. This script deletes each row in the group after the first row.

Saturday, July 11, 2009

Key gen cho Mcleaner 1.7.1

1) Download Putty
1a) If you dont have SSH on your Iphone Install it (OpenSSH) from Cydia
2) Install GNU Debugger from Cydia
3) Connect to iphone from putty using ssh protocol
login root
password alpine

4) run gdb
5) in gdb type these commands (copy and paste)

break *0x00003320
break *0x00003348
commands 1
silent
print $r4
set $pc=0x3328
continue
end
commands 2
silent
printf "\n\n\nSERIAL:%c%c%c%c%c%c%c%c! ENJOY!\n\n\n",$1,$2,$3,$4,$5,$6,$7,$8
end
attach -waitfor MCleaner

6) Run Mcleaner
7) type continue in gdb
8) wait when Mcleaner is loaded
9) Click Buy and Activate
10) Type serial 00000000 (8 zeros)
11) look in gdb here your serial
12) close gdb (type quit)
13) Close Mcleaner and open it again
14) Click Buy and Activate and type new serial, enjoy

You can unstall GNU Debugger

While Trying to Commit or Rollback a Pending Transaction Getting ORA-02058,ORA-01453,ORA-06512

Applies to:

Oracle Server Enterprise Edition - Version: 9.2.0.1 to 11.1.0.6
This problem can occur on any platform.
Oracle Server - Enterprise Edition - Version: 9.2 to 11.1

Symptoms

While trying to commit or rollback a pending transaction getting error ORA-2058...
Subsequently when trying to purge the pending transactions using the
procedure "dbms_transaction.purge_lost_db_entry" gives the following errors..

SQL> EXECUTE DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('5.23.2386');

BEGIN DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('5.23.2386'); END;
*
ERROR at line 1:
ORA-30019: Illegal rollback Segment operation in Automatic Undo mode
ORA-06512: at "SYS.DBMS_TRANSACTION", line 65

SQL> execute DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('37.16.108');
BEGIN DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('37.16.108'); END;
*
ERROR at line 1:
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "SYS.DBMS_TRANSACTION", line 94


Cause

If the remote database no longer exists then the transaction will have to be
purged from the list of pending distributed transactions.
The transaction to be deleted is in the Prepared State.

Solution

If the command causes an ORA-2058 error to occur, it means that the remote
database cannot be accessed. In this case, check whether the database link to
the remote database exists and whether the remote database is shutdown.

If the remote database no longer exists then the transaction will have to be
purged from the list of pending distributed transactions.

Follow the instructions on how to purge a
distributed transaction from the database.
=================================
If the remote database cannot be accessed, a failed distributed transaction
cannot be committed or rolled back and so must be purged from the list of
pending transactions.

1. Identify the id of the transaction:

SQL> SELECT LOCAL_TRAN_ID, GLOBAL_TRAN_ID FROM DBA_2PC_PENDING;

2. Purge the transaction:

SQL> EXECUTE DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('');
SQL> COMMIT;

3. Confirm that the transaction has been purged:

SQL> SELECT LOCAL_TRAN_ID, GLOBAL_TRAN_ID FROM DBA_2PC_PENDING;


Step 2:
=====
If you get the following errors while purging transactions using "dbms_transaction.purge_lost_db_entry"


SQL> EXECUTE DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('5.23.2386');

BEGIN DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('5.23.2386'); END;
*
ERROR at line 1:
ORA-30019: Illegal rollback Segment operation in Automatic Undo mode
ORA-06512: at "SYS.DBMS_TRANSACTION", line 65
ORA-06512: at "SYS.DBMS_TRANSACTION", line 85


Fix:
===
This problem is logged as
Bug.2191458 (unpublished) UNABLE TO EXEC DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY WITH AUTO UNDO MANAGEMENT
and is worked by development.

Use the following Workaround:

You have to use local_tran_id.....

Issue commit before alter system set "_smu_debug_mode" = 4;

Follow the steps,

SQL> commit;
SQL> alter session set "_smu_debug_mode" = 4;
SQL> commit;
SQL> execute DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('local_tran_id');
SQL> commit;

Step 3:
=====

When executing the following procedure(dbms_transaction.purge_lost_db_entry)
to delete entries from
dba_2pc_pending one encounters the following error:

SQL> execute DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('37.16.108'); ==>For example..
BEGIN DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('37.16.108'); END;
*
ERROR at line 1:
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "SYS.DBMS_TRANSACTION", line 94


Fix:
===

The transaction to be deleted is in the prepared state and has to be either
force committed or force rollback

SQL> select LOCAL_TRAN_ID,STATE from dba_2pc_pending;

LOCAL_TRAN_ID STATE
---------------------- ----------------
37.16.108 prepared

SQL> rollback force '37.16.108'; ==>For example

Rollback complete.

SQL> select LOCAL_TRAN_ID,STATE from dba_2pc_pending;

LOCAL_TRAN_ID STATE
---------------------- ----------------
37.16.108 forced rollback

SQL> COMMIT;

SQL>alter system set "_smu_debug_mode" = 4;
Rollback complete.

SQL> exec dbms_transaction.purge_lost_db_entry('37.16.108'); ==>For example
SQL> COMMIT;

Tuesday, July 7, 2009

Backup Database in Noarchivelog mode

To take backup in noarchivelog mode you must aware of several things.

1)Don't skip any online tablespace to take backup. If you do exclude an online tablespace to take backup then whenever you restore the backup that tablespace will be lost.

2)You must take a cold backup of your database while taking database backup. Cold backup means your database will be either in mount stage or the instance will be not running.

In next steps I gave an example of how we can take incremental level 0 backup in noarchivelog mode.

1)See the current log mode and Shut down the database.

SQL> SELECT LOG_MODE FROM V$DATABASE;
LOG_MODE
------------
NOARCHIVELOG

SQL> SHUTDOWN IMMEDIATE

2)Connect to RMAN.
SQL> !rman target /

3)Mount the database.
RMAN> STARTUP MOUNT

4)Take incremental level 0 backup.
RMAN> BACKUP INCREMENTAL LEVEL 0 DATABASE TAG 'LEVEL_0_BACKUP';
In this example a tag is assigned to level 0 incremental backup.

5)Open the database to use for all.
RMAN> ALTER DATABASE OPEN;

Hướng dấn cài đặt máy chủ FTP cho Ubuntu

Vsftpd is the most easy ftp server to setup.

Installing vsftpd:
Code:

sudo apt-get install vsftpd

The configuration file for vsftpd is located in /etc/vsftpd.conf. The default configuration is a little bit paranoid, not so usable for file sharing. So use this configuration instead:
Code:

# Put in /etc/vsftpd.conf
# Don't forget to change samurai into your local username
listen=YES
anonymous_enable=YES
local_enable=YES
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
chown_uploads=YES
chown_username=samurai
ftpd_banner=Welcome to blah FTP service.
secure_chroot_dir=/var/run/vsftpd
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/vsftpd.pem
anon_root=/home/ftp

Don't forget to backup before you use this configuration.
Code:

sudo cp /etc/vsftpd.conf /root/

Now we must make writable directory for anonymous user.
Code:

cd /home/ftp
sudo mkdir opendir
sudo chmod 777 opendir/

Ok, I explain this. In my local system, I have user named 'samurai'. With this configuration, I can log into ftp server with local user, that is 'samurai'. 'samurai' can go anywhere, create files, delete files, etc as long as he has sufficient permission.

With this configuration I can log into ftp server with anonymous user ( without username and password ). After logging in, the anonymous user jailed in /home/ftp directory ( pointed by anon_root ). I can't go outside. I can download files from /home/ftp directory but not create, delete anything from this directory. But I can write and delete files in opendir. If I write files in opendir or upload files in opendir, the files automatically belong to 'samurai' user.

To run this server:
Code:

sudo /etc/init.d/vsftpd start

To stop it:
Code:

sudo /etc/init.d/vsftpd stop

To restart it:
Code:

sudo /etc/init.d/vsftpd restart

Now it is usable for file sharing, right?!!!!

Friday, July 3, 2009

Làm Cách Nào để Re-install Tất Cả Các Packages Trong Cydia (sau Khi Upgrade/restore)

Xin Chào Các Bạn ............ Các Bạn sẽ không còn phải đi kiếm lòng vòng những Packages mà Các Bạn đã Install trước đây sau khi các Bạn đã Upgrade hay Restore ,một vài bước sau đây sẽ giúp các Bạn đỡ mất thời gian
1) Login qua SSH into Iphone của các Bạn
2) Thiết lập một danh sách tất cả các Packages đã Install qua Cydia bằng cách sử dụng lệnh này
dpkg -l | grep ^ii | awk '{print $2}' > /private/var/mobile/Media/installed.txt
3) Copy File này “installed.txt” tới Computer của Bạn sử dụng SFTP e.g DiskAid
4) Bây giờ các Bạn có thể an tâm Upgrade hay Restore lại Iphone của các Bạn ,Make Sure ,Cydia đã Install bởi QuckPwn or PwnageTool chưa
RE-INSTALL TẤT CẢ CÁC PACKAGES
1) Kiểm tra lại ,Bạn đã install OpenSSH với Cydia ,mở Cydia và kiếm OpenSSH Package và Install nó ,sau đó Install tất cả các Repositories mà các Bạn đã Install trước đây ,mở Cydia và vào " Section " và mở “Repositories " và chọn tất cả các Packages trước đây Bạn đã sử dụng ,nếu không thì Cydia sẽ không kiếm được tất cả các Packages để RESTORE
2) Copy File này “installed.txt” trở lại thiết bị của Bạn sử dụng SFTP hay DiskAid.
3) Login into your iPhone using root:
ssh -l root (IP-number của iPhone các Bạn)
4) Cái này đã Install và Update ,do đó chỉ có những Packages mới thì nó sẽ Install ,Enter :

dpkg -l | grep ^ii | awk '{print $2}' > /private/var/mobile/Media/installed-new.txt
xong đến
diff /private/var/mobile/Media/installed-new.txt /private/var/mobile/Media/installed.txt | grep ^\> | awk '{print $2}' > /private/var/mobile/Media/installed-todo.txt
rồi đến
apt-get install `cat /private/var/mobile/Media/installed-todo.txt

5) Các Bạn REBOOT lại

Thế là xong ,Chúc các Bạn thành công

Thursday, July 2, 2009

Listener Hangs, Child listener process remains persistence

$ ps -ef | grep tnslsnr
oracle 3102 1 0 Jan 01 ? 12:28 /var/opt/oracle/bin/tnslsnr LISTENER -inherit
oracle 5012 3102 0 Jan 25 ? 10:15 /var/opt/oracle/bin/tnslsnr LISTENER -inherit


From the output first one is parent listener process and second line is child listener process. For child listener process parent id is 3102.

Just killing the child process allows new connections to work until the problem reoccurs. So after seeing above and if listener hangs then do,
$kill -9 5012 3102

Cause of the Problem
This problem remains in oracle 10.1.0.3, 10.1.0.4, 10.1.0.4.2, 10.1.0.5, 10.2.0.1 and 10.2.0.2. The listener hangs if the child listener process is not closed i.e after creating child process it persists. Note that, child listener processes are not unusual, depending on traffic as well as when the OS grep snapshot is taken. However, a persistent secondary process (longer than 5 seconds) is not normal and may be a result of this referenced problem.

This listener hanging event can happen on a standalone server or on a RAC server.

Solution of the Problem
1)The issue is fixed in patchset 10.2.0.3 and in 10.2.0.4. So apply patchset.

2)Apply Patch 4518443 which is available in metalink. Download from metalink and apply on your databse server.

3)As a workaround, you can follow the following two steps if you don't like to apply patch now.

Step 01: Add the following entry in your listener.ora file.
SUBSCRIBE_FOR_NODE_DOWN_EVENT_{listener_name}=OFF

Where {listener_name} should be replaced with the actual listener name configured in the LISTENER.ORA file.

Suppose your have default listener name and it is LISTENER. Then in the listener.ora file(by default in location $ORACLE_HOME/network/admin on unix) add the following entry in a new line,

SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF


Step 02: Go to directory cd $ORACLE_HOME/opmn/conf , find ons.config and move it to another location. Like,

cd $ORACLE_HOME/opmn/conf
mv ons.config ons.config.bak


After completing above two steps bounce the listener.

lsnrctl stop
lsnrctl start


Alternatively, you can simply issue,
$lsnrctl reload
if database availability is important.
Note that adding the SUBSCRIBE_FOR_NODE_DOWN_EVENT_{listener_name} to listener.ora file on RAC and disabling the ONS file, will mean that FAN (fast application notification) will not be possible. So, if you have a RAC configuration, then apply the patch and do not disable ONS or FAN.