Sunday, September 16, 2012
Wednesday, September 5, 2012
important Database query
To query all database tables in given database owned by the user T24
SQL> l
1* select table_name, tablespace_name from dba_tables where owner='T24'
SQL> select table_name, tablespace_name from dba_tables where owner='T24';
To query space usage
SQL> select sum(bytes)/1024/1024/1000 gb from dba_data_files;
GB
----------
47.3125
SQL>
SQL> select sum(sum_bytes)/1024/1024 m_bytes
from(
select sum(bytes) sum_bytes from v$datafile
union
select sum(bytes) sum_bytes from v$tempfile
union
select (sum(bytes) * members) sum_bytes from v$log
group by members); 2 3 4 5 6 7 8
M_BYTES
----------
47927.5
SQL> l
1 select sum(sum_bytes)/1024/1024 m_bytes
2 from(
3 select sum(bytes) sum_bytes from v$datafile
4 union
5 select sum(bytes) sum_bytes from v$tempfile
6 union
7 select (sum(bytes) * members) sum_bytes from v$log
8* group by members)
To query database data guard status
SQL> select GUARD_STATUS , DATAGUARD_BROKER, FLASHBACK_ON, REMOTE_ARCHIVE, PROTECTION_MODE from v$database;
GUARD_S DATAGUAR FLASHBACK_ON REMOTE_A PROTECTION_MODE
------- -------- ------------------ -------- --------------------
NONE DISABLED NO ENABLED MAXIMUM PERFORMANCE
SQL>
SQL>
To query all export and import directory
SQL> select * from dba_directories;
OWNER DIRECTORY_NAME
------------------------------ ------------------------------
DIRECTORY_PATH
--------------------------------------------------------------------------------
SYS XMLDIR
/ade/b/3705469564/oracle/rdbms/xml
SYS IMPDP_DIR
/u02/backup/export/CBELIVE
SYS DATA_PUMP_DIR
/u03/export/FEMOBILE
OWNER DIRECTORY_NAME
------------------------------ ------------------------------
DIRECTORY_PATH
--------------------------------------------------------------------------------
SYS ORACLE_OCM_CONFIG_DIR
/u01/app/oracle/product/11.2.0/dbhome_1/ccr/state
SQL>
SQL> select directory_name,directory_path from dba_directories;
DIRECTORY_NAME
------------------------------
DIRECTORY_PATH
XMLDIR
/ade/b/3705469564/oracle/rdbms/xml
IMPDP_DIR
/u02/backup/export/CBELIVE
DATA_PUMP_DIR
/u03/export/FEMOBILE
Monday, July 30, 2012
How To Determine if Your Computer Is 32-Bit or 64-Bit
When downloading a software program, you may be asked whether it's for an operating system that's 32-bit or 64-bit. Most PCs currently are 32-bit machines; their processors can handle 32 bits of data at a time.
Following these steps on a Windows operating system, you can determine whether your computer is 32-bit or 64-bit.
Open the System Information
1:- Open the Start menu, and click on Programs -> Accessories -> System Tools -> System Information
2:-Look in the System Summary
The System Information tool will display detailed information about your Windows operating system. Once opened it will show the "System Summary" – it’s an overview of your computer and operating system.
3:-Look for the System Type Item
On the right hand side of the window you will see a list of items. Look for the item called "System Type".
The value of this item will tell you whether your computer is 32-bit or 64-bit:
x86-based PC: It’s a 32-bit computer.
x64-based PC: It’s a 64-bit computer.
url list to download
http://netbeans.org/downloads/index.html :: for netbeens dowload
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1637583.html :- for jdk download
http://www.zoho.com/projects/ :- free project manager software download
What is project ?
A project, by definition, is a temporary activity with a starting date, specific goals and conditions, defined responsibilities, a budget, a planning, a fixed end date and multiple parties involved. You know what you have to do, do it, once, and that's the end of it. That's a project.
http://netbeans.org/downloads/index.html :: for netbeens dowload
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1637583.html :- for jdk download
http://www.zoho.com/projects/ :- free project manager software download
What is project ?
A project, by definition, is a temporary activity with a starting date, specific goals and conditions, defined responsibilities, a budget, a planning, a fixed end date and multiple parties involved. You know what you have to do, do it, once, and that's the end of it. That's a project.
Object-oriented methods combine the problem and solution domain modeling activities
into one.
into one.
Monday, June 25, 2012
Configuring SSH on All Cluster Nodes
Configuring SSH on All Cluster Nodes
Configure SSH without using a password or passphrase between primary and standby server.
For Linux or Unix.
To configure SSH without using a password or passphrase the utility ssh-keygen is run. You have to create
a RSA authentication key to be able to log into a remote site from your account. This should be done as the
Dbvisit software owner, never as root!
Important:
Ensure the home directories (cd $HOME) of the accounts on the primary and standby servers have
the following permissions:
[oracle@RAC1]$ ls –al .
drwxr-xr-x 40 oracle dba 4096 Sep 17 02:46 .
If the permissions are 775 or 777 then ssh may keep asking for a password. Change permission
with: chmod 755 .
1. On the primary server as Dbvisit software owner (do not enter passphrase!):
[oracle@RAC1]$ ssh-keygen
Generating public/private dsa key pair.
Enter file in which to save the key (/oracle/orabase/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /oracle/orabase/.ssh/id_dsa.
Your public key has been saved in /oracle/orabase/.ssh/id_dsa.pub.
The key fingerprint is:
73:c7:f5:7c:ee:bd:62:7f:0d:51:ed:8a:c7:45:f7:d9 oracle@RAC1
In this example RAC1 is the primary server and RAC2 is the standby server
The public/private key pair may either be dsa or rsa
On some implementations of ssh, you have to specify: ssh-keygen –t dsa
On Linux the output may be different:
[oracle@RAC1]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/oracle/orabase/.ssh/identity):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /oracle/orabase/.ssh/identity.
Your public key has been saved in /oracle/orabase/.ssh/identity.pub.
The key fingerprint is:
a2:88:ad:53:e8:5b:37:a1:82:6d:03:ec:96:c4:6b:df oracle@RAC1
In this example RAC1 is the primary server and RAC2 is the standby server
This will generate 2 files under your home directory:
.ssh/id_dsa
.ssh/id_dsa.pub
Or alternatively generate the following files under your home directory:
.ssh/id_rsa
.ssh/id_rsa.pub
On Linux the files may be called different.
.ssh/identity
.ssh/identity.pub
2. On the standby server as Dbvisit software owner (do not enter passphrase!):
[oracle@RAC2]$ ssh-keygen
Oracle is a registered trademark of Oracle Corporation
Copyright 2000-2008 Avisit Solutions Limited
www.dbvisit.com
Generating public/private dsa key pair.
Enter file in which to save the key (/oracle/orabase/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /oracle/orabase/.ssh/id_dsa.
Your public key has been saved in /oracle/orabase/.ssh/id_dsa.pub.
The key fingerprint is:
73:c7:f5:7c:ee:bd:62:7f:0d:51:ed:8a:c7:45:f7:d9 oracle@RAC2
In this example RAC1 is the primary server and RAC2 is the standby server
The public/private key pair may either be dsa or rsa
On Linux the output may be different:
[oracle@RAC2]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/oracle/orabase/.ssh/identity):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /oracle/orabase/.ssh/identity.
Your public key has been saved in /oracle/orabase/.ssh/identity.pub.
The key fingerprint is:
a2:88:ad:53:e8:5b:37:a1:82:6d:03:ec:96:c4:6b:df oracle@RAC2
In this example RAC1 is the primary server and RAC2 is the standby server
This will generate 2 files under your home directory:
.ssh/id_dsa
.ssh/id_dsa.pub
Or alternatively generate the following files under your home directory:
.ssh/id_rsa
.ssh/id_rsa.pub
On Linux the files may be called different
.ssh/identity
.ssh/identity.pub
3. On the standby server create a new empty file called .ssh/authorized_keys
[oracle@RAC2]$ cd .ssh
[oracle@RAC2]$ vi authorized_keys
In this example RAC1 is the primary server and RAC2 is the standby server
4. On your primary server copy the contents of file .ssh/id_dsa.pub to the new file .ssh/authorized_keys on
the standby server. The file may be called identity.pub or id_rsa.pub instead of id_dsa.pub.
[oracle@RAC1]$ cat id_dsa.pub
ssh-dss AAAAB3NzaC1kc3MAAACBALj5RhJzSDOvRnTID/P2kblmE9qM2zCrzUa0gDL/fbngdcB8EELeJJi
LuhR9uM/XyQr+UySGVeMS1jM0uBfQcs/7p3WAEkxncXzGduxlsyO8iyYfr8Kf7ufGPdJq7n15v0hjUMWSa
w6YcA== oracle@RAC1
5. Ensure the new file .ssh/authorized_keys has the correct permission:
[oracle@RAC1]$ chmod 600 authorized_keys
6. On the primary server create a new empty file called .ssh/authorized_keys
[oracle@RAC1]$ cd .ssh
[oracle@RAC1]$ vi authorized_keys
In this example RAC1 is the primary server and RAC2 is the standby server
7. On your standby server copy the contents of file .ssh/id_dsa.pub to the new file .ssh/authorized_keys
on the primary server. The file may be called identity.pub or id_rsa.pub instead of
id_dsa.pub.
[oracle@RAC2]$ cat id_dsa.pub
ssh-dss AAAAB3NzaC1kc3MAAACBALj5RhJzSDOvRnTID/P2kblmE9qM2zCrzUa0gDL/fbngdcB8EELeJJi
Oracle is a registered trademark of Oracle Corporation
Copyright 2000-2008 Avisit Solutions Limited
www.dbvisit.com
LuhR9uM/XyQr+UySGVeMS1jM0uBfQcs/7p3WAEkxncXzGduxlsyO8iyYfr8Kf7ufGPdJq7n15v0hjUMWSa
w6YcA== oracle@RAC2
8. Ensure the new file .ssh/authorized_keys has the correct permission:
[oracle@RAC1]$ chmod 600 authorized_keys
SSH is now setup and configured. To test:
On the primary server:
[oracle@RAC1]$ ssh RAC2 ls -al
The authenticity of host ‘RAC2 (10.1.1.82)’ can’t be established.
RSA key fingerprint is 40:bb:ea:96:48:7d:22:fa:36:a6:8e:e7:37:7c:f4:d3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘RAC2,10.1.1.82′ (RSA) to the list of known hosts.
total 896
drwxr-xr-x 26 oracle dba 4096 Feb 27 18:49 .
drwxr-xr-x 6 root root 4096 May 30 2006 ..
-rw——- 1 oracle dba 2640 Feb 15 09:39 .ICEauthority
drwx—— 5 oracle dba 4096 May 21 2006 .Trash
-rw——- 1 oracle dba 120 Feb 15 09:39 .Xauthority
-rw-r–r– 1 oracle dba 76 May 24 2006 .alias
-rw——- 1 oracle dba 16019 Jun 1 2006 .bash_history
……
In this example RAC1 is the primary server and RAC2 is the standby server
On the standby server:
[oracle@RAC2]$ ssh RAC1 ls –al
The authenticity of host ‘RAC1 (10.1.1.81)’ can’t be established.
RSA key fingerprint is 40:bb:ea:96:48:7d:22:fa:36:a6:8e:e7:37:7c:f4:d3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘RAC1,10.1.1.81′ (RSA) to the list of known hosts.
total 896
drwxr-xr-x 26 oracle dba 4096 Feb 27 18:49 .
drwxr-xr-x 6 root root 4096 May 30 2006 ..
-rw——- 1 oracle dba 2640 Feb 15 09:39 .ICEauthority
drwx—— 5 oracle dba 4096 May 21 2006 .Trash
-rw——- 1 oracle dba 120 Feb 15 09:39 .Xauthority
-rw-r–r– 1 oracle dba 76 May 24 2006 .alias
-rw——- 1 oracle dba 16019 Jun 1 2006 .bash_history
……
In this example RAC1 is the primary server and RAC2 is the standby server
Secure shell configuration is now competed.
Configure SSH without using a password or passphrase between primary and standby server.
For Linux or Unix.
To configure SSH without using a password or passphrase the utility ssh-keygen is run. You have to create
a RSA authentication key to be able to log into a remote site from your account. This should be done as the
Dbvisit software owner, never as root!
Important:
Ensure the home directories (cd $HOME) of the accounts on the primary and standby servers have
the following permissions:
[oracle@RAC1]$ ls –al .
drwxr-xr-x 40 oracle dba 4096 Sep 17 02:46 .
If the permissions are 775 or 777 then ssh may keep asking for a password. Change permission
with: chmod 755 .
1. On the primary server as Dbvisit software owner (do not enter passphrase!):
[oracle@RAC1]$ ssh-keygen
Generating public/private dsa key pair.
Enter file in which to save the key (/oracle/orabase/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /oracle/orabase/.ssh/id_dsa.
Your public key has been saved in /oracle/orabase/.ssh/id_dsa.pub.
The key fingerprint is:
73:c7:f5:7c:ee:bd:62:7f:0d:51:ed:8a:c7:45:f7:d9 oracle@RAC1
In this example RAC1 is the primary server and RAC2 is the standby server
The public/private key pair may either be dsa or rsa
On some implementations of ssh, you have to specify: ssh-keygen –t dsa
On Linux the output may be different:
[oracle@RAC1]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/oracle/orabase/.ssh/identity):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /oracle/orabase/.ssh/identity.
Your public key has been saved in /oracle/orabase/.ssh/identity.pub.
The key fingerprint is:
a2:88:ad:53:e8:5b:37:a1:82:6d:03:ec:96:c4:6b:df oracle@RAC1
In this example RAC1 is the primary server and RAC2 is the standby server
This will generate 2 files under your home directory:
.ssh/id_dsa
.ssh/id_dsa.pub
Or alternatively generate the following files under your home directory:
.ssh/id_rsa
.ssh/id_rsa.pub
On Linux the files may be called different.
.ssh/identity
.ssh/identity.pub
2. On the standby server as Dbvisit software owner (do not enter passphrase!):
[oracle@RAC2]$ ssh-keygen
Oracle is a registered trademark of Oracle Corporation
Copyright 2000-2008 Avisit Solutions Limited
www.dbvisit.com
Generating public/private dsa key pair.
Enter file in which to save the key (/oracle/orabase/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /oracle/orabase/.ssh/id_dsa.
Your public key has been saved in /oracle/orabase/.ssh/id_dsa.pub.
The key fingerprint is:
73:c7:f5:7c:ee:bd:62:7f:0d:51:ed:8a:c7:45:f7:d9 oracle@RAC2
In this example RAC1 is the primary server and RAC2 is the standby server
The public/private key pair may either be dsa or rsa
On Linux the output may be different:
[oracle@RAC2]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/oracle/orabase/.ssh/identity):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /oracle/orabase/.ssh/identity.
Your public key has been saved in /oracle/orabase/.ssh/identity.pub.
The key fingerprint is:
a2:88:ad:53:e8:5b:37:a1:82:6d:03:ec:96:c4:6b:df oracle@RAC2
In this example RAC1 is the primary server and RAC2 is the standby server
This will generate 2 files under your home directory:
.ssh/id_dsa
.ssh/id_dsa.pub
Or alternatively generate the following files under your home directory:
.ssh/id_rsa
.ssh/id_rsa.pub
On Linux the files may be called different
.ssh/identity
.ssh/identity.pub
3. On the standby server create a new empty file called .ssh/authorized_keys
[oracle@RAC2]$ cd .ssh
[oracle@RAC2]$ vi authorized_keys
In this example RAC1 is the primary server and RAC2 is the standby server
4. On your primary server copy the contents of file .ssh/id_dsa.pub to the new file .ssh/authorized_keys on
the standby server. The file may be called identity.pub or id_rsa.pub instead of id_dsa.pub.
[oracle@RAC1]$ cat id_dsa.pub
ssh-dss AAAAB3NzaC1kc3MAAACBALj5RhJzSDOvRnTID/P2kblmE9qM2zCrzUa0gDL/fbngdcB8EELeJJi
LuhR9uM/XyQr+UySGVeMS1jM0uBfQcs/7p3WAEkxncXzGduxlsyO8iyYfr8Kf7ufGPdJq7n15v0hjUMWSa
w6YcA== oracle@RAC1
5. Ensure the new file .ssh/authorized_keys has the correct permission:
[oracle@RAC1]$ chmod 600 authorized_keys
6. On the primary server create a new empty file called .ssh/authorized_keys
[oracle@RAC1]$ cd .ssh
[oracle@RAC1]$ vi authorized_keys
In this example RAC1 is the primary server and RAC2 is the standby server
7. On your standby server copy the contents of file .ssh/id_dsa.pub to the new file .ssh/authorized_keys
on the primary server. The file may be called identity.pub or id_rsa.pub instead of
id_dsa.pub.
[oracle@RAC2]$ cat id_dsa.pub
ssh-dss AAAAB3NzaC1kc3MAAACBALj5RhJzSDOvRnTID/P2kblmE9qM2zCrzUa0gDL/fbngdcB8EELeJJi
Oracle is a registered trademark of Oracle Corporation
Copyright 2000-2008 Avisit Solutions Limited
www.dbvisit.com
LuhR9uM/XyQr+UySGVeMS1jM0uBfQcs/7p3WAEkxncXzGduxlsyO8iyYfr8Kf7ufGPdJq7n15v0hjUMWSa
w6YcA== oracle@RAC2
8. Ensure the new file .ssh/authorized_keys has the correct permission:
[oracle@RAC1]$ chmod 600 authorized_keys
SSH is now setup and configured. To test:
On the primary server:
[oracle@RAC1]$ ssh RAC2 ls -al
The authenticity of host ‘RAC2 (10.1.1.82)’ can’t be established.
RSA key fingerprint is 40:bb:ea:96:48:7d:22:fa:36:a6:8e:e7:37:7c:f4:d3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘RAC2,10.1.1.82′ (RSA) to the list of known hosts.
total 896
drwxr-xr-x 26 oracle dba 4096 Feb 27 18:49 .
drwxr-xr-x 6 root root 4096 May 30 2006 ..
-rw——- 1 oracle dba 2640 Feb 15 09:39 .ICEauthority
drwx—— 5 oracle dba 4096 May 21 2006 .Trash
-rw——- 1 oracle dba 120 Feb 15 09:39 .Xauthority
-rw-r–r– 1 oracle dba 76 May 24 2006 .alias
-rw——- 1 oracle dba 16019 Jun 1 2006 .bash_history
……
In this example RAC1 is the primary server and RAC2 is the standby server
On the standby server:
[oracle@RAC2]$ ssh RAC1 ls –al
The authenticity of host ‘RAC1 (10.1.1.81)’ can’t be established.
RSA key fingerprint is 40:bb:ea:96:48:7d:22:fa:36:a6:8e:e7:37:7c:f4:d3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘RAC1,10.1.1.81′ (RSA) to the list of known hosts.
total 896
drwxr-xr-x 26 oracle dba 4096 Feb 27 18:49 .
drwxr-xr-x 6 root root 4096 May 30 2006 ..
-rw——- 1 oracle dba 2640 Feb 15 09:39 .ICEauthority
drwx—— 5 oracle dba 4096 May 21 2006 .Trash
-rw——- 1 oracle dba 120 Feb 15 09:39 .Xauthority
-rw-r–r– 1 oracle dba 76 May 24 2006 .alias
-rw——- 1 oracle dba 16019 Jun 1 2006 .bash_history
……
In this example RAC1 is the primary server and RAC2 is the standby server
Secure shell configuration is now competed.
Saturday, June 9, 2012
DBA checklists
I. Daily Procedure
1. Verify all instances are up
2. Look for any new alert log entries
3. Verify DBSNMP is running : Which may be security treat
4. Verify success of database backup
5. Verify success of database archiving to tape
6. Verify enough resources for acceptable performance
7. Copy Archived Logs to Standby Database and Roll Forward
8. Read DBA manuals for sometime
II. Nightly Procedures
1. Collect volumetric data
2. Taking offline/cool full backup if necessary
III. Weekly Procedures
1. Look for objects that break rules
2. Look for security policy violations
3. Look in SQL*Net logs for errors, issues
4. Archive all Alert Logs to history
5. Visit home pages of key vendors
IV. Monthly Procedures
1. Look for Harmful Growth Rates
2. Review Tuning Opportunities
3. Look for I/O Contention
4. Review Fragmentation
5. Project Performance into the Future
6. Perform Tuning and Maintenance
Subscribe to:
Posts (Atom)
