Showing posts with label database. Show all posts
Showing posts with label database. Show all posts
Moving Oracle Database Between Mount points
Thursday, September 29, 2011
Ø Take Backup of the database through RMAN. Below are some configuration changes which helps you take the backup effectively. Run the below commands in RMAN prompt.
1. Configure the backup location
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/backup_dumps/IDC/RMAN_Backups/RMAN_MX210XRL_%U';
2. Switch on contrfolfile autobackup
CONFIGURE CONTROLFILE AUTOBACKUP ON;
3. Set parallel parameter to 2 for the speedy backup.
CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
Ø Take Backup of the database along with archives.
RMAN> Backup database plus archivelog;
Ø Create the new logfile groups with new mount point and drop the groups with old logfile members.
SQL>alter database ADD LOGFILE GROUP 4 ('/mwm_oradata_01/MX210XRL/redo04.log') size 100m;
SQL>Alter database drop logfile group 1;
Ø Once the backup is done shut down the database and change the parameter file for appropriate location of controlfiles.
Ø Move the control files physically from OS level to the new mount point(or Create the controlfile from the from rman backup by bringing the database in nomount state).
For 2nd option here is the command:
RMAN>restore controlfile from '/backup_dumps/IDC/MWM21DEV_HotBackup_03082011/RMAN_04mj1i6m_1_1';
Ø Mount the database and run the below command from rman to change the newname for datafiles and to restore the database from latest backup set.
RMAN>run
{
set newname for datafile '/mwm_oradata_03/MX210XRL/system01.dbf' TO '/mwm_oradata_01/MX210XRL/system01.dbf';
set newname for datafile '/mwm_oradata_03/MX210XRL/SYSAUX.dbf' TO '/mwm_oradata_01/MX210XRL/SYSAUX.dbf';
set newname for datafile '/mwm_oradata_03/MX210XRL/UNDOTBS1.dbf' TO '/mwm_oradata_01/MX210XRL/UNDOTBS1.dbf';
set newname for datafile '/mwm_oradata_03/MX210XRL/tools01.dbf' TO '/mwm_oradata_01/MX210XRL/tools01.dbf';
set newname for datafile '/mwm_oradata_03/MX210XRL/cists01.dbf' TO '/mwm_oradata_01/MX210XRL/cists01.dbf';
set newname for datafile '/mwm_oradata_03/MX210XRL/xmldbts01.dbf' TO '/mwm_oradata_01/MX210XRL/xmldbts01.dbf';
Restore database;
switch datafile all;
}
Ø Once done connect to the database as sysdba and run the below command.
SQL> Recover database;
Ø Check the datafile,controlfile and redo log file locations.
SQL> select name from v$datafile;
SQL> select name from v$controlfile;
SQL> select member from v$logfile;
1. Configure the backup location
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/backup_dumps/IDC/RMAN_Backups/RMAN_MX210XRL_%U';
2. Switch on contrfolfile autobackup
CONFIGURE CONTROLFILE AUTOBACKUP ON;
3. Set parallel parameter to 2 for the speedy backup.
CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
Ø Take Backup of the database along with archives.
RMAN> Backup database plus archivelog;
Ø Create the new logfile groups with new mount point and drop the groups with old logfile members.
SQL>alter database ADD LOGFILE GROUP 4 ('/mwm_oradata_01/MX210XRL/redo04.log') size 100m;
SQL>Alter database drop logfile group 1;
Ø Once the backup is done shut down the database and change the parameter file for appropriate location of controlfiles.
Ø Move the control files physically from OS level to the new mount point(or Create the controlfile from the from rman backup by bringing the database in nomount state).
For 2nd option here is the command:
RMAN>restore controlfile from '/backup_dumps/IDC/MWM21DEV_HotBackup_03082011/RMAN_04mj1i6m_1_1';
Ø Mount the database and run the below command from rman to change the newname for datafiles and to restore the database from latest backup set.
RMAN>run
{
set newname for datafile '/mwm_oradata_03/MX210XRL/system01.dbf' TO '/mwm_oradata_01/MX210XRL/system01.dbf';
set newname for datafile '/mwm_oradata_03/MX210XRL/SYSAUX.dbf' TO '/mwm_oradata_01/MX210XRL/SYSAUX.dbf';
set newname for datafile '/mwm_oradata_03/MX210XRL/UNDOTBS1.dbf' TO '/mwm_oradata_01/MX210XRL/UNDOTBS1.dbf';
set newname for datafile '/mwm_oradata_03/MX210XRL/tools01.dbf' TO '/mwm_oradata_01/MX210XRL/tools01.dbf';
set newname for datafile '/mwm_oradata_03/MX210XRL/cists01.dbf' TO '/mwm_oradata_01/MX210XRL/cists01.dbf';
set newname for datafile '/mwm_oradata_03/MX210XRL/xmldbts01.dbf' TO '/mwm_oradata_01/MX210XRL/xmldbts01.dbf';
Restore database;
switch datafile all;
}
Ø Once done connect to the database as sysdba and run the below command.
SQL> Recover database;
Ø Check the datafile,controlfile and redo log file locations.
SQL> select name from v$datafile;
SQL> select name from v$controlfile;
SQL> select member from v$logfile;
Prevent MS SQL database passwords from expiring
Sunday, February 6, 2011
If you are experiencing the issue in MS SQL database passwords expire, then you need to contact Hosting service provider to Change the Password Policy for all SQL users in SQL server. So anymore you wont face the problem of password Expiration.
Prevent MS SQL database passwords from expiring
Friday, February 4, 2011
In order to resolve the issue you need to check the MySQL database settings password in config.php file and database settings password is MySQL. It should be matched.
Resolve: You need to reset the database password according to on the config.php file, it will resolve your issue. If the issue still persist you need to contact Hosting Service Provider.
Resolve: You need to reset the database password according to on the config.php file, it will resolve your issue. If the issue still persist you need to contact Hosting Service Provider.
PHP and MySQL Connection.
Wednesday, February 2, 2011
Unix database connection string for ipower, ipage, startlogic, bizland, fatcow, Readyhosting, blue host....
< ?php
$username = “your_name”;
$password = “your_password”;
$hostname = “localhost”;
//connection to the database
$dbname = mysql_connect($hostname, $username, $password)
or die(“Unable to connect to MySQL”);
echo “Connected to MySQL
“;
?>
Note: Here if ($hostname, $username, $password) are matched then only it connect to $dbname (Database name). In most of the web page, you can view this code in config.php file.
< ?php
$username = “your_name”;
$password = “your_password”;
$hostname = “localhost”;
//connection to the database
$dbname = mysql_connect($hostname, $username, $password)
or die(“Unable to connect to MySQL”);
echo “Connected to MySQL
“;
?>
Note: Here if ($hostname, $username, $password) are matched then only it connect to $dbname (Database name). In most of the web page, you can view this code in config.php file.
PHP and MSSQL Connection
<?
$msserver=”vmssql02/i2″; //put your server name here
$usrname=”dpuser”; //put your MS SQL username here
$passwrd=”password”; //put your MS SQL password here
$conn=mssql_connect($msserver,$usrname,$passwrd) or die(mssql_get_last_message());
echo “Connection to $msserver was successful.\n”;
$conn=mssql_close($conn);
?>
$msserver=”vmssql02/i2″; //put your server name here
$usrname=”dpuser”; //put your MS SQL username here
$passwrd=”password”; //put your MS SQL password here
$conn=mssql_connect($msserver,$usrname,$passwrd) or die(mssql_get_last_message());
echo “Connection to $msserver was successful.\n”;
$conn=mssql_close($conn);
?>
PHP–MS Access Connection String
You can use following string:
?php
if (!$conn = new COM(“ADODB.Connection”))
exit(“Unable to create an ADODB connection<br>”);
$strConn = “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” . realpath(“/testdb/test.mdb”);
$conn->open($strConn);
?>
?php
if (!$conn = new COM(“ADODB.Connection”))
exit(“Unable to create an ADODB connection<br>”);
$strConn = “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” . realpath(“/testdb/test.mdb”);
$conn->open($strConn);
?>
Error establishing a database connection
In order to resolve the issue you need to check the MySQL database password in config.php file. It should be matched with MySQL. You can resolve this issue by resetting the password some time it will not resolve the issue, so you need to point local host directly to your database. Once you done with this clear the cache and check the website again.
If the issue still persist you need to contact Hosting Service Provider.
Note: You need to reset the database password according to on the config.php file, it will resolve your issue.
If the issue still persist you need to contact Hosting Service Provider.
Note: You need to reset the database password according to on the config.php file, it will resolve your issue.
Subscribe to:
Posts (Atom)