Sunday, 23 October 2016

How to put RAC database in archive log.

1) Login to any rac node and export oracle sid.

export ORACLE_SID=test1
sqlplus / as sysdba

2) Check archive log is enabled or not by using below query.

select name ,created ,open_mode ,log_mode from v$database;
or
archive log list;

3) Disable cluster instance parameter by setting cluster database to FALSE from the current instance.

alter system set cluster_database=false scope=spfile

4) Exit from sqlplus prompt and fire srvctl commands to stop all instances accessing cluster database

srvctl stop database -d test

5) Again login to local instance using sqlplus and mount database.

sqlplus / as sysdba
startup mount;

6) Enable archive log using below command.

alter database archivelog;

7) Re-enable support for clustering by setting instance parameter cluster_database to TRUE

alter system set cluster_database=true scope=spfile

8) shutdown local instance

shut immediate;

9) Bring all instance back up using srvctl

srvctl start database -d test

10) Login to local instance and check if archive log is enabled or not

sqlplus / as sysdba
archive log list;
or
select name ,created ,open_mode ,log_mode from v$database;

Friday, 24 June 2016

How To Move System DB's to another drive.

How To Move System DB's to another drive.

1) Master
1) Check the existing path using sp_helpdb 'master'
2) Go to SQL Server Configuration Manager
3) Navigate to the sql server service.
4) Go to sql server properties.
5) copy startup parameter for .mdf and .ldf file.
6) Update that parameter to the location that you wish to move.
7) Apply those changes.
8) Copy .mdf and .ldf files of the master database to the new location.
7) Start sql server services.

2) MSDB

1) Go to SSMS.
2) Check the existing path using sp_helpdb.
2) Use the below query to modify system catalog:

ALTER DATABASE msdb
MODIFY FILE (NAME = MSDBData, FILENAME = 'Path of the filename');
GO
ALTER DATABASE msdb
MODIFY FILE (NAME = MSDBLog, FILENAME = 'Path of the filename');
GO
3) Stop the SQL Server Servies.
4) Move .mdf and .ldf file to the new directory.
5) Start sql server services.

Use the same procedure to move MODEL and TEMPDB.