Change data type of a column
mysql> alter tableUPDATE table_name SET field1=new-value1, field2=new-value2 [WHERE Clause]
-> changevarchar(100); <-- new data type to be changed to
Update Table
Change value of a Column based on a condition
mysql> alter tableUPDATE table_name SET field1=new-value1, field2=new-value2 [WHERE Clause]
-> changevarchar(100); <-- new data type to be changed to
Update Table
Change value of a Column based on a condition
1. without username / password
shell>mysql
mysql -u username -p database_name < sqlfile.sqldb_name
< sqlfile.sql
>output.txt
2. with username / password
Indexes - Faster Reads / Slower Inserts,Updates,Deletes -
Views – Simpler Query / Slower Reads and more work for DB
De normalization - More Space Req and cost of write operations / Faster Reads with fewer join’s required
Normalization - Lesser Space Req, low cost of write operations / Slower Reads with more join’s required.
Well they (Apps or users) can’t hide any longer … The Oracle’s best Spy is on your side – here is the SQL which can bring them to the open. ( you need to be the SysDBA to do this though )
1. set linesize 30000 – to make sure everything appears in a single line
2. SQL> select username, sid, serial#, status, osuser, process, machine, terminal, program, logon_time from v$session where username is not null and username not in (‘SYSTEM’,'SYS’,'DBSNMP’);
- All the agents are displayed in a table with their USERNAME, SID,SERIAL#,STATUS,OSUSER,PROCESS,MACHINE,TERMINAL,PROGRAM
you have to decide if you will shoot (force kill ) or negotiate ( stop the services in the machines they are running in )
mysql -u user -p -e 'SQL Query' database
Where,