Showing posts with label Users. Show all posts
Showing posts with label Users. Show all posts

Thursday, 20 March 2025

how to export and import all users in SAP HANA using export and import option in HANA studio

Exporting and importing all users in SAP HANA can be done using the SAP HANA Studio or the SAP HANA Database Explorer. Below are the steps to export and import users using the export and import option in HANA Studio:

---

### **Exporting Users in SAP HANA**
1. **Open SAP HANA Studio**:
   - Launch SAP HANA Studio and connect to your HANA system.

2. **Open the Export Wizard**:
   - In the **Systems** view, right-click on the HANA system you want to export users from.
   - Navigate to **Export** > **Catalog Objects**.

3. **Select Export Type**:
   - In the Export Wizard, choose **Users** as the object type to export.
   - Click **Next**.

4. **Specify Export Options**:
   - Select the users you want to export. You can export all users by selecting the appropriate option.
   - Choose the export format (e.g., SQL script or CSV).
   - Specify the file path where the export file will be saved.
   - Click **Next**.

5. **Review and Export**:
   - Review the selected options and click **Finish** to start the export process.
   - The users will be exported to the specified file.

---

### **Importing Users in SAP HANA**
1. **Open SAP HANA Studio**:
   - Launch SAP HANA Studio and connect to the target HANA system where you want to import the users.

2. **Open the Import Wizard**:
   - In the **Systems** view, right-click on the HANA system.
   - Navigate to **Import** > **Catalog Objects**.

3. **Select Import File**:
   - Browse to the location of the exported file (e.g., SQL script or CSV) containing the user data.
   - Click **Next**.

4. **Specify Import Options**:
   - Choose the appropriate import options (e.g., overwrite existing users or skip conflicts).
   - Click **Next**.

5. **Review and Import**:
   - Review the selected options and click **Finish** to start the import process.
   - The users will be imported into the target HANA system.

---

### **Notes**:
- **Permissions**: Ensure you have the necessary privileges (e.g., `USER ADMIN` or `ROLE ADMIN`) to export and import users.
- **Passwords**: User passwords are not exported for security reasons. You will need to reset passwords after importing users.
- **Roles and Privileges**: If you want to export/import roles and privileges along with users, you may need to export/import those separately.

---

### **Alternative Method: Using SQL Scripts**
You can also use SQL scripts to export and import users:
1. **Export Users**:
   - Generate a script to create users using SQL commands like `SELECT 'CREATE USER ' || USER_NAME || ' PASSWORD <new_password>;' FROM USERS;`.
   - Save the script to a file.

2. **Import Users**:
   - Execute the script in the target system to create the users.

---

Let me know if you need further clarification!

how to export and import sap hana database users in system refresh

During a system refresh in SAP HANA, you may need to export and import database users to ensure that the target system has the same user configurations as the source system. Below is a step-by-step guide to export and import SAP HANA database users:

---

### **Step 1: Export Users from the Source System**

#### **Option 1: Export Users Using SQL Scripts**
1. **Generate the List of Users:**
   Run the following SQL query in the source system to generate a list of users and their roles:
   ```sql
   SELECT USER_NAME, CREATE_TIME, LAST_SUCCESSFUL_CONNECT, VALID_FROM, VALID_UNTIL
   FROM USERS
   WHERE USER_NAME NOT IN ('SYS', 'SYSTEM', '_SYS_REPO', '_SYS_STATISTICS');
   ```

2. **Export User Roles and Privileges:**
   Use the following SQL query to export user roles and privileges:
   ```sql
   SELECT GRANTEE, GRANTED_ROLE, IS_GRANTABLE
   FROM GRANTED_ROLES;
   ```

3. **Generate SQL Scripts for User Creation:**
   Create a script to generate `CREATE USER` and `GRANT` statements for all users:
   ```sql
   SELECT 'CREATE USER "' || USER_NAME || '" PASSWORD "InitialPassword" NO FORCE_FIRST_PASSWORD_CHANGE;'
   FROM USERS
   WHERE USER_NAME NOT IN ('SYS', 'SYSTEM', '_SYS_REPO', '_SYS_STATISTICS');
   ```

   Save the output as a SQL script (e.g., `create_users.sql`).

4. **Export the Script:**
   Save the generated SQL script to a file for later use.

---

#### **Option 2: Export Users Using SAP HANA Cockpit**
1. Log in to the SAP HANA Cockpit.
2. Navigate to **Security** > **Users**.
3. Export the list of users and their roles to a CSV or Excel file.

---

### **Step 2: Import Users into the Target System**

#### **Option 1: Import Users Using SQL Scripts**
1. **Execute the SQL Script:**
   Run the SQL script generated in Step 1 (e.g., `create_users.sql`) in the target system to create the users.

