Put your tips and tricks online - Share your knowledge! Login | Register
 
 
  Search     Advanced search
 

Home | Ask Question | Add tip | My tips | Recent tips & tricks | Suggest a category | FAQ | Forums

h8dk97 : member's tip(s)


   Found 202 tips, Displaying 131 - 140 
 
Sort by 
 
 Select random row from Oracle table
Use this query to select a random record from Oracle table. This works from TOAD as well as sqlplus: SELECT col_name FROM (SELECT col_name FROM table_name ORDER BY dbms_random.value) WHERE rownum = 1;
     
More...

02/16/06
 
 
Category : Databases > Oracle
 
 
 Selecting random record
To select a random record from PostgreSQL table use the following SQL statement: SELECT col_name FROM table_name ORDER BY random() LIMIT 1;
 More...
02/16/06
 
 
Category : Databases > PostgreSQL
 
 
 Find duplicate records query
Use the following SQL statement for finding duplicates in a table. I think this should work for any relational database, not only MySQL. SELECT col_name, COUNT(col_name) AS num FROM table_name GROUP BY col_name HAVING (COUNT(col_name) > 1);
     
More...

02/16/06
 
 
Category : Databases > MySQL
 
 
 How to select random record from database table
To select random row from a MySQL table use the following query: mysql> SELECT col1, col2 FROM table_name ORDER BY rand() LIMIT 1;
 More...
02/15/06
 
 
Category : Databases > MySQL
 
 
 Unregister snapshots
Script to generate sql to unregister snapshots in Oracle database select 'exec DBMS_SNAPSHOT.UNREGISTER_SNAPSHOT(snapowner => ' || '''' || owner || '''' || ', snapname => ' || '''' || name || '''' || ', snapsite => ' || '''' || snapshot_site || '''' || ');' from dba_registered_snapshots /
 More...
02/13/06
 
 
Category : Databases > Oracle > Replication
 
 
 How to purge MySQL binary logs
You can put this command in crontab to run at regular intervals. This will purge database binary logs. $ designates shell prompt, replace passwd with the actual password. $ /bin/echo 'reset master' | /usr/local/mysql/bin/mysql --password=passwd
 More...
02/08/06
 
 
Category : Databases > MySQL
 
 
 How to switch to another user
Need to become a different Oracle database user? There is a way to login into a another user's account without knowing their password: 1. Find out the encrypted password for the user SQL> select username, password from dba_users where username = 'USERNAME'; USERNAME PASSWORD ------------ ------------------------------ USERNAME ...
     
More...

02/07/06
 
 
Category : Databases > Oracle > Security
 
 
 How to create externally identified user
This is an example how to create externally identified user in Oracle; i.e. if you want the os oracle user to connect to database without supplying password run the following statement from sqlplus: SQL> create user OPS$ORACLE identified externally default tablespace users temporary ...
     
More...

02/07/06
 
 
Category : Databases > Oracle > Security
 
 
 Show system parameters on Solaris
The sysdef utility outputs the current system definition in tabular form. It lists all hardware devices, as well as pseudo devices, system devices, loadable modules, and the values of selected kernel tunable parameters. $ /usr/sbin/sysdef
 More...
02/06/06
 
 
Category : Operating Systems > Unix > SUN Solaris
 
 
 How to kill Unix user session
One way to kill all sessions for a specific user is to run the following command (replace username with the actual user name): kill -9 `ps -u username | grep -v PID | awk '{ printf ("%s ", $1); }'` Of course you should only use the -9 option when you really ...
     
More...

01/25/06
 
 
Category : Operating Systems > Unix
 
 


<< 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Page 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 >>

Home |  FAQ |  Terms of Use |  Privacy Policy

© 2005 tiplib.com