The Following Documents like the followings :
1- Upgrade Oracle 10g Clusterware to 11gR2 Clusterware.
2- Upgrade ASM 10g to 11gR2 .
3- Upgrade Database 10g to 11gR2 .
Enjoy
Thank you
Osama mustafa
For the people who think differently Welcome aboard
The Following Documents like the followings :
1- Upgrade Oracle 10g Clusterware to 11gR2 Clusterware.
2- Upgrade ASM 10g to 11gR2 .
3- Upgrade Database 10g to 11gR2 .
Enjoy
Thank you
Osama mustafa
The following query will reveal the profile:
SQL> select profile, resource_name, limit
from dba_profiles
where resource_type='PASSWORD' order by 1,2;
The default 10.2.0.1.0 profile for SYSMAN has the following parameters:
PROFILE………..RESOURCE_NAME……………. LIMIT
———————————————————————————–
DEFAULT………..FAILED_LOGIN_ATTEMPTS…….. 10
DEFAULT………..PASSWORD_GRACE_TIME………. UNLIMITED
DEFAULT………..PASSWORD_LIFE_TIME……….. UNLIMITED
DEFAULT………..PASSWORD_LOCK_TIME……….. UNLIMITED
DEFAULT………..PASSWORD_REUSE_MAX………. . UNLIMITED
DEFAULT………..PASSWORD_REUSE_TIME……… UNLIMITED
DEFAULT………..PASSWORD_VERIFY_FUNCTION…..NULL
DBSNMP uses the MONITORING_PROFILE, which is defined the same except for the FAILED_LOGIN_ATTEMPTS, which is set to UNLIMITED.
The failing instance, in one case, showed the following for the DEFAULT profile:
PROFILE………..RESOURCE_NAME……..LIMIT
—————————— ——————————————-
DEFAULT………..FAILED_LOGIN_ATTEMPTS……… 4
DEFAULT………..PASSWORD_GRACE_TIME……….. 1
DEFAULT………..PASSWORD_LIFE_TIME………… 60
DEFAULT………..PASSWORD_LOCK_TIME……….. . 0138
DEFAULT………..PASSWORD_REUSE_MAX………… 100
DEFAULT………..PASSWORD_REUSE_TIME……….. UNLIMITED
DEFAULT………..PASSWORD_VERIFY_FUNCTION…… NULL
1. In SQL*Plus, logon as SYS and change DBSNMP’s MONITORING_PROFILE, for example:
ALTER PROFILE MONITORING_PROFILE
LIMIT FAILED_LOGIN_ATTEMPTS UNLIMITED
PASSWORD_GRACE_TIME UNLIMITED
PASSWORD_LIFE_TIME UNLIMITED
PASSWORD_LOCK_TIME UNLIMITED
PASSWORD_REUSE_MAX UNLIMITED
PASSWORD_REUSE_TIME UNLIMITED
PASSWORD_VERIFY_FUNCTION NULL;
2. Then modify SYSMAN’s DEFAULT:
ALTER PROFILE DEFAULT
LIMIT FAILED_LOGIN_ATTEMPTS 10
PASSWORD_GRACE_TIME UNLIMITED
PASSWORD_LIFE_TIME UNLIMITED
PASSWORD_LOCK_TIME UNLIMITED
PASSWORD_REUSE_MAX UNLIMITED
PASSWORD_REUSE_TIME UNLIMITED
PASSWORD_VERIFY_FUNCTION NULL;
After this Drop with following Steps :
SQL> drop role mgmt_user;
SQL> drop user sysman cascade;
SQL> drop user MGMT_VIEW cascade;
SQL> drop public synonym mgmt_target_blackouts;
SQL> drop public synonym setemviewusercontext;
-Recreate EM
emca -dbcontrol db -repos create ;
Thank you
Osama mustafa
DBSNMP Not Found On dba_users
So Simple run the following scripts :
@?/rdbms/admin/catnsnmp.sql@?/rdbms/admin/catsnmp.sql
Thank you
Osama mustafa
There’s Two Kind Of OCR Backup :
$ORA_CRS_HOME/cdata
Or
ocrconfig -showbackup
Want to change The Default Location for automatic backup :
ocrconfig -backuploc
$ocrconfig -export /u04/crs_backup/ocrbackup/exports/OCRFile_expBackup.dmp
$ocrconfig -export /u04/crs_backup/ocrbackup/exports/OCRFile_expBackup.dmp
$ocrconfig -showbackup
$srvctl -stop database -d ORCL (Shutdown all RAC instances and RAC database)
$crsctl stop crs (Shutdown Cluster)
#ocrconfig -restore /u02/apps/crs/cdata/crs/backup00.ocr
$crsctl start crs (After issuing start cluster check status of cluster using ‘crs_stat -t’)
$srvctl start database -d ORCL (Start Oracle RAC database and RAC instances)
$srvctl -stop database -d ORCL (Shutdown all RAC instances and RAC database)
$crsctl stop crs (Shutdown Cluster)SAME process should need to repeat for OCR mirror also.
ocrconfig -import /u04/crs_backup/ocrbackup/exports/OCRFile_exp_Backup.dmp (Import metadata of OCR using command)
$crsctl start crs (After issuing start cluster check status of cluster using ‘crs_stat -t’)
$srvctl start database -d ORCL (Start Oracle RAC database and RAC instances)
Thank you
Osama mustafa
select * from all_directories where directory_name = ‘DIRECTORY_NAME‘;select * from user_tab_privs
where table_name = ‘DIRECTORY_NAME‘;select * from user_sys_privs
where privilege = 'CREATE ANY DIRECTORY';
1) Create data-pump directory
CONN / AS SYSDBACREATE OR REPLACE DIRECTORY test_dir AS '';
2.) Grant permission now to this directory
GRANT READ, WRITE ON DIRECTORY test_dir TO ;
3.)Copy the desired dump-file at directory Location :
4.)Start import now .
Good Luck
Thank you
Osama mustafa
SQL>alter database backup controlfile to trace;
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE “OLDLSQ” NORESETLOGS
NOARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 2
MAXDATAFILES 240
MAXINSTANCES 1
MAXLOGHISTORY 113
LOGFILE
GROUP 1 (‘/u01/oradata/oldlsq/log1a.dbf’,
‘/u01/oradata/olslsq/log1b.dbf’) SIZE 30M,
GROUP 2 (‘/u01/oradata/oldlsq/log2a.dbf’,
‘/u01/oradata/oldlsq/log2b.dbf’) SIZE 30M
DATAFILE
‘/u01/oradata/oldlsq/system01.dbf’,
‘/u01/oradata/oldlsq/mydatabase.dbf’
;
# Recovery is required if any of the datafiles are restored
# backups, or if the last shutdown was not normal or immediate.
RECOVER DATABASE
# Database can now be opened normally.
ALTER DATABASE OPEN;
SQL>Shutdown immediate ;
Step-3 : Copy and Edit the Control file – Using the output syntax from STEP 1, modify the controlfile creation script by changing the following:
CREATE CONTROLFILE REUSE DATABASE “OLDLSQ” NORESETLOGSCREATE CONTROLFILE SET DATABASE “NEWLSQ” RESETLOGS
Step-4 :Remove the “recover database” and “alter database open” syntax
Step-5:Re-names of the data files location to new clone location in a dbclone_controlfile_creation.sql.
Old:
DATAFILE
‘/u01/oradata/oldlsq/system01.dbf’,
‘/u01/oradata/oldlsq/mydatabase.dbf’New:
DATAFILE
‘/u01/oradata/newlsq/system01.dbf’,
‘/u01/oradata/newlsq/mydatabase.dbf’
Step-6: Copy all data files into the new directories on the new server. You may change the file names if you want, but you must edit the controlfile to reflect the new data files names on the new server.
Step-7 : Create the bdump, udump and cdump directories
cd /u01/admin/
mkdir newlsq
cd newlsq
mkdir bdump
mkdir udump
mkdir cdump
mkdir pfile
Step-8 : Copy-over the old init.ora file
open the primary database pfile in a notepad or text editor and change the udump,bdump,pfile,controlfile destination and save it in new clone pfile location newlsq folder and save as newlsq.ora
eg: primary database location /u01/admin/oldlsq/pfile/oldlsq.ora
open that oldlsq.ora file in a text editor or notepad and change the required destinations cdump,udump,bdump,controlfile destinations and save as newlsq.ora in the below destination
/u01/admin/newlsq/pfile/newlsq.ora
Step-9 : Start the new database
SQL>startup nomount pfile=’ /u01/admin/newlsq/pfile/newlsq.ora ‘ ;SQL> @dbclone_controlfile_creation.sqlSQL>alter database open resetlogs;SQL>create spfile from pfile;
Step-10 : Place the new database in archivelog mode.
Thank you
osama mustafa
Check the below Steps to delete duplicate row :
SQL>select * from emp;
EMPID ENAME SAL DEPTNO
---------- -------------------- ---------- ----------
10005 palani 54544 10
10001 Scott Tiger 1000 40
10002 Frank Naude 500 20
10003 rajesh 21000 140
10004 ramesh 3500 220
10005 suresh 34567 123
delete duplicate rows in empid column in emp table
SQL>delete from emp where rowid not in (select max(rowid) from emp group by empid);
1 row deleted.
SQL>select * from emp;
EMPID ENAME SAL DEPTNO
---------- -------------------- ---------- ----------
10001 Scott Tiger 1000 40
10002 Frank Naude 500 20
10003 rajesh 21000 140
10004 ramesh 3500 220
10005 suresh 34567 123
to delete the old duplicate row from the table instead of max(rowid) replace min(rowid)
for exampl
SQL>insert into emp values(10005,’Osama’,54544,10);
1 row created.
SQL>select * from emp;
EMPID ENAME SAL DEPTNO
---------- -------------------- ---------- ----------
10005 Osama 54544 10
10001 Scott Tiger 1000 40
10002 Frank Naude 500 20
10003 rajesh 21000 140
10004 ramesh 3500 220
10005 suresh 34567 123
6 rows selected.
SQL>delete from emp where rowid not in (select min(rowid) from emp group by empid);
1 row deleted.
SQL>select * from emp;
EMPID ENAME SAL DEPTNO
---------- -------------------- ---------- ----------
10005 Osama 54544 10
10001 Scott Tiger 1000 40
10002 Frank Naude 500 20
10003 rajesh 21000 140
10004 ramesh 3500 220
thank you
Osama mustafa
kernel BUG at kernel/exit.c:904!
kernel/exit.c:904!
Upgraded the Kernel to version RHEL4.7
Bug Introduced in RHEL 4.6:
Broken in RHEL kernel : 2.6.9-67.0.20.EL
Fixed in RHEL kernel : 2.6.9-67.0.22.EL
Broken in OEL kernel : 2.6.9-67.0.20.0.1.EL
Fixed in OEL kernel : 2.6.9-67.0.20.0.2.EL
Fixed in OEL kernel : 2.6.9-67.0.22.0.1.EL
4.7:
Broken in RHEL kernel: 2.6.9-78.EL
Fixed in RHEL kernel : 2.6.9-78.0.1.EL
Broken in OEL kernel : N/A - OEL 4.7 base (GA) kernel includes the fix for
this crash (2.6.9-78.0.0.0.1.EL)
Fixed in OEL kernel : 2.6.9-78.0.0.0.1.EL
Fixed in OEL kernel : 2.6.9-78.0.1.0.1.EL
Run The Pre-Upgrade Information Tools : (Mandatory)