Posts

Showing posts from 2012

Last_date

There is no function like last_date in sql server.

How to upload excel file to MYsql server

Save your spreadsheet as a CSV (comma separated value) file. >| >| After I save the spreadsheet as a CSV file how do I import the data >| into a MySQL table?[/color] Look under the Load Data instruction. I use the following: LOAD DATA LOCAL INFILE 'e:\\sydnet2\\_info\\curdocs.csv' INTO TABLE pnp_docs_current FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';

Maximize SQL Server Performance with SQL Tuning

Image

Memcached Functions in MySQL

Image

How to remove MYSQL from Windows 7

How To: Run Command Prompt as Administrator and execute the following command to stop and remove MySQL service. Net stop MySQL Sc delete MySQL Go to Control Panel >> Programs >> Programs and Features, select MySQL Server 5.x and click Uninstall. (If you can uninstall MySQL from Control Panel) Open Windows Explorer and go to Organize > Folder and search options, Select the “View” tab and under “Hidden files and Folders” choose “Show hidden files and folders”. Now explore the following locations and delete following folders. C:\Program Files\MySQL C:\Program Files (x86)\MySQL C:\ProgramData\MySQL And if exists, delete it too C:\Users\[User-Name]\AppData\Roaming\MySQL Restart your PC and reinstall MySQL. That’s all! Applies To: Windows Server 2008 R2 Windows Server 2008 Windows 7 Windows Vista

Enabling ARCHIVELOG Mode

The following steps will guide you to enable archivelog Mode. 1. Check the current archivelog mode.   SELECT LOG_MODE FROM V$DATABASE 2. SHUTDOWN AND RESTART YOUR DATABASE TO MOUNT STATE.   SHUTDOWN IMMEDIATE STARTUP MOUNT 3. ENABLE ARCHIVE MODE ALTER DATABASE ARCHIVELOG. 4. OPEN YOUR DATABASE. ALTER DATABASE OPEN

Introduction to Linux Security

There is a saying in the security world that the only truly safe computer system is one that is disconnected from the network, switched off and buried six feet under ground . The sentiment may be somewhat true but it is hardly a practical solution to the problems we face today in protecting servers and desktops from outside intrusion. There are more computer systems connected to the internet either directly or via local area networks than at any time in the history of technology and the numbers are growing at a rapid rate. It seems that not a month goes by without another story in the news about the internal network of a major corporation being compromised by an intruder.   The simple fact is that there really is no such thing as a truly secure system as long is it is connected to a network. If the large corporations with expensive firewalls and talented IT staff can’t always stop criminals from breaking in what chance do the rest of us have? Fortunately all is not lost an...

Introduction to Computer Security

What is computer security? Security is risk management. - unknown "A computer is secure if you can depend on it and it's software to behave as you expect" - Practical UNIX and Internet Security Security is: availability, consistency, access control, data confidentiality, authentication. -  http://www.sun.com/security/overview.html "The principal objective of computer security is to protect and assure the confidentiality, integrity, and availability of automated information systems and the data they contain." -  http://csrc.nist.gov/publications/secpubs/cslaw.txt There are numerous definitions for "computer security", and most of them are correct. Essentially computer security means enforcement of usage policies, this must be done since people and software have flaws that can result in accidents, but also because someone may want to steal your information, use your resources inappropriately or simply deny you the use of your resources. S...

10 Tips for Technology Proposal-Writers

Sun Associates collaborates with school districts and state education agencies to write educational technology funding proposals, and to implement funded activities, including professional development and evaluation. We have found that successful funding proposals have several things in common. We invite you to share these 10 tips with your colleagues, and use them as a starting point for your next grant-planning meeting. 1. Read the Request for Proposals (RFP) The number one rule for writing a successful grant is to read the RFP...and then to follow the RFP's rules and guidelines when writing your proposal. Not surprisingly, most unsuccessful proposals violate this basic rule. The RFP is written for the specific purpose of providing prospective grantees with  all  of the information that they need to write a successful proposal. Most grant-makers spend a huge amount of time writing their RFP. They expect you to read it and follow it carefully. 2. Write Appropriate P...

NICE ARTICLE ON REDO LOG

In the Oracle RDBMS environment,  redo logs  comprise files in a proprietary format which log a history of all changes made to the database. Each redo log file consists of redo records. A redo record, also called a redo entry, holds a group of Change vectors, each of which describes or represents a change made to a single block in the database. For example, if a user  UPDATE s a salary-value in a table containing employee-related data, the DBMS generates a redo record containing change-vectors that describe changes to the data segment block for the table. And if the user then  COMMIT s the update, Oracle generates another redo record and assigns the change a "system change number" (SCN). Whenever something is changed on a datafile, Oracle records it in the redo log. The name  redo log  indicates its purpose: When the database crashes, oracle can redo all changes on datafiles which will take the database data back to the s...

Tuning the Oracle Shared Pool

I hope you now understand that the old "just increase the shared pool" answer isn't good enough anymore when it comes to tuning problems. You must take an in depth look at your shared pool and tune what needs to be tuned, not just throw memory at a problem until it submerges. Indeed, I have shown that in some cases increasing the size of the shared pool may harm performance and decreasing the size may be advisable.  The shared pool is vital to the proper performance of your Oracle database, you must have it properly tuned or drown in bad performance. Next we will cover what to pin, the shared pool and multi-threaded server, hashing and generalized library and dictionary cache tuning. We have also discussed ways to monitor for what objects should be pinned, discussed multi-threaded server, looked at hashing problems and their resolution as well as examined classic library and data dictionary cache tuning. We have established 8 guidelines for tuning the Oracle shared pool:...

