Changing Archive Log Destination

Today I am Gonna Show you How to change Archive log Destination in Two Ways :

1.Temporarily Changing the Destination Using SQL*Plus

sqlplus / as sysdba

sql> archive log list;

Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/product/10.2.0/db_1/dbs/arch
Oldest online log sequence 9285
Next log sequence to archive 9287
Current log sequence 9287

 To change the location

sql>ARCHIVE LOG START ‘/u01/arch’;

To Verify your changes:

sql> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oracle/arch
Oldest online log sequence 9285
Next log sequence to archive 9287
Current log sequence 9287

2-Permanently Changing the Destination Using SQL*Plus

sqlplus / as sysdba

ALTER SYSTEM SET log_archive_dest =’/oradata/arch’ scope=both;

To Verify your changes:

sql> archive log list;

Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oracle/arch
Oldest online log sequence 9285
Next log sequence to archive 9287
Current log sequence 9287   

To change the size of archive log

SQL> alter system SET DB_RECOVERY_FILE_DEST_SIZE = 10G SCOPE=BOTH SID=’orcl’;

System altered. 

Thank You
Osama Mustafa

  

Linux Command On Windows :)

Install Cygwin

Cygwin comes with a normal setup.exe to install in Windows, but there are a couple steps you will need to pay attention to, so we will walk you through the installation.

To keep the installation small while saving bandwidth for you and Cygwin, the default installer will download only the files you need from the internet.

The default install path is C:\Cygwin

Click next until you come to a download mirror selection. Unfortunately, the installer does not say where the mirrors are located so in most cases you might as well just guess which mirror works best.

After you have selected a mirror, the installer will download a list of available packages for you to install. Here is where things get a bit more intimidating.
There will be hundreds of packages available separated by multiple different categories. If you don’t know what the package is you can leave the default selection and install additional packages later by running the installer again.


If you know what package you need, you can search for it and the results will be automatically filtered.

Once you click next, it will take a little while to download all the selected tools and then finish the installation.

Add Cygwin Path to Windows Environment Variable

In the left column click on advanced system settings to open the system properties window we are looking for


From the advanced tab, click on environment variables at the bottom.

Then in the system variables, locate the path variable and click edit.

At the end of the variable value option, add the Cygwin bin location like so.
;C:\Cygwin\bin
Note: Make sure you add a semicolon to separate it from the other values.




Click OK to close out of the window and then open a command prompt to test out a few Linux commands.

Enjoy

Osama Mustafa

How to recreate DBA roles if accidentally drop?

VERSION 7.X:   From Server Manager, logged in as internal or sys, run the following commands:

         SVRMGRL > create role dba;
        SVRMGRL > grant all privileges to dba with admin option;

VERSION 8.X:   From SQL*Plus or Server Manager, logged in as internal or sys, run the   following commands:   

SQL > create role dba;       
SQL > grant all privileges to dba with admin option;       
SQL > grant select_catalog_role to dba with admin option;       
SQL > grant execute_catalog_role to dba with admin option;       
SQL > grant delete_catalog_role to dba with admin option;

Explanation:  ============    
The DBA role is created at database creation time by the “sql.bsq” script. (The “sql.bsq” script is typically found in the $ORACLE_HOME/dbs or the $ORACLE_HOME/rdbms/admin directory.)  Additional grants are made to dba through other scripts in the admin directory.  For example, exp_full_database  and imp_full_database in catexp.sql.

Note : Version 8.X will works On 10g , 11g

Thank you
Osama mustafa

Upgrade 11.1.0.6 to 11.1.0.7 – APPS DBA

On each application tier server node,
shut down all server processes or services.

On the database tier server node,
shut down the database listener in the old Oracle home.

On the database server node,
as the owner of the Oracle 11g file system and database instance, unzip and extract the 11.1.0.7 patch set file for your platform.

Use the runInstaller in the patchset to start the OUI.

Once the OUi starts from the LOV s in the Oracle_home list choose the appropriate one to be upgraded and the location also.

The present oracle_home and its location will appear if the environment is set correctly.

Proceed with the next steps on the OUI screen.

On next Screen it will Say Configuration Assistant has failed.Skip this Step since its not required for Oracle E-Business Suite .

MOST IMPORTANT STEP IN UPGRADE .
After Installation you need to Apply the RDBMS patches7486407 and 7684818

Copy $APPL_TOP/admin/adstats.sql from the administration server node to the database server node.

$ sqlplus / as sysdba
SQL> shutdown normal;
SQL> startup restrict;
SQL> @adstats.sql
SQL> shutdown normal;
SQL> startup;
SQL> exit;

Thank You
Osama mustafa

Change Enterprise manager password for 11g

For the DB Control Release 11.2 and higher, you need to set the environment variable ORACLE_UNQNAME to the value of the DB_UNIQUE_NAME database parameter.

Steps :

1.Stop the DB Control
On Unix
$ emctl stop dbconsole

On Windows
Open a Command Window and type
**> emctl stop dbconsole

2.Check that the DB Control is stopped
 On Unix
$ emctl status dbconsole
 

On Windows
Open a Command Window and type
 **>emctl status dbconsole

3.Connect to the database as a user with DBA privilege with SQL*Plus and execute:

SQL> alter user sysman identified by ;
 
4.Check the new password
SQL> connect sysman/[@database_alias]
 
5.From the database directory $ORACLE_HOME/bin, execute:
On Unix

$ emctl setpasswd dbconsole
Provide the new SYSMAN password
 
On Windows

**>: emctl setpasswd dbconsoleProvide the new SYSMAN password
 
6.Restart the DB Control
On Unix
$ emctl start dbconsole
 
On Windows
Open a DOS Command Window and type
**>: emctl start dbconsole
 

Thank you 

Osama Mustafa