Wednesday, June 8, 2022
When setting the table to NOLOGGING, what is the expected result?
Monday, May 16, 2022
Stop Cluster, unmount and remount oracle shared storage, Start Cluster .
Stop Cluster
remount Oracle shared storage
Stop the cluster
#> pcs cluster stop --all
#> mount -t xfs -f -b size=4096 -m crc=0 /dev/OraVg2/Ora_Exp /backup/ora_exp
#> mount -t xfs -f -b size=4096 -m crc=0 /dev/OraVg2/Ora_Online /backup/ora_online
#> mount -t xfs -f -b size=4096 -m crc=0 /dev/OraVg3/db2 /oracle_db/db2
Perform Database Restore
==============
==============
Start the cluster
==============
umount /oracle_db/db1
Delete tag and deactivate
#> for i in $(vgscan |grep Ora | cut -d '"' -f 2) ;do vgchange -an $i ; vgchange --deltag sometag $i ; done
Restart the cluster
sudo hagrp -flush -force <service_group> -sys <host_group>
This command can be run from one node to reload corosync on all nodes and does not require a downtime.
Thursday, May 12, 2022
User Permissions SQL Server
db_owner
Members of the fixed database role can perform all configuration and maintenance activities on the database, and can also drop the database in SQL Server.
db_datawriter
Members of the db_datawriter fixed database role can add, delete, or change data in all user tables.
db_ddladmin
Members of the db_ddladmin fixed database role can run any Data Definition Language (DDL) command in a database.
Rename files in SQL Server
GO
--Disconnect all existing session.
ALTER DATABASE jiradev4 SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
--Change database in to OFFLINE mode.
ALTER DATABASE jiradev4 SET OFFLINE
GO
ALTER DATABASE jiradev4 MODIFY FILE (Name='jiradev4', FILENAME='D:\DB\jiradev4.mdf')
GO
ALTER DATABASE jiradev4 MODIFY FILE (Name='jiradev4_log', FILENAME='D:\Logs\jiradev4_log.ldf')
GO
Here - physically rename datafiles on server to the new names
ALTER DATABASE jiradev4 SET ONLINE
Go
ALTER DATABASE jiradev4 SET MULTI_USER
Go
SQL Server Copy Database options
1. Right click on the database you want to duplicate and choose Tasks->"Back Up..."
2. Save the back up to a .bak file
2. As the source, select "File" and point to the .bak file you created earlier.
3. Change the name of the database to restore to.
Option 2 – using Database Copy Wizard
Database -> my_database -> Tasks -> Copy ->
Source server MY_SERVER->
Destination Server MY_SERVER->
Select option Detach + Attach (source database must be offline, faster) or "SQL Management Option" (source database can be online, slower) ->
Select database Name to copy ->
Give new Database Name -> my_database_new
Give new Database File path D:\DB
Give new Database Log path D:\Logs ->
A new package is created under server_name/DTS Packages/Copy Database Wizard Packages CDW_MY_SERVER_dba_util_copy ->
Run Immediately ->
Click Finish to perform the following actions:
Destination: MY_SERVER Other SQL Server Version, Microsoft SQL Server Standard Edition (64-bit) , Build 3223, Microsoft Windows NT 6.3 (14393) NT x64
Using SMO online transfer
The following databases will be moved or copied:
Copy:dba_util
Destination file will be created: D:\DB\dba_util_test.mdf
Destination file will be created: D:\Logs\dba_util_test_log.ldf
Stop transfer if duplicate database name exists at destination
Package scheduled to run immediately