The Top 10 Business Plan Mistakes

It’s been nearly seven years since I posted  Top 10 Business Plan Mistakes  on this site. Looking back and reading the post again today, I think the list holds up very well. Still, I can’t resist making a few changes. So here is my revised version for 2012, incorporating what I wrote back then that still holds true. 1. Misunderstanding the purpose: It’s the planning that matters, not just the document.  You engage in planning your business because planning becomes management. Planning is a process of setting goals and establishing specific measures of progress, then tracking your progress and following up with course corrections. The plan itself is just the first step; it is reviewed and revised often. Don’t even print it unless you absolutely have to. Leave it on a digital network instead. 2. Doing it in one big push; do it in pieces and steps.  The plan is a set of connected modules, like blocks. Start anywhere and get going. Do the part that interests you most,...

PCTFREE property for tables and indexes

Why databases aren’t really fast When most Oracle databases are inspected to see exactly what they are doing, most often it is disk I/O access. Databases read and write a lot of data, and because magnetic drive technology is slow, often the database spends a majority of its time waiting for disk read/write requests to complete. How Oracle manages data The main way that Oracle manages data (in datafiles), is using blocks. Each block is read, and is written, as a single object; Oracle does not read or write partial blocks. This means that if a tablespace’s block size is set at 8k (8192 bytes), whenever information is required to be read or written, it will do it in a number of 8k chunks. The  PCTFREE  property of a segment There is a property of a table or index that can be set, that will force Oracle to pack more rows into each block. This can have a very dramatic affect on the throughput of read and write requests, because if more rows of data are packed into each block, the ...

Senior Data Manager is needed

Qualifications • A minimum of first degree in database development and management of data systems is a requirement • Additional training in statistics or public health will be an added advantage • A minimum of 5 yrs experience in working at a management level position for data systems especially in HIV care and treatment setting demonstrated data analysis (in what software package ) and report writing skills • At least 3 yrs experience in middle level management skills and in staff supervision staff Application Instructions: Interested applicants should send their CV, Cover Letter, and 3 references to the Email Link above or by post to Human Resource Manager P O BOX 79810 Dar es Salaam, Tanzania 

Set a wait time for DDL Lock

alter session set ddl_lock_timeout = t;

Pré-requis pour Installer Oracle 11g sous Linux

Vérifier la mémoire (1Go nécessaire) [oracle@dsiege103829 oracle]$ grep MemTotal /proc/meminfo MemTotal: 1024364 kB Déterminer la taille du Swap grep SwapTotal /proc/meminfo [oracle@dsiege103829 oracle]$ grep SwapTotal /proc/meminfo SwapTotal: 1048568 kB Déterminer la mémoire partagé [oracle@dsiege103829 oracle]$ df -k /dev/shm/ Filesystem 1K-blocks Used Available Use% Mounted on tmpfs 512180 0 512180 0% /dev/shm Déterminer l'espace disponible du TMP ( il faut environ 150Mo à 200Mo ) [oracle@dsiege103829 oracle]$ df -m /tmp Filesystem 1M-blocks Used Available Use% Mounted on /dev/mapper/VGsys-tmpLV 992 36 906 4% /tmp Vérifier les packages d'installer rpm -qa | grep package_name Liste des packages nécessaires compat-libstdc++-33.2.3-47.3 elfutils-libelf-0.97-5 elfutils-libelf-devel-0.97-5 glibc-2.3.9.4-2.19 glibc-common-2.3.9.4-2.19 glibc-devel-2.3.9.4-2.19 gcc-3....

How to display the top three earners in the employees table.

SELECT last_name, salary FROM employees e WHERE 3 > (SELECT COUNT (*) FROM employees WHERE e.salary

Why and when should I backup my database?

Backup and recovery is one of the most important aspects of a DBA's job. If you lose your company's data, you could very well lose your job. Hardware and software can always be replaced, but your data may be irreplaceable! Normally one would schedule a hierarchy of daily, weekly and monthly backups, however consult with your users before deciding on a backup schedule. Backup frequency normally depends on the following factors: Rate of data change/ transaction rate Database availability/ Can you shutdown for cold backups? Criticality of the data/ Value of the data to the company Read-only tablespace needs backing up just once right after you make it read-only If you are running in archivelog mode you can backup parts of a database over an extended cycle of days If archive logging is enabled one needs to backup archived log files timeously to prevent database freezes Carefully plan backup retention periods. Ensure enough backup media (tapes) are available and that old back...

Liste des plus grandes consommations CPU

Ce script SQL permet d'afficher les opérations les plus gourmandes en terme de CPU   SET echo off SET feedback off SET linesize 512   prompt ---------------------------------- prompt - plus grandes consommation CPU -- prompt ----------------------------------   COLUMN sid format 999 heading "SID" COLUMN username format a20 heading "Utilisateur" COLUMN command format a20 heading "Commande" COLUMN osuser format a20 heading "Utilisateur OS" COLUMN process format a20 heading "Processus OS" COLUMN machine format a20 heading "Machine" COLUMN value format 99 , 999 heading "Temps CPU"   SELECT s . sid sid , s . username username , UPPER ( DECODE ( command , 1 , 'Create Table' , 2 , 'Insert' , 3 , 'Select' , 4 , 'Create Cluster' , 5 , 'Alter Cluster' , 6 , 'Update...