Monday, 29 June 2015

Backup details in SAP Sybase IQ

BACKUP START TIME:

To get the backup start time you need to execute the following System Procedure :

exec sp_iqstatus

execution of this proc will show you a lot of output regarding your SAP IQ database but, you need to give some extra time to understand those points...:)

From the above output you need to locate these few lines which will let you know the information regarding Backup.

  

BACKUP END TIME :

To get the backup end time in SAP IQ:

1) Login to the server(not database)
2) Go to the path 

# cd $ASDIR/logfiles                 (for IQ 12.7 and earlier)
# cd $IQDIR15/logfiles               (for IQ 15.x and later)

here you will find a file named 'backup.syb', last modified time of this file will be the Backup End time.

There are few other ways to get the more backup details, like :

select * from SYSIQBACKUPHISTORY
select * from SYSIQBACKUPHISTORYDETAIL

exec sa_read_backup_historyexec sp_iqbackupsummaryexec sp_iqbackupstatus


Cheers....!! 
  

Keep updating me with your suggestions and queries in the comments below...everything will be appreciated..Thanks...!!

Saturday, 20 June 2015

Changing System Administrator's(sa) password back to NULL

As you might seen during the installation of SAP ASE server it asks for System Administrator's password and you must have to provide that, else it will raise an error like 

'Password is too short, minimum 6 characters required'

To resolve this you have to provide a 6 chars password to complete the installation successfully.

After the completion of installation, you can login the server with sa(login name) and password which you have provided above.

Now its time when you can change your password as NULL(the password which you might like most, as me...!!!)

Step 1:

First thing what you have to do is take FULL dump of your master database as it contains the system tables which will get updated in next few steps which may create some consequences with your database, at that time you will be in a situation where you will have a clean dump of master which you can restore. So the first thing what you need to consider is 'be safe'.

1> dump database master to 'd:\\dumps\\master_dump_20062015_145200.dmp'
2> go

(for Unix platform just change the path like 
'/sybase/dumps/master_dump_20062015_145200.dmp' above)

Now you are ready to play with system tables.

Step 2:

To set the server-wide default minimum password length to 0 :

1> sp_configure "minimum password length", 0

2> go

Note: this configuration option is dynamic. Also note that this server-wide setting also applies the (optional) passwords for user-defined roles.


Step 3:

To set a minimum password length for a specific login

1> sp_modifylogin 'login_name','minimum password length',0
2> go

here your login name will be 'sa' in this case, else you can put any login from your server.

Example:

1> sp_modifylogin 'sa','minimum password length',0
2> go


Now you have overcame the error 

'Password is too short, minimum 6 characters required'

Step 4:

To set a password to blank for your own login

1> sp_password 'login_name',NULL
2> go

Example:

1> sp_password 'sa',NULL
2> go


It's done..!!

Now you can login with blank password, like

$ isql -Usa -P -S<server_name> (in Unix)

c:\sybase_ase157> isql -Usa -P -S<server_name> (in Windows)


Cheers....!! 
  



Keep updating me with your suggestions and queries in the comments below...everything will be appreciated..Thanks...!!



Adding login to SAP ASE

There are multiple ways to add login to SAP ASE.

Method 1:


sp_addlogin 'login_name','login_pwd', <db_name>

Example:

sp_addlogin 'pankaj','pathak',sony

1) Here 'pankaj' is the login name, 'pathak' is the password and 'sony' is the default database for the login 'pankaj'. 
2) Means that there is default database can be specified for different logins. 
3) if you will not provide the db_name in above procedure, it will consider it as master by default.

now you can view the details for login 'pankaj'

sp_displaylogin 'pankaj' 



Suid: 4
Loginame: pankaj
Fullname:
Default Database: sony
Default Language:
Auto Login Script:
Configured Authorization:
Locked: NO
Date of Last Password Change: Jun 20 2015 1:58PM
Password expiration interval: 0
Password expired: NO
Minimum password length: 6
Maximum failed logins: 0
Current failed login attempts:
Authenticate with: AUTH_DEFAULT
Login Password Encryption: SHA-256
Last login date: Jun 20 2015 2:20PM
Exempt inactive lock: 0
Execution time: 0.041 seconds


Method 2:

create login <login_name> with password <login_password>

Example

create login 'pankaj' with password 'pathak'

Note:
Your password should satisfy the no. of characters provided in the Run Value

sp_configure "minimum password length"

Also, you can change it to server wide or for a specific login.

Cheers....!!!

Keep updating me with your suggestions and queries in the comments below...everything will be appreciated..Thanks...!!