You can check the status of SAP Hana using the following command line:
You can use the T-SQL code below within your database to give permissions to ‘MYUSER’ for viewing all stored procedures. (of course, replace “MYUSER” with your own user) Once executed, you can copy and paste the output to a new query window an execute it.
Doing a dbcc checkdb can take a lot of time, and in case of corruption you really want to see the progress. You can use the t-sql statement below to find the progress. Keep in mind to replace the YOUR_DB_ID to the id of your database. (find out in sys.databases)
Step 1: If block corruption was found, first find the corrupted blocks: Stzp 2: Check to which table/index/etc that block belongs to. Step 3: Resolve the block corruption using RMAN (which is one of the possibilities):
If you do a df, and you compare those values with ‘du’, it is possible that those values don’t match. There are multiple reasons why this can happen, and one of those reasons if that files where deleted, but that the files are still in use by an application.In that case, it is possible that you need to stop/restart the
The code below will list the transactions on the instance, and it will also include the size of the log which is used for that transaction.The output is ordered by log size. You can also use the below to find more info regarding a transaction
You can use the default trace in SQL server in order to track CREATE/DELETE/ALTER DDL operations.The T-sql code below will show the CREATE/DELETE/ALTER DDL operations visible in the default trace.
Backups/restores can take a lot of time, but when it’s running, you want so see the progress.By executing the handy T-SQL code below, you can see the progress of the backups/restores on your system.
If you copy (backup/restore) a database from system A to system B, it is possible that the SQL users won’t be able login and this because the GUID/SID of the users on system A doesn’t match the GUID/SID of system B. It is using the EXEC sp_change_users_login ‘Auto_Fix’, which inks a user entry in the sys.database_principals system catalog view in
Not all SQL scripts should be short 😉 The T-SQL code below will list the SQL Agent job history.