2. **Grant Roles and Privileges:**
   Execute the `GRANT` statements to assign roles and privileges to the users.

   Example:
   ```sql
   GRANT "ROLE_NAME" TO "USER_NAME";
   ```

3. **Verify User Creation:**
   Check that the users and roles have been correctly imported:
   ```sql
   SELECT * FROM USERS;
   SELECT * FROM GRANTED_ROLES;
   ```

---

#### **Option 2: Import Users Using SAP HANA Cockpit**
1. Log in to the SAP HANA Cockpit in the target system.
2. Navigate to **Security** > **Users**.
3. Use the **Import Users** option to upload the CSV or Excel file exported from the source system.

---

### **Step 3: Post-Import Steps**
1. **Reset Passwords:**
   After importing users, reset their passwords to ensure security:
   ```sql
   ALTER USER "USER_NAME" PASSWORD "NewPassword";
   ```

2. **Validate User Access:**
   Test user logins and verify that they have the correct roles and privileges.

3. **Check System-Specific Users:**
   Ensure that system-specific users (e.g., `SYS`, `SYSTEM`) are not overwritten during the import process.

---

### **Step 4: Automate the Process (Optional)**
If you frequently perform system refreshes, consider automating the export and import process using:
- **SAP HANA SQL Scripts**: Write a script to export and import users.
- **SAP HANA CLI (hdbsql)**: Use command-line tools for automation.
- **SAP HANA Transport Management**: Use transports to move users and roles between systems.

---

### **Important Notes:**
- **Passwords**: Passwords are not exported during the process. You will need to reset them in the target system.
- **System Differences**: Ensure that the source and target systems are compatible (e.g., same SAP HANA version).
- **Backup**: Always take a backup of the target system before performing a system refresh.

By following these steps, you can successfully export and import SAP HANA database users during a system refresh.

Friday, 27 November 2020

rdisp/tm_max_no

 

Parameter

rdisp/tm_max_no

Short text

Maximum number of possible logons

Parameter Description

This parameter restricts the maximum number of logons per instance. This includes SAP GUI logons, RFC and HTTP logons, and also logons for internal tasks (for example, the execution of background jobs or updates).

Application Area

Dispatcher

Default Value

200

Who is permitted to make changes?

Customer

Operating System Restrictions

None

Database System Restrictions

None

Are other parameters affected or dependent?

None

Values allowed

Whole Number >= 10000

Friday, 17 May 2019

SAP HANA NOTES 24: Send a Notification to Logged-In Users in HANA cockpit

Send a Notification to Logged-In Users in HANA cockpit


Send a pop-up alert to all users logged in to SAP HANA cockpit.

Prerequisites

Your cockpit user has one of these roles: 

● Cockpit Administrator
● Cockpit User Administrator

Procedure

  1. Connect to the Cockpit Manager.

     2.In the Cockpit Manager, select Active Sessions.                                                                    


3. (Optional.) Enter a user's name in the Search Sessions field to filter the list of users.

4.choose inform option. and enter the message. the screen looks like below.

 5.choose interrupt option from step2.                                                

6.Result looks like one pop-up screen.                                                                      




Note:  The message will display only in Cockpit screen, exception for cockpit manager screen. 

Thursday, 16 May 2019

SAP HANA COCKPIT NOTES 23: Managing Resources, Users, and Groups with the Cockpit APIs

Managing Resources, Users, and Groups with the Cockpit APIs




SAP HANA COCKPIT NOTES 22: Add or Remove Users in Resource Groups

Add or Remove Users in Resource Groups


Add a cockpit user to a resource group or remove a user from a resource group.

Prerequisites

● Your cockpit user has the assigned role Cockpit Resource Administrator. 
● The Cockpit User Administrator has created some cockpit users. See Managing Cockpit Users. 

Procedure

1. Connect to the Cockpit Manager and sign in as a cockpit user with the Cockpit Resource Administrator role. You can reach the Cockpit Manager by entering the Cockpit Manager URL created during cockpit installation, or by following the Manage Cockpit link in the cockpit. The URL takes this form: 

https://<cockpit-host>:<port_number>

2.In the Cockpit Manager, select Resource Groups.
3. In the left pane, select the group you want to modify.
4. (Optional) To add a cockpit user.
               a. If necessary, click Users to display the list of cockpit users in this group. 
               b. Click Add User (far right). 
               c. Select the users to add and click OK. 
The cockpit displays the group, including the newly added cockpit user(s), on the Resource Groups page. 
5. (Optional) To remove a user:
               a. If necessary, click Users to display the list of cockpit users in this group.                                           b. Click the red  to the right of the user to be deleted and confirm the deletion. 
The cockpit displays the group, without the removed user, on the Resource Groups page.