Skip to content

Instantly share code, notes, and snippets.

View JustinMcNamara74's full-sized avatar

Justin McNamara JustinMcNamara74

View GitHub Profile
@JustinMcNamara74
JustinMcNamara74 / dmp_setup.md
Last active August 3, 2020 06:44
DMP Development Setup

Setup For DMP Developement

Install Windows Environment

  1. Install Parallels
    • Trial Version
      • You will need to aquire a parallel license (see functional Manager)
    • Will need an MSDN account to obtain product keys
      • here is the list of product keys
@JustinMcNamara74
JustinMcNamara74 / fix_commit.md
Last active October 18, 2017 02:11
Undo, fix, and redo a commit

git commit -m "Something terribly misguided"

Dammit, I forgot a [puts, console.log, etc..]

😟

Undo commit
  • git reset HEAD~
@JustinMcNamara74
JustinMcNamara74 / #NETEZZA list_all_permissions.md
Last active September 13, 2023 04:35
Lists all user/group permissions for each object in every database

Lists all user/group permissions

SELECT CASE WHEN _V_USER.USERNAME  IS NOT NULL THEN 'USER'
           WHEN _V_GROUP.GROUPNAME IS NOT NULL THEN 'GROUP'
               ELSE 'UNKNOWN' END                            AS USERS_GROUPS,
        COALESCE(_V_USER.USERNAME,_V_GROUP.GROUPNAME)        AS NAME,             
    NVL(_V_DATABASE. DATABASE,'GLOBAL' )                     AS DATABASE ,
    _T_OBJECT.OBJNAME                                        AS OBJECTNAME,
@JustinMcNamara74
JustinMcNamara74 / open_netezza_ticket
Created July 28, 2017 18:54
#Netezza Open Netezza ticket
Netezza ticket Instructions
call 1-800-426-7378
Option 2
Option 2
Ask to open a Netezza appliance ticket
@JustinMcNamara74
JustinMcNamara74 / goom_altered_tables.md
Last active July 28, 2017 16:18
#NETEZZA Find and groom altered tables

List all altered tabled

Run the command:
nz_alterd_tables
Sample Results:

| Database | Schema | Table Name | Size (Bytes) | # Of Versions |

@JustinMcNamara74
JustinMcNamara74 / db_user_info.sql
Created July 5, 2017 16:05
List DB user info for all users
use [db_name]
select *
from sysusers
order by name ;
@JustinMcNamara74
JustinMcNamara74 / recently_modified_stored_procedures.sql
Created June 16, 2017 23:25
Lists recently modified stored procedures.
SELECT TOP 100 name, create_date, modify_date
FROM sys.objects
WHERE type = 'P'
ORDER BY modify_date DESC
@JustinMcNamara74
JustinMcNamara74 / recently_executed_stored_procedures.sql
Created June 16, 2017 23:23
Lists the most recently executed SPs in descending order.
SELECT DB_NAME(database_id)
,OBJECT_NAME(object_id)
,cached_time
,last_execution_time
,execution_count
FROM sys.dm_exec_procedure_stats
WHERE DB_NAME(database_id) = 'DB_NAME'
ORDER BY last_execution_time DESC
@JustinMcNamara74
JustinMcNamara74 / netezza_reset_user_password.sql
Created December 20, 2016 19:25
Reset a user's password
-- This will force the user to enter a new passowrd upon the next login. User needs to know currentl PW.
-- http://www.ibm.com/support/knowledgecenter/SSULQD_7.2.1/com.ibm.nz.adm.doc/c_sysadm_password_expiration.html
ALTER USER User EXPIRE PASSWORD;
@JustinMcNamara74
JustinMcNamara74 / netezza_create_user_with_perms.md
Last active December 22, 2016 13:45
Create a user, and give that user select permissions on a given DB

Reference

Create User

CREATE USER User WITH PASSWORD 'password';
Check current perms after each step by using the following command:

\dpu User;

Grants list privileges. Without it, user cannot list tables in aginity when selecting a DB