Showing posts with label Oracle. Show all posts
Showing posts with label Oracle. Show all posts

07 June 2013

How to find which process caused cluster node reboot


Determining Which Process Caused Reboot
Log File Locations for Processes Causing Reboots.
• oclskd
/log//client/oclskd.log
• ocssd
– /var/log/messages
/log//cssd/ocssd.log
• cssdagent
/log//agent/ohasd/oracss
dagent_root
• cssdmonitor
/log//agent/ohasd/oracss
dmonitor_root
• hangcheck-timer
– /var/log/messages

Determining Which Process Caused Reboot
First, determine the time of the node reboot by using the uptime command and subtracting the
up time from the current system time. The reboot time will be used when examining log files.
When the OCSSD daemon is responsible for rebooting a node, a message similar to “Oracle
CSSD failure. Rebooting for cluster integrity” is written into the system messages log at
/var/log/messages. The cssd daemon log file that is located at
/log//cssd/ocssd.log may also contain messages similar to
"Begin Dump" or "End Dump" just before the reboot.
If hangcheck-timer is being used, it will provide message logging to the system messages log
when a node restart is initiated by the module. To verify whether this process was responsible
for the node reboot, examine the /var/log/messages file and look for an error message
similar to: "Hangcheck: hangcheck is restarting the machine."
Other useful log files include the Clusterware alert log in /log/
and the lastgasp log in /etc/oracle/lastgasp or /var/opt/oracle/lastgasp.
If no indication of which process caused the reboot can be determined from these files,
additional debugging and tracing may need to be enabled.
Note: The oclsomon and the oprocd background processes have been eliminated in Oracle
Database 11g Release 2.

Standby redologs



Quote from documentation:

The standby redo logs are populated with redo information as fast as the primary redo logs, rather than waiting for the redo log to be archived and shipped to the standby database. This means that the standby redo log has more current information than the log apply mechanism because it took a "shortcut" and was written to the standby, bypassing the traditional archiving and FTP to the standby database.

18 November 2010

Change location for RMAN backupset

Execute commands below:


crosscheck backup;
delete noprompt expired;

catalog backuppiece ; {repeat this for each backup file}

22 October 2010

ORA-00600: INTERNAL ERROR CODE, ARGUMENTS: [KELTNFY-LDMINIT]

OS: OEL 5.5
RDBMS: Oracle 10.2.0
Before installing Oracle server do all the jobs with server network (ip, host_naming, etc.) in order to avoid getting error above.

21 October 2010

27 September 2010

Standby log errors

Error
FAL[client]: Failed to request gap sequence 
 GAP - thread 1 sequence 2-101
 DBID 2236488982 branch 665833900
FAL[client]: All defined FAL servers have been attempted.

Solution
crosscheck archivelog all;

22 September 2010

SGA exceeds 2GB on Linux 32bit

1. edit init.ora

use_indirect_data_buffers=true 
db_block_size=8192 
db_block_buffers=1048576 # 8Gb
shared_pool_size=1415577600 #2831155200 - 2G

Grant/Revoke object privileges

begin
  for cur in (select do.owner || '.' || do.object_name obj
                from dba_objects do
               where do.owner = 'user1'
                 and do.object_type = 'TABLE') loop
    execute immediate 'grant select on ' || cur.obj || ' to user2';
    --execute immediate 'revoke select on '||cur.obj ||' from user2';
    dbms_output.put_line(cur.obj);
  end loop;
end;

14 September 2010

Linux kernel parameters for Oracle installation

1) Edit file /etc/sysctl.config
example RAM8Gb
kernel.shmmax = 2147483648 #max RAM
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=1048576
net.core.rmem_max=1048576
net.core.wmem_default=262144
net.core.wmem_max=262144

06 August 2010

LDAP essentials

LDAP is an acronym that stands for Lightweight Directory Access Protocol.


Oracle is beginning to support and use LDAP. Release 8.1.6 contain an LDAP naming adaptor for Net8. This allows you to define net service names in an LDAP directory instead of the traditional tnsnames.ora file. Another planned use for LDAP in the Oracle world is to support single sign-on. Instead of defining the same user over-and-over again in different databases, you will be able to define a user once in an LDAP directory. Information about a user's roles and privileges will be stored in the directory. The user will authenticate to the directory, and once that has been done, the user will be able to connect to any Oracle database that he has been authorized to use without having to supply a database-specific username and password.

30 July 2010

Parametrized view

Following is an example which shows use of parametrized view:

CREATE OR REPLACE VIEW test_vw AS
SELECT empno,ename,sal
FROM emp
WHERE empno = to_number(userenv('client_info')) ;

In Stored Procedure, will have to call following procedure before executing the View query, as in following example:

exec dbms_application_info.set_client_info(7934);

select * from test_vw ;

And the output is:

EMPNO ENAME SAL
---------- ---------- ----------
7934 MILLER 13040

05 July 2010

Installation Oracle 10g on Slackware 13.1 Linux

The reason for this actions could be an error has been gotten while installing Oracle on Slackware.
Error description: Failure OS verification
Action: create a file - /etc/redhat-release for OS verification and add something like "Red Hat Enterprise Linux AS release 3 (Taroon)".

09 June 2010

Changing the Database Archiving Mode

1)See the current archiving mode of the database.

select log_mode from v$database;

2)Perform clean shutdown of the database.
shutdown immediate or,
shutdown transactional or,
shutdown normal

You cannot change the mode from ARCHIVELOG to NOARCHIVELOG if any datafiles need media recovery.

How to Enable Flashback Database

To enable flashback database the following operations is needed.


1)Configure the Database in archivelog mode.

To change archiving read, Change Archival Mode

2)Configure Flash Recovery Area.
To configure flash recovery area,
Set up Flash Recovery Area

Set Up a Flash Recovery Area for RMAN

Flash recovery area simplifies the ongoing administration of your database by automatically naming recovery-related files, retaining them as long as they are needed for restore and recovery activities, and deleting them when they are no longer needed to restore your database and space is needed for some other backup and recovery-related purpose.


To see up flash recovery follow below steps.

03 June 2010

Quiescing mode of database state

Quiesced state
Aim: perform DBA actions (compile objects, alter tables ...)
Conditions:
Active non-DBA sessions go on until they are becoming inactive. No active sessions are allowed to be active, but they will be hung. When the database is unquiesced, all hung sessions are resumed and blocking actions are processed. Issued command will wait  for active sessions to become inactive.
RAC: Quiesce affects all instances.
Command:
ALTER SYSTEM QUIESCE RESTRICTED;
ALTER SYSTEM UNQUIESCE;
Control:
V$BLOCKING_QUIESCE - view where DBA can check the info about sessions that are blocking.

31 May 2010

SQL revise (part 2)

Union/Union all


The UNION operator returns results from both queries after eliminating duplications.
The UNION ALL operator returns results from both queries, including all duplications.


The INTERSECT operator returns rows that are common to both queries.
The MINUS operator returns rows in the first query that are not present in the second query.