Sunday, July 12, 2009

How to Change/Reset ias_admin Password

ias_admin is user required to use Enterprise Manager Web (Application Server Console - iASConsole) Site.

ias_admin password is set during Installation of Oracle Application Server (902, 904, 10.1.2.X) or Oracle Identity Management (Infra Tier 10.1.4.X)—ias_admin account is NOT stored in OID (Oracle Internet Directory), It is stored in XML file (JAZN-XML - Java AuthoriZatioN)

How to Reset / Change ias_admin Password

You can reset/change ias_admin password in following ways

1. Using Enterprise Manager (Application Server Control) Web Site
–Login to Instance Home Page
–Click on Preferences on top right
–In new screen, click on “Change Password” on left menu
–Enter current password and New Password

2. Using Command line tool

emctl set password oldpassword new password

like

emctl set password welcome1 welcome2 (Here welcome1 is current ias_admin password and welcome2 is new password which you wish to reset)

If you don’t know current ias_admin password then change it in configuration file

3. Change ias_admin password directly in configuration file
–Backup $ORACLE_HOME/sysman/j2ee/config/jazn-data.xml
–Search for xml entry like below

< user >
< name > ias_admin < / >
< credentials >{903}8QkQ/crno3lX0f3+67dj6WxW9KJMXaCu < / credentials >
< /user >

and Update new password (welcome2 like )


< user >< name > ias_admin < / >
< credentials > !welcome2 / credentials >
< /user >

Note ! (Exclamation Mark in front of password. This signifies that password is stored in clear text)

Thursday, July 9, 2009

Renaming/Dropping and recreating online redo logs and Standby logfiles

If you are in process of testing Dataguard with Physical standby and After created Primary and Standby DB's you realize that u haven't put file names as per your standard. So I would recommend you to do the following,
rename both, online redo logs and standby logs.
Follow these steps to do it,

1. Following is the script to identify all log files we have
SELECT GROUP#, BYTES, 'ONLINE' AS TYPE FROM V$LOG
UNION
SELECT GROUP#, BYTES, 'STANDBY' AS TYPE FROM V$STANDBY_LOG
ORDER BY 1;
2. Make sure protection mode is MAXPERFORMANCE:
SELECT PROTECTION_MODE, PROTECTION_LEVEL, DATABASE_ROLE FROM V$DATABASE

First we start working on Standby database
3. STOP redo apply
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
4. Set STANDBY_FILE_MANAGEMENT to MANUAL.
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT='MANUAL';
5. Gather current status of all member.
SQL> select member from v$logfile;
6. Prepare command to drop standby redo logfiles.
select 'alter database drop standby logfile group ' group# ';' from v$standby_log;
7. Prepare command to drop online redo logfiles.
select 'alter database drop logfile group ' group# ';' from v$log;
8. Check the status of online redolog group.
SELECT GROUP#, STATUS FROM V$LOG;
GROUP# STATUS
---------- ----------------
1 CLEARING_CURRENT
3 CLEARING
2 CLEARING
We can not drop CLEARING_CURRENT status logs, for that you have sync with Primary (Easy way is, leave them for a while and move ahead with droping Primary Database redo logs, and come back to Standby and you will be able to do it).
9. Clear the log group first before drop.
ALTER DATABASE CLEAR LOGFILE GROUP 1;
10. Now drop online redo log.
alter database drop logfile group 1;
Follow the same process for rest of the groups.
11. Now drop standby redo logs, leave the one which refuses to drop.
alter database drop standby logfile group 5;
12. Now create new online redo logs.
ALTER DATABASE ADD LOGFILE GROUP 1 '/path/redo_01.dbf' SIZE 10M;
13. Now we will crate standby redo logs.
ALTER DATABASE ADD STANDBY LOGFILE '/path/redo_std_by_05.dbf' SIZE 10M REUSE;
14. Again check the current status of member.
select member from v$logfile;

Now you will see latest updated names for all files. The one which left we can do them after We are done with Primary DB.

Now on Primary Database:
15. Follow step 5,6,7 to know current status and prepare commands.
16. Drop Standby redo logs and recreate them
alter database drop standby logfile group 5;
ALTER DATABASE ADD STANDBY LOGFILE '/path/redo_std_by_05.dbf' SIZE 10M REUSE;
17. Drop online Redo logs, recrate, switch and drop next inactive one.
alter database drop logfile group 1;
ALTER DATABASE ADD LOGFILE GROUP 1 '/path/redo_01.dbf' SIZE 10M;
ALTER SYSTEM SWITCH LOGFILE;
SELECT GROUP#, STATUS FROM V$LOG;
18. Check the new status.
select member from v$logfile;

Now come back to Standby Database back and drop recreate left over online and standby redo logs.
19. Set STANDBY_FILE_MANAGEMENT to AUTO.
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT='AUTO';
20. start redo apply.
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
21. Check the status of applied log again.
select sequence#, applied from v$archived_log;

Monday, July 6, 2009

SS Cannot open user default database

Sql Server 2005: Cannot open user default database: Login Failed

Last month I attended training for Microsoft SQL Server 2008 Administration. It was a nice experience and something new for me to learn. During the training I was thanking god that I took a right direction in taking oracle as my career path than microsoft technology. :-)

Immediately after joining back in office I was given a task to move the entire sql server database from c-drive to f-drive for a reporting/auditing application called SCOM. It was quite easy to DETACH and ATTACH the database from c-drive to f-drive. But I faced a problem when I detached a database that was a default database. It was throwing following error when I tried to start the management studio,

"Cannot open user default database, login fails"

After some links on the web, I could resolve the issue,

I used the sqlcmd utility to change the default database in SQL Server 2005 to master database.
To do this, I follow these steps:

1. Click Start, click Run, type cmd, and then press ENTER.
2. Use one of the following methods, depending on the kind of authentication that the SQL Server login uses:

• If the SQL Server login uses Microsoft Windows authentication to connect to the instance which my instance was using, i typed the following at the command prompt, and then pressed ENTER:

sqlcmd –E -d master
ALTER LOGIN [QIA\OpsMgrAdmin] WITH DEFAULT_DATABASE=master
GO

• If the SQL Server login used SQL Server authentication to connect to the instance, then I would have typed the following at the command prompt, and then pressed ENTER:

sqlcmd -S InstanceName -d master -U SQLLogin -P Password
ALTER LOGIN SQLLogin WITH DEFAULT_DATABASE = AvailDBName
GO

sqlcmd -S InstanceName -d master -U sa -P Password
ALTER LOGIN sa WITH DEFAULT_DATABASE = master
GO

Anyway it was nice experience and the task was completed after following the above commands to troubleshoot the issue. Thanks to the training to understand Microsoft Sql Server 2008 Database architecture.